13 lines
1.1 KiB
JavaScript
13 lines
1.1 KiB
JavaScript
/** Original package access is exclusively through the public isolated REA CLI. */
|
|
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
import { spawnSync } from 'node:child_process'
|
|
const input = 'C:/Users/Administrator/.workbuddy/plugins/marketplaces/experts/plugins/ui-designer'
|
|
const result = spawnSync(process.execPath, ['.tmp/rea-css-runtime/scripts/rea.mjs', 'inspect-selected-directory-text-root', input], { encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 })
|
|
if (result.status !== 0) throw Error(result.stderr || result.stdout || `REA exit ${result.status}`)
|
|
const evidence = JSON.parse(result.stdout)
|
|
if (evidence.predicate_type !== 'rea.artifact.directory-inventory' || !/^[a-f0-9]{64}$/.test(evidence.normalized_result.root_sha256)) throw Error('Unexpected REA inventory identity')
|
|
const output = '.tmp/rea-ui-designer-inventory-20261016.json'
|
|
fs.writeFileSync(output, JSON.stringify(evidence, null, 2))
|
|
console.log(JSON.stringify({ output: path.resolve(output), evidenceId: evidence.evidence_id, rootSha256: evidence.normalized_result.root_sha256, coverage: evidence.normalized_result.coverage, members: evidence.normalized_result.members }, null, 2))
|