feat: initial commit - Jhonny Editor

- Adicionado estrutura completa do projeto
- Configurado MCP server para Premiere Pro
- Adicionado documentação e skills
- Configurado Gitignore para o projeto
This commit is contained in:
João Henrique
2026-09-08 09:59:31 -04:00
commit b541f502ba
1507 changed files with 387650 additions and 0 deletions
@@ -0,0 +1,31 @@
import { createHash } from "node:crypto";
import { readFile, writeFile } from "node:fs/promises";
import { dirname, relative, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import ts from "typescript";
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const stablePath = process.env.PREMIERE_BETA_GUID_STABLE_DECLARATIONS_PATH ? resolve(process.env.PREMIERE_BETA_GUID_STABLE_DECLARATIONS_PATH) : resolve(root, "node_modules/@adobe/premierepro/src/premierepro.d.ts");
const betaPath = process.env.PREMIERE_BETA_GUID_BETA_DECLARATIONS_PATH ? resolve(process.env.PREMIERE_BETA_GUID_BETA_DECLARATIONS_PATH) : resolve(root, "node_modules/@adobe/premierepro-beta/src/premierepro.d.ts");
const outputPath = resolve(root, "src/resources/adobe-beta-guid-drift.json");
const normalize = (text) => text.replaceAll("\r\n", "\n").replace(/\s+/g, " ").trim();
const compare = (left, right) => left < right ? -1 : left > right ? 1 : 0;
const parse = (text, path) => { const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true); if (source.parseDiagnostics.length) throw new Error(`Adobe Guid declaration parse failed: ${source.parseDiagnostics.map((item) => ts.flattenDiagnosticMessageText(item.messageText, " ")).join("; ")}`); return source; };
const literal = (source, name) => { const declaration = source.statements.find((item) => ts.isTypeAliasDeclaration(item) && item.name.text === name); if (!declaration || !ts.isTypeLiteralNode(declaration.type)) throw new Error(`Adobe declarations must expose ${name} as a type literal.`); return declaration; };
const binding = (rootDeclaration, source) => { const member = rootDeclaration.type.members.find((item) => ts.isPropertySignature(item) && item.name && ts.isIdentifier(item.name) && item.name.text === "Guid"); if (!member?.type) throw new Error("Adobe declarations must expose premierepro.Guid as a typed property."); return { symbol: "premierepro.Guid", kind: "property", signature: normalize(member.type.getText(source)) }; };
const factories = (declaration, source, owner) => declaration.type.members.filter((item) => ts.isConstructSignatureDeclaration(item) || ts.isCallSignatureDeclaration(item)).map((item) => { if (!item.type) throw new Error(`Adobe ${owner} factory signature is missing a return type.`); return { symbol: `${owner}.${ts.isConstructSignatureDeclaration(item) ? "new" : "call"}`, kind: ts.isConstructSignatureDeclaration(item) ? "construct_signature" : "call_signature", signature: `(${item.parameters.map((parameter) => normalize(parameter.getText(source))).join(", ")}) => ${normalize(item.type.getText(source))}` }; }).sort((left, right) => compare(left.symbol, right.symbol));
const nonFactories = (declaration, source) => declaration.type.members.filter((item) => !ts.isConstructSignatureDeclaration(item) && !ts.isCallSignatureDeclaration(item)).map((item) => normalize(item.getText(source))).sort(compare);
const [stablePackageText, betaPackageText, stableText, betaText] = await Promise.all([readFile(resolve(root, "node_modules/@adobe/premierepro/package.json"), "utf8"), readFile(resolve(root, "node_modules/@adobe/premierepro-beta/package.json"), "utf8"), readFile(stablePath, "utf8"), readFile(betaPath, "utf8")]);
const stable = parse(stableText, stablePath), beta = parse(betaText, betaPath), stableRoot = literal(stable, "premierepro"), betaRoot = literal(beta, "premierepro"), stableGuid = literal(stable, "Guid"), betaGuid = literal(beta, "Guid"), stableStatic = literal(stable, "GuidStatic"), betaStatic = literal(beta, "GuidStatic"), stableBinding = binding(stableRoot, stable), betaBinding = binding(betaRoot, beta), stableFactories = factories(stableGuid, stable, "Guid"), betaFactories = factories(betaStatic, beta, "GuidStatic");
if (stableBinding.signature !== "GuidStatic" || betaBinding.signature !== "GuidStatic") throw new Error("Adobe beta declarations must retain premierepro.Guid as GuidStatic.");
if (factories(stableStatic, stable, "GuidStatic").length || factories(betaGuid, beta, "Guid").length) throw new Error("Adobe beta Guid factory signatures must move only from stable Guid to beta GuidStatic.");
const stableShapes = stableFactories.map(({ kind, signature }) => ({ kind, signature })), betaShapes = betaFactories.map(({ kind, signature }) => ({ kind, signature }));
if (stableFactories.length !== 2 || betaFactories.length !== 2 || JSON.stringify(stableShapes) !== JSON.stringify(betaShapes)) throw new Error("Adobe beta GuidStatic factory signatures must match stable Guid.");
if (JSON.stringify(nonFactories(stableGuid, stable)) !== JSON.stringify(nonFactories(betaGuid, beta))) throw new Error("Adobe beta Guid non-factory members must match stable Guid.");
if (JSON.stringify(nonFactories(stableStatic, stable)) !== JSON.stringify(nonFactories(betaStatic, beta))) throw new Error("Adobe beta GuidStatic non-factory members must match stable GuidStatic.");
const hash = (declaration, source) => createHash("sha256").update(normalize(declaration.getText(source))).digest("hex");
const inventory = { schemaVersion: 1, scope: { declarations: ["premierepro.Guid", "Guid", "GuidStatic"], semantics: "This records the beta Guid factory-placement migration against the pinned stable package. It is static declaration-drift accounting, not beta API support or a complete package diff.", doesNotEstablish: "It does not prove a beta host exposes GuidStatic factory calls, that a Guid can be constructed or parsed or accepted by another API, that GUID identity is stable, or that any MCP action is supported or licensed-host validated." }, sources: { stable: { package: "@adobe/premierepro", version: JSON.parse(stablePackageText).version, declarations: relative(root, stablePath).replaceAll("\\", "/"), guidDeclarationSha256: hash(stableGuid, stable), guidStaticDeclarationSha256: hash(stableStatic, stable), rootBinding: stableBinding.signature }, beta: { package: "@adobe/premierepro-beta", version: JSON.parse(betaPackageText).version, declarations: relative(root, betaPath).replaceAll("\\", "/"), guidDeclarationSha256: hash(betaGuid, beta), guidStaticDeclarationSha256: hash(betaStatic, beta), rootBinding: betaBinding.signature } }, diff: { betaOnly: betaFactories, stableOnly: stableFactories, changed: [{ symbol: "Guid.factorySignaturePlacement", stable: { owner: "Guid", entries: stableShapes }, beta: { owner: "GuidStatic", entries: betaShapes } }] } };
const rendered = `${JSON.stringify(inventory, null, 2)}\n`;
if (process.argv.includes("--validate-only")) console.log("Validated Adobe beta Guid declaration drift.");
else if (process.argv.includes("--check")) { let current = ""; try { current = await readFile(outputPath, "utf8"); } catch {} if (current.replaceAll("\r\n", "\n") !== rendered) { console.error("Adobe beta Guid declaration drift inventory is stale. Run npm run adobe:beta-guid-drift."); process.exitCode = 1; } else console.log("Adobe beta Guid declaration drift inventory is current: 2 beta-only, 2 stable-only, and 1 changed symbol."); }
else { await writeFile(outputPath, rendered); console.log("Wrote Adobe beta Guid declaration drift inventory: 2 beta-only, 2 stable-only, and 1 changed symbol."); }