@powerhousedao/vetra 6.0.2-staging.8 → 6.1.0-dev.0
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/app-module-D_cAVvt0.js +48 -0
- package/dist/app-module-D_cAVvt0.js.map +1 -0
- package/dist/codegen/index.d.ts +117 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +793 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/connect-BRlVKs1s.js +6 -0
- package/dist/connect-BRlVKs1s.js.map +1 -0
- package/dist/document-editor-1NFr9t3a.js +48 -0
- package/dist/document-editor-1NFr9t3a.js.map +1 -0
- package/dist/document-models/app-module/index.d.ts +12 -2
- package/dist/document-models/app-module/index.d.ts.map +1 -0
- package/dist/document-models/app-module/index.js +5 -2
- package/dist/document-models/document-editor/index.d.ts +12 -2
- package/dist/document-models/document-editor/index.d.ts.map +1 -0
- package/dist/document-models/document-editor/index.js +5 -2
- package/dist/document-models/index.d.ts +6 -29
- package/dist/document-models/index.js +6 -2
- package/dist/document-models/processor-module/index.d.ts +12 -2
- package/dist/document-models/processor-module/index.d.ts.map +1 -0
- package/dist/document-models/processor-module/index.js +5 -2
- package/dist/document-models/subgraph-module/index.d.ts +12 -2
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/index.js +5 -2
- package/dist/document-models/vetra-package/index.d.ts +12 -2
- package/dist/document-models/vetra-package/index.d.ts.map +1 -0
- package/dist/document-models/vetra-package/index.js +3 -2
- package/dist/{editor-9B-mf9yE.js → editor-BwbJ65NZ.js} +10 -9
- package/dist/editor-BwbJ65NZ.js.map +1 -0
- package/dist/{editor-CQwD5q6a.js → editor-CJAn9WTA.js} +8 -7
- package/dist/editor-CJAn9WTA.js.map +1 -0
- package/dist/{editor-CwC9mpEu.js → editor-CLERZjRS.js} +11 -11
- package/dist/editor-CLERZjRS.js.map +1 -0
- package/dist/{editor-Bm0GwtcN.js → editor-DWufJcmG.js} +7 -7
- package/dist/editor-DWufJcmG.js.map +1 -0
- package/dist/{editor-ouUpfWQx.js → editor-DabfMxkF.js} +15 -15
- package/dist/editor-DabfMxkF.js.map +1 -0
- package/dist/{editor-BwBHWEmR.js → editor-WWMGVelM.js} +9 -9
- package/dist/editor-WWMGVelM.js.map +1 -0
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.d.ts +13 -12
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/factory-Bd_0OaF8.js +79 -0
- package/dist/factory-Bd_0OaF8.js.map +1 -0
- package/dist/{codegen-PnsnCMkw.js → factory-CEzh-u5J.js} +55 -7
- package/dist/factory-CEzh-u5J.js.map +1 -0
- package/dist/{hooks-Vx4YtE1e.js → hooks-Btogj1f0.js} +1 -1
- package/dist/{hooks-Vx4YtE1e.js.map → hooks-Btogj1f0.js.map} +1 -1
- package/dist/index-BPoF8P3O.d.ts +357 -0
- package/dist/index-BPoF8P3O.d.ts.map +1 -0
- package/dist/index-BoGed4Fa.d.ts +437 -0
- package/dist/index-BoGed4Fa.d.ts.map +1 -0
- package/dist/index-C4s0aLv3.d.ts +424 -0
- package/dist/index-C4s0aLv3.d.ts.map +1 -0
- package/dist/index-ClaOdn_F.d.ts +393 -0
- package/dist/index-ClaOdn_F.d.ts.map +1 -0
- package/dist/index.d.ts +142 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/{logger-BLNtquAC.js → logger-CYkStoEb.js} +1 -1
- package/dist/{logger-BLNtquAC.js.map → logger-CYkStoEb.js.map} +1 -1
- package/dist/module-DPyV2vUY.js +138 -0
- package/dist/module-DPyV2vUY.js.map +1 -0
- package/dist/module-Drla4Vmn.d.ts +478 -0
- package/dist/module-Drla4Vmn.d.ts.map +1 -0
- package/dist/{vetra-package-VqptqKzx.js → module-dDKBr6QY.js} +186 -236
- package/dist/module-dDKBr6QY.js.map +1 -0
- package/dist/{module-DWvO3WCv.js → module-jWN6gsmi.js} +15 -11
- package/dist/module-jWN6gsmi.js.map +1 -0
- package/dist/module-pK0hpO6c.js +131 -0
- package/dist/module-pK0hpO6c.js.map +1 -0
- package/dist/module-ryHOwQp-.js +105 -0
- package/dist/module-ryHOwQp-.js.map +1 -0
- package/dist/module-x2Liyk0-.js +80 -0
- package/dist/module-x2Liyk0-.js.map +1 -0
- package/dist/ph-factories-B0_E6LY6.js +53 -0
- package/dist/ph-factories-B0_E6LY6.js.map +1 -0
- package/dist/ph-factories-B6PSPkPQ.js +52 -0
- package/dist/ph-factories-B6PSPkPQ.js.map +1 -0
- package/dist/ph-factories-Bn_HTUfT.js +50 -0
- package/dist/ph-factories-Bn_HTUfT.js.map +1 -0
- package/dist/ph-factories-CJXfT_Z1.js +51 -0
- package/dist/ph-factories-CJXfT_Z1.js.map +1 -0
- package/dist/powerhouse.manifest.d.ts +8 -5
- package/dist/powerhouse.manifest.d.ts.map +1 -1
- package/dist/powerhouse.manifest.js +19 -12
- package/dist/processor-module-B7IAItXQ.js +48 -0
- package/dist/processor-module-B7IAItXQ.js.map +1 -0
- package/dist/processors/codegen/index.d.ts +7 -4
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +2 -2
- package/dist/processors/index.d.ts +4 -15
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +8 -81
- package/dist/processors/index.js.map +1 -1
- package/dist/processors/vetra-read-model/index.d.ts +18599 -2
- package/dist/processors/vetra-read-model/index.d.ts.map +1 -0
- package/dist/processors/vetra-read-model/index.js +2 -54
- package/dist/style.css +7 -8
- package/dist/subgraph-module-CfzSZTNC.js +48 -0
- package/dist/subgraph-module-CfzSZTNC.js.map +1 -0
- package/dist/switchboard-CIUZkhea.js +8 -0
- package/dist/switchboard-CIUZkhea.js.map +1 -0
- package/dist/{useVetraDocument-DF0teXXM.js → useVetraDocument-BQKyels4.js} +1 -1
- package/dist/{useVetraDocument-DF0teXXM.js.map → useVetraDocument-BQKyels4.js.map} +1 -1
- package/dist/{app-module-BbhoykB5.js → utils-BRx88WW3.js} +70 -235
- package/dist/utils-BRx88WW3.js.map +1 -0
- package/dist/{processor-module-CkuQiq7B.js → utils-Byjf33qt.js} +63 -240
- package/dist/utils-Byjf33qt.js.map +1 -0
- package/dist/utils-CWO5kDus.js +162 -0
- package/dist/utils-CWO5kDus.js.map +1 -0
- package/dist/utils-CnZc-0E4.js +202 -0
- package/dist/utils-CnZc-0E4.js.map +1 -0
- package/dist/vetra-package-BgTjv343.js +100 -0
- package/dist/vetra-package-BgTjv343.js.map +1 -0
- package/package.json +19 -14
- package/dist/app-module-BbhoykB5.js.map +0 -1
- package/dist/codegen-PnsnCMkw.js.map +0 -1
- package/dist/document-editor-CHM7Pu4m.js +0 -344
- package/dist/document-editor-CHM7Pu4m.js.map +0 -1
- package/dist/document-models/index.d.ts.map +0 -1
- package/dist/editor-9B-mf9yE.js.map +0 -1
- package/dist/editor-Bm0GwtcN.js.map +0 -1
- package/dist/editor-BwBHWEmR.js.map +0 -1
- package/dist/editor-CD3KcVf6.js +0 -2
- package/dist/editor-CQwD5q6a.js.map +0 -1
- package/dist/editor-CwC9mpEu.js.map +0 -1
- package/dist/editor-ouUpfWQx.js.map +0 -1
- package/dist/index-CHfOF-Et.d.ts +0 -363
- package/dist/index-CHfOF-Et.d.ts.map +0 -1
- package/dist/index-CL_CHW_Z.d.ts +0 -330
- package/dist/index-CL_CHW_Z.d.ts.map +0 -1
- package/dist/index-COsHJRmm.d.ts +0 -37
- package/dist/index-COsHJRmm.d.ts.map +0 -1
- package/dist/index-C_kUPMNf.d.ts +0 -298
- package/dist/index-C_kUPMNf.d.ts.map +0 -1
- package/dist/index-Qr_rU6VS.d.ts +0 -271
- package/dist/index-Qr_rU6VS.d.ts.map +0 -1
- package/dist/index-cBMMID-w.d.ts +0 -323
- package/dist/index-cBMMID-w.d.ts.map +0 -1
- package/dist/module-DWvO3WCv.js.map +0 -1
- package/dist/module-XCoMwFat.js +0 -59
- package/dist/module-XCoMwFat.js.map +0 -1
- package/dist/processor-module-CkuQiq7B.js.map +0 -1
- package/dist/processors/vetra-read-model/index.js.map +0 -1
- package/dist/subgraph-module-CU_-umq2.js +0 -278
- package/dist/subgraph-module-CU_-umq2.js.map +0 -1
- package/dist/vetra-package-VqptqKzx.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-CEzh-u5J.js","names":[],"sources":["../processors/codegen/document-handlers/base-document-gen.ts","../processors/codegen/interactive-manager.ts","../processors/codegen/document-handlers/document-codegen-manager.ts","../processors/codegen/document-handlers/generators/utils.ts","../processors/codegen/document-handlers/generators/app-generator.ts","../processors/codegen/document-handlers/generators/document-editor-generator.ts","../processors/codegen/document-handlers/generators/document-model-generator.ts","../processors/codegen/document-handlers/generators/package-generator.ts","../processors/codegen/document-handlers/generators/processor-generator.ts","../processors/codegen/document-handlers/generators/subgraph-generator.ts","../processors/codegen/document-handlers/document-codegen-factory.ts","../processors/codegen/processor.ts","../processors/codegen/factory.ts"],"sourcesContent":["import type { Project } from \"ts-morph\";\nimport type { CodegenInput, Config } from \"./types.js\";\n/**\n * Abstract base class for document generators\n * Defines the interface that all document-type handlers must implement\n */\nexport abstract class BaseDocumentGen {\n /**\n * The document type(s) this generator supports\n * Can be a single string or an array of strings for generators that handle multiple types\n */\n abstract readonly supportedDocumentTypes: string | string[];\n project: Project;\n\n constructor(\n protected config: Config,\n project: Project,\n ) {\n this.project = project;\n }\n\n /**\n * Generate code for the given document\n * Must be implemented by each specific document generator\n */\n abstract generate(strand: CodegenInput): Promise<void>;\n\n /**\n * Check if this generator supports the given document type\n */\n supportsDocumentType(documentType: string): boolean {\n if (typeof this.supportedDocumentTypes === \"string\") {\n return this.supportedDocumentTypes === documentType;\n }\n return this.supportedDocumentTypes.includes(documentType);\n }\n\n /**\n * Get all supported document types as an array\n */\n getSupportedDocumentTypes(): string[] {\n if (typeof this.supportedDocumentTypes === \"string\") {\n return [this.supportedDocumentTypes];\n }\n return [...this.supportedDocumentTypes];\n }\n\n /**\n * Validate if this strand should be processed\n * Override this method in specific generators to add custom validation logic\n */\n shouldProcess(strand: CodegenInput): boolean {\n // Basic validation: ensure strand has required properties\n if (!strand.documentId || !strand.documentType) {\n return false;\n }\n\n // Basic validation: check if document type is supported\n if (!this.supportsDocumentType(strand.documentType)) {\n return false;\n }\n\n // Default to processing if basic validation passes\n return true;\n }\n}\n","import { createInterface } from \"node:readline\";\nimport type { CodegenInput } from \"./document-handlers/types.js\";\nimport { logger } from \"./logger.js\";\n\nexport interface QueuedStrand {\n strand: CodegenInput;\n timestamp: number;\n}\n\n/**\n * InteractiveManager handles user interaction for code generation confirmation\n * Supports both individual strand processing and queue-based batch processing\n */\nexport class InteractiveManager {\n private isInteractiveMode: boolean;\n private processingConfirmation = false;\n private strandQueue = new Map<string, QueuedStrand>();\n\n constructor(interactiveMode = false) {\n this.isInteractiveMode = interactiveMode;\n }\n\n private getDocumentKey(documentType: string, documentId: string): string {\n return `${documentType}:${documentId}`;\n }\n\n /**\n * Add a strand to the queue, replacing any existing strand for the same document\n */\n public queueStrand(strand: CodegenInput): void {\n const documentKey = this.getDocumentKey(\n strand.documentType,\n strand.documentId,\n );\n\n this.strandQueue.set(documentKey, {\n strand,\n timestamp: Date.now(),\n });\n\n logger.debug(\n `>>> Queued strand for ${documentKey}, queue size: ${this.strandQueue.size}`,\n );\n }\n\n /**\n * Get all queued strands\n */\n public getQueuedStrands(): QueuedStrand[] {\n return Array.from(this.strandQueue.values());\n }\n\n /**\n * Clear and return all queued strands\n */\n public clearQueue(): QueuedStrand[] {\n const queuedStrands = Array.from(this.strandQueue.values());\n this.strandQueue.clear();\n return queuedStrands;\n }\n\n /**\n * Get the current queue size\n */\n public getQueueSize(): number {\n return this.strandQueue.size;\n }\n\n private async promptUserConfirmation(): Promise<boolean> {\n return new Promise((resolve) => {\n const rl = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n console.log(\"\\n\" + \"=\".repeat(50));\n console.log(\"🔄 Code generation ready to run.\");\n console.log(\"=\".repeat(50));\n\n process.stdout.write(\n \"Do you want to proceed with code generation? (y/n): \\n\\n\",\n );\n\n rl.on(\"line\", (answer: string) => {\n rl.close();\n console.log(\"\"); // Add blank line after user input\n resolve(answer.toLowerCase() === \"y\" || answer.toLowerCase() === \"yes\");\n });\n });\n }\n\n /**\n * Process generation with user confirmation (legacy single-strand method)\n * This method assumes interactive mode is already enabled (checked by caller)\n */\n public async processWithConfirmation<T>(\n documentType: string,\n generator: () => Promise<T>,\n ): Promise<T | null> {\n if (this.processingConfirmation) {\n logger.debug(\"Already processing confirmation, skipping\");\n return null;\n }\n\n this.processingConfirmation = true;\n\n try {\n // Always prompt user since this method only called in interactive mode\n const shouldProceed = await this.promptUserConfirmation();\n\n if (!shouldProceed) {\n logger.info(`❌ Code generation cancelled by user for ${documentType}`);\n return null;\n }\n\n logger.info(`✅ User approved code generation for ${documentType}`);\n\n const result = await generator();\n return result;\n } catch (error) {\n logger.error(\n `❌ Error during interactive code generation for ${documentType}:`,\n error,\n );\n throw error;\n } finally {\n this.processingConfirmation = false;\n }\n }\n\n /**\n * Process all queued strands with a single user confirmation\n * This is the main method for queue-based interactive processing\n */\n public async processQueueWithConfirmation(\n processor: (strands: QueuedStrand[]) => Promise<void>,\n ): Promise<void> {\n if (this.processingConfirmation) {\n logger.debug(\n \"Already processing confirmation, skipping queue processing\",\n );\n return;\n }\n\n // Check if there are any strands to process\n let queuedStrands = this.getQueuedStrands();\n if (queuedStrands.length === 0) {\n logger.debug(\"No strands in queue to process\");\n return;\n }\n\n this.processingConfirmation = true;\n\n try {\n // Prompt user for confirmation\n const shouldProceed = await this.promptUserConfirmation();\n\n if (!shouldProceed) {\n logger.info(\"❌ Code generation cancelled by user\");\n // Clear the queue since user cancelled\n this.clearQueue();\n return;\n }\n\n // Get and clear the final queue state right before processing\n // (in case new strands were added while waiting for user input)\n queuedStrands = this.clearQueue();\n if (queuedStrands.length === 0) {\n logger.info(\"ℹ️ No documents to process\");\n return;\n }\n\n logger.info(\n `✅ User approved code generation for ${queuedStrands.length} document(s)`,\n );\n\n // Process all queued strands\n await processor(queuedStrands);\n logger.info(\"✅ Code generation completed\");\n } catch (error) {\n logger.error(\n \"❌ Error during interactive queue processing: @error\",\n error,\n );\n throw error;\n } finally {\n this.processingConfirmation = false;\n }\n }\n\n public setInteractiveMode(enabled: boolean): void {\n this.isInteractiveMode = enabled;\n logger.debug(`Interactive mode set to: ${enabled}`);\n }\n\n public isInteractive(): boolean {\n return this.isInteractiveMode;\n }\n\n public isProcessing(): boolean {\n return this.processingConfirmation;\n }\n}\n","import type { Project } from \"ts-morph\";\nimport type { QueuedStrand } from \"../interactive-manager.js\";\nimport { InteractiveManager } from \"../interactive-manager.js\";\nimport { logger } from \"../logger.js\";\nimport type { BaseDocumentGen } from \"./base-document-gen.js\";\nimport type { CodegenInput, Config } from \"./types.js\";\n\nconst DEFAULT_DEBOUNCE_TIME = 1000; // wait 1 second between codegen calls\n\n/**\n * Manager class responsible for routing documents to the correct generator\n * and managing generator registration and instantiation\n */\nexport class DocumentCodegenManager {\n project: Project;\n private generators = new Map<string, BaseDocumentGen>();\n private debounceTimers = new Map<string, NodeJS.Timeout>();\n private processingQueue: Promise<void> = Promise.resolve();\n private interactiveManager: InteractiveManager;\n\n constructor(\n private config: Config,\n project: Project,\n interactiveMode = false,\n ) {\n this.project = project;\n this.interactiveManager = new InteractiveManager(interactiveMode);\n }\n\n /**\n * Register a generator class for a specific document type\n */\n registerGenerator(\n documentType: string,\n generatorClass: new (config: Config, project: Project) => BaseDocumentGen,\n ): void {\n if (this.generators.has(documentType)) {\n logger.warn(\n `⚠️ Generator for document type \"${documentType}\" is already registered. Overwriting.`,\n );\n }\n\n this.generators.set(\n documentType,\n new generatorClass(this.config, this.project),\n );\n logger.debug(`✅ Registered generator for document type: ${documentType}`);\n }\n\n /**\n * Register a generator class that supports multiple document types\n */\n registerMultiTypeGenerator(\n generatorClass: new (config: Config, project: Project) => BaseDocumentGen,\n ): void {\n const generator = new generatorClass(this.config, this.project);\n const supportedTypes = generator.getSupportedDocumentTypes();\n\n for (const documentType of supportedTypes) {\n if (this.generators.has(documentType)) {\n logger.warn(\n `⚠️ Generator for document type \"${documentType}\" is already registered. Overwriting.`,\n );\n }\n this.generators.set(documentType, generator);\n }\n\n logger.debug(\n `✅ Registered multi-type generator for document types: ${supportedTypes.join(\", \")}`,\n );\n }\n\n /**\n * Get a generator instance for the given document type\n * Public method to allow external access for validation\n */\n public getGenerator(documentType: string): BaseDocumentGen | undefined {\n return this.generators.get(documentType);\n }\n\n /**\n * Get all registered document types\n */\n getRegisteredDocumentTypes(): string[] {\n return Array.from(this.generators.keys());\n }\n\n /**\n * Check if a document type is supported\n */\n isDocumentTypeSupported(documentType: string): boolean {\n return this.generators.has(documentType);\n }\n\n /**\n * Route a document to the appropriate generator and handle the generation\n * Handles both interactive and non-interactive modes with queue-based processing\n */\n async routeAndGenerate(strand: CodegenInput): Promise<void> {\n const documentType = strand.documentType;\n\n if (!documentType) {\n logger.error(\"❌ Document type is missing from strand state\");\n throw new Error(\"Document type is missing from strand state\");\n }\n\n const generator = this.getGenerator(documentType);\n\n if (!generator) {\n logger.warn(`⚠️ No generator found for document type: ${documentType}`);\n logger.warn(\n `ℹ️ Supported document types: ${this.getRegisteredDocumentTypes().join(\", \")}`,\n );\n throw new Error(`Unsupported document type: ${documentType}`);\n }\n\n // Validate if this strand should be processed\n if (!generator.shouldProcess(strand)) {\n logger.debug(\n `>>> Generator validation failed for ${documentType}:${strand.documentId}, skipping processing`,\n );\n return;\n }\n\n // Different flow for interactive vs non-interactive mode\n if (this.interactiveManager.isInteractive()) {\n // Interactive mode: queue strands and use debounce timer to trigger batch processing\n logger.debug(\n `>>> Queueing strand for interactive processing: ${documentType}:${strand.documentId}`,\n );\n\n // Add strand to queue (will replace any existing strand for same document)\n this.interactiveManager.queueStrand(strand);\n\n // Clear any existing debounce timer for interactive processing\n const existingTimer = this.debounceTimers.get(\"interactive\");\n if (existingTimer) {\n clearTimeout(existingTimer);\n }\n\n // Set up debounce timer for batch interactive processing\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n const debounceTimer = setTimeout(async () => {\n try {\n await this.interactiveManager.processQueueWithConfirmation(\n async (queuedStrands: QueuedStrand[]) => {\n await this.processQueuedStrands(queuedStrands);\n },\n );\n } catch (error) {\n logger.error(\n \"❌ Error during interactive batch processing: @error\",\n error,\n );\n } finally {\n // Clean up the timer reference\n this.debounceTimers.delete(\"interactive\");\n }\n }, DEFAULT_DEBOUNCE_TIME);\n\n // Store the timer reference using 'interactive' key\n this.debounceTimers.set(\"interactive\", debounceTimer);\n } else {\n // Non-interactive mode: use debouncing per document instance\n // Create unique key for this specific document instance\n const timerKey = `${documentType}:${strand.documentId}`;\n\n // Clear any existing debounce timer for this document instance\n const existingTimer = this.debounceTimers.get(timerKey);\n if (existingTimer) {\n clearTimeout(existingTimer);\n }\n\n // Set up new debounced generation (no interactive confirmation)\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n const debounceTimer = setTimeout(async () => {\n try {\n logger.debug(\n `🔄 Routing document type \"${documentType}\" to generator (debounced)`,\n );\n\n // Direct generation, no interactive confirmation\n await generator.generate(strand);\n logger.debug(\n `✅ Successfully generated code for document type: ${documentType}`,\n );\n } catch (error) {\n logger.error(\n `❌ Error generating code for document type \"${documentType}\":`,\n error,\n );\n // Don't throw - let codegen continue with other documents\n } finally {\n // Clean up the timer reference\n this.debounceTimers.delete(timerKey);\n }\n }, DEFAULT_DEBOUNCE_TIME);\n\n // Store the timer reference\n this.debounceTimers.set(timerKey, debounceTimer);\n }\n }\n\n /**\n * Process multiple strands in priority order (document-model types first)\n */\n private async processQueuedStrands(\n queuedStrands: QueuedStrand[],\n ): Promise<void> {\n logger.debug(`🔄 Processing ${queuedStrands.length} queued strand(s)`);\n\n // Sort by priority (document-model first to ensure dependencies exist)\n const documentModelStrands = queuedStrands.filter(\n (qs: QueuedStrand) =>\n qs.strand.documentType === \"powerhouse/document-model\",\n );\n const otherStrands = queuedStrands.filter(\n (qs: QueuedStrand) =>\n qs.strand.documentType !== \"powerhouse/document-model\",\n );\n\n // Process document models first\n for (const queuedStrand of documentModelStrands) {\n await this.processStrand(queuedStrand.strand);\n }\n\n // Then process other document types\n for (const queuedStrand of otherStrands) {\n await this.processStrand(queuedStrand.strand);\n }\n\n logger.debug(\n `✅ Successfully processed all ${queuedStrands.length} queued strand(s)`,\n );\n }\n\n /**\n * Process a single strand (used internally by processQueuedStrands)\n */\n private async processStrand(strand: CodegenInput): Promise<void> {\n const documentType = strand.documentType;\n const generator = this.getGenerator(documentType);\n\n if (!generator) {\n logger.warn(`⚠️ No generator found for document type: ${documentType}`);\n return;\n }\n\n try {\n logger.debug(`🔄 Generating code for document type: ${documentType}`);\n await generator.generate(strand);\n logger.debug(\n `✅ Successfully generated code for document type: ${documentType}`,\n );\n } catch (error) {\n logger.error(\n `❌ Error generating code for document type \"${documentType}\":`,\n error,\n );\n // Don't throw here to allow other strands to be processed\n }\n }\n\n /**\n * Clear all registered generators\n */\n clearGenerators(): void {\n this.generators.clear();\n logger.debug(\"🧹 Cleared all registered generators\");\n }\n\n /**\n * Get statistics about registered generators\n */\n getStats(): { totalGenerators: number; supportedTypes: string[] } {\n return {\n totalGenerators: this.generators.size,\n supportedTypes: this.getRegisteredDocumentTypes(),\n };\n }\n\n /**\n * Set interactive mode for code generation\n */\n setInteractiveMode(enabled: boolean): void {\n this.interactiveManager.setInteractiveMode(enabled);\n }\n\n /**\n * Check if interactive mode is enabled\n */\n isInteractiveMode(): boolean {\n return this.interactiveManager.isInteractive();\n }\n\n /**\n * Check if the manager is currently processing an interactive confirmation\n */\n isProcessingInteractive(): boolean {\n return this.interactiveManager.isProcessing();\n }\n}\n","import type {\n MinimalBackupData,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport { baseMinimalSaveToFile, baseSaveToFile } from \"document-model/node\";\nimport { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { logger } from \"../../logger.js\";\n\nconst BACKUP_FOLDER = \"backup-documents\";\n\n/**\n * Exports a document to the backup directory.\n * Creates the backup directory if it doesn't exist.\n *\n * @param document - The document to backup\n * @param workingDir - Current working directory\n * @param extension - File extension for the document type (without dot)\n * @param name - Name of the document to use for the backup file (optional)\n * @returns Promise resolving to the backup file path, or undefined if backup failed\n */\nexport async function backupDocument(\n document: PHDocument,\n workingDir: string,\n extension: string = \"\",\n name?: string,\n): Promise<string | undefined> {\n const docName = name ?? document.header.name;\n\n try {\n const backupPath = join(workingDir, BACKUP_FOLDER);\n await mkdir(backupPath, { recursive: true });\n\n const filePath = await baseSaveToFile(\n document,\n backupPath,\n extension,\n docName,\n );\n\n logger.debug(`📁 Document backed up to: ${filePath}`);\n return filePath;\n } catch (error) {\n logger.warn(`⚠️ Failed to backup document \"${docName}\":`, error);\n return undefined;\n }\n}\n\n/**\n * Creates a minimal backup of a document from strand data.\n * Used when the full document is not available (e.g., in onOperations handler).\n */\nexport async function minimalBackupDocument(\n data: MinimalBackupData,\n workingDir: string,\n extension?: string,\n): Promise<string | undefined> {\n try {\n const backupPath = join(workingDir, BACKUP_FOLDER);\n await mkdir(backupPath, { recursive: true });\n\n const filePath = await baseMinimalSaveToFile(\n data,\n backupPath,\n extension ?? \"\",\n );\n\n logger.debug(`Document backed up to: ${filePath}`);\n return filePath;\n } catch (error) {\n logger.warn(`Failed to backup document \"${data.name}\":`, error);\n return undefined;\n }\n}\n","import { generateApp } from \"@powerhousedao/codegen\";\nimport type {\n AppModuleGlobalState,\n AppModulePHState,\n} from \"@powerhousedao/vetra/document-models/app-module\";\nimport { kebabCase } from \"change-case\";\nimport { logger } from \"../../logger.js\";\nimport { BaseDocumentGen } from \"../base-document-gen.js\";\nimport type { CodegenInput } from \"../types.js\";\nimport { minimalBackupDocument } from \"./utils.js\";\n\n/**\n * Generator for app documents\n */\nexport class AppGenerator extends BaseDocumentGen {\n readonly supportedDocumentTypes = \"powerhouse/app\";\n\n /**\n * Parse and extract the global state from the serialized state string\n */\n private extractGlobalState(\n input: CodegenInput,\n ): AppModuleGlobalState | undefined {\n if (!input.state) {\n return undefined;\n }\n const fullState = input.state as AppModulePHState;\n return fullState.global;\n }\n\n /**\n * Validate if this app strand should be processed\n */\n shouldProcess(input: CodegenInput): boolean {\n // First run base validation\n if (!super.shouldProcess(input)) {\n return false;\n }\n\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.debug(`No state found for app: ${input.documentId}`);\n return false;\n }\n\n // Check if we have a valid app name and it's confirmed\n if (!state.name) {\n logger.debug(`No name found for app: ${input.documentId}`);\n return false;\n }\n\n if (state.status !== \"CONFIRMED\") {\n logger.debug(\n `App not confirmed: ${state.name} (status: ${state.status})`,\n );\n return false;\n }\n\n return true;\n }\n\n async generate(input: CodegenInput): Promise<void> {\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.error(`No state found for app: ${input.documentId}`);\n return;\n }\n\n // Check if we have a valid app name and it's confirmed\n if (state.name && state.status === \"CONFIRMED\") {\n logger.info(`🔄 Starting app generation for app: ${state.name}`);\n try {\n // Generate app ID using kebabCase\n const appId: string = kebabCase(state.name);\n // Generate the app using the codegen function\n await generateApp(\n {\n ...this.config.PH_CONFIG,\n appName: state.name,\n appId: appId,\n allowedDocumentTypes: state.allowedDocumentTypes ?? [],\n isDragAndDropEnabled: state.isDragAndDropEnabled,\n },\n this.project,\n );\n await this.project.save();\n\n logger.info(\n `✅ App generation completed successfully for app: ${state.name}`,\n );\n\n // Backup the document\n const fullState = input.state as AppModulePHState;\n await minimalBackupDocument(\n {\n documentId: input.documentId,\n documentType: input.documentType,\n branch: input.branch,\n state: fullState,\n name: state.name,\n },\n this.config.CURRENT_WORKING_DIR,\n );\n } catch (error) {\n logger.error(\n `❌ Error during app generation for app ${state.name}:`,\n error,\n );\n if (error instanceof Error) {\n logger.error(`❌ Error message: ${error.message}`);\n }\n }\n } else {\n if (!state.name) {\n logger.error(`❌ Skipping app generation - missing name for app`);\n return;\n } else if (state.status !== \"CONFIRMED\") {\n logger.error(\n `❌ Skipping app generation - app \"${state.name}\" is not confirmed (status: ${state.status})`,\n );\n return;\n }\n }\n }\n}\n","import { generateEditor } from \"@powerhousedao/codegen\";\nimport { kebabCase } from \"change-case\";\nimport type {\n DocumentEditorPHState,\n DocumentEditorState,\n} from \"../../../../document-models/document-editor/index.js\";\nimport { logger } from \"../../logger.js\";\nimport { BaseDocumentGen } from \"../base-document-gen.js\";\nimport type { CodegenInput } from \"../types.js\";\nimport { minimalBackupDocument } from \"./utils.js\";\n\n/**\n * Generator for document editor documents\n */\nexport class DocumentEditorGenerator extends BaseDocumentGen {\n readonly supportedDocumentTypes = \"powerhouse/document-editor\";\n\n /**\n * Parse and extract the global state from the serialized state string\n */\n private extractGlobalState(\n input: CodegenInput,\n ): DocumentEditorState | undefined {\n if (!input.state) {\n return undefined;\n }\n const fullState = input.state as DocumentEditorPHState;\n return fullState.global;\n }\n\n /**\n * Validate if this document editor strand should be processed\n */\n shouldProcess(input: CodegenInput): boolean {\n // First run base validation\n if (!super.shouldProcess(input)) {\n return false;\n }\n\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.debug(`No state found for document editor: ${input.documentId}`);\n return false;\n }\n\n // Check if we have a valid editor name, document types, and it's confirmed\n if (!state.name) {\n logger.debug(`No name found for document editor: ${input.documentId}`);\n return false;\n }\n\n if (!state.documentTypes || state.documentTypes.length === 0) {\n logger.debug(\n `No document types found for document editor: ${state.name}`,\n );\n return false;\n }\n\n if (state.status !== \"CONFIRMED\") {\n logger.debug(\n `Document editor not confirmed: ${state.name} (status: ${state.status})`,\n );\n return false;\n }\n\n return true;\n }\n\n async generate(input: CodegenInput): Promise<void> {\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.error(`No state found for document editor: ${input.documentId}`);\n return;\n }\n\n // Validation is already done in shouldProcess, so we can proceed directly\n logger.info(`🔄 Starting editor generation for: ${state.name}`);\n try {\n // Extract document types from the state\n const documentTypes = state.documentTypes.map((dt) => dt.documentType);\n\n // Generate editor ID using kebabCase\n const editorId: string = kebabCase(state.name);\n\n // Generate the editor using the codegen function\n await generateEditor(\n {\n ...this.config.PH_CONFIG,\n editorName: state.name,\n documentTypes: documentTypes,\n editorId: editorId,\n },\n this.project,\n );\n await this.project.save();\n\n logger.info(\n `✅ Editor generation completed successfully for: ${state.name}`,\n );\n\n // Backup the document\n const fullState = input.state as DocumentEditorPHState;\n await minimalBackupDocument(\n {\n documentId: input.documentId,\n documentType: input.documentType,\n branch: input.branch,\n state: fullState,\n name: state.name,\n },\n this.config.CURRENT_WORKING_DIR,\n );\n } catch (error) {\n logger.error(\n `❌ Error during editor generation for ${state.name}:`,\n error,\n );\n if (error instanceof Error) {\n logger.error(`❌ Error message: ${error.message}`);\n }\n // Don't throw - let codegen continue with other documents\n return;\n }\n }\n}\n","import {\n generateDocumentModel,\n validateDocumentModelState,\n} from \"@powerhousedao/codegen\";\nimport type {\n DocumentModelGlobalState,\n DocumentModelPHState,\n} from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"../../logger.js\";\nimport { BaseDocumentGen } from \"../base-document-gen.js\";\nimport type { CodegenInput } from \"../types.js\";\nimport { minimalBackupDocument } from \"./utils.js\";\n\n/**\n * Generator for document model documents\n */\nexport class DocumentModelGenerator extends BaseDocumentGen {\n readonly supportedDocumentTypes = \"powerhouse/document-model\";\n\n /**\n * Parse and extract the global state from the serialized state string\n */\n private extractGlobalState(\n input: CodegenInput,\n ): DocumentModelGlobalState | undefined {\n if (!input.state) {\n return undefined;\n }\n const fullState = input.state as DocumentModelPHState;\n return fullState.global;\n }\n\n /**\n * Validate if this document model strand should be processed\n */\n shouldProcess(input: CodegenInput): boolean {\n // First run base validation\n if (!super.shouldProcess(input)) {\n return false;\n }\n\n // Extract the global state from the full document state\n const globalState = this.extractGlobalState(input);\n if (!globalState) {\n logger.debug(\n `>>> No global state found for document model: ${input.documentId}`,\n );\n return false;\n }\n\n const validationResult = validateDocumentModelState(globalState);\n if (!validationResult.isValid) {\n const errorList = validationResult.errors\n .map((error) => ` - ${error}`)\n .join(\"\\n\");\n logger.info(\n `⚠️ Skipped code generation for '${globalState.name || input.documentId}' due to validation errors:\\n${errorList}`,\n );\n return false;\n }\n\n logger.info(\n `Document model ${globalState.name} is valid, proceeding with code generation`,\n );\n\n return true;\n }\n\n async generate(input: CodegenInput): Promise<void> {\n const globalState = this.extractGlobalState(input);\n if (!globalState) {\n logger.error(\n `❌ No global state found for document model: ${input.documentId}`,\n );\n return;\n }\n // Validation is already done in shouldProcess, so we can proceed directly\n logger.debug(\n `🔄 Starting code generation for document model: ${globalState.name}`,\n );\n try {\n await generateDocumentModel(globalState, this.project);\n await this.project.save();\n logger.info(\n `✅ Code generation completed successfully for: ${globalState.name}`,\n );\n\n // Backup the document\n const fullState = input.state as DocumentModelPHState;\n const extension = globalState.extension?.replace(/^\\.+|\\.+$/g, \"\") || \"\";\n await minimalBackupDocument(\n {\n documentId: input.documentId,\n documentType: input.documentType,\n branch: input.branch,\n state: fullState,\n name: globalState.name,\n },\n this.config.CURRENT_WORKING_DIR,\n extension,\n );\n } catch (error) {\n logger.error(\n `❌ Error during code generation for ${globalState.name}:`,\n error,\n );\n // Don't throw - let codegen continue with other documents\n return;\n }\n }\n}\n","import { createOrUpdateManifest } from \"@powerhousedao/codegen/file-builders\";\nimport type {\n VetraPackageGlobalState,\n VetraPackagePHState,\n} from \"../../../../document-models/vetra-package/index.js\";\nimport { logger } from \"../../logger.js\";\nimport { BaseDocumentGen } from \"../base-document-gen.js\";\nimport type { CodegenInput } from \"../types.js\";\nimport { minimalBackupDocument } from \"./utils.js\";\n\n/**\n * Generator for package documents\n */\nexport class PackageGenerator extends BaseDocumentGen {\n readonly supportedDocumentTypes = \"powerhouse/package\";\n\n /**\n * Validate if this package strand should be processed\n */\n shouldProcess(input: CodegenInput): boolean {\n // First run base validation\n if (!super.shouldProcess(input)) {\n return false;\n }\n\n if (!input.state) {\n logger.debug(`>>> No state found for package: ${input.documentId}`);\n return false;\n }\n\n return true;\n }\n\n async generate(input: CodegenInput): Promise<void> {\n const fullState = input.state as VetraPackagePHState;\n const state = fullState.global as VetraPackageGlobalState;\n\n await createOrUpdateManifest(\n {\n name: state.name ?? \"\",\n category: state.category ?? \"\",\n description: state.description ?? \"\",\n publisher: {\n name: state.author?.name ?? \"\",\n url: state.author?.website ?? \"\",\n },\n },\n this.config.CURRENT_WORKING_DIR,\n );\n\n // Backup the document\n await minimalBackupDocument(\n {\n documentId: input.documentId,\n documentType: input.documentType,\n branch: input.branch,\n state: fullState,\n name: \"vetra-package\",\n },\n this.config.CURRENT_WORKING_DIR,\n );\n }\n}\n","import { generateProcessor } from \"@powerhousedao/codegen\";\nimport {\n PROCESSOR_APPS,\n type ProcessorApp,\n type ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport type {\n ProcessorModulePHState,\n ProcessorModuleState,\n} from \"../../../../document-models/processor-module/index.js\";\nimport { logger } from \"../../logger.js\";\nimport { BaseDocumentGen } from \"../base-document-gen.js\";\nimport type { CodegenInput } from \"../types.js\";\nimport { minimalBackupDocument } from \"./utils.js\";\n\n/**\n * Generator for processor documents\n */\nexport class ProcessorGenerator extends BaseDocumentGen {\n readonly supportedDocumentTypes = \"powerhouse/processor\";\n\n /**\n * Parse and extract the global state from the serialized state string\n */\n private extractGlobalState(\n input: CodegenInput,\n ): ProcessorModuleState | undefined {\n if (!input.state) {\n return undefined;\n }\n const fullState = input.state as ProcessorModulePHState;\n return fullState.global;\n }\n\n /**\n * Validate if this processor strand should be processed\n */\n shouldProcess(input: CodegenInput): boolean {\n // First run base validation\n if (!super.shouldProcess(input)) {\n return false;\n }\n\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.debug(`No state found for processor: ${input.documentId}`);\n return false;\n }\n\n // Check if we have a valid processor name, type, document types, and it's confirmed\n if (!state.name) {\n logger.debug(`No name found for processor: ${input.documentId}`);\n return false;\n }\n\n if (!state.type) {\n logger.debug(`No type found for processor: ${state.name}`);\n return false;\n }\n\n if (!state.documentTypes || state.documentTypes.length === 0) {\n logger.debug(`No document types found for processor: ${state.name}`);\n return false;\n }\n\n if (!state.processorApps || state.processorApps.length === 0) {\n logger.debug(`No processor apps found for processor: ${state.name}`);\n return false;\n }\n\n if (state.status !== \"CONFIRMED\") {\n logger.debug(\n `Processor not confirmed: ${state.name} (status: ${state.status})`,\n );\n return false;\n }\n\n return true;\n }\n\n async generate(input: CodegenInput): Promise<void> {\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.error(`No state found for processor: ${input.documentId}`);\n return;\n }\n\n // Check if we have a valid processor name, type, document types, and it's confirmed\n if (\n state.name &&\n state.type &&\n state.documentTypes.length > 0 &&\n state.processorApps.length > 0 &&\n state.status === \"CONFIRMED\"\n ) {\n logger.info(`🔄 Starting processor generation for: ${state.name}`);\n try {\n // Map the type value from document state to generateProcessor expected values\n let processorType: \"analytics\" | \"relationalDb\";\n if (state.type === \"analytics\") {\n processorType = \"analytics\";\n } else if (state.type === \"relational\") {\n processorType = \"relationalDb\";\n } else {\n logger.error(`❌ Unsupported processor type: ${state.type}`);\n return;\n }\n\n // Extract document types from the state\n const documentTypes = state.documentTypes.map((dt) => dt.documentType);\n\n const processorApps = state.processorApps;\n\n if (!isProcessorApps(processorApps)) {\n logger.error(\n `❌ Unsupported processor apps: ${processorApps.join(\", \")}`,\n );\n return;\n }\n\n // Generate the processor using the codegen function\n await generateProcessor(\n {\n processorName: state.name,\n processorType,\n documentTypes,\n processorApps,\n },\n this.project,\n );\n await this.project.save();\n\n logger.info(\n `✅ Processor generation completed successfully for: ${state.name}`,\n );\n\n // Backup the document\n const fullState = input.state as ProcessorModulePHState;\n await minimalBackupDocument(\n {\n documentId: input.documentId,\n documentType: input.documentType,\n branch: input.branch,\n state: fullState,\n name: state.name,\n },\n this.config.CURRENT_WORKING_DIR,\n );\n } catch (error) {\n logger.error(\n `❌ Error during processor generation for ${state.name}:`,\n error,\n );\n if (error instanceof Error) {\n logger.error(`❌ Error message: ${error.message}`);\n }\n }\n } else {\n if (!state.name) {\n logger.error(\n `❌ Skipping processor generation - missing name for processor`,\n );\n return;\n } else if (!state.type) {\n logger.error(\n `❌ Skipping processor generation - missing type for processor \"${state.name}\"`,\n );\n return;\n } else if (state.documentTypes.length === 0) {\n logger.error(\n `❌ Skipping processor generation - missing document types for processor \"${state.name}\"`,\n );\n return;\n } else if (state.status !== \"CONFIRMED\") {\n logger.error(\n `❌ Skipping processor generation - processor \"${state.name}\" is not confirmed (status: ${state.status})`,\n );\n return;\n }\n }\n }\n}\n\nfunction isProcessorApps(input: readonly string[]): input is ProcessorApps {\n if (input.length === 0) return false;\n if (new Set(input).size !== input.length) {\n return false;\n }\n if (!input.every((i) => PROCESSOR_APPS.includes(i as ProcessorApp)))\n return false;\n\n return true;\n}\n","import { generateSubgraph } from \"@powerhousedao/codegen\";\nimport type {\n SubgraphModulePHState,\n SubgraphModuleState,\n} from \"../../../../document-models/subgraph-module/index.js\";\nimport { logger } from \"../../logger.js\";\nimport { BaseDocumentGen } from \"../base-document-gen.js\";\nimport type { CodegenInput } from \"../types.js\";\nimport { minimalBackupDocument } from \"./utils.js\";\n\n/**\n * Generator for subgraph documents\n */\nexport class SubgraphGenerator extends BaseDocumentGen {\n readonly supportedDocumentTypes = \"powerhouse/subgraph\";\n\n /**\n * Parse and extract the global state from the serialized state string\n */\n private extractGlobalState(\n input: CodegenInput,\n ): SubgraphModuleState | undefined {\n if (!input.state) {\n return undefined;\n }\n const fullState = input.state as SubgraphModulePHState;\n return fullState.global;\n }\n\n /**\n * Validate if this subgraph strand should be processed\n */\n shouldProcess(input: CodegenInput): boolean {\n // First run base validation\n if (!super.shouldProcess(input)) {\n return false;\n }\n\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.debug(`No state found for subgraph: ${input.documentId}`);\n return false;\n }\n\n // Check if we have a valid subgraph name and it's confirmed\n if (!state.name) {\n logger.debug(`No name found for subgraph: ${input.documentId}`);\n return false;\n }\n\n if (state.status !== \"CONFIRMED\") {\n logger.debug(\n `Subgraph not confirmed: ${state.name} (status: ${state.status})`,\n );\n return false;\n }\n\n return true;\n }\n\n async generate(input: CodegenInput): Promise<void> {\n const state = this.extractGlobalState(input);\n if (!state) {\n logger.error(`No state found for subgraph: ${input.documentId}`);\n return;\n }\n\n // Check if we have a valid subgraph name and it's confirmed\n if (state.name && state.status === \"CONFIRMED\") {\n logger.info(`🔄 Starting subgraph generation for: ${state.name}`);\n try {\n await generateSubgraph(state.name, this.project);\n await this.project.save();\n logger.info(\n `✅ Subgraph generation completed successfully for: ${state.name}`,\n );\n\n // Backup the document\n const fullState = input.state as SubgraphModulePHState;\n await minimalBackupDocument(\n {\n documentId: input.documentId,\n documentType: input.documentType,\n branch: input.branch,\n state: fullState,\n name: state.name,\n },\n this.config.CURRENT_WORKING_DIR,\n );\n } catch (error) {\n logger.error(\n `❌ Error during subgraph generation for ${state.name}:`,\n error,\n );\n }\n } else {\n if (!state.name) {\n logger.error(\n `❌ Skipping subgraph generation - missing name for subgraph`,\n );\n return;\n } else if (state.status !== \"CONFIRMED\") {\n logger.error(\n `❌ Skipping subgraph generation - subgraph \"${state.name}\" is not confirmed (status: ${state.status})`,\n );\n return;\n }\n }\n }\n}\n","import type { Project } from \"ts-morph\";\nimport type { BaseDocumentGen } from \"./base-document-gen.js\";\nimport { DocumentCodegenManager } from \"./document-codegen-manager.js\";\nimport {\n AppGenerator,\n DocumentEditorGenerator,\n DocumentModelGenerator,\n PackageGenerator,\n ProcessorGenerator,\n SubgraphGenerator,\n} from \"./generators/index.js\";\nimport type { Config } from \"./types.js\";\n\n/**\n * Factory class for creating and configuring DocumentCodegenManager instances\n * with all the standard generators pre-registered\n */\nexport class DocumentCodegenFactory {\n /**\n * Create a DocumentCodegenManager with all standard generators registered\n */\n static createManager(\n config: Config,\n project: Project,\n interactiveMode: boolean = false,\n ): DocumentCodegenManager {\n const manager = new DocumentCodegenManager(\n config,\n project,\n interactiveMode,\n );\n\n // Register all the standard generators\n manager.registerGenerator(\n \"powerhouse/document-model\",\n DocumentModelGenerator,\n );\n manager.registerGenerator(\"powerhouse/package\", PackageGenerator);\n manager.registerGenerator(\"powerhouse/app\", AppGenerator);\n manager.registerGenerator(\n \"powerhouse/document-editor\",\n DocumentEditorGenerator,\n );\n manager.registerGenerator(\"powerhouse/subgraph\", SubgraphGenerator);\n manager.registerGenerator(\"powerhouse/processor\", ProcessorGenerator);\n\n return manager;\n }\n\n /**\n * Create a DocumentCodegenManager with only specific generators\n */\n static createManagerWithGenerators(\n config: Config,\n generators: Array<new (config: Config) => any>,\n project: Project,\n interactiveMode: boolean = false,\n ): DocumentCodegenManager {\n const manager = new DocumentCodegenManager(\n config,\n project,\n interactiveMode,\n );\n\n for (const generatorClass of generators) {\n const generator = new generatorClass(config) as BaseDocumentGen;\n const supportedTypes = generator.getSupportedDocumentTypes();\n\n for (const documentType of supportedTypes) {\n manager.registerGenerator(documentType, generatorClass);\n }\n }\n\n return manager;\n }\n\n /**\n * Get all available generator classes\n */\n static getAvailableGenerators() {\n return {\n DocumentModelGenerator,\n PackageGenerator,\n AppGenerator,\n DocumentEditorGenerator,\n SubgraphGenerator,\n ProcessorGenerator,\n };\n }\n}\n","import type {\n IProcessor,\n OperationWithContext,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PowerhouseConfig } from \"@powerhousedao/shared\";\nimport type { Project } from \"ts-morph\";\nimport type { DocumentCodegenManager } from \"./document-handlers/document-codegen-manager.js\";\nimport { DocumentCodegenFactory } from \"./document-handlers/index.js\";\nimport type { CodegenInput } from \"./document-handlers/types.js\";\nimport { logger } from \"./logger.js\";\n\nexport class CodegenProcessor implements IProcessor {\n private manager: DocumentCodegenManager;\n\n constructor(\n project: Project,\n config: PowerhouseConfig,\n cwd: string,\n interactiveMode = false,\n ) {\n this.manager = DocumentCodegenFactory.createManager(\n {\n PH_CONFIG: config,\n CURRENT_WORKING_DIR: cwd,\n },\n project,\n interactiveMode,\n );\n\n if (interactiveMode) {\n logger.info(`CodegenProcessor initialized with interactive mode enabled`);\n } else {\n logger.debug(\n `CodegenProcessor initialized with interactive mode disabled`,\n );\n }\n }\n\n async onOperations(operations: OperationWithContext[]): Promise<void> {\n logger.info(\"CodegenProcessor.onOperations()\");\n\n for (const { context } of operations) {\n const generator = this.manager.getGenerator(context.documentType);\n if (!generator) {\n logger.debug(\n `No generator found for document type: ${context.documentType}`,\n );\n continue;\n }\n\n const input: CodegenInput = {\n documentId: context.documentId,\n documentType: context.documentType,\n scope: context.scope,\n branch: context.branch,\n state: context.resultingState\n ? JSON.parse(context.resultingState)\n : undefined,\n };\n\n const shouldProcess = generator.shouldProcess(input);\n if (shouldProcess) {\n await this.manager.routeAndGenerate(input);\n }\n }\n }\n\n async onDisconnect() {}\n\n // Utility methods for external configuration and monitoring\n public setInteractiveMode(enabled: boolean): void {\n this.manager.setInteractiveMode(enabled);\n }\n\n public isInteractive(): boolean {\n return this.manager.isInteractiveMode();\n }\n\n public isProcessingInteractive(): boolean {\n return this.manager.isProcessingInteractive();\n }\n}\n","import { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\nimport type { VetraProcessorConfigType } from \"@powerhousedao/config\";\nimport { VETRA_PROCESSOR_CONFIG_KEY } from \"@powerhousedao/config\";\nimport { getConfig } from \"@powerhousedao/config/node\";\nimport type {\n IProcessorHostModule,\n ProcessorFactoryBuilder,\n ProcessorRecord,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocumentHeader } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"./logger.js\";\nimport { CodegenProcessor } from \"./processor.js\";\n\n/**\n * Determines if a drive header matches the Vetra drive criteria.\n * @param driveHeader - The drive header to check\n * @param explicitDriveId - Optional explicit drive ID from config (if set, uses exact match)\n * @returns true if the drive is a Vetra drive, false otherwise\n */\nfunction isDriveVetra(\n driveHeader: PHDocumentHeader,\n driveIdFromConfig?: string,\n): boolean {\n // If explicit drive ID is configured, use exact match\n if (driveIdFromConfig) {\n return (\n driveHeader.slug === driveIdFromConfig ||\n driveHeader.id === driveIdFromConfig\n );\n }\n\n // Otherwise, check if slug/id matches Vetra pattern\n // Matches \"vetra\" exactly or IDs starting with \"vetra-\" (case-insensitive)\n const matchesPattern = (identifier: string): boolean => {\n const lower = identifier.toLowerCase();\n return lower === \"vetra\" || lower.startsWith(\"vetra-\");\n };\n\n return matchesPattern(driveHeader.slug) || matchesPattern(driveHeader.id);\n}\n\nexport const codegenFactoryBuilder: ProcessorFactoryBuilder = (\n module: IProcessorHostModule,\n) => {\n return (driveHeader: PHDocumentHeader): ProcessorRecord[] => {\n const config = getConfig();\n const cwd = process.cwd();\n /* Use one instance of ts-morph project, which handles race conditions */\n const project = buildTsMorphProject(cwd);\n const processorsConfig = module.config ?? new Map<string, unknown>();\n const vetraConfig = processorsConfig.get(VETRA_PROCESSOR_CONFIG_KEY) as\n | VetraProcessorConfigType\n | undefined;\n\n // Check if this drive should use the Vetra processor\n if (!isDriveVetra(driveHeader, vetraConfig?.driveId)) {\n logger.debug(\n `Drive ${driveHeader.slug} is not a Vetra drive, skipping codegen processor`,\n );\n return [];\n }\n\n logger.info(\n `Drive ${driveHeader.slug} is a Vetra drive, using codegen processor`,\n );\n const processor = new CodegenProcessor(\n project,\n config,\n cwd,\n vetraConfig?.interactive,\n );\n return [\n {\n processor,\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n documentType: [\n \"powerhouse/document-model\",\n \"powerhouse/package\",\n \"powerhouse/document-editor\",\n \"powerhouse/subgraph\",\n \"powerhouse/processor\",\n \"powerhouse/app\",\n ],\n scope: [\"global\"],\n },\n },\n ];\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAsB,kBAAtB,MAAsC;CAMpC;CAEA,YACE,QACA,SACA;AAFU,OAAA,SAAA;AAGV,OAAK,UAAU;;;;;CAYjB,qBAAqB,cAA+B;AAClD,MAAI,OAAO,KAAK,2BAA2B,SACzC,QAAO,KAAK,2BAA2B;AA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AAe,YAAY,GAAG;;AAG3E,MAAa,yBACX,WACG;AACH,SAAQ,gBAAqD;EAC3D,MAAM,SAAS,WAAW;EAC1B,MAAM,MAAM,QAAQ,KAAK;EAEzB,MAAM,UAAU,oBAAoB,IAAI;EAExC,MAAM,eADmB,OAAO,0BAAU,IAAI,KAAsB,EAC/B,IAAI,2BAA2B;AAKpE,MAAI,CAAC,aAAa,aAAa,aAAa,QAAQ,EAAE;AACpD,UAAO,MACL,SAAS,YAAY,KAAK,mDAC3B;AACD,UAAO,EAAE;;AAGX,SAAO,KACL,SAAS,YAAY,KAAK,4CAC3B;AAOD,SAAO,CACL;GACE,WARc,IAAI,iBACpB,SACA,QACA,KACA,aAAa,YACd;GAIG,QAAQ;IACN,QAAQ,CAAC,OAAO;IAChB,YAAY,CAAC,IAAI;IACjB,cAAc;KACZ;KACA;KACA;KACA;KACA;KACA;KACD;IACD,OAAO,CAAC,SAAS;IAClB;GACF,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-
|
|
1
|
+
{"version":3,"file":"hooks-Btogj1f0.js","names":[],"sources":["../editors/hooks/useAvailableDocumentTypes.ts","../editors/hooks/useDebounce.ts"],"sourcesContent":["import {\n useDocumentsInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentModelDocument,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\n\nfunction isDocumentModelDocument(\n document: PHDocument,\n): document is DocumentModelDocument {\n return document.header.documentType === \"powerhouse/document-model\";\n}\n\nexport function useAvailableDocumentTypes(\n onlyDocumentTypesFromDriveDocuments = false,\n): string[] {\n const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];\n const documents = useDocumentsInSelectedDrive() ?? [];\n const documentModelDocumentsInSelectedDrive = documents.filter(\n isDocumentModelDocument,\n );\n const documentTypesFromDocumentModelDocuments =\n documentModelDocumentsInSelectedDrive.map((doc) => doc.state.global.id);\n\n if (onlyDocumentTypesFromDriveDocuments)\n return [...new Set(documentTypesFromDocumentModelDocuments)];\n\n return [\n ...new Set([\n ...supportedDocumentTypes,\n ...documentTypesFromDocumentModelDocuments,\n ]),\n ];\n}\n","import { useEffect } from \"react\";\n\n/**\n * Reusable debounce hook that calls a callback function after a specified delay\n * when the value changes. Useful for API calls, search inputs, etc.\n *\n * @param value - The value to debounce\n * @param callback - Function to call with the debounced value (optional)\n * @param delay - Delay in milliseconds\n */\nexport function useDebounce<T>(\n value: T,\n callback: ((value: T) => void) | undefined,\n delay: number,\n) {\n useEffect(() => {\n if (!callback) return;\n\n const timer = setTimeout(() => {\n callback(value);\n }, delay);\n\n return () => clearTimeout(timer);\n }, [value, callback, delay]);\n}\n"],"mappings":";;;AASA,SAAS,wBACP,UACmC;AACnC,QAAO,SAAS,OAAO,iBAAiB;;AAG1C,SAAgB,0BACd,sCAAsC,OAC5B;CACV,MAAM,yBAAyB,oCAAoC,IAAI,EAAE;CAKzE,MAAM,2CAJY,6BAA6B,IAAI,EAAE,EACG,OACtD,wBACD,CAEuC,KAAK,QAAQ,IAAI,MAAM,OAAO,GAAG;AAEzE,KAAI,oCACF,QAAO,CAAC,GAAG,IAAI,IAAI,wCAAwC,CAAC;AAE9D,QAAO,CACL,GAAG,IAAI,IAAI,CACT,GAAG,wBACH,GAAG,wCACJ,CAAC,CACH;;;;;;;;;;;;ACxBH,SAAgB,YACd,OACA,UACA,OACA;AACA,iBAAgB;AACd,MAAI,CAAC,SAAU;EAEf,MAAM,QAAQ,iBAAiB;AAC7B,YAAS,MAAM;KACd,MAAM;AAET,eAAa,aAAa,MAAM;IAC/B;EAAC;EAAO;EAAU;EAAM,CAAC"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import * as document_model0 from "document-model";
|
|
2
|
+
import { Action, DocumentModelGlobalState, DocumentModelUtils, PHAuthState, PHBaseState, PHDocument, PHDocumentController, PHDocumentState, Reducer, SignalDispatch } from "document-model";
|
|
3
|
+
import * as z$1 from "zod";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
6
|
+
|
|
7
|
+
//#region document-models/subgraph-module/v1/gen/schema/types.d.ts
|
|
8
|
+
type Maybe<T> = T | null | undefined;
|
|
9
|
+
type InputMaybe<T> = T | null | undefined;
|
|
10
|
+
type Exact<T extends {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}> = { [K in keyof T]: T[K] };
|
|
13
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
14
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
15
|
+
type MakeEmpty<T extends {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}, K extends keyof T> = { [_ in K]?: never };
|
|
18
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
19
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
20
|
+
type Scalars = {
|
|
21
|
+
ID: {
|
|
22
|
+
input: string;
|
|
23
|
+
output: string;
|
|
24
|
+
};
|
|
25
|
+
String: {
|
|
26
|
+
input: string;
|
|
27
|
+
output: string;
|
|
28
|
+
};
|
|
29
|
+
Boolean: {
|
|
30
|
+
input: boolean;
|
|
31
|
+
output: boolean;
|
|
32
|
+
};
|
|
33
|
+
Int: {
|
|
34
|
+
input: number;
|
|
35
|
+
output: number;
|
|
36
|
+
};
|
|
37
|
+
Float: {
|
|
38
|
+
input: number;
|
|
39
|
+
output: number;
|
|
40
|
+
};
|
|
41
|
+
Address: {
|
|
42
|
+
input: `${string}:0x${string}`;
|
|
43
|
+
output: `${string}:0x${string}`;
|
|
44
|
+
};
|
|
45
|
+
Amount: {
|
|
46
|
+
input: {
|
|
47
|
+
unit?: string;
|
|
48
|
+
value?: number;
|
|
49
|
+
};
|
|
50
|
+
output: {
|
|
51
|
+
unit?: string;
|
|
52
|
+
value?: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
Amount_Crypto: {
|
|
56
|
+
input: {
|
|
57
|
+
unit: string;
|
|
58
|
+
value: string;
|
|
59
|
+
};
|
|
60
|
+
output: {
|
|
61
|
+
unit: string;
|
|
62
|
+
value: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
Amount_Currency: {
|
|
66
|
+
input: {
|
|
67
|
+
unit: string;
|
|
68
|
+
value: string;
|
|
69
|
+
};
|
|
70
|
+
output: {
|
|
71
|
+
unit: string;
|
|
72
|
+
value: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
Amount_Fiat: {
|
|
76
|
+
input: {
|
|
77
|
+
unit: string;
|
|
78
|
+
value: number;
|
|
79
|
+
};
|
|
80
|
+
output: {
|
|
81
|
+
unit: string;
|
|
82
|
+
value: number;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
Amount_Money: {
|
|
86
|
+
input: number;
|
|
87
|
+
output: number;
|
|
88
|
+
};
|
|
89
|
+
Amount_Percentage: {
|
|
90
|
+
input: number;
|
|
91
|
+
output: number;
|
|
92
|
+
};
|
|
93
|
+
Amount_Tokens: {
|
|
94
|
+
input: number;
|
|
95
|
+
output: number;
|
|
96
|
+
};
|
|
97
|
+
Attachment: {
|
|
98
|
+
input: string;
|
|
99
|
+
output: string;
|
|
100
|
+
};
|
|
101
|
+
Currency: {
|
|
102
|
+
input: string;
|
|
103
|
+
output: string;
|
|
104
|
+
};
|
|
105
|
+
Date: {
|
|
106
|
+
input: string;
|
|
107
|
+
output: string;
|
|
108
|
+
};
|
|
109
|
+
DateTime: {
|
|
110
|
+
input: string;
|
|
111
|
+
output: string;
|
|
112
|
+
};
|
|
113
|
+
EmailAddress: {
|
|
114
|
+
input: string;
|
|
115
|
+
output: string;
|
|
116
|
+
};
|
|
117
|
+
EthereumAddress: {
|
|
118
|
+
input: string;
|
|
119
|
+
output: string;
|
|
120
|
+
};
|
|
121
|
+
OID: {
|
|
122
|
+
input: string;
|
|
123
|
+
output: string;
|
|
124
|
+
};
|
|
125
|
+
OLabel: {
|
|
126
|
+
input: string;
|
|
127
|
+
output: string;
|
|
128
|
+
};
|
|
129
|
+
PHID: {
|
|
130
|
+
input: string;
|
|
131
|
+
output: string;
|
|
132
|
+
};
|
|
133
|
+
URL: {
|
|
134
|
+
input: string;
|
|
135
|
+
output: string;
|
|
136
|
+
};
|
|
137
|
+
Unknown: {
|
|
138
|
+
input: unknown;
|
|
139
|
+
output: unknown;
|
|
140
|
+
};
|
|
141
|
+
Upload: {
|
|
142
|
+
input: File;
|
|
143
|
+
output: File;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
type SetSubgraphNameInput = {
|
|
147
|
+
name: Scalars["String"]["input"];
|
|
148
|
+
};
|
|
149
|
+
type SetSubgraphStatusInput = {
|
|
150
|
+
status: StatusType;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Lifecycle status of a module definition.
|
|
154
|
+
* - DRAFT: still being edited; codegen does not run.
|
|
155
|
+
* - CONFIRMED: locked in; codegen produces the corresponding scaffold.
|
|
156
|
+
*/
|
|
157
|
+
type StatusType = "CONFIRMED" | "DRAFT";
|
|
158
|
+
/**
|
|
159
|
+
* Configuration for a GraphQL subgraph contributed by the package. The subgraph
|
|
160
|
+
* is served by Switchboard and stitched into the unified Powerhouse API.
|
|
161
|
+
*/
|
|
162
|
+
type SubgraphModuleState = {
|
|
163
|
+
/** Display name of the subgraph. Also determines the generated folder name under `subgraphs/` and the route segment Switchboard mounts it at. */name: Scalars["String"]["output"]; /** Lifecycle status. While DRAFT the subgraph definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation. */
|
|
164
|
+
status: StatusType;
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region document-models/subgraph-module/v1/gen/types.d.ts
|
|
168
|
+
type SubgraphModuleLocalState = Record<PropertyKey, never>;
|
|
169
|
+
type SubgraphModulePHState = PHBaseState & {
|
|
170
|
+
global: SubgraphModuleState;
|
|
171
|
+
local: SubgraphModuleLocalState;
|
|
172
|
+
};
|
|
173
|
+
type SubgraphModuleDocument = PHDocument<SubgraphModulePHState>;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region document-models/subgraph-module/v1/gen/base-operations/actions.d.ts
|
|
176
|
+
type SetSubgraphNameAction = Action & {
|
|
177
|
+
type: "SET_SUBGRAPH_NAME";
|
|
178
|
+
input: SetSubgraphNameInput;
|
|
179
|
+
};
|
|
180
|
+
type SetSubgraphStatusAction = Action & {
|
|
181
|
+
type: "SET_SUBGRAPH_STATUS";
|
|
182
|
+
input: SetSubgraphStatusInput;
|
|
183
|
+
};
|
|
184
|
+
type SubgraphModuleBaseOperationsAction = SetSubgraphNameAction | SetSubgraphStatusAction;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region document-models/subgraph-module/v1/gen/actions.d.ts
|
|
187
|
+
type SubgraphModuleAction = SubgraphModuleBaseOperationsAction;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region document-models/subgraph-module/v1/gen/base-operations/operations.d.ts
|
|
190
|
+
interface SubgraphModuleBaseOperationsOperations {
|
|
191
|
+
setSubgraphNameOperation: (state: SubgraphModuleState, action: SetSubgraphNameAction, dispatch?: SignalDispatch) => void;
|
|
192
|
+
setSubgraphStatusOperation: (state: SubgraphModuleState, action: SetSubgraphStatusAction, dispatch?: SignalDispatch) => void;
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region document-models/subgraph-module/v1/gen/controller.d.ts
|
|
196
|
+
declare const SubgraphModuleController: new (initialDocument?: document_model0.PHDocument<SubgraphModulePHState> | undefined) => PHDocumentController<SubgraphModulePHState> & document_model0.ActionMap<SubgraphModuleBaseOperationsAction, PHDocumentController<SubgraphModulePHState>>;
|
|
197
|
+
declare namespace creators_d_exports {
|
|
198
|
+
export { setSubgraphName, setSubgraphStatus };
|
|
199
|
+
}
|
|
200
|
+
declare const setSubgraphName: (input: SetSubgraphNameInput) => SetSubgraphNameAction;
|
|
201
|
+
declare const setSubgraphStatus: (input: SetSubgraphStatusInput) => SetSubgraphStatusAction;
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region document-models/subgraph-module/v1/gen/document-model.d.ts
|
|
204
|
+
declare const documentModel: DocumentModelGlobalState;
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region document-models/subgraph-module/v1/gen/document-schema.d.ts
|
|
207
|
+
/** Schema for validating the header object of a SubgraphModule document */
|
|
208
|
+
declare const SubgraphModuleDocumentHeaderSchema: z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
createdAtUtcIso: z.ZodString;
|
|
212
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
213
|
+
documentType: z.ZodLiteral<"powerhouse/subgraph">;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
/** Schema for validating the state object of a SubgraphModule document */
|
|
216
|
+
declare const SubgraphModulePHStateSchema: z.ZodObject<{
|
|
217
|
+
global: z.ZodObject<Required<{
|
|
218
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
219
|
+
status: z.ZodType<StatusType, unknown, z.core.$ZodTypeInternals<StatusType, unknown>>;
|
|
220
|
+
}>, z.core.$strip>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
declare const SubgraphModuleDocumentSchema: z.ZodObject<{
|
|
223
|
+
header: z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
createdAtUtcIso: z.ZodString;
|
|
227
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
228
|
+
documentType: z.ZodLiteral<"powerhouse/subgraph">;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
state: z.ZodObject<{
|
|
231
|
+
global: z.ZodObject<Required<{
|
|
232
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
233
|
+
status: z.ZodType<StatusType, unknown, z.core.$ZodTypeInternals<StatusType, unknown>>;
|
|
234
|
+
}>, z.core.$strip>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
initialState: z.ZodObject<{
|
|
237
|
+
global: z.ZodObject<Required<{
|
|
238
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
239
|
+
status: z.ZodType<StatusType, unknown, z.core.$ZodTypeInternals<StatusType, unknown>>;
|
|
240
|
+
}>, z.core.$strip>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
/** Simple helper function to check if a state object is a SubgraphModule document state object */
|
|
244
|
+
declare function isSubgraphModuleState(state: unknown): state is SubgraphModulePHState;
|
|
245
|
+
/** Simple helper function to assert that a document state object is a SubgraphModule document state object */
|
|
246
|
+
declare function assertIsSubgraphModuleState(state: unknown): asserts state is SubgraphModulePHState;
|
|
247
|
+
/** Simple helper function to check if a document is a SubgraphModule document */
|
|
248
|
+
declare function isSubgraphModuleDocument(document: unknown): document is SubgraphModuleDocument;
|
|
249
|
+
/** Simple helper function to assert that a document is a SubgraphModule document */
|
|
250
|
+
declare function assertIsSubgraphModuleDocument(document: unknown): asserts document is SubgraphModuleDocument;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region document-models/subgraph-module/v1/gen/document-type.d.ts
|
|
253
|
+
/**
|
|
254
|
+
* WARNING: DO NOT EDIT
|
|
255
|
+
* This file is auto-generated and updated by codegen
|
|
256
|
+
*/
|
|
257
|
+
declare const subgraphModuleDocumentType = "powerhouse/subgraph";
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region document-models/subgraph-module/v1/gen/ph-factories.d.ts
|
|
260
|
+
declare function defaultGlobalState(): SubgraphModuleState;
|
|
261
|
+
declare function defaultLocalState(): SubgraphModuleLocalState;
|
|
262
|
+
declare function defaultPHState(): SubgraphModulePHState;
|
|
263
|
+
declare function createState$1(baseState?: Partial<PHBaseState>, globalState?: Partial<SubgraphModuleState>, localState?: Partial<SubgraphModuleLocalState>): SubgraphModulePHState;
|
|
264
|
+
/**
|
|
265
|
+
* Creates a SubgraphModuleDocument with custom global and local state
|
|
266
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
267
|
+
* document-specific state to be set.
|
|
268
|
+
*/
|
|
269
|
+
declare function createSubgraphModuleDocument(state?: Partial<{
|
|
270
|
+
auth?: Partial<PHAuthState>;
|
|
271
|
+
document?: Partial<PHDocumentState>;
|
|
272
|
+
global?: Partial<SubgraphModuleState>;
|
|
273
|
+
local?: Partial<SubgraphModuleLocalState>;
|
|
274
|
+
}>): SubgraphModuleDocument;
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region document-models/subgraph-module/v1/actions.d.ts
|
|
277
|
+
/** Actions for the SubgraphModule document model */
|
|
278
|
+
declare const actions: {
|
|
279
|
+
setSubgraphName: (input: SetSubgraphNameInput) => SetSubgraphNameAction;
|
|
280
|
+
setSubgraphStatus: (input: SetSubgraphStatusInput) => SetSubgraphStatusAction;
|
|
281
|
+
setName: (name: string | {
|
|
282
|
+
name: string;
|
|
283
|
+
}) => document_model0.SetNameAction;
|
|
284
|
+
setPreferredEditor: (input: string | null | {
|
|
285
|
+
preferredEditor: string | null;
|
|
286
|
+
}) => document_model0.SetPreferredEditorAction;
|
|
287
|
+
undo: (count?: number, scope?: string) => document_model0.UndoAction;
|
|
288
|
+
redo: (count?: number, scope?: string) => document_model0.RedoAction;
|
|
289
|
+
prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
|
|
290
|
+
loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
|
|
291
|
+
name: string;
|
|
292
|
+
}, operations: number) => document_model0.LoadStateAction;
|
|
293
|
+
noop: (scope?: string) => document_model0.NOOPAction;
|
|
294
|
+
};
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region document-models/subgraph-module/v1/hooks.d.ts
|
|
297
|
+
/** Hook to get a SubgraphModule document by its id */
|
|
298
|
+
declare function useSubgraphModuleDocumentById(documentId: string | null | undefined): [SubgraphModuleDocument, DocumentDispatch<SubgraphModuleAction>] | [undefined, undefined];
|
|
299
|
+
/** Hook to get the selected SubgraphModule document */
|
|
300
|
+
declare function useSelectedSubgraphModuleDocument(): [SubgraphModuleDocument, DocumentDispatch<SubgraphModuleAction>];
|
|
301
|
+
/** Hook to get all SubgraphModule documents in the selected drive */
|
|
302
|
+
declare function useSubgraphModuleDocumentsInSelectedDrive(): SubgraphModuleDocument[] | undefined;
|
|
303
|
+
/** Hook to get all SubgraphModule documents in the selected folder */
|
|
304
|
+
declare function useSubgraphModuleDocumentsInSelectedFolder(): SubgraphModuleDocument[] | undefined;
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region document-models/subgraph-module/v1/module.d.ts
|
|
307
|
+
/** Document model module for the SubgraphModule document type */
|
|
308
|
+
declare const SubgraphModule: {
|
|
309
|
+
readonly version: 1;
|
|
310
|
+
readonly reducer: document_model0.Reducer<SubgraphModulePHState>;
|
|
311
|
+
readonly actions: {
|
|
312
|
+
setSubgraphName: (input: SetSubgraphNameInput) => SetSubgraphNameAction;
|
|
313
|
+
setSubgraphStatus: (input: SetSubgraphStatusInput) => SetSubgraphStatusAction;
|
|
314
|
+
setName: (name: string | {
|
|
315
|
+
name: string;
|
|
316
|
+
}) => document_model0.SetNameAction;
|
|
317
|
+
setPreferredEditor: (input: string | null | {
|
|
318
|
+
preferredEditor: string | null;
|
|
319
|
+
}) => document_model0.SetPreferredEditorAction;
|
|
320
|
+
undo: (count?: number, scope?: string) => document_model0.UndoAction;
|
|
321
|
+
redo: (count?: number, scope?: string) => document_model0.RedoAction;
|
|
322
|
+
prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
|
|
323
|
+
loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
|
|
324
|
+
name: string;
|
|
325
|
+
}, operations: number) => document_model0.LoadStateAction;
|
|
326
|
+
noop: (scope?: string) => document_model0.NOOPAction;
|
|
327
|
+
};
|
|
328
|
+
readonly utils: document_model0.DocumentModelUtils<SubgraphModulePHState>;
|
|
329
|
+
readonly documentModel: document_model0.DocumentModelPHState;
|
|
330
|
+
};
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region document-models/subgraph-module/v1/utils.d.ts
|
|
333
|
+
/** Utils for the SubgraphModule document model */
|
|
334
|
+
declare const utils: DocumentModelUtils<SubgraphModulePHState>;
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region document-models/subgraph-module/v1/gen/reducer.d.ts
|
|
337
|
+
declare const reducer: Reducer<SubgraphModulePHState>;
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region document-models/subgraph-module/v1/gen/schema/zod.d.ts
|
|
340
|
+
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]> }>;
|
|
341
|
+
type definedNonNullAny = {};
|
|
342
|
+
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
343
|
+
declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
344
|
+
declare const StatusTypeSchema: z$1.ZodEnum<{
|
|
345
|
+
CONFIRMED: "CONFIRMED";
|
|
346
|
+
DRAFT: "DRAFT";
|
|
347
|
+
}>;
|
|
348
|
+
declare function SetSubgraphNameInputSchema(): z$1.ZodObject<Properties<SetSubgraphNameInput>>;
|
|
349
|
+
declare function SetSubgraphStatusInputSchema(): z$1.ZodObject<Properties<SetSubgraphStatusInput>>;
|
|
350
|
+
declare function SubgraphModuleStateSchema(): z$1.ZodObject<Properties<SubgraphModuleState>>;
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region document-models/subgraph-module/v1/gen/utils.d.ts
|
|
353
|
+
declare const initialGlobalState: SubgraphModuleState;
|
|
354
|
+
declare const initialLocalState: SubgraphModuleLocalState;
|
|
355
|
+
//#endregion
|
|
356
|
+
export { StatusType as $, documentModel as A, SubgraphModuleDocument as B, SubgraphModuleDocumentHeaderSchema as C, assertIsSubgraphModuleState as D, assertIsSubgraphModuleDocument as E, SubgraphModuleBaseOperationsOperations as F, InputMaybe as G, SubgraphModulePHState as H, SubgraphModuleAction as I, MakeOptional as J, MakeEmpty as K, SetSubgraphNameAction as L, setSubgraphName as M, setSubgraphStatus as N, isSubgraphModuleDocument as O, SubgraphModuleController as P, SetSubgraphStatusInput as Q, SetSubgraphStatusAction as R, subgraphModuleDocumentType as S, SubgraphModulePHStateSchema as T, Exact as U, SubgraphModuleLocalState as V, Incremental as W, Scalars as X, Maybe as Y, SetSubgraphNameInput as Z, createState$1 as _, StatusTypeSchema as a, defaultLocalState as b, isDefinedNonNullAny as c, SubgraphModule as d, SubgraphModuleState as et, useSelectedSubgraphModuleDocument as f, actions as g, useSubgraphModuleDocumentsInSelectedFolder as h, SetSubgraphStatusInputSchema as i, creators_d_exports as j, isSubgraphModuleState as k, reducer as l, useSubgraphModuleDocumentsInSelectedDrive as m, initialLocalState as n, SubgraphModuleStateSchema as o, useSubgraphModuleDocumentById as p, MakeMaybe as q, SetSubgraphNameInputSchema as r, definedNonNullAnySchema as s, initialGlobalState as t, utils as u, createSubgraphModuleDocument as v, SubgraphModuleDocumentSchema as w, defaultPHState as x, defaultGlobalState as y, SubgraphModuleBaseOperationsAction as z };
|
|
357
|
+
//# sourceMappingURL=index-BPoF8P3O.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BPoF8P3O.d.ts","names":[],"sources":["../document-models/subgraph-module/v1/gen/schema/types.ts","../document-models/subgraph-module/v1/gen/types.ts","../document-models/subgraph-module/v1/gen/base-operations/actions.ts","../document-models/subgraph-module/v1/gen/actions.ts","../document-models/subgraph-module/v1/gen/base-operations/operations.ts","../document-models/subgraph-module/v1/gen/controller.ts","../document-models/subgraph-module/v1/gen/base-operations/creators.ts","../document-models/subgraph-module/v1/gen/document-model.ts","../document-models/subgraph-module/v1/gen/document-schema.ts","../document-models/subgraph-module/v1/gen/document-type.ts","../document-models/subgraph-module/v1/gen/ph-factories.ts","../document-models/subgraph-module/v1/actions.ts","../document-models/subgraph-module/v1/hooks.ts","../document-models/subgraph-module/v1/module.ts","../document-models/subgraph-module/v1/utils.ts","../document-models/subgraph-module/v1/gen/reducer.ts","../document-models/subgraph-module/v1/gen/schema/zod.ts","../document-models/subgraph-module/v1/gen/utils.ts"],"mappings":";;;;;;;KAAY,KAAA,MAAW,CAAA;AAAA,KACX,UAAA,MAAgB,CAAA;AAAA,KAChB,KAAA;EAAA,CAAmB,GAAA;AAAA,mBACjB,CAAA,GAAI,CAAA,CAAE,CAAA;AAAA,KAER,YAAA,oBAAgC,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,iBAC5C,CAAA,IAAK,KAAA,CAAM,CAAA,CAAE,MAAA;AAAA,KAEd,SAAA,oBAA6B,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,iBACzC,CAAA,GAAI,KAAA,CAAM,CAAA,CAAE,MAAA;AAAA,KAEb,SAAA;EAAA,CACG,GAAA;AAAA,mBACG,CAAA,YACN,CAAA;AAAA,KACA,WAAA,MACR,CAAA,iBAEc,CAAA,IAAK,CAAA,2CAA4C,CAAA,CAAE,CAAA;;KAGzD,OAAA;EACV,EAAA;IAAM,KAAA;IAAe,MAAA;EAAA;EACrB,MAAA;IAAU,KAAA;IAAe,MAAA;EAAA;EACzB,OAAA;IAAW,KAAA;IAAgB,MAAA;EAAA;EAC3B,GAAA;IAAO,KAAA;IAAe,MAAA;EAAA;EACtB,KAAA;IAAS,KAAA;IAAe,MAAA;EAAA;EACxB,OAAA;IAAW,KAAA;IAAgC,MAAA;EAAA;EAC3C,MAAA;IACE,KAAA;MAAS,IAAA;MAAe,KAAA;IAAA;IACxB,MAAA;MAAU,IAAA;MAAe,KAAA;IAAA;EAAA;EAE3B,aAAA;IACE,KAAA;MAAS,IAAA;MAA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