@sequenceholdings/studio-cli 0.1.27 → 0.1.28
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 +255 -72
- package/dist/app/adapters.d.ts +9 -0
- package/dist/app/adapters.js +176 -0
- package/dist/app/commands.d.ts +2 -2
- package/dist/app/commands.js +98 -22
- package/dist/app/deploy.d.ts +9 -10
- package/dist/app/deploy.js +83 -141
- package/dist/app/graph.d.ts +15 -0
- package/dist/app/graph.js +36 -0
- package/dist/app/manifest-validation.d.ts +16 -0
- package/dist/app/manifest-validation.js +99 -0
- package/dist/app/manifest.d.ts +27 -9
- package/dist/app/manifest.js +23 -107
- package/dist/app/paths.d.ts +14 -0
- package/dist/app/paths.js +77 -0
- package/dist/app/primitive-scaffold.d.ts +18 -0
- package/dist/app/primitive-scaffold.js +136 -0
- package/dist/app/readme.d.ts +4 -18
- package/dist/app/readme.js +105 -233
- package/dist/app/run-deployment.d.ts +8 -0
- package/dist/app/run-deployment.js +50 -0
- package/dist/app/scaffold-files.d.ts +13 -0
- package/dist/app/scaffold-files.js +68 -0
- package/dist/app/scaffold.d.ts +11 -3
- package/dist/app/scaffold.js +77 -245
- package/dist/app/workspace-compile.d.ts +18 -0
- package/dist/app/workspace-compile.js +143 -0
- package/dist/app/workspace-model.d.ts +70 -0
- package/dist/app/workspace-model.js +159 -0
- package/dist/app/workspace-scaffold.d.ts +27 -0
- package/dist/app/workspace-scaffold.js +126 -0
- package/dist/app/workspace.d.ts +14 -0
- package/dist/app/workspace.js +147 -0
- package/dist/atlas-client.js +28 -6
- package/dist/auth-cmds/commands.d.ts +1 -1
- package/dist/auth-cmds/commands.js +5 -2
- package/dist/functions/commands.js +7 -1
- package/dist/functions/manifest.d.ts +18 -0
- package/dist/functions/manifest.js +29 -4
- package/dist/main.js +8 -3
- package/dist/pat-hints.js +1 -0
- package/dist/pipeline/commands.js +27 -9
- package/dist/pipeline/lifecycle.d.ts +2 -0
- package/dist/pipeline/lifecycle.js +91 -11
- package/dist/process/build.js +59 -43
- package/dist/process/codegen.d.ts +3 -2
- package/dist/process/codegen.js +143 -27
- package/dist/process/commands.d.ts +2 -0
- package/dist/process/commands.js +63 -18
- package/dist/process/discover.d.ts +6 -3
- package/dist/process/discover.js +11 -3
- package/dist/process/lint.d.ts +14 -0
- package/dist/process/lint.js +143 -5
- package/dist/process/plan-diff.d.ts +8 -0
- package/dist/process/plan-diff.js +61 -4
- package/dist/process/safety-baseline.d.ts +154 -0
- package/dist/process/safety-baseline.js +387 -0
- package/dist/process/simulate.js +64 -22
- package/dist/repos/commands.d.ts +1 -1
- package/dist/repos/commands.js +29 -3
- package/package.json +6 -5
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { realpath, readFile } from 'node:fs/promises';
|
|
2
|
+
import { basename, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export const packageJsonSchema = z.object({
|
|
5
|
+
name: z.string().optional(),
|
|
6
|
+
main: z.string().optional(),
|
|
7
|
+
module: z.string().optional(),
|
|
8
|
+
type: z.string().optional(),
|
|
9
|
+
exports: z.unknown().optional(),
|
|
10
|
+
dependencies: z.record(z.string(), z.string()).optional(),
|
|
11
|
+
optionalDependencies: z.record(z.string(), z.string()).optional(),
|
|
12
|
+
devDependencies: z.record(z.string(), z.string()).optional(),
|
|
13
|
+
peerDependencies: z.record(z.string(), z.string()).optional(),
|
|
14
|
+
scripts: z.record(z.string(), z.string()).optional(),
|
|
15
|
+
pnpm: z.object({ overrides: z.record(z.string(), z.string()).optional() }).passthrough().optional(),
|
|
16
|
+
seqStudio: z.object({ source: z.string().optional() }).passthrough().optional(),
|
|
17
|
+
}).passthrough();
|
|
18
|
+
export const DEPENDENCY_SECTIONS = ['dependencies', 'optionalDependencies', 'devDependencies', 'peerDependencies'];
|
|
19
|
+
export const RUNTIME_SECTIONS = ['dependencies', 'optionalDependencies', 'peerDependencies'];
|
|
20
|
+
const NON_REGISTRY_SPEC = /^(?:git\+|git:|github:|gitlab:|bitbucket:|https?:|file:|link:|catalog:|\.{0,2}\/)/i;
|
|
21
|
+
function assertRegistryDependency({ name, spec }) {
|
|
22
|
+
const target = spec.startsWith('npm:') ? spec.slice(4) : spec;
|
|
23
|
+
if (NON_REGISTRY_SPEC.test(target) || target.includes('/')) {
|
|
24
|
+
throw new Error(`Dependency ${name} must use a registry version, got ${spec}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export async function readWorkspacePackage({ dir }) {
|
|
28
|
+
return packageJsonSchema.parse(JSON.parse(await readFile(join(dir, 'package.json'), 'utf8')));
|
|
29
|
+
}
|
|
30
|
+
export function isWithin({ root, path }) {
|
|
31
|
+
const rel = relative(root, path);
|
|
32
|
+
return rel === '' || (rel !== '..' && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));
|
|
33
|
+
}
|
|
34
|
+
export async function containedPath({ root, path }) {
|
|
35
|
+
const canonicalRoot = await realpath(root);
|
|
36
|
+
const canonicalPath = await realpath(resolve(canonicalRoot, path));
|
|
37
|
+
if (!isWithin({ root: canonicalRoot, path: canonicalPath })) {
|
|
38
|
+
throw new Error(`Workspace source is outside the app/package root: ${path}`);
|
|
39
|
+
}
|
|
40
|
+
return canonicalPath;
|
|
41
|
+
}
|
|
42
|
+
export async function loadWorkspacePackages({ rootDir, manifest }) {
|
|
43
|
+
const packages = new Map();
|
|
44
|
+
for (const entry of manifest.packages ?? []) {
|
|
45
|
+
if (packages.has(entry.name))
|
|
46
|
+
throw new Error(`Duplicate workspace package ${entry.name}`);
|
|
47
|
+
const dir = await containedPath({ root: rootDir, path: entry.path });
|
|
48
|
+
const json = await readWorkspacePackage({ dir });
|
|
49
|
+
if (json.name !== entry.name)
|
|
50
|
+
throw new Error(`Workspace package ${entry.path}/package.json must name ${entry.name}`);
|
|
51
|
+
packages.set(entry.name, { ...entry, dir, json });
|
|
52
|
+
}
|
|
53
|
+
return packages;
|
|
54
|
+
}
|
|
55
|
+
export function workspaceDependency({ name, spec, packages }) {
|
|
56
|
+
if (!spec.startsWith('workspace:'))
|
|
57
|
+
return undefined;
|
|
58
|
+
if (!/^workspace:(?:\*|[~^]|[~^]?\d[^/:]*)$/.test(spec)) {
|
|
59
|
+
throw new Error(`Workspace dependency ${name} uses unsupported alias/range ${spec}; use the package name with workspace:*`);
|
|
60
|
+
}
|
|
61
|
+
const dependency = packages.get(name);
|
|
62
|
+
if (!dependency)
|
|
63
|
+
throw new Error(`Workspace dependency ${name} is not declared in sequence.app.yml packages`);
|
|
64
|
+
return dependency;
|
|
65
|
+
}
|
|
66
|
+
export function packageClosure({ json, packages }) {
|
|
67
|
+
const selected = new Map();
|
|
68
|
+
const visit = (source, includeDev) => {
|
|
69
|
+
for (const section of includeDev ? DEPENDENCY_SECTIONS : RUNTIME_SECTIONS) {
|
|
70
|
+
for (const [name, spec] of Object.entries(source[section] ?? {})) {
|
|
71
|
+
const dependency = workspaceDependency({ name, spec, packages });
|
|
72
|
+
if (!dependency || selected.has(name))
|
|
73
|
+
continue;
|
|
74
|
+
selected.set(name, dependency);
|
|
75
|
+
visit(dependency.json, false);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
visit(json, true);
|
|
80
|
+
return [...selected.values()];
|
|
81
|
+
}
|
|
82
|
+
/** The upload is registry-only after workspace code has been compiled into it. */
|
|
83
|
+
export function deploymentPackageJson({ json, closure, platformPeers }) {
|
|
84
|
+
const result = structuredClone(json);
|
|
85
|
+
for (const section of DEPENDENCY_SECTIONS) {
|
|
86
|
+
if (result[section])
|
|
87
|
+
result[section] = Object.fromEntries(Object.entries(result[section]).filter(([, spec]) => !spec.startsWith('workspace:')));
|
|
88
|
+
for (const [name, spec] of Object.entries(result[section] ?? {}))
|
|
89
|
+
assertRegistryDependency({ name, spec });
|
|
90
|
+
}
|
|
91
|
+
for (const pkg of closure) {
|
|
92
|
+
for (const section of RUNTIME_SECTIONS) {
|
|
93
|
+
for (const [name, spec] of Object.entries(pkg.json[section] ?? {})) {
|
|
94
|
+
if (spec.startsWith('workspace:'))
|
|
95
|
+
continue;
|
|
96
|
+
assertRegistryDependency({ name, spec });
|
|
97
|
+
const target = platformPeers?.has(name) ? 'devDependencies' : section === 'optionalDependencies' ? 'optionalDependencies' : 'dependencies';
|
|
98
|
+
const previous = result.dependencies?.[name] ?? result.optionalDependencies?.[name];
|
|
99
|
+
if (previous !== undefined && previous !== spec)
|
|
100
|
+
throw new Error(`Conflicting shared dependency ${name}: ${previous} and ${spec}; align workspace package dependency ranges`);
|
|
101
|
+
result[target] = { ...result[target], [name]: spec };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
function exportCondition(value, browser, requireImport) {
|
|
108
|
+
if (typeof value === 'string')
|
|
109
|
+
return value;
|
|
110
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
111
|
+
return undefined;
|
|
112
|
+
const conditions = new Set([browser ? 'browser' : 'node', requireImport ? 'require' : 'import', 'default']);
|
|
113
|
+
for (const condition of Object.keys(value)) {
|
|
114
|
+
if (conditions.has(condition)) {
|
|
115
|
+
const target = exportCondition(Reflect.get(value, condition), browser, requireImport);
|
|
116
|
+
if (target)
|
|
117
|
+
return target;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
function subpathExport({ exports, key, browser, requireImport }) {
|
|
123
|
+
const exact = exportCondition(Reflect.get(exports, key), browser, requireImport);
|
|
124
|
+
if (exact)
|
|
125
|
+
return exact;
|
|
126
|
+
for (const pattern of Object.keys(exports).filter((value) => value.includes('*'))) {
|
|
127
|
+
const [prefix, suffix = ''] = pattern.split('*');
|
|
128
|
+
if (prefix === undefined || !key.startsWith(prefix) || !key.endsWith(suffix))
|
|
129
|
+
continue;
|
|
130
|
+
const match = key.slice(prefix.length, suffix ? -suffix.length : undefined);
|
|
131
|
+
const entry = exportCondition(Reflect.get(exports, pattern), browser, requireImport)?.replaceAll('*', match);
|
|
132
|
+
if (entry)
|
|
133
|
+
return entry;
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
function workspaceExport({ pkg, subpath, browser, requireImport }) {
|
|
138
|
+
const exports = pkg.json.exports;
|
|
139
|
+
if (exports && typeof exports === 'object' && !Array.isArray(exports) && Object.keys(exports).some((key) => key.startsWith('.'))) {
|
|
140
|
+
return subpathExport({ exports, key: subpath ? `.${subpath}` : '.', browser, requireImport });
|
|
141
|
+
}
|
|
142
|
+
if (!subpath)
|
|
143
|
+
return exports !== undefined ? exportCondition(exports, browser, requireImport) : pkg.json.module ?? pkg.json.main ?? 'index.js';
|
|
144
|
+
return exports === undefined ? `.${subpath}` : undefined;
|
|
145
|
+
}
|
|
146
|
+
export async function resolveWorkspaceImport({ specifier, packages, browser, requireImport = false }) {
|
|
147
|
+
const name = specifier.startsWith('@') ? specifier.split('/').slice(0, 2).join('/') : specifier.split('/')[0];
|
|
148
|
+
const pkg = packages.get(name);
|
|
149
|
+
if (!pkg)
|
|
150
|
+
return undefined;
|
|
151
|
+
const entry = workspaceExport({ pkg, subpath: specifier.slice(name.length), browser, requireImport });
|
|
152
|
+
if (!entry)
|
|
153
|
+
throw new Error(`Workspace package ${pkg.name} does not export ${specifier}`);
|
|
154
|
+
if (/^\.env(?:\..*)?$/.test(basename(entry)))
|
|
155
|
+
throw new Error(`Dotenv files cannot be workspace exports: ${entry}`);
|
|
156
|
+
if (isAbsolute(entry) || entry.split('/').includes('..'))
|
|
157
|
+
throw new Error(`Workspace package ${pkg.name} export escapes its package: ${entry}`);
|
|
158
|
+
return containedPath({ root: pkg.dir, path: entry });
|
|
159
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AppManifest, type PrimitiveEntry } from './manifest.js';
|
|
2
|
+
export declare const WORKSPACE_ROOT_FILES: string[];
|
|
3
|
+
export declare function scaffoldSharedPackage({ rootDir, appId, name, }: {
|
|
4
|
+
rootDir: string;
|
|
5
|
+
appId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
name: string;
|
|
9
|
+
path: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** Convert only freshly generated primitive files into members of the app workspace. */
|
|
12
|
+
export declare function joinAppWorkspace({ rootDir, manifest, entries, }: {
|
|
13
|
+
rootDir: string;
|
|
14
|
+
manifest: AppManifest;
|
|
15
|
+
entries: readonly PrimitiveEntry[];
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
export declare function scaffoldAppWorkspace({ rootDir, manifest, }: {
|
|
18
|
+
rootDir: string;
|
|
19
|
+
manifest: AppManifest;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
export declare function addSharedPackageToApp({ rootDir, name, }: {
|
|
22
|
+
rootDir: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { dump as yamlDump, load as yamlLoad } from 'js-yaml';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { loadAppManifest, writeAppManifest } from './manifest.js';
|
|
7
|
+
import { currentVersion } from '../update-check.js';
|
|
8
|
+
const packageSchema = z.looseObject({
|
|
9
|
+
dependencies: z.record(z.string(), z.string()).optional(),
|
|
10
|
+
pnpm: z.strictObject({ overrides: z.record(z.string(), z.string()).optional() }).optional(),
|
|
11
|
+
});
|
|
12
|
+
const workspaceSchema = z.looseObject({
|
|
13
|
+
packages: z.array(z.string()).optional(),
|
|
14
|
+
overrides: z.record(z.string(), z.string()).optional(),
|
|
15
|
+
});
|
|
16
|
+
function mergeOverrides({ existing, incoming }) {
|
|
17
|
+
for (const [selector, version] of Object.entries(incoming)) {
|
|
18
|
+
if (existing[selector] !== undefined && existing[selector] !== version) {
|
|
19
|
+
throw new Error(`conflicting pnpm override for "${selector}": "${existing[selector]}" and "${version}" — reconcile the root workspace policy first`);
|
|
20
|
+
}
|
|
21
|
+
existing[selector] = version;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const WORKSPACE_ROOT_FILES = ['package.json', 'pnpm-workspace.yaml', 'packages'];
|
|
25
|
+
export async function scaffoldSharedPackage({ rootDir, appId, name, }) {
|
|
26
|
+
if (!/^[a-z][a-z0-9-]*$/.test(name))
|
|
27
|
+
throw new Error('shared package names must be kebab-case starting with a letter');
|
|
28
|
+
const entry = { name: `@${appId}/${name}`, path: `packages/${name}` };
|
|
29
|
+
const directory = join(rootDir, entry.path);
|
|
30
|
+
if (existsSync(directory))
|
|
31
|
+
throw new Error(`${entry.path} already exists — choose another package name`);
|
|
32
|
+
await mkdir(join(directory, 'src'), { recursive: true });
|
|
33
|
+
await writeFile(join(directory, 'package.json'), `${JSON.stringify({
|
|
34
|
+
name: entry.name,
|
|
35
|
+
version: '0.0.1',
|
|
36
|
+
private: true,
|
|
37
|
+
type: 'module',
|
|
38
|
+
exports: './src/index.ts',
|
|
39
|
+
}, null, 2)}\n`);
|
|
40
|
+
await writeFile(join(directory, 'src/index.ts'), '// Export shared types, validation, and helpers here.\nexport {}\n');
|
|
41
|
+
return entry;
|
|
42
|
+
}
|
|
43
|
+
/** Convert only freshly generated primitive files into members of the app workspace. */
|
|
44
|
+
export async function joinAppWorkspace({ rootDir, manifest, entries, }) {
|
|
45
|
+
const workspacePath = join(rootDir, 'pnpm-workspace.yaml');
|
|
46
|
+
if (manifest.schema_version !== 2 || !existsSync(workspacePath))
|
|
47
|
+
return;
|
|
48
|
+
const config = workspaceSchema.parse(yamlLoad(await readFile(workspacePath, 'utf8')));
|
|
49
|
+
const paths = new Set(config.packages ?? []);
|
|
50
|
+
const overrides = { ...config.overrides };
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
const directory = join(rootDir, entry.path);
|
|
53
|
+
const packagePath = join(directory, 'package.json');
|
|
54
|
+
if (!existsSync(packagePath))
|
|
55
|
+
continue;
|
|
56
|
+
const pkg = packageSchema.parse(JSON.parse(await readFile(packagePath, 'utf8')));
|
|
57
|
+
const { pnpm, ...packageFields } = pkg;
|
|
58
|
+
mergeOverrides({ existing: overrides, incoming: pnpm?.overrides ?? {} });
|
|
59
|
+
await writeFile(packagePath, `${JSON.stringify({
|
|
60
|
+
...packageFields,
|
|
61
|
+
name: `@${manifest.app.id}/primitive-${entry.id}`,
|
|
62
|
+
dependencies: {
|
|
63
|
+
...pkg.dependencies,
|
|
64
|
+
...Object.fromEntries((manifest.packages ?? []).map((shared) => [shared.name, 'workspace:*'])),
|
|
65
|
+
},
|
|
66
|
+
}, null, 2)}\n`);
|
|
67
|
+
for (const name of ['pnpm-workspace.yaml', 'pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', '.npmrc']) {
|
|
68
|
+
await rm(join(directory, name), { force: true });
|
|
69
|
+
}
|
|
70
|
+
paths.add(entry.path);
|
|
71
|
+
}
|
|
72
|
+
for (const entry of manifest.packages ?? [])
|
|
73
|
+
paths.add(entry.path);
|
|
74
|
+
await writeFile(workspacePath, yamlDump({
|
|
75
|
+
...config,
|
|
76
|
+
packages: [...paths],
|
|
77
|
+
...(Object.keys(overrides).length > 0 ? { overrides } : {}),
|
|
78
|
+
}, { lineWidth: 100 }));
|
|
79
|
+
}
|
|
80
|
+
export async function scaffoldAppWorkspace({ rootDir, manifest, }) {
|
|
81
|
+
await writeFile(join(rootDir, 'package.json'), `${JSON.stringify({
|
|
82
|
+
name: `@${manifest.app.id}/app`,
|
|
83
|
+
private: true,
|
|
84
|
+
type: 'module',
|
|
85
|
+
packageManager: 'pnpm@10.28.2',
|
|
86
|
+
scripts: { deploy: 'seq-studio deploy', 'deploy:plan': 'seq-studio deploy --dry-run' },
|
|
87
|
+
devDependencies: { '@sequenceholdings/studio-cli': `^${currentVersion()}` },
|
|
88
|
+
}, null, 2)}\n`);
|
|
89
|
+
await writeFile(join(rootDir, 'pnpm-workspace.yaml'), yamlDump({
|
|
90
|
+
packages: [],
|
|
91
|
+
minimumReleaseAge: 10080,
|
|
92
|
+
minimumReleaseAgeExclude: [
|
|
93
|
+
'@sequenceholdings/agent-spec', '@sequenceholdings/atlas-ui',
|
|
94
|
+
'@sequenceholdings/lattice-form-renderer', '@sequenceholdings/artifact-studio',
|
|
95
|
+
'@sequenceholdings/lattice', '@sequenceholdings/orm',
|
|
96
|
+
'@sequenceholdings/pipeline-spec', '@sequenceholdings/studio-cli',
|
|
97
|
+
],
|
|
98
|
+
strictDepBuilds: true,
|
|
99
|
+
allowBuilds: { esbuild: true },
|
|
100
|
+
}));
|
|
101
|
+
await joinAppWorkspace({ rootDir, manifest, entries: manifest.primitives });
|
|
102
|
+
}
|
|
103
|
+
export async function addSharedPackageToApp({ rootDir, name, }) {
|
|
104
|
+
const manifest = await loadAppManifest(rootDir);
|
|
105
|
+
const workspacePath = join(rootDir, 'pnpm-workspace.yaml');
|
|
106
|
+
if (manifest.schema_version !== 2 || !existsSync(workspacePath)) {
|
|
107
|
+
throw new Error('adding a shared package requires a version 2 app with a root pnpm-workspace.yaml');
|
|
108
|
+
}
|
|
109
|
+
const packageName = `@${manifest.app.id}/${name}`;
|
|
110
|
+
if (name === 'app' || name.startsWith('primitive-') || manifest.packages?.some((entry) => entry.name === packageName)) {
|
|
111
|
+
throw new Error(`package name "${packageName}" is already used or reserved by this app`);
|
|
112
|
+
}
|
|
113
|
+
const previousWorkspace = await readFile(workspacePath, 'utf8');
|
|
114
|
+
const entry = await scaffoldSharedPackage({ rootDir, appId: manifest.app.id, name });
|
|
115
|
+
try {
|
|
116
|
+
const next = { ...manifest, packages: [...(manifest.packages ?? []), entry] };
|
|
117
|
+
await joinAppWorkspace({ rootDir, manifest: next, entries: [] });
|
|
118
|
+
await writeAppManifest({ rootDir, manifest: next });
|
|
119
|
+
return entry;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
await writeFile(workspacePath, previousWorkspace);
|
|
123
|
+
await rm(join(rootDir, entry.path), { recursive: true, force: true });
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PrimitiveEntry } from './manifest.js';
|
|
2
|
+
import { type WorkspaceManifest } from './workspace-model.js';
|
|
3
|
+
export interface AppWorkspaceOptions {
|
|
4
|
+
rootDir: string;
|
|
5
|
+
manifest: WorkspaceManifest;
|
|
6
|
+
entries: readonly PrimitiveEntry[];
|
|
7
|
+
paths: ReadonlyMap<string, string>;
|
|
8
|
+
}
|
|
9
|
+
/** Read-only dependency/path validation, suitable for deploy --dry-run. */
|
|
10
|
+
export declare function validateAppWorkspace(options: AppWorkspaceOptions): Promise<void>;
|
|
11
|
+
export declare function prepareAppWorkspace(options: AppWorkspaceOptions): Promise<{
|
|
12
|
+
paths: Map<string, string>;
|
|
13
|
+
cleanup: () => Promise<void>;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/** Compile declared workspace source packages into isolated primitive uploads. */
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { copyFile, mkdir, mkdtemp, readFile, readdir, realpath, rm, symlink, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { dirname, join, relative, sep } from 'node:path';
|
|
5
|
+
import { dump as yamlDump, load as yamlLoad } from 'js-yaml';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { REMOTE_INSTALL_PLATFORM_PACKAGES } from '@sequenceholdings/artifact-studio/trusted-install';
|
|
8
|
+
import { ensureAppOutputDirectory } from './paths.js';
|
|
9
|
+
import { compileWorkspaceArtifact, compileWorkspaceFunction } from './workspace-compile.js';
|
|
10
|
+
import { DEPENDENCY_SECTIONS, deploymentPackageJson, loadWorkspacePackages, packageClosure, readWorkspacePackage, } from './workspace-model.js';
|
|
11
|
+
const IGNORED_DIRS = new Set(['node_modules', '.git', '.sequence', '.next', '.artifact-studio', 'dist', 'build']);
|
|
12
|
+
const ENV_FILE = /^\.env(?:\..*)?$/;
|
|
13
|
+
const slash = (value) => value.split(sep).join('/');
|
|
14
|
+
async function workspaceConsumers(options) {
|
|
15
|
+
const packages = await loadWorkspacePackages(options);
|
|
16
|
+
const consumers = [];
|
|
17
|
+
for (const entry of options.entries) {
|
|
18
|
+
const path = options.paths.get(entry.id);
|
|
19
|
+
if (!path || !existsSync(join(path, 'package.json')))
|
|
20
|
+
continue;
|
|
21
|
+
const dir = await realpath(path);
|
|
22
|
+
const original = await readWorkspacePackage({ dir });
|
|
23
|
+
const closure = packageClosure({ json: original, packages });
|
|
24
|
+
const json = deploymentPackageJson({ json: original, closure, platformPeers: entry.kind === 'artifact' ? REMOTE_INSTALL_PLATFORM_PACKAGES : undefined });
|
|
25
|
+
consumers.push({ entry, dir, original, json, closure });
|
|
26
|
+
}
|
|
27
|
+
return { packages, consumers };
|
|
28
|
+
}
|
|
29
|
+
/** Read-only dependency/path validation, suitable for deploy --dry-run. */
|
|
30
|
+
export async function validateAppWorkspace(options) {
|
|
31
|
+
await workspaceConsumers(options);
|
|
32
|
+
}
|
|
33
|
+
async function copyPrimitiveSources({ sourceDir, stageDir, preserveEnv }) {
|
|
34
|
+
const files = [];
|
|
35
|
+
const walk = async (dir) => {
|
|
36
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
37
|
+
if (IGNORED_DIRS.has(entry.name) || entry.name === '.npmrc')
|
|
38
|
+
continue;
|
|
39
|
+
if (!preserveEnv && ENV_FILE.test(entry.name))
|
|
40
|
+
continue;
|
|
41
|
+
const source = join(dir, entry.name);
|
|
42
|
+
const file = relative(sourceDir, source);
|
|
43
|
+
const target = join(stageDir, file);
|
|
44
|
+
if (entry.isSymbolicLink())
|
|
45
|
+
throw new Error(`Symlinks are not allowed in app deployment sources: ${file}`);
|
|
46
|
+
if (entry.isDirectory()) {
|
|
47
|
+
await mkdir(target, { recursive: true });
|
|
48
|
+
await walk(source);
|
|
49
|
+
}
|
|
50
|
+
else if (entry.isFile()) {
|
|
51
|
+
await mkdir(dirname(target), { recursive: true });
|
|
52
|
+
await copyFile(source, target);
|
|
53
|
+
files.push(file);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
await walk(sourceDir);
|
|
58
|
+
return files;
|
|
59
|
+
}
|
|
60
|
+
const lockDependencySchema = z.object({ specifier: z.string(), version: z.string() }).passthrough();
|
|
61
|
+
const lockImporterSchema = z.object({
|
|
62
|
+
dependencies: z.record(z.string(), lockDependencySchema).optional(),
|
|
63
|
+
devDependencies: z.record(z.string(), lockDependencySchema).optional(),
|
|
64
|
+
optionalDependencies: z.record(z.string(), lockDependencySchema).optional(),
|
|
65
|
+
}).passthrough();
|
|
66
|
+
const lockSchema = z.object({ importers: z.record(z.string(), lockImporterSchema), overrides: z.record(z.string(), z.string()).optional() }).passthrough();
|
|
67
|
+
/** Keep registry resolutions from the one workspace lock, with one importer. */
|
|
68
|
+
async function writeDeploymentLock({ rootDir, consumer, stageDir }) {
|
|
69
|
+
const rootLock = join(rootDir, 'pnpm-lock.yaml');
|
|
70
|
+
if (!existsSync(rootLock)) {
|
|
71
|
+
// A leaf lock still references workspace specs after compilation. The
|
|
72
|
+
// function worker can safely resolve registry-only dependencies itself.
|
|
73
|
+
if (consumer.closure.length > 0)
|
|
74
|
+
await rm(join(stageDir, 'pnpm-lock.yaml'), { force: true });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const lock = lockSchema.parse(yamlLoad(await readFile(rootLock, 'utf8')));
|
|
78
|
+
const overrides = lock.overrides ?? {};
|
|
79
|
+
if (Object.keys(overrides).length > 0)
|
|
80
|
+
consumer.json.pnpm = { ...consumer.json.pnpm, overrides: { ...consumer.json.pnpm?.overrides, ...overrides } };
|
|
81
|
+
const sources = [consumer.dir, ...consumer.closure.map((pkg) => pkg.dir)];
|
|
82
|
+
const importers = sources.map((dir) => lock.importers[slash(relative(rootDir, dir)) || '.']);
|
|
83
|
+
const importer = {};
|
|
84
|
+
for (const section of ['dependencies', 'devDependencies', 'optionalDependencies']) {
|
|
85
|
+
const next = {};
|
|
86
|
+
for (const [name, specifier] of Object.entries(consumer.json[section] ?? {})) {
|
|
87
|
+
const effectiveSpecifier = overrides[name] ?? overrides[`${name}@${specifier}`] ?? specifier;
|
|
88
|
+
const resolution = importers.flatMap((source) => [source?.dependencies?.[name], source?.optionalDependencies?.[name], source?.devDependencies?.[name]])
|
|
89
|
+
.find((candidate) => candidate?.specifier === effectiveSpecifier && !candidate.version.startsWith('link:'));
|
|
90
|
+
if (!resolution)
|
|
91
|
+
throw new Error(`Workspace lockfile is out of date for ${name}@${specifier}; run pnpm install at the app root before deploying`);
|
|
92
|
+
next[name] = resolution;
|
|
93
|
+
if (consumer.json[section] && effectiveSpecifier !== specifier)
|
|
94
|
+
consumer.json[section][name] = effectiveSpecifier;
|
|
95
|
+
}
|
|
96
|
+
if (Object.keys(next).length > 0)
|
|
97
|
+
importer[section] = next;
|
|
98
|
+
}
|
|
99
|
+
await writeFile(join(stageDir, 'pnpm-lock.yaml'), yamlDump({ ...lock, importers: { '.': importer } }, { noRefs: true, lineWidth: -1 }));
|
|
100
|
+
}
|
|
101
|
+
/** Local Vite resolves registry dependencies through existing installed peers. */
|
|
102
|
+
async function linkInstalledRegistryDependencies({ rootDir, consumer, stageDir }) {
|
|
103
|
+
const directories = [consumer.dir, ...consumer.closure.map((pkg) => pkg.dir), rootDir];
|
|
104
|
+
for (const name of new Set(DEPENDENCY_SECTIONS.flatMap((section) => Object.keys(consumer.json[section] ?? {})))) {
|
|
105
|
+
if (!/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/i.test(name))
|
|
106
|
+
throw new Error(`Invalid registry package name ${name}`);
|
|
107
|
+
const installed = directories.map((dir) => join(dir, 'node_modules', name)).find((path) => existsSync(path));
|
|
108
|
+
if (!installed)
|
|
109
|
+
continue;
|
|
110
|
+
const target = join(stageDir, 'node_modules', name);
|
|
111
|
+
await mkdir(dirname(target), { recursive: true });
|
|
112
|
+
await symlink(await realpath(installed), target, 'dir');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export async function prepareAppWorkspace(options) {
|
|
116
|
+
const { packages, consumers } = await workspaceConsumers(options);
|
|
117
|
+
const paths = new Map(options.paths);
|
|
118
|
+
const staged = consumers.filter((consumer) => consumer.closure.length > 0 && ['function', 'artifact'].includes(consumer.entry.kind));
|
|
119
|
+
if (staged.length === 0)
|
|
120
|
+
return { paths, cleanup: async () => { } };
|
|
121
|
+
const rootDir = await realpath(options.rootDir);
|
|
122
|
+
const buildRoot = await ensureAppOutputDirectory({ rootDir, entryPath: '.sequence/builds' });
|
|
123
|
+
const temporary = await mkdtemp(join(buildRoot, 'app-'));
|
|
124
|
+
const cleanup = async () => { await rm(temporary, { recursive: true, force: true }); };
|
|
125
|
+
try {
|
|
126
|
+
for (const [index, consumer] of staged.entries()) {
|
|
127
|
+
const stageDir = join(temporary, String(index));
|
|
128
|
+
await mkdir(stageDir, { recursive: true });
|
|
129
|
+
const sourceFiles = await copyPrimitiveSources({ sourceDir: consumer.dir, stageDir, preserveEnv: consumer.entry.kind === 'function' });
|
|
130
|
+
const compilerOptions = { sourceDir: consumer.dir, stageDir, json: consumer.json, packages, closure: consumer.closure };
|
|
131
|
+
if (consumer.entry.kind === 'function')
|
|
132
|
+
await compileWorkspaceFunction(compilerOptions);
|
|
133
|
+
else
|
|
134
|
+
await compileWorkspaceArtifact({ ...compilerOptions, sourceFiles });
|
|
135
|
+
await writeDeploymentLock({ rootDir, consumer, stageDir });
|
|
136
|
+
await writeFile(join(stageDir, 'package.json'), `${JSON.stringify(consumer.json, null, 2)}\n`);
|
|
137
|
+
if (consumer.entry.kind === 'artifact')
|
|
138
|
+
await linkInstalledRegistryDependencies({ rootDir, consumer, stageDir });
|
|
139
|
+
paths.set(consumer.entry.id, stageDir);
|
|
140
|
+
}
|
|
141
|
+
return { paths, cleanup };
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
await cleanup();
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
package/dist/atlas-client.js
CHANGED
|
@@ -92,15 +92,37 @@ function cfAccessHeaders(baseUrl) {
|
|
|
92
92
|
return {};
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Structured `violations[]` from the Lattice contract routes (authoring
|
|
97
|
+
* policy, static graph limits, …). The server already bounds the array; the
|
|
98
|
+
* `detail` line summarizes only the first few, so list every message here or
|
|
99
|
+
* an author sees three of forty problems per round trip.
|
|
100
|
+
*/
|
|
101
|
+
function violationLines(violations) {
|
|
102
|
+
if (!Array.isArray(violations))
|
|
103
|
+
return [];
|
|
104
|
+
const lines = [];
|
|
105
|
+
for (const v of violations) {
|
|
106
|
+
if (v && typeof v === 'object' && typeof v.message === 'string') {
|
|
107
|
+
lines.push(` - ${v.message}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return lines;
|
|
111
|
+
}
|
|
95
112
|
function messageFromBody(body, status, statusText) {
|
|
96
113
|
if (body && typeof body === 'object') {
|
|
97
114
|
const record = body;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (typeof record.
|
|
101
|
-
return record.
|
|
102
|
-
|
|
103
|
-
|
|
115
|
+
const violations = violationLines(record.violations);
|
|
116
|
+
const withViolations = (headline) => violations.length > 0 ? [headline, ...violations].join('\n') : headline;
|
|
117
|
+
if (typeof record.detail === 'string' && record.detail.length > 0) {
|
|
118
|
+
return withViolations(record.detail);
|
|
119
|
+
}
|
|
120
|
+
if (typeof record.error === 'string' && record.error.length > 0) {
|
|
121
|
+
return withViolations(record.error);
|
|
122
|
+
}
|
|
123
|
+
if (typeof record.message === 'string' && record.message.length > 0) {
|
|
124
|
+
return withViolations(record.message);
|
|
125
|
+
}
|
|
104
126
|
}
|
|
105
127
|
if (typeof body === 'string' && body.trim().length > 0) {
|
|
106
128
|
const trimmed = body.trim();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ParsedArgs } from '../process/commands.js';
|
|
2
2
|
declare const PAT_SCOPES: readonly ["repo:read", "repo:write", "repo:admin"];
|
|
3
3
|
type PatScope = (typeof PAT_SCOPES)[number];
|
|
4
|
-
export declare const AUTH_USAGE = "usage:\n seq-studio auth pat create --name <n> -e <env> [--scopes repo:read,repo:write]\n [--expires 7d|30d|90d|1y|never] [--store-credentials]\n seq-studio auth pat list -e <env>\n seq-studio auth pat revoke <id> -e <env> [--yes]\n\n Issue a personal access token for git clone / git push against the platform\n git service.\n\n Authenticate with `seq-studio login`, then run `auth pat create -e <env>`.\n Alternatively, open Atlas \u2192 Settings \u2192 Tokens:\n https://<atlas-host>/settings/tokens\n Sign in, create a token (repo:read / repo:write), copy once, then:\n export ATLAS_GIT_PAT=<token>\n\n On create the raw token is printed ONCE \u2014 store it; Atlas cannot re-show it.\n Git Basic auth: any username (e.g. git), PAT as the password.\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n";
|
|
4
|
+
export declare const AUTH_USAGE = "usage:\n seq-studio auth pat create --name <n> -e <env> [--scopes repo:read,repo:write]\n [--expires 1d|7d|30d|90d|1y|never] [--store-credentials]\n seq-studio auth pat list -e <env>\n seq-studio auth pat revoke <id> -e <env> [--yes]\n\n Issue a personal access token for git clone / git push against the platform\n git service.\n\n Authenticate with `seq-studio login`, then run `auth pat create -e <env>`.\n Alternatively, open Atlas \u2192 Settings \u2192 Tokens:\n https://<atlas-host>/settings/tokens\n Sign in, create a token (repo:read / repo:write), copy once, then:\n export ATLAS_GIT_PAT=<token>\n repo:write covers push and PR open; merging a PR requires an FGA Merge\n (or Admin) grant on the repository, not a PAT scope.\n\n On create the raw token is printed ONCE \u2014 store it; Atlas cannot re-show it.\n Git Basic auth: any username (e.g. git), PAT as the password.\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n";
|
|
5
5
|
export declare function parsePatScopes(raw: string | undefined): PatScope[];
|
|
6
6
|
/**
|
|
7
7
|
* Map UI-style duration choices to an absolute ISO-8601 expiresAt, or undefined
|
|
@@ -40,7 +40,7 @@ function stringFlag(flags, key) {
|
|
|
40
40
|
}
|
|
41
41
|
export const AUTH_USAGE = `usage:
|
|
42
42
|
seq-studio auth pat create --name <n> -e <env> [--scopes repo:read,repo:write]
|
|
43
|
-
[--expires 7d|30d|90d|1y|never] [--store-credentials]
|
|
43
|
+
[--expires 1d|7d|30d|90d|1y|never] [--store-credentials]
|
|
44
44
|
seq-studio auth pat list -e <env>
|
|
45
45
|
seq-studio auth pat revoke <id> -e <env> [--yes]
|
|
46
46
|
|
|
@@ -52,6 +52,8 @@ export const AUTH_USAGE = `usage:
|
|
|
52
52
|
https://<atlas-host>/settings/tokens
|
|
53
53
|
Sign in, create a token (repo:read / repo:write), copy once, then:
|
|
54
54
|
export ATLAS_GIT_PAT=<token>
|
|
55
|
+
repo:write covers push and PR open; merging a PR requires an FGA Merge
|
|
56
|
+
(or Admin) grant on the repository, not a PAT scope.
|
|
55
57
|
|
|
56
58
|
On create the raw token is printed ONCE — store it; Atlas cannot re-show it.
|
|
57
59
|
Git Basic auth: any username (e.g. git), PAT as the password.
|
|
@@ -110,6 +112,7 @@ export function resolveExpiresAt(choice) {
|
|
|
110
112
|
const now = Date.now();
|
|
111
113
|
const day = 24 * 60 * 60 * 1000;
|
|
112
114
|
const map = {
|
|
115
|
+
'1d': 1 * day,
|
|
113
116
|
'7d': 7 * day,
|
|
114
117
|
'30d': 30 * day,
|
|
115
118
|
'90d': 90 * day,
|
|
@@ -117,7 +120,7 @@ export function resolveExpiresAt(choice) {
|
|
|
117
120
|
};
|
|
118
121
|
const delta = map[choice];
|
|
119
122
|
if (delta === undefined) {
|
|
120
|
-
throw new Error(`--expires must be one of: 7d, 30d, 90d, 1y, never (got "${choice}")`);
|
|
123
|
+
throw new Error(`--expires must be one of: 1d, 7d, 30d, 90d, 1y, never (got "${choice}")`);
|
|
121
124
|
}
|
|
122
125
|
return new Date(now + delta).toISOString();
|
|
123
126
|
}
|
|
@@ -198,7 +198,7 @@ entrypoint: handler
|
|
|
198
198
|
limits:
|
|
199
199
|
memory_mb: 256
|
|
200
200
|
timeout_seconds: 60
|
|
201
|
-
min_instances:
|
|
201
|
+
min_instances: 1
|
|
202
202
|
max_instances: 3
|
|
203
203
|
invoke_rate_per_minute: 60
|
|
204
204
|
|
|
@@ -272,6 +272,12 @@ const TEMPLATE_PACKAGE_JSON = (id) => JSON.stringify({
|
|
|
272
272
|
'@types/node': '^20.11.0',
|
|
273
273
|
typescript: '^5.6.0',
|
|
274
274
|
},
|
|
275
|
+
pnpm: {
|
|
276
|
+
overrides: {
|
|
277
|
+
'uuid@<11.1.1': '11.1.1',
|
|
278
|
+
'fast-uri@>=3.0.0 <3.1.6': '3.1.6',
|
|
279
|
+
},
|
|
280
|
+
},
|
|
275
281
|
}, null, 2) + '\n';
|
|
276
282
|
const TEMPLATE_GITIGNORE = `node_modules/
|
|
277
283
|
dist/
|
|
@@ -6,16 +6,28 @@ import { z } from 'zod';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const MF_MANIFEST_FILENAME = "managed-function.yml";
|
|
8
8
|
export declare const managedFunctionAuthorizationAdapterSchema: z.ZodEnum<{
|
|
9
|
+
"encompass.global-metadata-read": "encompass.global-metadata-read";
|
|
10
|
+
"encompass.loan-attachment-read": "encompass.loan-attachment-read";
|
|
11
|
+
"encompass.loan-document-read": "encompass.loan-document-read";
|
|
12
|
+
"encompass.loan-fields-read": "encompass.loan-fields-read";
|
|
13
|
+
"encompass.loan-folder-read": "encompass.loan-folder-read";
|
|
9
14
|
"encompass.loan-read-by-guid": "encompass.loan-read-by-guid";
|
|
10
15
|
"encompass.loan-read-by-number": "encompass.loan-read-by-number";
|
|
16
|
+
"encompass.loan-read-full": "encompass.loan-read-full";
|
|
11
17
|
"encompass.loan-search": "encompass.loan-search";
|
|
12
18
|
}>;
|
|
13
19
|
export type ManagedFunctionAuthorizationAdapter = z.infer<typeof managedFunctionAuthorizationAdapterSchema>;
|
|
14
20
|
export declare const managedFunctionAuthorizationSchema: z.ZodObject<{
|
|
15
21
|
version: z.ZodLiteral<1>;
|
|
16
22
|
adapter: z.ZodEnum<{
|
|
23
|
+
"encompass.global-metadata-read": "encompass.global-metadata-read";
|
|
24
|
+
"encompass.loan-attachment-read": "encompass.loan-attachment-read";
|
|
25
|
+
"encompass.loan-document-read": "encompass.loan-document-read";
|
|
26
|
+
"encompass.loan-fields-read": "encompass.loan-fields-read";
|
|
27
|
+
"encompass.loan-folder-read": "encompass.loan-folder-read";
|
|
17
28
|
"encompass.loan-read-by-guid": "encompass.loan-read-by-guid";
|
|
18
29
|
"encompass.loan-read-by-number": "encompass.loan-read-by-number";
|
|
30
|
+
"encompass.loan-read-full": "encompass.loan-read-full";
|
|
19
31
|
"encompass.loan-search": "encompass.loan-search";
|
|
20
32
|
}>;
|
|
21
33
|
}, z.core.$strict>;
|
|
@@ -79,8 +91,14 @@ export declare const managedFunctionManifestSchema: z.ZodObject<{
|
|
|
79
91
|
authorization: z.ZodOptional<z.ZodObject<{
|
|
80
92
|
version: z.ZodLiteral<1>;
|
|
81
93
|
adapter: z.ZodEnum<{
|
|
94
|
+
"encompass.global-metadata-read": "encompass.global-metadata-read";
|
|
95
|
+
"encompass.loan-attachment-read": "encompass.loan-attachment-read";
|
|
96
|
+
"encompass.loan-document-read": "encompass.loan-document-read";
|
|
97
|
+
"encompass.loan-fields-read": "encompass.loan-fields-read";
|
|
98
|
+
"encompass.loan-folder-read": "encompass.loan-folder-read";
|
|
82
99
|
"encompass.loan-read-by-guid": "encompass.loan-read-by-guid";
|
|
83
100
|
"encompass.loan-read-by-number": "encompass.loan-read-by-number";
|
|
101
|
+
"encompass.loan-read-full": "encompass.loan-read-full";
|
|
84
102
|
"encompass.loan-search": "encompass.loan-search";
|
|
85
103
|
}>;
|
|
86
104
|
}, z.core.$strict>>;
|