@inneranimalmedia/primetech-procedures 0.0.0-stage → 2.6.19
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/.codex-plugin/plugin.json +39 -0
- package/LICENSE +110 -0
- package/README.md +181 -2
- package/agents/openai.yaml +6 -0
- package/agentsam.package.json +80 -0
- package/assets/architect-icon.svg +10 -0
- package/assets/primetech-design-studio.svg +7 -0
- package/companion.json +40 -0
- package/package.json +56 -4
- package/plugin.README.md +37 -0
- package/plugin.json +43 -0
- package/procedures/arch.assembly.calculate/procedure.json +83 -0
- package/procedures/cad.motor-bearing-end-plate/README.md +21 -0
- package/procedures/cad.motor-bearing-end-plate/build_freecad.py +514 -0
- package/procedures/cad.motor-bearing-end-plate/finalize_bundle.py +26 -0
- package/procedures/cad.motor-bearing-end-plate/generate_assets.py +284 -0
- package/procedures/cad.motor-bearing-end-plate/generate_toolpaths.py +715 -0
- package/procedures/cad.motor-bearing-end-plate/package_artifacts.py +154 -0
- package/procedures/cad.motor-bearing-end-plate/parameters.json +51 -0
- package/procedures/cad.motor-bearing-end-plate/procedure.json +101 -0
- package/procedures/cad.motor-bearing-end-plate/render_preview.py +98 -0
- package/procedures/cad.motor-bearing-end-plate/run.py +214 -0
- package/procedures/cad.motor-bearing-end-plate/test_generate_toolpaths.py +50 -0
- package/procedures/media.asset.preflight/procedure.json +85 -0
- package/procedures/media.image.optimize-asset/procedure.json +102 -0
- package/procedures/primetech.assets.package/procedure.json +63 -0
- package/procedures/primetech.design-system.package/procedure.json +58 -0
- package/procedures/primetech.ebook.package/procedure.json +53 -0
- package/procedures/primetech.icon-family.build/procedure.json +101 -0
- package/procedures/primetech.production-board.manage/procedure.json +156 -0
- package/procedures/primetech.sprite-atlas.build/procedure.json +86 -0
- package/procedures/primetech.typeface.package/procedure.json +61 -0
- package/procedures/primetech.visuals.compare/procedure.json +74 -0
- package/procedures/repo.asset.inventory/procedure.json +65 -0
- package/procedures/repo.asset.inventory/run.py +116 -0
- package/procedures/repo.asset.inventory/run.sh +11 -0
- package/procedures/repo.git.status/procedure.json +58 -0
- package/procedures/repo.git.status/run.sh +10 -0
- package/profiles/PRIMETECH_PROCEDURE_ENGINEER.md +25 -0
- package/scripts/generate-procedures.py +112 -0
- package/scripts/generate-skills.py +425 -0
- package/scripts/package-openai-plugin.py +94 -0
- package/skills/primetech-brand-kit/SKILL.md +40 -0
- package/skills/primetech-brand-kit/agentsam.skill.json +64 -0
- package/skills/primetech-character-sprites/SKILL.md +40 -0
- package/skills/primetech-character-sprites/agentsam.skill.json +64 -0
- package/skills/primetech-creative-delivery/SKILL.md +39 -0
- package/skills/primetech-creative-delivery/agentsam.skill.json +57 -0
- package/skills/primetech-design-systems/SKILL.md +43 -0
- package/skills/primetech-design-systems/agentsam.skill.json +57 -0
- package/skills/primetech-digital-publishing/SKILL.md +39 -0
- package/skills/primetech-digital-publishing/agentsam.skill.json +52 -0
- package/skills/primetech-iconography/SKILL.md +40 -0
- package/skills/primetech-iconography/agentsam.skill.json +53 -0
- package/skills/primetech-type-design/SKILL.md +40 -0
- package/skills/primetech-type-design/agentsam.skill.json +53 -0
- package/skills/primetech-ui-ux-prototypes/SKILL.md +43 -0
- package/skills/primetech-ui-ux-prototypes/agentsam.skill.json +64 -0
- package/skills/primetech-visual-qa/SKILL.md +39 -0
- package/skills/primetech-visual-qa/agentsam.skill.json +56 -0
- package/src/creative/asset-package.js +42 -0
- package/src/creative/design-system.js +107 -0
- package/src/creative/ebook.js +88 -0
- package/src/creative/icon-family.js +125 -0
- package/src/creative/index.d.ts +157 -0
- package/src/creative/index.js +7 -0
- package/src/creative/paths.js +64 -0
- package/src/creative/sprite-atlas.js +100 -0
- package/src/creative/typeface.js +154 -0
- package/src/creative/visual-qa.js +88 -0
- package/src/index.d.ts +160 -0
- package/src/index.js +656 -0
- package/src/production-board.d.ts +103 -0
- package/src/production-board.js +181 -0
- package/src/skills.d.ts +48 -0
- package/src/skills.js +101 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "agentsam.skill.v1",
|
|
3
|
+
"package": "@inneranimalmedia/primetech-procedures",
|
|
4
|
+
"id": "primetech-ui-ux-prototypes",
|
|
5
|
+
"name": "PrimeTech \u00b7 High-fidelity UX flows and demos",
|
|
6
|
+
"description": "Research, map, implement and verify complete responsive product flows and working demos in the actual application codebase.",
|
|
7
|
+
"icon": "layout",
|
|
8
|
+
"slash": {
|
|
9
|
+
"suggested": "/primetech-ui-ux-prototypes"
|
|
10
|
+
},
|
|
11
|
+
"instructions": {
|
|
12
|
+
"source": "local_file",
|
|
13
|
+
"ref": "SKILL.md"
|
|
14
|
+
},
|
|
15
|
+
"execution": {
|
|
16
|
+
"mode": "turn",
|
|
17
|
+
"tools": [
|
|
18
|
+
"agentsam_excalidraw",
|
|
19
|
+
"excalidraw_export",
|
|
20
|
+
"excalidraw_plan_map_create",
|
|
21
|
+
"agentsam_codebase_retrieve",
|
|
22
|
+
"agentsam_terminal_local",
|
|
23
|
+
"browser_navigate",
|
|
24
|
+
"browser_screenshot",
|
|
25
|
+
"browser_run_snapshot",
|
|
26
|
+
"browser_evaluate_script"
|
|
27
|
+
],
|
|
28
|
+
"operations": [
|
|
29
|
+
"primetech.production-board.manage",
|
|
30
|
+
"primetech.visuals.compare",
|
|
31
|
+
"primetech.assets.package"
|
|
32
|
+
],
|
|
33
|
+
"capabilities": [
|
|
34
|
+
"primetech.procedure.run",
|
|
35
|
+
"design.read",
|
|
36
|
+
"design.write",
|
|
37
|
+
"repository.read",
|
|
38
|
+
"terminal.execute",
|
|
39
|
+
"browser.navigate",
|
|
40
|
+
"browser.capture",
|
|
41
|
+
"browser.execute",
|
|
42
|
+
"workflow.execute"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"provenance": {
|
|
46
|
+
"source": "PrimeTech Creative Production",
|
|
47
|
+
"status": "authored",
|
|
48
|
+
"notice": "Original PrimeTech workflow. Tool references are validated against the live AgentSam registry."
|
|
49
|
+
},
|
|
50
|
+
"metadata": {
|
|
51
|
+
"skill_domain": "design",
|
|
52
|
+
"task_types": [
|
|
53
|
+
"ux_flow",
|
|
54
|
+
"ui_prototype",
|
|
55
|
+
"interactive_demo",
|
|
56
|
+
"product_experience"
|
|
57
|
+
],
|
|
58
|
+
"route_keys": [
|
|
59
|
+
"primetech_ui_ux_prototypes",
|
|
60
|
+
"ux_flow",
|
|
61
|
+
"interactive_demo"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PrimeTech · Visual quality assurance
|
|
3
|
+
description: Compare approved references and rendered outputs with measurable image evidence and a separate semantic design review.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Trigger conditions
|
|
7
|
+
Use for visual QA, reference comparison, screenshot review, render verification or evidence that a design revision actually landed.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
Identify approved reference, candidate render, exact viewport, device scale, state, theme, browser and acceptance criteria.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
Capture actual current application output. Ensure reference and candidate represent the same dimensions and state before pixel comparison. A screenshot from an old build is not proof of the current build.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
1. Capture reference and candidate at matching viewport and state.
|
|
17
|
+
2. Inspect layout, typography, hierarchy, contrast, alignment, clipping, content fidelity and interaction affordances.
|
|
18
|
+
3. Run primetech.visuals.compare when dimensions match to generate diff, overlay, MAE, RMSE, changed-pixel ratio and report.
|
|
19
|
+
4. Review semantic differences separately; pixel similarity cannot determine whether a workflow is correct or accessible.
|
|
20
|
+
5. Record defects with screenshot evidence, location, severity, reproduction steps and expected result.
|
|
21
|
+
6. Re-run the full affected flow after fixes and preserve before/after evidence.
|
|
22
|
+
|
|
23
|
+
## Artifact contract
|
|
24
|
+
Deliver reference and candidate paths, viewport details, diff and overlay images, machine-readable metrics, semantic findings, severity and pass/review result.
|
|
25
|
+
|
|
26
|
+
## Quality gates
|
|
27
|
+
Do not treat pixel metrics as a substitute for UX judgment. Flag mismatched dimensions, stale references, fixture data, hidden controls, inaccessible contrast and interaction failures. State exactly which thresholds passed or failed.
|
|
28
|
+
|
|
29
|
+
## Persistence
|
|
30
|
+
Keep evidence with the project or approved QA artifact store. Preserve original screenshots and hashes. Never overwrite the approved reference.
|
|
31
|
+
|
|
32
|
+
## Iteration
|
|
33
|
+
Re-test the same viewport and state after each change. Track resolved, regressed and open findings.
|
|
34
|
+
|
|
35
|
+
## Handoff
|
|
36
|
+
Summarize measurable result, semantic review, affected screens and remaining defects. Link actual evidence artifacts.
|
|
37
|
+
|
|
38
|
+
## Failure handling
|
|
39
|
+
If screenshots cannot be captured or dimensions do not match, report the comparison as blocked. Do not invent metrics or claim a pass without the generated report.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "agentsam.skill.v1",
|
|
3
|
+
"package": "@inneranimalmedia/primetech-procedures",
|
|
4
|
+
"id": "primetech-visual-qa",
|
|
5
|
+
"name": "PrimeTech \u00b7 Visual quality assurance",
|
|
6
|
+
"description": "Compare approved references and rendered outputs with measurable image evidence and a separate semantic design review.",
|
|
7
|
+
"icon": "scan-eye",
|
|
8
|
+
"slash": {
|
|
9
|
+
"suggested": "/primetech-visual-qa"
|
|
10
|
+
},
|
|
11
|
+
"instructions": {
|
|
12
|
+
"source": "local_file",
|
|
13
|
+
"ref": "SKILL.md"
|
|
14
|
+
},
|
|
15
|
+
"execution": {
|
|
16
|
+
"mode": "turn",
|
|
17
|
+
"tools": [
|
|
18
|
+
"browser_screenshot",
|
|
19
|
+
"browser_run_snapshot",
|
|
20
|
+
"browser_content",
|
|
21
|
+
"agentsam_terminal_local"
|
|
22
|
+
],
|
|
23
|
+
"operations": [
|
|
24
|
+
"primetech.visuals.compare",
|
|
25
|
+
"primetech.production-board.manage"
|
|
26
|
+
],
|
|
27
|
+
"capabilities": [
|
|
28
|
+
"primetech.procedure.run",
|
|
29
|
+
"design.read",
|
|
30
|
+
"design.write",
|
|
31
|
+
"browser.capture",
|
|
32
|
+
"browser.read",
|
|
33
|
+
"media.export",
|
|
34
|
+
"terminal.execute"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"provenance": {
|
|
38
|
+
"source": "PrimeTech Creative Production",
|
|
39
|
+
"status": "authored",
|
|
40
|
+
"notice": "Original PrimeTech workflow. Tool references are validated against the live AgentSam registry."
|
|
41
|
+
},
|
|
42
|
+
"metadata": {
|
|
43
|
+
"skill_domain": "design",
|
|
44
|
+
"task_types": [
|
|
45
|
+
"visual_qa",
|
|
46
|
+
"design_review",
|
|
47
|
+
"render_comparison",
|
|
48
|
+
"visual_regression"
|
|
49
|
+
],
|
|
50
|
+
"route_keys": [
|
|
51
|
+
"primetech_visual_qa",
|
|
52
|
+
"visual_qa",
|
|
53
|
+
"design_review"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { zipSync } from 'fflate';
|
|
4
|
+
import { ensureProjectDirectory, readProjectFile, safeSlug, sha256, writeJsonAtomic } from './paths.js';
|
|
5
|
+
|
|
6
|
+
const CONTENT_TYPES = new Map([
|
|
7
|
+
['.svg', 'image/svg+xml'], ['.png', 'image/png'], ['.jpg', 'image/jpeg'], ['.jpeg', 'image/jpeg'],
|
|
8
|
+
['.webp', 'image/webp'], ['.gif', 'image/gif'], ['.pdf', 'application/pdf'], ['.ttf', 'font/ttf'],
|
|
9
|
+
['.otf', 'font/otf'], ['.woff', 'font/woff'], ['.woff2', 'font/woff2'], ['.glb', 'model/gltf-binary'],
|
|
10
|
+
['.gltf', 'model/gltf+json'], ['.mp4', 'video/mp4'], ['.mov', 'video/quicktime'], ['.json', 'application/json'],
|
|
11
|
+
['.html', 'text/html'], ['.css', 'text/css'], ['.md', 'text/markdown'], ['.txt', 'text/plain'],
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
export async function packageCreativeAssets({ projectRoot, name, files, outputDir = '.agentsam/primetech/deliverables', metadata = {}, includeReadme = true } = {}) {
|
|
15
|
+
const packageName = safeSlug(name, 'package_name');
|
|
16
|
+
if (!Array.isArray(files) || !files.length || files.length > 500) throw new Error('creative_package_files_invalid');
|
|
17
|
+
const entries = {};
|
|
18
|
+
const records = [];
|
|
19
|
+
const seen = new Set();
|
|
20
|
+
for (const item of files) {
|
|
21
|
+
if (!item || typeof item.path !== 'string') throw new Error('creative_package_file_path_required');
|
|
22
|
+
const row = await readProjectFile(projectRoot, item.path, 100 * 1024 * 1024);
|
|
23
|
+
const relative = item.archivePath || item.path.replaceAll('\\', '/');
|
|
24
|
+
if (relative.startsWith('/') || relative.split('/').some(part => part === '..' || part === '.' || !part)) throw new Error('creative_package_archive_path_invalid');
|
|
25
|
+
if (seen.has(relative)) throw new Error(`creative_package_duplicate_archive_path:${relative}`);
|
|
26
|
+
seen.add(relative);
|
|
27
|
+
const ext = path.extname(relative).toLowerCase();
|
|
28
|
+
const record = { path: relative, sourcePath: item.path, role: item.role || 'deliverable', contentType: CONTENT_TYPES.get(ext) || 'application/octet-stream', bytes: row.bytes.length, sha256: sha256(row.bytes) };
|
|
29
|
+
entries[relative] = new Uint8Array(row.bytes);
|
|
30
|
+
records.push(record);
|
|
31
|
+
}
|
|
32
|
+
const manifest = { schema: 'agentsam.creative-delivery.v1', name: packageName, createdAt: new Date().toISOString(), metadata, files: records, totalBytes: records.reduce((sum, item) => sum + item.bytes, 0) };
|
|
33
|
+
entries['manifest.json'] = new TextEncoder().encode(JSON.stringify(manifest, null, 2) + '\n');
|
|
34
|
+
if (includeReadme) entries['README.md'] = new TextEncoder().encode(`# ${packageName}\n\nThis delivery contains ${records.length} verified source and export files.\n\nSee \`manifest.json\` for file roles, MIME types, sizes, and SHA-256 checksums. Original source files are listed separately from generated derivatives.\n`);
|
|
35
|
+
const zip = zipSync(entries, { level: 8 });
|
|
36
|
+
const root = await ensureProjectDirectory(projectRoot, outputDir);
|
|
37
|
+
const packagePath = path.join(root, `${packageName}.zip`);
|
|
38
|
+
const manifestPath = path.join(root, `${packageName}.manifest.json`);
|
|
39
|
+
await fs.writeFile(packagePath, zip, { mode: 0o600 });
|
|
40
|
+
await writeJsonAtomic(manifestPath, manifest);
|
|
41
|
+
return { ok: true, packageName, fileCount: records.length, totalBytes: manifest.totalBytes, packagePath: path.relative(projectRoot, packagePath), packageBytes: zip.length, packageSha256: sha256(zip), manifestPath: path.relative(projectRoot, manifestPath), files: records };
|
|
42
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { ensureProjectDirectory, readProjectFile, sha256, writeJsonAtomic } from './paths.js';
|
|
4
|
+
|
|
5
|
+
function flatten(value, prefix = '', result = {}) {
|
|
6
|
+
for (const [key, item] of Object.entries(value || {})) {
|
|
7
|
+
const name = prefix ? `${prefix}.${key}` : key;
|
|
8
|
+
if (item && typeof item === 'object' && !Array.isArray(item)) flatten(item, name, result);
|
|
9
|
+
else result[name] = item;
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function hexRgb(value) {
|
|
15
|
+
if (typeof value !== 'string' || !/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(value)) return null;
|
|
16
|
+
let hex = value.slice(1);
|
|
17
|
+
if (hex.length === 3) hex = [...hex].map(char => char + char).join('');
|
|
18
|
+
return [0, 2, 4].map(index => parseInt(hex.slice(index, index + 2), 16) / 255);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function luminance(rgb) {
|
|
22
|
+
const channels = rgb.map(value => value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4);
|
|
23
|
+
return channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function contrastRatio(foreground, background) {
|
|
27
|
+
const fg = hexRgb(foreground);
|
|
28
|
+
const bg = hexRgb(background);
|
|
29
|
+
if (!fg || !bg) return null;
|
|
30
|
+
const a = luminance(fg);
|
|
31
|
+
const b = luminance(bg);
|
|
32
|
+
return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function cssName(value) {
|
|
36
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-|-$/g, '').toLowerCase();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function buildDesignSystemPackage({ projectRoot, tokensPath, outputDir = '.agentsam/primetech/design-system', projectName = 'PrimeTech Design System' } = {}) {
|
|
40
|
+
const source = await readProjectFile(projectRoot, tokensPath, 8 * 1024 * 1024);
|
|
41
|
+
let tokens;
|
|
42
|
+
try { tokens = JSON.parse(source.bytes.toString('utf8')); } catch { throw new Error('design_tokens_json_invalid'); }
|
|
43
|
+
if (!tokens || typeof tokens !== 'object' || Array.isArray(tokens)) throw new Error('design_tokens_object_required');
|
|
44
|
+
const sections = ['colors', 'typography', 'spacing', 'radius', 'shadows', 'breakpoints'];
|
|
45
|
+
const flat = {};
|
|
46
|
+
for (const section of sections) {
|
|
47
|
+
const values = tokens[section];
|
|
48
|
+
if (values && (typeof values !== 'object' || Array.isArray(values))) throw new Error(`design_tokens_section_invalid:${section}`);
|
|
49
|
+
Object.assign(flat, flatten(values || {}, section));
|
|
50
|
+
}
|
|
51
|
+
const cssLines = [':root {'];
|
|
52
|
+
const warnings = [];
|
|
53
|
+
const colors = flatten(tokens.colors || {});
|
|
54
|
+
for (const [key, value] of Object.entries(colors)) {
|
|
55
|
+
if (typeof value !== 'string' || !value.trim()) throw new Error(`design_token_color_invalid:${key}`);
|
|
56
|
+
cssLines.push(` --color-${cssName(key)}: ${value};`);
|
|
57
|
+
}
|
|
58
|
+
for (const section of ['spacing', 'radius', 'shadows', 'breakpoints']) {
|
|
59
|
+
for (const [key, value] of Object.entries(flatten(tokens[section] || {}))) {
|
|
60
|
+
const tokenName = key.slice(section.length + 1);
|
|
61
|
+
if (typeof value !== 'string' && typeof value !== 'number') throw new Error(`design_token_value_invalid:${key}`);
|
|
62
|
+
cssLines.push(` --${section}-${cssName(tokenName)}: ${value}${section === 'spacing' && typeof value === 'number' ? 'px' : ''};`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const typography = flatten(tokens.typography || {});
|
|
66
|
+
for (const [key, value] of Object.entries(typography)) {
|
|
67
|
+
if (typeof value !== 'string' && typeof value !== 'number' && !Array.isArray(value)) throw new Error(`design_token_typography_invalid:${key}`);
|
|
68
|
+
const cssValue = Array.isArray(value) ? value.map(item => JSON.stringify(String(item))).join(', ') : value;
|
|
69
|
+
cssLines.push(` --type-${cssName(key)}: ${cssValue}${typeof value === 'number' && /size|line-height|tracking/i.test(key) ? 'px' : ''};`);
|
|
70
|
+
}
|
|
71
|
+
cssLines.push('}', '');
|
|
72
|
+
if (tokens.contrastPairs !== undefined && !Array.isArray(tokens.contrastPairs)) throw new Error('design_tokens_contrast_pairs_invalid');
|
|
73
|
+
for (const pair of tokens.contrastPairs || []) {
|
|
74
|
+
const ratio = contrastRatio(pair.foreground, pair.background);
|
|
75
|
+
if (ratio === null) warnings.push({ code: 'contrast_pair_unverifiable', pair });
|
|
76
|
+
else if (ratio < (pair.minimum ?? 4.5)) warnings.push({ code: 'contrast_below_target', foreground: pair.foreground, background: pair.background, ratio: Number(ratio.toFixed(2)), minimum: pair.minimum ?? 4.5 });
|
|
77
|
+
}
|
|
78
|
+
const tailwind = {
|
|
79
|
+
theme: { extend: {
|
|
80
|
+
colors: tokens.colors || {},
|
|
81
|
+
spacing: tokens.spacing || {},
|
|
82
|
+
borderRadius: tokens.radius || {},
|
|
83
|
+
boxShadow: tokens.shadows || {},
|
|
84
|
+
fontFamily: tokens.typography?.fontFamily || {},
|
|
85
|
+
fontSize: tokens.typography?.fontSize || {},
|
|
86
|
+
} },
|
|
87
|
+
};
|
|
88
|
+
const root = await ensureProjectDirectory(projectRoot, outputDir);
|
|
89
|
+
const cssPath = path.join(root, 'tokens.css');
|
|
90
|
+
const jsonPath = path.join(root, 'tokens.normalized.json');
|
|
91
|
+
const tailwindPath = path.join(root, 'tailwind.tokens.json');
|
|
92
|
+
await fs.writeFile(cssPath, cssLines.join('\n'), { mode: 0o600 });
|
|
93
|
+
await writeJsonAtomic(jsonPath, { schema: tokens.schema || 'agentsam.design-tokens.v1', ...tokens });
|
|
94
|
+
await writeJsonAtomic(tailwindPath, tailwind);
|
|
95
|
+
const manifest = {
|
|
96
|
+
schema: 'agentsam.design-system-package.v1',
|
|
97
|
+
projectName,
|
|
98
|
+
source: { path: tokensPath, sha256: sha256(source.bytes), preserved: true },
|
|
99
|
+
tokenCount: Object.keys(flat).length,
|
|
100
|
+
sections: sections.filter(section => tokens[section] && Object.keys(tokens[section]).length),
|
|
101
|
+
outputs: ['tokens.css', 'tokens.normalized.json', 'tailwind.tokens.json'],
|
|
102
|
+
warnings,
|
|
103
|
+
status: warnings.length ? 'review' : 'pass',
|
|
104
|
+
};
|
|
105
|
+
await writeJsonAtomic(path.join(root, 'manifest.json'), manifest);
|
|
106
|
+
return { ok: true, status: manifest.status, outputDir: path.relative(projectRoot, root), tokenCount: manifest.tokenCount, warnings, cssPath: path.relative(projectRoot, cssPath), normalizedPath: path.relative(projectRoot, jsonPath), tailwindPath: path.relative(projectRoot, tailwindPath), manifestPath: path.relative(projectRoot, path.join(root, 'manifest.json')) };
|
|
107
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import crypto from 'node:crypto';
|
|
4
|
+
import { zipSync, unzipSync } from 'fflate';
|
|
5
|
+
import { ensureProjectDirectory, readProjectFile, sha256, writeJsonAtomic } from './paths.js';
|
|
6
|
+
|
|
7
|
+
function escapeXml(value) {
|
|
8
|
+
return String(value).replace(/[&<>"']/g, char => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[char]);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function markdownToXhtml(markdown) {
|
|
12
|
+
const lines = String(markdown || '').replace(/\r\n/g, '\n').split('\n');
|
|
13
|
+
const output = [];
|
|
14
|
+
let paragraph = [];
|
|
15
|
+
let list = false;
|
|
16
|
+
const flushParagraph = () => { if (paragraph.length) { output.push(`<p>${paragraph.join(' ')}</p>`); paragraph = []; } };
|
|
17
|
+
const closeList = () => { if (list) { output.push('</ul>'); list = false; } };
|
|
18
|
+
const inline = value => escapeXml(value).replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>').replace(/\*(.+?)\*/g, '<em>$1</em>').replace(/`(.+?)`/g, '<code>$1</code>');
|
|
19
|
+
for (const line of lines) {
|
|
20
|
+
const heading = line.match(/^(#{1,6})\s+(.+)$/);
|
|
21
|
+
const item = line.match(/^\s*[-*+]\s+(.+)$/);
|
|
22
|
+
if (heading) { flushParagraph(); closeList(); const level = heading[1].length; output.push(`<h${level}>${inline(heading[2])}</h${level}>`); }
|
|
23
|
+
else if (item) { flushParagraph(); if (!list) { output.push('<ul>'); list = true; } output.push(`<li>${inline(item[1])}</li>`); }
|
|
24
|
+
else if (!line.trim()) { flushParagraph(); closeList(); }
|
|
25
|
+
else { closeList(); paragraph.push(inline(line.trim())); }
|
|
26
|
+
}
|
|
27
|
+
flushParagraph(); closeList();
|
|
28
|
+
return output.join('\n');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function validateBook(book) {
|
|
32
|
+
if (!book || typeof book !== 'object') throw new Error('ebook_book_object_required');
|
|
33
|
+
if (typeof book.title !== 'string' || !book.title.trim() || book.title.length > 200) throw new Error('ebook_title_invalid');
|
|
34
|
+
if (typeof book.author !== 'string' || !book.author.trim() || book.author.length > 120) throw new Error('ebook_author_invalid');
|
|
35
|
+
if (typeof (book.language || 'en') !== 'string' || !/^[a-z]{2,3}(-[A-Z]{2})?$/.test(book.language || 'en')) throw new Error('ebook_language_invalid');
|
|
36
|
+
if (!Array.isArray(book.chapters) || !book.chapters.length || book.chapters.length > 200) throw new Error('ebook_chapters_invalid');
|
|
37
|
+
for (const chapter of book.chapters) {
|
|
38
|
+
if (typeof chapter.title !== 'string' || !chapter.title.trim() || typeof chapter.contentMarkdown !== 'string' || !chapter.contentMarkdown.trim()) throw new Error('ebook_chapter_content_required');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function buildEpubPackage({ projectRoot, sourcePath, outputDir = '.agentsam/primetech/editorial/epub' } = {}) {
|
|
43
|
+
const source = await readProjectFile(projectRoot, sourcePath, 32 * 1024 * 1024);
|
|
44
|
+
let book;
|
|
45
|
+
try { book = JSON.parse(source.bytes.toString('utf8')); } catch { throw new Error('ebook_source_json_invalid'); }
|
|
46
|
+
validateBook(book);
|
|
47
|
+
const language = book.language || 'en';
|
|
48
|
+
const identifier = book.identifier || `urn:uuid:${crypto.randomUUID()}`;
|
|
49
|
+
const chapters = book.chapters.map((chapter, index) => ({
|
|
50
|
+
id: `chapter-${index + 1}`,
|
|
51
|
+
file: `chapter-${String(index + 1).padStart(3, '0')}.xhtml`,
|
|
52
|
+
title: chapter.title,
|
|
53
|
+
content: markdownToXhtml(chapter.contentMarkdown),
|
|
54
|
+
}));
|
|
55
|
+
const files = {
|
|
56
|
+
mimetype: new TextEncoder().encode('application/epub+zip'),
|
|
57
|
+
'META-INF/container.xml': `<?xml version="1.0" encoding="UTF-8"?><container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/></rootfiles></container>`,
|
|
58
|
+
'EPUB/styles.css': 'body{font-family:serif;line-height:1.55;margin:5%;}h1,h2,h3{line-height:1.2;}p{orphans:2;widows:2;}code{font-family:monospace;}nav ol{list-style:none;}',
|
|
59
|
+
};
|
|
60
|
+
const navItems = chapters.map(chapter => `<li><a href="${chapter.file}">${escapeXml(chapter.title)}</a></li>`).join('');
|
|
61
|
+
files['EPUB/nav.xhtml'] = `<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="${language}" lang="${language}"><head><title>Contents</title><link rel="stylesheet" type="text/css" href="styles.css"/></head><body><nav epub:type="toc" id="toc"><h1>Contents</h1><ol>${navItems}</ol></nav></body></html>`;
|
|
62
|
+
for (const chapter of chapters) {
|
|
63
|
+
files[`EPUB/${chapter.file}`] = `<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="${language}" lang="${language}"><head><title>${escapeXml(chapter.title)}</title><link rel="stylesheet" type="text/css" href="styles.css"/></head><body><section epub:type="chapter"><h1>${escapeXml(chapter.title)}</h1>${chapter.content}</section></body></html>`;
|
|
64
|
+
}
|
|
65
|
+
const manifestItems = [
|
|
66
|
+
'<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>',
|
|
67
|
+
'<item id="css" href="styles.css" media-type="text/css"/>',
|
|
68
|
+
...chapters.map(chapter => `<item id="${chapter.id}" href="${chapter.file}" media-type="application/xhtml+xml"/>`),
|
|
69
|
+
].join('');
|
|
70
|
+
const spine = chapters.map(chapter => `<itemref idref="${chapter.id}"/>`).join('');
|
|
71
|
+
files['EPUB/package.opf'] = `<?xml version="1.0" encoding="UTF-8"?><package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="book-id" xml:lang="${language}"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier id="book-id">${escapeXml(identifier)}</dc:identifier><dc:title>${escapeXml(book.title)}</dc:title><dc:creator>${escapeXml(book.author)}</dc:creator><dc:language>${escapeXml(language)}</dc:language>${book.rights ? `<dc:rights>${escapeXml(book.rights)}</dc:rights>` : ''}</metadata><manifest>${manifestItems}</manifest><spine>${spine}</spine></package>`;
|
|
72
|
+
const zipEntries = Object.fromEntries(Object.entries(files).map(([name, value]) => [name, typeof value === 'string' ? new TextEncoder().encode(value) : value]));
|
|
73
|
+
const zipBytes = zipSync(zipEntries, { level: 0 });
|
|
74
|
+
const unpacked = unzipSync(zipBytes);
|
|
75
|
+
if (Object.keys(unpacked)[0] !== 'mimetype' || new TextDecoder().decode(unpacked.mimetype) !== 'application/epub+zip' || !unpacked['EPUB/package.opf'] || !unpacked['EPUB/nav.xhtml']) throw new Error('ebook_epub_package_validation_failed');
|
|
76
|
+
const root = await ensureProjectDirectory(projectRoot, outputDir);
|
|
77
|
+
const slug = book.slug || book.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'book';
|
|
78
|
+
if (!/^[a-z0-9][a-z0-9-]{0,79}$/.test(slug)) throw new Error('ebook_slug_invalid');
|
|
79
|
+
const epubPath = path.join(root, `${slug}.epub`);
|
|
80
|
+
const previewPath = path.join(root, 'preview.html');
|
|
81
|
+
await fs.writeFile(epubPath, zipBytes, { mode: 0o600 });
|
|
82
|
+
const preview = `<!doctype html><html lang="${language}"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeXml(book.title)}</title><style>body{max-width:760px;margin:48px auto;padding:0 24px;font:18px/1.65 Georgia,serif;color:#222}h1{line-height:1.2}</style><h1>${escapeXml(book.title)}</h1><p>By ${escapeXml(book.author)}</p>${chapters.map(chapter => `<section><h2>${escapeXml(chapter.title)}</h2>${chapter.content}</section>`).join('')}</html>`;
|
|
83
|
+
await fs.writeFile(previewPath, preview, { mode: 0o600 });
|
|
84
|
+
const manifest = { schema: 'agentsam.ebook-package.v1', format: 'epub-3', title: book.title, author: book.author, language, identifier, source: { path: sourcePath, sha256: sha256(source.bytes), preserved: true }, chapters: chapters.length, epub: { path: path.basename(epubPath), bytes: zipBytes.length, sha256: sha256(zipBytes), validated: true }, preview: path.basename(previewPath), pdf: 'not-generated' };
|
|
85
|
+
const manifestPath = path.join(root, 'manifest.json');
|
|
86
|
+
await writeJsonAtomic(manifestPath, manifest);
|
|
87
|
+
return { ok: true, format: 'epub-3', title: book.title, author: book.author, chapterCount: chapters.length, epubPath: path.relative(projectRoot, epubPath), epubBytes: zipBytes.length, epubSha256: sha256(zipBytes), previewPath: path.relative(projectRoot, previewPath), manifestPath: path.relative(projectRoot, manifestPath), validation: { mimetype: true, container: Boolean(unpacked['META-INF/container.xml']), packageDocument: true, navigation: true } };
|
|
88
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import sharp from 'sharp';
|
|
4
|
+
import { ensureProjectDirectory, readProjectFile, sha256, writeJsonAtomic } from './paths.js';
|
|
5
|
+
|
|
6
|
+
export const PRIMETECH_ICON_COLORWAY_IDS = Object.freeze([
|
|
7
|
+
'technical-slate', 'lagoon', 'industrial-ember', 'alloy-blue',
|
|
8
|
+
'prime-electric', 'prime-spectrum', 'reverse', 'core-mono',
|
|
9
|
+
]);
|
|
10
|
+
export const PRIMETECH_ICON_SHAPES = Object.freeze(['bare', 'circle', 'squircle']);
|
|
11
|
+
export const PRIMETECH_ICON_SIZES = Object.freeze([1024, 512, 256, 128, 64, 32, 16]);
|
|
12
|
+
|
|
13
|
+
function parseSvg(source) {
|
|
14
|
+
if (typeof source !== 'string' || source.length < 30 || source.length > 8 * 1024 * 1024) throw new Error('icon_source_svg_invalid');
|
|
15
|
+
if (/<\s*(script|foreignObject|iframe|object|embed|image)\b/i.test(source) || /\bon[a-z]+\s*=/i.test(source) || /javascript\s*:/i.test(source) || /url\(\s*['"]?https?:/i.test(source)) {
|
|
16
|
+
throw new Error('icon_source_svg_unsafe_content');
|
|
17
|
+
}
|
|
18
|
+
const match = source.match(/<svg\b([^>]*)>([\s\S]*?)<\/svg\s*>/i);
|
|
19
|
+
if (!match) throw new Error('icon_source_svg_root_missing');
|
|
20
|
+
const attributes = match[1];
|
|
21
|
+
const inner = match[2];
|
|
22
|
+
const viewBoxMatch = attributes.match(/\bviewBox\s*=\s*['"]([^'"]+)['"]/i);
|
|
23
|
+
if (!viewBoxMatch) throw new Error('icon_source_svg_viewbox_required');
|
|
24
|
+
const viewBox = viewBoxMatch[1].trim().split(/[\s,]+/).map(Number);
|
|
25
|
+
if (viewBox.length !== 4 || viewBox.some(value => !Number.isFinite(value)) || viewBox[2] <= 0 || viewBox[3] <= 0) {
|
|
26
|
+
throw new Error('icon_source_svg_viewbox_invalid');
|
|
27
|
+
}
|
|
28
|
+
if (!inner.trim()) throw new Error('icon_source_svg_empty');
|
|
29
|
+
return { inner, viewBox: viewBox.join(' '), sourceViewBox: viewBox };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function replaceColors(svg, colorway) {
|
|
33
|
+
let output = svg;
|
|
34
|
+
const mapping = { 'currentColor': colorway.foreground, 'var(--mark)': colorway.foreground, ...(colorway.sourceColorMap || {}) };
|
|
35
|
+
for (const [source, target] of Object.entries(mapping)) {
|
|
36
|
+
if (typeof target !== 'string' || !/^#[0-9a-f]{3,8}$/i.test(target)) throw new Error('icon_color_mapping_invalid');
|
|
37
|
+
const escaped = source.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
38
|
+
output = output.replace(new RegExp(escaped, 'gi'), target);
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function buildVariant(parsed, colorway, shape, size = 1024) {
|
|
44
|
+
const inner = replaceColors(parsed.inner, colorway);
|
|
45
|
+
if (shape === 'bare') {
|
|
46
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="${parsed.viewBox}" role="img" aria-label="PrimeTech ${colorway.id} bare mark">${inner}</svg>`;
|
|
47
|
+
}
|
|
48
|
+
const background = colorway.background;
|
|
49
|
+
if (typeof background !== 'string' || !/^#[0-9a-f]{3,8}$/i.test(background)) throw new Error(`icon_colorway_background_required:${colorway.id}`);
|
|
50
|
+
const markInset = Number(colorway.markInset ?? 0.18);
|
|
51
|
+
if (!(markInset >= 0.05 && markInset <= 0.35)) throw new Error(`icon_mark_inset_invalid:${colorway.id}`);
|
|
52
|
+
const markSize = Math.round(size * (1 - markInset * 2));
|
|
53
|
+
const offset = Math.round((size - markSize) / 2);
|
|
54
|
+
const backgroundShape = shape === 'circle'
|
|
55
|
+
? `<circle cx="${size / 2}" cy="${size / 2}" r="${Math.round(size * 0.465)}" fill="${background}"/>`
|
|
56
|
+
: `<rect x="${Math.round(size * 0.035)}" y="${Math.round(size * 0.035)}" width="${Math.round(size * 0.93)}" height="${Math.round(size * 0.93)}" rx="${Math.round(size * 0.205)}" fill="${background}"/>`;
|
|
57
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}" role="img" aria-label="PrimeTech ${colorway.id} ${shape} icon">${backgroundShape}<svg x="${offset}" y="${offset}" width="${markSize}" height="${markSize}" viewBox="${parsed.viewBox}" preserveAspectRatio="xMidYMid meet">${inner}</svg></svg>`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function renderPng(svg, size, target) {
|
|
61
|
+
const bytes = await sharp(Buffer.from(svg), { density: 384, failOn: 'warning' })
|
|
62
|
+
.resize(size, size, { fit: 'contain', background: { r: 0, g: 0, b: 0, alpha: 0 } })
|
|
63
|
+
.png({ compressionLevel: 9, adaptiveFiltering: true })
|
|
64
|
+
.toBuffer();
|
|
65
|
+
await fs.writeFile(target, bytes, { mode: 0o600 });
|
|
66
|
+
return bytes;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function assertTransparentCorners(pngBytes, label) {
|
|
70
|
+
const { data, info } = await sharp(pngBytes).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
71
|
+
const alphaAt = (x, y) => data[(y * info.width + x) * info.channels + 3];
|
|
72
|
+
const corners = [alphaAt(0, 0), alphaAt(info.width - 1, 0), alphaAt(0, info.height - 1), alphaAt(info.width - 1, info.height - 1)];
|
|
73
|
+
if (corners.some(alpha => alpha !== 0)) throw new Error(`icon_transparency_gate_failed:${label}`);
|
|
74
|
+
let visible = 0;
|
|
75
|
+
for (let offset = 3; offset < data.length; offset += info.channels) if (data[offset] > 0) visible += 1;
|
|
76
|
+
if (visible < Math.max(4, Math.floor(info.width * info.height * 0.002))) throw new Error(`icon_mark_missing:${label}`);
|
|
77
|
+
return { transparentCorners: true, visiblePixelCount: visible };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export async function buildIconFamily({ projectRoot, sourceSvgPath, outputDir = '.agentsam/primetech/brand/primetech-icon-family', colorways, sizes = PRIMETECH_ICON_SIZES } = {}) {
|
|
81
|
+
if (!Array.isArray(colorways) || colorways.length !== 8) throw new Error('primetech_icon_family_requires_eight_colorways');
|
|
82
|
+
const ids = colorways.map(item => item?.id);
|
|
83
|
+
if (PRIMETECH_ICON_COLORWAY_IDS.some(id => !ids.includes(id)) || new Set(ids).size !== 8) throw new Error('primetech_icon_family_colorway_set_invalid');
|
|
84
|
+
if (!Array.isArray(sizes) || !sizes.length || sizes.some(size => !Number.isInteger(size) || size < 16 || size > 4096) || new Set(sizes).size !== sizes.length) throw new Error('primetech_icon_family_sizes_invalid');
|
|
85
|
+
const source = await readProjectFile(projectRoot, sourceSvgPath, 8 * 1024 * 1024);
|
|
86
|
+
const parsed = parseSvg(source.bytes.toString('utf8'));
|
|
87
|
+
const root = await ensureProjectDirectory(projectRoot, outputDir);
|
|
88
|
+
const outputs = [];
|
|
89
|
+
for (const colorway of colorways) {
|
|
90
|
+
if (!/^#[0-9a-f]{3,8}$/i.test(colorway.foreground || '')) throw new Error(`icon_colorway_foreground_required:${colorway.id}`);
|
|
91
|
+
const colorwayRoot = path.join(root, colorway.id);
|
|
92
|
+
await fs.mkdir(colorwayRoot, { recursive: true, mode: 0o700 });
|
|
93
|
+
for (const shape of PRIMETECH_ICON_SHAPES) {
|
|
94
|
+
const svg = buildVariant(parsed, colorway, shape, 1024);
|
|
95
|
+
const svgPath = path.join(colorwayRoot, `${shape}.svg`);
|
|
96
|
+
await fs.writeFile(svgPath, svg, { mode: 0o600 });
|
|
97
|
+
const svgBytes = Buffer.from(svg);
|
|
98
|
+
const svgRecord = { path: path.relative(root, svgPath), contentType: 'image/svg+xml', bytes: svgBytes.length, sha256: sha256(svgBytes), colorway: colorway.id, shape };
|
|
99
|
+
outputs.push(svgRecord);
|
|
100
|
+
const rasterDir = path.join(colorwayRoot, 'png');
|
|
101
|
+
await fs.mkdir(rasterDir, { recursive: true, mode: 0o700 });
|
|
102
|
+
for (const size of sizes) {
|
|
103
|
+
const pngPath = path.join(rasterDir, `${size}.png`);
|
|
104
|
+
const pngBytes = await renderPng(buildVariant(parsed, colorway, shape, size), size, pngPath);
|
|
105
|
+
const transparency = await assertTransparentCorners(pngBytes, `${colorway.id}/${shape}/${size}`);
|
|
106
|
+
outputs.push({ path: path.relative(root, pngPath), contentType: 'image/png', bytes: pngBytes.length, sha256: sha256(pngBytes), colorway: colorway.id, shape, size, quality: transparency });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const manifest = {
|
|
111
|
+
schema: 'primetech.icon-family.v1',
|
|
112
|
+
family: 'PrimeTech',
|
|
113
|
+
source: { path: sourceSvgPath, bytes: source.bytes.length, sha256: sha256(source.bytes), originalPreserved: true },
|
|
114
|
+
colorways: PRIMETECH_ICON_COLORWAY_IDS,
|
|
115
|
+
shapes: PRIMETECH_ICON_SHAPES,
|
|
116
|
+
variantCount: 24,
|
|
117
|
+
rasterSizes: sizes,
|
|
118
|
+
outputCount: outputs.length,
|
|
119
|
+
outputs,
|
|
120
|
+
quality: { transparentBareMarks: true, transparentBadgeCorners: true, sourcePreserved: true },
|
|
121
|
+
};
|
|
122
|
+
const manifestPath = path.join(root, 'manifest.json');
|
|
123
|
+
await writeJsonAtomic(manifestPath, manifest);
|
|
124
|
+
return { ok: true, schema: manifest.schema, outputDir: path.relative(projectRoot, root), variantCount: 24, outputCount: outputs.length, sourceSha256: manifest.source.sha256, manifestPath: path.relative(projectRoot, manifestPath), manifestSha256: sha256(Buffer.from(JSON.stringify(manifest, null, 2) + '\n')), outputs };
|
|
125
|
+
}
|