@powerhousedao/vetra 6.2.0-dev.27 → 6.2.0-dev.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/dist/codegen/index.d.ts +6 -91
- package/dist/codegen/index.d.ts.map +1 -1
- package/dist/codegen/index.js +2 -632
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/spec.d.ts +2 -0
- package/dist/codegen/spec.js +2 -0
- package/dist/{connect-Bbz4cL8F.js → connect-CjGVphlq.js} +1 -1
- package/dist/{connect-Bbz4cL8F.js.map → connect-CjGVphlq.js.map} +1 -1
- package/dist/document-models/app-module/index.d.ts +1 -1
- package/dist/document-models/document-editor/index.d.ts +1 -1
- package/dist/document-models/index.d.ts +5 -5
- package/dist/document-models/processor-module/index.d.ts +1 -1
- package/dist/document-models/subgraph-module/index.d.ts +1 -1
- package/dist/document-models/vetra-package/index.d.ts +1 -1
- package/dist/{editor-mor7dV6n.js → editor-BmYxPe_4.js} +1 -1
- package/dist/{editor-mor7dV6n.js.map → editor-BmYxPe_4.js.map} +1 -1
- package/dist/{editor-DnG2Zzet.js → editor-CtN1Sy88.js} +2 -2
- package/dist/{editor-DnG2Zzet.js.map → editor-CtN1Sy88.js.map} +1 -1
- package/dist/{editor-xCnDas6c.js → editor-De5XaIXa.js} +3 -3
- package/dist/{editor-xCnDas6c.js.map → editor-De5XaIXa.js.map} +1 -1
- package/dist/{editor-CVCLxUhe.js → editor-bA5TTxfU.js} +2 -2
- package/dist/{editor-CVCLxUhe.js.map → editor-bA5TTxfU.js.map} +1 -1
- package/dist/{editor-CAVHtR-v.js → editor-fNaLqnMc.js} +3 -3
- package/dist/{editor-CAVHtR-v.js.map → editor-fNaLqnMc.js.map} +1 -1
- package/dist/{editor-B560eld_.js → editor-saGUzfCl.js} +3 -3
- package/dist/{editor-B560eld_.js.map → editor-saGUzfCl.js.map} +1 -1
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/{factory-DcPyqWkY.js → factory-B6hBnFAf.js} +3 -3
- package/dist/{factory-DcPyqWkY.js.map → factory-B6hBnFAf.js.map} +1 -1
- package/dist/{factory-BkA-IvkR.js → factory-Cn0UwIFB.js} +2 -2
- package/dist/{factory-BkA-IvkR.js.map → factory-Cn0UwIFB.js.map} +1 -1
- package/dist/{hooks-Btogj1f0.js → hooks-D_8Uwk1s.js} +1 -1
- package/dist/{hooks-Btogj1f0.js.map → hooks-D_8Uwk1s.js.map} +1 -1
- package/dist/{index-DsC-4q78.d.ts → index-BES2zg3c.d.ts} +1 -1
- package/dist/{index-DsC-4q78.d.ts.map → index-BES2zg3c.d.ts.map} +1 -1
- package/dist/{index-DCNTOgFn.d.ts → index-D2tNV62S.d.ts} +1 -1
- package/dist/{index-DCNTOgFn.d.ts.map → index-D2tNV62S.d.ts.map} +1 -1
- package/dist/{index-DKH5DHrE.d.ts → index-DMMMQaUe.d.ts} +1 -1
- package/dist/{index-DKH5DHrE.d.ts.map → index-DMMMQaUe.d.ts.map} +1 -1
- package/dist/{index-uG0ivQaR.d.ts → index-HHjpYUNP.d.ts} +1 -1
- package/dist/{index-uG0ivQaR.d.ts.map → index-HHjpYUNP.d.ts.map} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/{logger-CYkStoEb.js → logger-DLnGUZk9.js} +1 -1
- package/dist/{logger-CYkStoEb.js.map → logger-DLnGUZk9.js.map} +1 -1
- package/dist/{module-DySsSIQV.js → module-BhsG8kkn.js} +7 -7
- package/dist/{module-DySsSIQV.js.map → module-BhsG8kkn.js.map} +1 -1
- package/dist/{module-DTjIlvYU.d.ts → module-D3n9Z2mN.d.ts} +1 -1
- package/dist/{module-DTjIlvYU.d.ts.map → module-D3n9Z2mN.d.ts.map} +1 -1
- package/dist/{processor-BfQ_DU7u.js → processor-D2z8Eq93.js} +2 -2
- package/dist/{processor-BfQ_DU7u.js.map → processor-D2z8Eq93.js.map} +1 -1
- package/dist/processors/codegen/index.js +2 -2
- package/dist/processors/index.js +1 -1
- package/dist/processors/vetra-read-model/index.js +1 -1
- package/dist/spec-api-CT1DqmgF.js +640 -0
- package/dist/spec-api-CT1DqmgF.js.map +1 -0
- package/dist/specs-_7A7Tl_N.d.ts +90 -0
- package/dist/specs-_7A7Tl_N.d.ts.map +1 -0
- package/dist/switchboard-CvWiUgBP.js +8 -0
- package/dist/{switchboard-C_BapCdk.js.map → switchboard-CvWiUgBP.js.map} +1 -1
- package/dist/{useVetraDocument-tpjMF571.js → useVetraDocument-BpPD6DKR.js} +1 -1
- package/dist/{useVetraDocument-tpjMF571.js.map → useVetraDocument-BpPD6DKR.js.map} +1 -1
- package/package.json +13 -8
- package/dist/switchboard-C_BapCdk.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-api-CT1DqmgF.js","names":["documentEditorReducer","documentEditorUtils","documentEditorActions","documentEditorSpec","processorModuleReducer","processorModuleUtils","processorModuleActions","processorModuleSpec","subgraphModuleReducer","subgraphModuleUtils","subgraphModuleActions","subgraphModuleSpec","appModuleReducer","appModuleUtils","appModuleActions","appModuleSpec"],"sources":["../document-models/app-module/app-module.json","../document-models/document-editor/document-editor.json","../document-models/processor-module/processor-module.json","../document-models/subgraph-module/subgraph-module.json","../codegen/specs.ts","../codegen/spec-api.ts"],"sourcesContent":["","","","","import type {\n Action,\n DocumentModelGlobalState,\n PHDocument,\n Reducer,\n} from \"@powerhousedao/shared/document-model\";\nimport { kebabCase } from \"change-case\";\nimport { documentModelDocumentModelModule } from \"document-model\";\nimport { baseSaveToFile } from \"document-model/node\";\nimport { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\n/* Import from gen/ + actions.ts directly (not the top-level barrel) so we\n * don't pull in `hooks.ts`, which depends on `@powerhousedao/reactor-browser`\n * (a browser-only module that breaks Node-side spec tooling). */\nimport appModuleSpec from \"../document-models/app-module/app-module.json\" with { type: \"json\" };\nimport { actions as appModuleActions } from \"../document-models/app-module/v1/actions.js\";\nimport {\n appModuleDocumentType,\n createAppModuleDocument,\n reducer as appModuleReducer,\n utils as appModuleUtils,\n} from \"../document-models/app-module/v1/gen/index.js\";\nimport documentEditorSpec from \"../document-models/document-editor/document-editor.json\" with { type: \"json\" };\nimport { actions as documentEditorActions } from \"../document-models/document-editor/v1/actions.js\";\nimport {\n createDocumentEditorDocument,\n documentEditorDocumentType,\n reducer as documentEditorReducer,\n utils as documentEditorUtils,\n} from \"../document-models/document-editor/v1/gen/index.js\";\nimport processorModuleSpec from \"../document-models/processor-module/processor-module.json\" with { type: \"json\" };\nimport { actions as processorModuleActions } from \"../document-models/processor-module/v1/actions.js\";\nimport {\n createProcessorModuleDocument,\n processorModuleDocumentType,\n reducer as processorModuleReducer,\n utils as processorModuleUtils,\n} from \"../document-models/processor-module/v1/gen/index.js\";\nimport subgraphModuleSpec from \"../document-models/subgraph-module/subgraph-module.json\" with { type: \"json\" };\nimport { actions as subgraphModuleActions } from \"../document-models/subgraph-module/v1/actions.js\";\nimport {\n createSubgraphModuleDocument,\n subgraphModuleDocumentType,\n reducer as subgraphModuleReducer,\n utils as subgraphModuleUtils,\n} from \"../document-models/subgraph-module/v1/gen/index.js\";\n\nexport const SPECS_DIRNAME = \"specs\";\n\nconst documentModelDocumentType = \"powerhouse/document-model\";\n\ntype ActionsModule = Record<string, (input?: any) => Action>;\n\ntype SpecEntry = {\n documentType: string;\n subdir: string;\n reducer: Reducer<any>;\n utils: { fileExtension: string };\n actions: ActionsModule;\n createDocument: (state?: any) => PHDocument;\n jsonSpec: DocumentModelGlobalState;\n};\n\nconst SPECS: Record<string, SpecEntry> = {\n [documentModelDocumentType]: {\n documentType: documentModelDocumentType,\n subdir: \"document-models\",\n reducer: documentModelDocumentModelModule.reducer,\n utils: documentModelDocumentModelModule.utils,\n actions: documentModelDocumentModelModule.actions as ActionsModule,\n createDocument: documentModelDocumentModelModule.utils.createDocument,\n jsonSpec: documentModelDocumentModelModule.documentModel\n .global as DocumentModelGlobalState,\n },\n [documentEditorDocumentType]: {\n documentType: documentEditorDocumentType,\n subdir: \"editors\",\n reducer: documentEditorReducer as Reducer<any>,\n utils: documentEditorUtils,\n actions: documentEditorActions as unknown as ActionsModule,\n createDocument: createDocumentEditorDocument as (state?: any) => PHDocument,\n jsonSpec: documentEditorSpec as unknown as DocumentModelGlobalState,\n },\n [processorModuleDocumentType]: {\n documentType: processorModuleDocumentType,\n subdir: \"processors\",\n reducer: processorModuleReducer as Reducer<any>,\n utils: processorModuleUtils,\n actions: processorModuleActions as unknown as ActionsModule,\n createDocument: createProcessorModuleDocument as (\n state?: any,\n ) => PHDocument,\n jsonSpec: processorModuleSpec as unknown as DocumentModelGlobalState,\n },\n [subgraphModuleDocumentType]: {\n documentType: subgraphModuleDocumentType,\n subdir: \"subgraphs\",\n reducer: subgraphModuleReducer as Reducer<any>,\n utils: subgraphModuleUtils,\n actions: subgraphModuleActions as unknown as ActionsModule,\n createDocument: createSubgraphModuleDocument as (state?: any) => PHDocument,\n jsonSpec: subgraphModuleSpec as unknown as DocumentModelGlobalState,\n },\n [appModuleDocumentType]: {\n documentType: appModuleDocumentType,\n subdir: \"apps\",\n reducer: appModuleReducer as Reducer<any>,\n utils: appModuleUtils,\n actions: appModuleActions as unknown as ActionsModule,\n createDocument: createAppModuleDocument as (state?: any) => PHDocument,\n jsonSpec: appModuleSpec as unknown as DocumentModelGlobalState,\n },\n};\n\nexport function getSpecEntry(documentType: string): SpecEntry {\n const entry = SPECS[documentType];\n if (!entry) {\n throw new Error(`No spec handler registered for \"${documentType}\"`);\n }\n return entry;\n}\n\nexport function listSpecDocumentTypes(): string[] {\n return Object.keys(SPECS);\n}\n\n/** Returns the directory that holds specs for a given document type. */\nexport function specDir(projectDir: string, documentType: string): string {\n return join(projectDir, SPECS_DIRNAME, getSpecEntry(documentType).subdir);\n}\n\n/**\n * Deterministic path for a doc-type + display name.\n * Format: `<projectDir>/<specsDir>/<subdir>/<kebab-name>.<ext>.phd`.\n */\nexport function specPath(\n projectDir: string,\n documentType: string,\n name: string,\n): string {\n const entry = getSpecEntry(documentType);\n const baseName = kebabCase(name);\n const ext = stripLeadingDot(entry.utils.fileExtension);\n return join(specDir(projectDir, documentType), `${baseName}.${ext}.phd`);\n}\n\n/* baseSaveToFile expects the extension WITHOUT a leading dot (\"phdm\"), while the\n * document-model utils export it WITH one (\".phdm\"). Normalize so we can pass\n * either through. */\nexport function stripLeadingDot(ext: string): string {\n return ext.startsWith(\".\") ? ext.slice(1) : ext;\n}\n\n/** Saves a document into `<projectDir>/specs/<subdir>/<kebab-name>.<ext>.phd`. */\nexport async function saveSpec(\n doc: PHDocument,\n projectDir: string,\n): Promise<string> {\n const entry = getSpecEntry(doc.header.documentType);\n const dir = specDir(projectDir, doc.header.documentType);\n await mkdir(dir, { recursive: true });\n const name = kebabCase(doc.header.name || \"untitled\");\n return baseSaveToFile(\n doc,\n dir,\n stripLeadingDot(entry.utils.fileExtension),\n name,\n );\n}\n","/**\n * File-backed mirror of reactor-mcp's tool surface. Same function names and\n * input shapes — same agent code works whether it's targeting a live reactor\n * or a `specs/` folder on disk. The \"drive id\" is the project directory;\n * \"document id\" is the file path of the spec.\n *\n * See `packages/reactor-mcp/src/tools/reactor.ts` for the canonical schema.\n */\nimport type {\n Action,\n DocumentModelGlobalState,\n OperationSpecification,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport { camelCase } from \"change-case\";\nimport { baseLoadFromFile } from \"document-model/node\";\nimport { readdir, rm, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport {\n getSpecEntry,\n listSpecDocumentTypes,\n saveSpec,\n specDir,\n SPECS_DIRNAME,\n} from \"./specs.js\";\n\nexport type DocumentModelInfo = {\n name: string;\n type: string;\n description: string;\n extension: string;\n authorName: string;\n authorWebsite: string;\n};\n\n/** Mirrors reactor-mcp `getDocumentModels`. */\nexport function getDocumentModels(): DocumentModelInfo[] {\n return listSpecDocumentTypes().map((documentType) => {\n const { jsonSpec } = getSpecEntry(documentType);\n return {\n name: jsonSpec.name,\n type: jsonSpec.id,\n description: jsonSpec.description ?? \"\",\n extension: jsonSpec.extension ?? \"\",\n authorName: jsonSpec.author?.name ?? \"\",\n authorWebsite: jsonSpec.author?.website ?? \"\",\n };\n });\n}\n\n/** Mirrors reactor-mcp `getDocumentModelSchema`. Returns the full\n * `DocumentModelGlobalState` (schema + operations + errors), same payload\n * shape reactor-mcp serves. */\nexport function getDocumentModelSchema(\n documentType: string,\n): DocumentModelGlobalState {\n return getSpecEntry(documentType).jsonSpec;\n}\n\n/** Mirrors reactor-mcp `getDocument`. Path = file location on disk. */\nexport async function getDocument(path: string): Promise<PHDocument> {\n // We don't know the documentType ahead of time, so try each registered\n // reducer until one loads cleanly. baseLoadFromFile validates against the\n // reducer; the wrong reducer rejects. Try the path's parent directory first\n // as a fast hint (matches our `specs/<subdir>/` convention).\n const subdir = pathSubdir(path);\n const hint = subdir\n ? listSpecDocumentTypes().find((t) => getSpecEntry(t).subdir === subdir)\n : undefined;\n const order = hint\n ? [hint, ...listSpecDocumentTypes().filter((t) => t !== hint)]\n : listSpecDocumentTypes();\n\n let lastError: unknown;\n for (const documentType of order) {\n const { reducer } = getSpecEntry(documentType);\n try {\n return await baseLoadFromFile(path, reducer);\n } catch (err) {\n lastError = err;\n }\n }\n throw new Error(\n `Failed to load spec at \"${path}\": no registered reducer accepted it. Last error: ${String(lastError)}`,\n );\n}\n\n/** Mirrors reactor-mcp `getDocuments`. `parentId` is the project directory\n * containing `specs/`. */\nexport async function getDocuments(\n projectDir: string,\n opts: { documentType?: string } = {},\n): Promise<PHDocument[]> {\n const documentTypes = opts.documentType\n ? [opts.documentType]\n : listSpecDocumentTypes();\n\n const results: PHDocument[] = [];\n for (const documentType of documentTypes) {\n const dir = specDir(projectDir, documentType);\n const exists = await stat(dir).then(\n (s) => s.isDirectory(),\n () => false,\n );\n if (!exists) continue;\n const entries = await readdir(dir);\n for (const entry of entries) {\n if (!entry.endsWith(\".phd\")) continue;\n results.push(await getDocument(join(dir, entry)));\n }\n }\n return results;\n}\n\n/** Mirrors reactor-mcp `createDocument`. Returns an in-memory document; the\n * caller persists with `saveSpec`. */\nexport function createDocument(\n documentType: string,\n opts: {\n name?: string;\n initialState?: { global?: unknown; local?: unknown };\n } = {},\n): PHDocument {\n const entry = getSpecEntry(documentType);\n const doc = entry.createDocument(opts.initialState);\n if (opts.name) doc.header.name = opts.name;\n return doc;\n}\n\nexport type ActionInput = {\n type: string;\n input?: unknown;\n scope?: string;\n};\n\n/** Mirrors reactor-mcp `addActions`. Validates every action up front against\n * the document model's latest specification, then applies them in order via\n * the reducer. If any action is invalid, throws an aggregated error and\n * leaves `doc` untouched. */\nexport function addActions(\n doc: PHDocument,\n actions: ActionInput[],\n): PHDocument {\n const entry = getSpecEntry(doc.header.documentType);\n const built = validateAndBuildActions(entry, actions);\n let current = doc;\n for (let i = 0; i < built.length; i++) {\n const action = built[i];\n current = entry.reducer(current, action);\n /* The base reducer wraps custom reducers in try/catch and records any\n * throw as `operation.error` instead of propagating. For an atomic\n * batch apply that's the wrong shape — surface the error so callers\n * (and `saveSpec`) bail out before persisting a half-applied doc. */\n const scope = action.scope ?? \"global\";\n const ops = current.operations[scope];\n const last = ops?.[ops.length - 1];\n if (last?.error) {\n const failures: ActionValidationError[] = [\n {\n index: i,\n type: actions[i].type ?? \"<missing>\",\n errors: [`Reducer error: ${last.error}`],\n },\n ];\n throw formatValidationError(failures);\n }\n }\n return current;\n}\n\nexport type ActionValidationError = {\n /** Position in the input array. */\n index: number;\n /** The action's `type` field (or `<missing>` when not a string). */\n type: string;\n /** Human-readable reasons the action was rejected. */\n errors: string[];\n};\n\n/** Validate a list of actions without applying them. Returns one entry per\n * invalid action with all of its problems aggregated. Used by `addActions`\n * and exposed for callers that want a dry-run check. */\nexport function validateActions(\n documentType: string,\n actions: ActionInput[],\n): ActionValidationError[] {\n const entry = getSpecEntry(documentType);\n const failures: ActionValidationError[] = [];\n for (let i = 0; i < actions.length; i++) {\n const errors = collectActionErrors(entry, actions[i]);\n if (errors.length > 0) {\n failures.push({ index: i, type: actions[i].type ?? \"<missing>\", errors });\n }\n }\n return failures;\n}\n\n/** Run validateActions across the batch and, on success, materialize the\n * built Action objects. On any failure throws with every action's errors\n * aggregated — the caller never sees a partial apply. */\nfunction validateAndBuildActions(\n entry: ReturnType<typeof getSpecEntry>,\n actions: ActionInput[],\n): Action[] {\n const built: Action[] = [];\n const failures: ActionValidationError[] = [];\n for (let i = 0; i < actions.length; i++) {\n const item = actions[i];\n const errors = collectActionErrors(entry, item);\n if (errors.length > 0) {\n failures.push({ index: i, type: item.type ?? \"<missing>\", errors });\n continue;\n }\n built.push(buildAction(entry.actions, item));\n }\n if (failures.length > 0) throw formatValidationError(failures);\n return built;\n}\n\n/* Mirrors reactor-mcp's `validateDocumentModelAction`: confirms the operation\n * is declared in the latest spec, looks up the action creator, runs the\n * creator's own input validation, and checks scope. */\nfunction collectActionErrors(\n entry: ReturnType<typeof getSpecEntry>,\n item: ActionInput,\n): string[] {\n const errors: string[] = [];\n if (typeof item.type !== \"string\" || item.type.length === 0) {\n errors.push(\"Missing `type` field\");\n return errors;\n }\n const specs = entry.jsonSpec.specifications;\n if (!specs || specs.length === 0) {\n errors.push(\"Document model has no specifications\");\n return errors;\n }\n const latest = specs[specs.length - 1];\n let operation: OperationSpecification | undefined;\n for (const module of latest.modules ?? []) {\n const found = (module.operations ?? []).find((op) => op.name === item.type);\n if (found) {\n operation = found;\n break;\n }\n }\n if (!operation) {\n errors.push(\n `Operation \"${item.type}\" is not defined in any module of the document model`,\n );\n }\n const creatorName = camelCase(item.type);\n const creator = entry.actions[creatorName];\n if (!creator) {\n errors.push(`No action creator found.`);\n } else {\n try {\n creator(item.input);\n } catch (err) {\n errors.push(\n `Input validation error: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n if (operation?.scope && item.scope && item.scope !== operation.scope) {\n errors.push(\n `Scope \"${item.scope}\" does not match operation scope \"${operation.scope}\"`,\n );\n }\n return errors;\n}\n\nfunction formatValidationError(failures: ActionValidationError[]): Error {\n const lines = failures.map(\n (f) => ` [${f.index}] ${f.type}: ${f.errors.join(\"; \")}`,\n );\n const header =\n failures.length === 1\n ? \"1 action failed validation:\"\n : `${failures.length} actions failed validation:`;\n const err = new Error([header, ...lines].join(\"\\n\")) as Error & {\n failures: ActionValidationError[];\n };\n err.failures = failures;\n return err;\n}\n\nfunction buildAction(\n actionsModule: Record<string, (input?: any) => Action>,\n item: ActionInput,\n): Action {\n const creatorName = camelCase(item.type);\n const creator = actionsModule[creatorName];\n if (!creator) {\n throw new Error(\n `No action creator found for \"${item.type}\" (looked up as \"${creatorName}\")`,\n );\n }\n const action = creator(item.input);\n // Caller may override the scope (creator picks a default).\n if (item.scope) action.scope = item.scope;\n return action;\n}\n\n/** Mirrors reactor-mcp `deleteDocument`. Removes the spec file from disk. */\nexport async function deleteDocument(\n path: string,\n): Promise<{ success: boolean }> {\n try {\n await rm(path);\n return { success: true };\n } catch {\n return { success: false };\n }\n}\n\n/* Convenience: persist after applying actions. Matches the typical agent\n * loop `getDocument → addActions → saveSpec` from the plan. */\nexport async function addActionsAndSave(\n path: string,\n projectDir: string,\n actions: ActionInput[],\n): Promise<{ doc: PHDocument; savedPath: string }> {\n const doc = await getDocument(path);\n const next = addActions(doc, actions);\n const savedPath = await saveSpec(next, projectDir);\n return { doc: next, savedPath };\n}\n\nfunction pathSubdir(filePath: string): string | undefined {\n const parts = filePath.split(/[/\\\\]/);\n const i = parts.lastIndexOf(SPECS_DIRNAME);\n if (i < 0 || i + 1 >= parts.length) return undefined;\n return parts[i + 1];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAM,WADF,MAAM,SAAS,MAAM,WAAW;EACnB;;AAGjC,SAAS,WAAW,UAAsC;CACxD,MAAM,QAAQ,SAAS,MAAM,QAAQ;CACrC,MAAM,IAAI,MAAM,YAAY,cAAc;AAC1C,KAAI,IAAI,KAAK,IAAI,KAAK,MAAM,OAAQ,QAAO,KAAA;AAC3C,QAAO,MAAM,IAAI"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Action, DocumentModelGlobalState, PHDocument, Reducer } from "@powerhousedao/shared/document-model";
|
|
2
|
+
|
|
3
|
+
//#region codegen/spec-api.d.ts
|
|
4
|
+
type DocumentModelInfo = {
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
description: string;
|
|
8
|
+
extension: string;
|
|
9
|
+
authorName: string;
|
|
10
|
+
authorWebsite: string;
|
|
11
|
+
};
|
|
12
|
+
/** Mirrors reactor-mcp `getDocumentModels`. */
|
|
13
|
+
declare function getDocumentModels(): DocumentModelInfo[];
|
|
14
|
+
/** Mirrors reactor-mcp `getDocumentModelSchema`. Returns the full
|
|
15
|
+
* `DocumentModelGlobalState` (schema + operations + errors), same payload
|
|
16
|
+
* shape reactor-mcp serves. */
|
|
17
|
+
declare function getDocumentModelSchema(documentType: string): DocumentModelGlobalState;
|
|
18
|
+
/** Mirrors reactor-mcp `getDocument`. Path = file location on disk. */
|
|
19
|
+
declare function getDocument(path: string): Promise<PHDocument>;
|
|
20
|
+
/** Mirrors reactor-mcp `getDocuments`. `parentId` is the project directory
|
|
21
|
+
* containing `specs/`. */
|
|
22
|
+
declare function getDocuments(projectDir: string, opts?: {
|
|
23
|
+
documentType?: string;
|
|
24
|
+
}): Promise<PHDocument[]>;
|
|
25
|
+
/** Mirrors reactor-mcp `createDocument`. Returns an in-memory document; the
|
|
26
|
+
* caller persists with `saveSpec`. */
|
|
27
|
+
declare function createDocument(documentType: string, opts?: {
|
|
28
|
+
name?: string;
|
|
29
|
+
initialState?: {
|
|
30
|
+
global?: unknown;
|
|
31
|
+
local?: unknown;
|
|
32
|
+
};
|
|
33
|
+
}): PHDocument;
|
|
34
|
+
type ActionInput = {
|
|
35
|
+
type: string;
|
|
36
|
+
input?: unknown;
|
|
37
|
+
scope?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Mirrors reactor-mcp `addActions`. Validates every action up front against
|
|
40
|
+
* the document model's latest specification, then applies them in order via
|
|
41
|
+
* the reducer. If any action is invalid, throws an aggregated error and
|
|
42
|
+
* leaves `doc` untouched. */
|
|
43
|
+
declare function addActions(doc: PHDocument, actions: ActionInput[]): PHDocument;
|
|
44
|
+
type ActionValidationError = {
|
|
45
|
+
/** Position in the input array. */index: number; /** The action's `type` field (or `<missing>` when not a string). */
|
|
46
|
+
type: string; /** Human-readable reasons the action was rejected. */
|
|
47
|
+
errors: string[];
|
|
48
|
+
};
|
|
49
|
+
/** Validate a list of actions without applying them. Returns one entry per
|
|
50
|
+
* invalid action with all of its problems aggregated. Used by `addActions`
|
|
51
|
+
* and exposed for callers that want a dry-run check. */
|
|
52
|
+
declare function validateActions(documentType: string, actions: ActionInput[]): ActionValidationError[];
|
|
53
|
+
/** Mirrors reactor-mcp `deleteDocument`. Removes the spec file from disk. */
|
|
54
|
+
declare function deleteDocument(path: string): Promise<{
|
|
55
|
+
success: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
declare function addActionsAndSave(path: string, projectDir: string, actions: ActionInput[]): Promise<{
|
|
58
|
+
doc: PHDocument;
|
|
59
|
+
savedPath: string;
|
|
60
|
+
}>;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region codegen/specs.d.ts
|
|
63
|
+
declare const SPECS_DIRNAME = "specs";
|
|
64
|
+
type ActionsModule = Record<string, (input?: any) => Action>;
|
|
65
|
+
type SpecEntry = {
|
|
66
|
+
documentType: string;
|
|
67
|
+
subdir: string;
|
|
68
|
+
reducer: Reducer<any>;
|
|
69
|
+
utils: {
|
|
70
|
+
fileExtension: string;
|
|
71
|
+
};
|
|
72
|
+
actions: ActionsModule;
|
|
73
|
+
createDocument: (state?: any) => PHDocument;
|
|
74
|
+
jsonSpec: DocumentModelGlobalState;
|
|
75
|
+
};
|
|
76
|
+
declare function getSpecEntry(documentType: string): SpecEntry;
|
|
77
|
+
declare function listSpecDocumentTypes(): string[];
|
|
78
|
+
/** Returns the directory that holds specs for a given document type. */
|
|
79
|
+
declare function specDir(projectDir: string, documentType: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* Deterministic path for a doc-type + display name.
|
|
82
|
+
* Format: `<projectDir>/<specsDir>/<subdir>/<kebab-name>.<ext>.phd`.
|
|
83
|
+
*/
|
|
84
|
+
declare function specPath(projectDir: string, documentType: string, name: string): string;
|
|
85
|
+
declare function stripLeadingDot(ext: string): string;
|
|
86
|
+
/** Saves a document into `<projectDir>/specs/<subdir>/<kebab-name>.<ext>.phd`. */
|
|
87
|
+
declare function saveSpec(doc: PHDocument, projectDir: string): Promise<string>;
|
|
88
|
+
//#endregion
|
|
89
|
+
export { getDocumentModels as _, specDir as a, ActionInput as c, addActions as d, addActionsAndSave as f, getDocumentModelSchema as g, getDocument as h, saveSpec as i, ActionValidationError as l, deleteDocument as m, getSpecEntry as n, specPath as o, createDocument as p, listSpecDocumentTypes as r, stripLeadingDot as s, SPECS_DIRNAME as t, DocumentModelInfo as u, getDocuments as v, validateActions as y };
|
|
90
|
+
//# sourceMappingURL=specs-_7A7Tl_N.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs-_7A7Tl_N.d.ts","names":[],"sources":["../codegen/spec-api.ts","../codegen/specs.ts"],"mappings":";;;KA2BY,iBAAA;EACV,IAAA;EACA,IAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;AAAA;;iBAIc,iBAAA,CAAA,GAAqB,iBAAA;;AAiBrC;;iBAAgB,sBAAA,CACd,YAAA,WACC,wBAAA;;iBAKmB,WAAA,CAAY,IAAA,WAAe,OAAA,CAAQ,UAAA;AAAzD;;AAAA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
|
+
import { t as codegenFactoryBuilder } from "./factory-B6hBnFAf.js";
|
|
2
|
+
import { t as vetraReadModelFactoryBuilder } from "./factory-Cn0UwIFB.js";
|
|
3
|
+
//#region processors/switchboard.ts
|
|
4
|
+
const processorFactoryBuilders = [vetraReadModelFactoryBuilder, codegenFactoryBuilder];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { processorFactoryBuilders };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=switchboard-CvWiUgBP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard-
|
|
1
|
+
{"version":3,"file":"switchboard-CvWiUgBP.js","names":[],"sources":["../processors/switchboard.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { ProcessorFactoryBuilder } from \"@powerhousedao/reactor-browser\";\nimport { codegenFactoryBuilder } from \"./codegen/factory.js\";\nimport { vetraReadModelFactoryBuilder } from \"./vetra-read-model/factory.js\";\n\nexport const processorFactoryBuilders: ProcessorFactoryBuilder[] = [\n vetraReadModelFactoryBuilder,\n codegenFactoryBuilder,\n];\n"],"mappings":";;;AAQA,MAAa,2BAAsD,CACjE,8BACA,sBACD"}
|
|
@@ -27,4 +27,4 @@ function useSelectedDriveVetraPackage() {
|
|
|
27
27
|
//#endregion
|
|
28
28
|
export { useSelectedProcessorModuleDocument as n, useSelectedSubgraphModuleDocument as r, useSelectedDriveVetraPackage as t };
|
|
29
29
|
|
|
30
|
-
//# sourceMappingURL=useVetraDocument-
|
|
30
|
+
//# sourceMappingURL=useVetraDocument-BpPD6DKR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVetraDocument-
|
|
1
|
+
{"version":3,"file":"useVetraDocument-BpPD6DKR.js","names":[],"sources":["../editors/hooks/useVetraDocument.ts"],"sourcesContent":["import {\n useDocumentOfType,\n useSelectedDocumentId,\n useSelectedDocumentOfType,\n useSelectedDrive,\n} from \"@powerhousedao/reactor-browser\";\nimport { isFileNode } from \"@powerhousedao/shared/document-drive\";\nimport type {\n AppModuleAction,\n AppModuleDocument,\n} from \"../../document-models/app-module/index.js\";\nimport {\n type DocumentEditorAction,\n type DocumentEditorDocument,\n} from \"../../document-models/document-editor/index.js\";\nimport type {\n ProcessorModuleAction,\n ProcessorModuleDocument,\n} from \"../../document-models/processor-module/index.js\";\nimport type {\n SubgraphModuleAction,\n SubgraphModuleDocument,\n} from \"../../document-models/subgraph-module/index.js\";\nimport type {\n VetraPackageAction,\n VetraPackageDocument,\n} from \"../../document-models/vetra-package/index.js\";\n\nconst VETRA_PACKAGE_DOCUMENT_TYPE = \"powerhouse/package\";\nconst DOCUMENT_EDITOR_DOCUMENT_TYPE = \"powerhouse/document-editor\";\nconst SUBGRAPH_MODULE_DOCUMENT_TYPE = \"powerhouse/subgraph\";\nconst PROCESSOR_MODULE_DOCUMENT_TYPE = \"powerhouse/processor\";\n\nexport function useAppModuleDocument(documentId: string | undefined | null) {\n return useDocumentOfType<AppModuleDocument, AppModuleAction>(\n documentId,\n \"powerhouse/app\",\n );\n}\n\nexport function useSelectedAppModuleDocument() {\n const documentId = useSelectedDocumentId();\n return useAppModuleDocument(documentId);\n}\n\nexport function useDocumentEditorDocument(\n documentId: string | undefined | null,\n) {\n return useDocumentOfType<DocumentEditorDocument, DocumentEditorAction>(\n documentId,\n DOCUMENT_EDITOR_DOCUMENT_TYPE,\n );\n}\n\nexport function useSelectedDocumentEditorDocument() {\n const documentId = useSelectedDocumentId();\n return useDocumentEditorDocument(documentId);\n}\n\nexport function useProcessorModuleDocument(\n documentId: string | undefined | null,\n) {\n return useDocumentOfType<ProcessorModuleDocument, ProcessorModuleAction>(\n documentId,\n PROCESSOR_MODULE_DOCUMENT_TYPE,\n );\n}\n\nexport function useSelectedProcessorModuleDocument() {\n const documentId = useSelectedDocumentId();\n return useProcessorModuleDocument(documentId);\n}\n\nexport function useSubgraphModuleDocument(\n documentId: string | undefined | null,\n) {\n return useDocumentOfType<SubgraphModuleDocument, SubgraphModuleAction>(\n documentId,\n SUBGRAPH_MODULE_DOCUMENT_TYPE,\n );\n}\n\nexport function useSelectedSubgraphModuleDocument() {\n const documentId = useSelectedDocumentId();\n return useSubgraphModuleDocument(documentId);\n}\n\nexport function useVetraPackageDocument(documentId: string | undefined | null) {\n return useDocumentOfType<VetraPackageDocument, VetraPackageAction>(\n documentId,\n VETRA_PACKAGE_DOCUMENT_TYPE,\n );\n}\n\nexport function useSelectedVetraPackageDocument() {\n return useSelectedDocumentOfType<VetraPackageDocument, VetraPackageAction>(\n VETRA_PACKAGE_DOCUMENT_TYPE,\n );\n}\n\nexport function useSelectedDriveVetraPackage() {\n const [selectedDrive] = useSelectedDrive();\n const documentId = selectedDrive.state.global.nodes.find(\n (node) =>\n isFileNode(node) && node.documentType === VETRA_PACKAGE_DOCUMENT_TYPE,\n )?.id;\n\n return useVetraPackageDocument(documentId);\n}\n"],"mappings":";;;AA4BA,MAAM,8BAA8B;AAEpC,MAAM,gCAAgC;AACtC,MAAM,iCAAiC;AA4BvC,SAAgB,2BACd,YACA;AACA,QAAO,kBACL,YACA,+BACD;;AAGH,SAAgB,qCAAqC;AAEnD,QAAO,2BADY,uBAAuB,CACG;;AAG/C,SAAgB,0BACd,YACA;AACA,QAAO,kBACL,YACA,8BACD;;AAGH,SAAgB,oCAAoC;AAElD,QAAO,0BADY,uBAAuB,CACE;;AAG9C,SAAgB,wBAAwB,YAAuC;AAC7E,QAAO,kBACL,YACA,4BACD;;AASH,SAAgB,+BAA+B;CAC7C,MAAM,CAAC,iBAAiB,kBAAkB;CAC1C,MAAM,aAAa,cAAc,MAAM,OAAO,MAAM,MACjD,SACC,WAAW,KAAK,IAAI,KAAK,iBAAiB,4BAC7C,EAAE;AAEH,QAAO,wBAAwB,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/vetra",
|
|
3
|
-
"version": "6.2.0-dev.
|
|
3
|
+
"version": "6.2.0-dev.28",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
"types": "./dist/codegen/index.d.ts",
|
|
52
52
|
"import": "./dist/codegen/index.js"
|
|
53
53
|
},
|
|
54
|
+
"./codegen/spec": {
|
|
55
|
+
"source": "./codegen/spec.ts",
|
|
56
|
+
"types": "./dist/codegen/spec.d.ts",
|
|
57
|
+
"import": "./dist/codegen/spec.js"
|
|
58
|
+
},
|
|
54
59
|
"./manifest": "./dist/powerhouse.manifest.json",
|
|
55
60
|
"./style.css": "./style.css",
|
|
56
61
|
"./package.json": "./package.json"
|
|
@@ -60,12 +65,12 @@
|
|
|
60
65
|
"react": "19.2.6",
|
|
61
66
|
"zod": "4.3.6",
|
|
62
67
|
"tailwind-merge": "3.4.0",
|
|
63
|
-
"@powerhousedao/codegen": "6.2.0-dev.
|
|
64
|
-
"@powerhousedao/
|
|
65
|
-
"@powerhousedao/design-system": "6.2.0-dev.
|
|
66
|
-
"@powerhousedao/
|
|
67
|
-
"@powerhousedao/
|
|
68
|
-
"document-model": "6.2.0-dev.
|
|
68
|
+
"@powerhousedao/codegen": "6.2.0-dev.28",
|
|
69
|
+
"@powerhousedao/reactor-browser": "6.2.0-dev.28",
|
|
70
|
+
"@powerhousedao/design-system": "6.2.0-dev.28",
|
|
71
|
+
"@powerhousedao/shared": "6.2.0-dev.28",
|
|
72
|
+
"@powerhousedao/config": "6.2.0-dev.28",
|
|
73
|
+
"document-model": "6.2.0-dev.28"
|
|
69
74
|
},
|
|
70
75
|
"devDependencies": {
|
|
71
76
|
"@tailwindcss/cli": "4.2.2",
|
|
@@ -84,7 +89,7 @@
|
|
|
84
89
|
"vite": "8.0.10",
|
|
85
90
|
"vite-tsconfig-paths": "6.1.1",
|
|
86
91
|
"vitest": "4.1.1",
|
|
87
|
-
"@powerhousedao/builder-tools": "6.2.0-dev.
|
|
92
|
+
"@powerhousedao/builder-tools": "6.2.0-dev.28"
|
|
88
93
|
},
|
|
89
94
|
"description": "Vetra — the agent-first builder platform for the Powerhouse ecosystem. Spec-driven and AI-native development of open-source, decentralized back-ends.",
|
|
90
95
|
"keywords": [
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { t as codegenFactoryBuilder } from "./factory-DcPyqWkY.js";
|
|
2
|
-
import { t as vetraReadModelFactoryBuilder } from "./factory-BkA-IvkR.js";
|
|
3
|
-
//#region processors/switchboard.ts
|
|
4
|
-
const processorFactoryBuilders = [vetraReadModelFactoryBuilder, codegenFactoryBuilder];
|
|
5
|
-
//#endregion
|
|
6
|
-
export { processorFactoryBuilders };
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=switchboard-C_BapCdk.js.map
|