@powerhousedao/vetra 4.1.0-dev.30 → 4.1.0-dev.32

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.
Files changed (99) hide show
  1. package/dist/document-models/app-module/gen/object.d.ts +2 -2
  2. package/dist/document-models/app-module/gen/object.d.ts.map +1 -1
  3. package/dist/document-models/app-module/gen/object.js.map +1 -1
  4. package/dist/document-models/app-module/gen/types.d.ts +2 -2
  5. package/dist/document-models/app-module/gen/types.d.ts.map +1 -1
  6. package/dist/document-models/app-module/gen/utils.d.ts.map +1 -1
  7. package/dist/document-models/app-module/gen/utils.js +3 -6
  8. package/dist/document-models/app-module/gen/utils.js.map +1 -1
  9. package/dist/document-models/app-module/index.d.ts +0 -1
  10. package/dist/document-models/app-module/index.d.ts.map +1 -1
  11. package/dist/document-models/document-editor/gen/object.d.ts +2 -2
  12. package/dist/document-models/document-editor/gen/object.d.ts.map +1 -1
  13. package/dist/document-models/document-editor/gen/object.js.map +1 -1
  14. package/dist/document-models/document-editor/gen/types.d.ts +2 -2
  15. package/dist/document-models/document-editor/gen/types.d.ts.map +1 -1
  16. package/dist/document-models/document-editor/gen/utils.d.ts.map +1 -1
  17. package/dist/document-models/document-editor/gen/utils.js +3 -6
  18. package/dist/document-models/document-editor/gen/utils.js.map +1 -1
  19. package/dist/document-models/document-editor/index.d.ts +0 -1
  20. package/dist/document-models/document-editor/index.d.ts.map +1 -1
  21. package/dist/document-models/processor-module/gen/object.d.ts +2 -2
  22. package/dist/document-models/processor-module/gen/object.d.ts.map +1 -1
  23. package/dist/document-models/processor-module/gen/object.js.map +1 -1
  24. package/dist/document-models/processor-module/gen/types.d.ts +2 -2
  25. package/dist/document-models/processor-module/gen/types.d.ts.map +1 -1
  26. package/dist/document-models/processor-module/gen/utils.d.ts.map +1 -1
  27. package/dist/document-models/processor-module/gen/utils.js +3 -6
  28. package/dist/document-models/processor-module/gen/utils.js.map +1 -1
  29. package/dist/document-models/processor-module/index.d.ts +0 -1
  30. package/dist/document-models/processor-module/index.d.ts.map +1 -1
  31. package/dist/document-models/subgraph-module/gen/object.d.ts +2 -2
  32. package/dist/document-models/subgraph-module/gen/object.d.ts.map +1 -1
  33. package/dist/document-models/subgraph-module/gen/object.js.map +1 -1
  34. package/dist/document-models/subgraph-module/gen/types.d.ts +2 -2
  35. package/dist/document-models/subgraph-module/gen/types.d.ts.map +1 -1
  36. package/dist/document-models/subgraph-module/gen/utils.d.ts.map +1 -1
  37. package/dist/document-models/subgraph-module/gen/utils.js +3 -6
  38. package/dist/document-models/subgraph-module/gen/utils.js.map +1 -1
  39. package/dist/document-models/subgraph-module/index.d.ts +0 -1
  40. package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
  41. package/dist/document-models/vetra-package/gen/object.d.ts +2 -2
  42. package/dist/document-models/vetra-package/gen/object.d.ts.map +1 -1
  43. package/dist/document-models/vetra-package/gen/object.js.map +1 -1
  44. package/dist/document-models/vetra-package/gen/types.d.ts +2 -2
  45. package/dist/document-models/vetra-package/gen/types.d.ts.map +1 -1
  46. package/dist/document-models/vetra-package/gen/utils.d.ts.map +1 -1
  47. package/dist/document-models/vetra-package/gen/utils.js +3 -6
  48. package/dist/document-models/vetra-package/gen/utils.js.map +1 -1
  49. package/dist/document-models/vetra-package/index.d.ts +0 -1
  50. package/dist/document-models/vetra-package/index.d.ts.map +1 -1
  51. package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
  52. package/dist/editors/document-editor/components/DocumentEditorForm.js +18 -14
  53. package/dist/editors/document-editor/components/DocumentEditorForm.js.map +1 -1
  54. package/dist/processors/codegen/document-handlers/base-document-gen.d.ts +5 -0
  55. package/dist/processors/codegen/document-handlers/base-document-gen.d.ts.map +1 -1
  56. package/dist/processors/codegen/document-handlers/base-document-gen.js +16 -0
  57. package/dist/processors/codegen/document-handlers/base-document-gen.js.map +1 -1
  58. package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts +2 -2
  59. package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts.map +1 -1
  60. package/dist/processors/codegen/document-handlers/document-codegen-factory.js +4 -4
  61. package/dist/processors/codegen/document-handlers/document-codegen-factory.js.map +1 -1
  62. package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts +24 -1
  63. package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts.map +1 -1
  64. package/dist/processors/codegen/document-handlers/document-codegen-manager.js +121 -21
  65. package/dist/processors/codegen/document-handlers/document-codegen-manager.js.map +1 -1
  66. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts +4 -0
  67. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -1
  68. package/dist/processors/codegen/document-handlers/generators/app-generator.js +28 -5
  69. package/dist/processors/codegen/document-handlers/generators/app-generator.js.map +1 -1
  70. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts +4 -0
  71. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map +1 -1
  72. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js +59 -48
  73. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js.map +1 -1
  74. package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts +4 -0
  75. package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -1
  76. package/dist/processors/codegen/document-handlers/generators/document-model-generator.js +47 -31
  77. package/dist/processors/codegen/document-handlers/generators/document-model-generator.js.map +1 -1
  78. package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts +4 -0
  79. package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts.map +1 -1
  80. package/dist/processors/codegen/document-handlers/generators/package-generator.js +15 -0
  81. package/dist/processors/codegen/document-handlers/generators/package-generator.js.map +1 -1
  82. package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts +4 -0
  83. package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts.map +1 -1
  84. package/dist/processors/codegen/document-handlers/generators/processor-generator.js +42 -10
  85. package/dist/processors/codegen/document-handlers/generators/processor-generator.js.map +1 -1
  86. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts +4 -0
  87. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts.map +1 -1
  88. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js +28 -5
  89. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js.map +1 -1
  90. package/dist/processors/codegen/index.d.ts +5 -0
  91. package/dist/processors/codegen/index.d.ts.map +1 -1
  92. package/dist/processors/codegen/index.js +49 -6
  93. package/dist/processors/codegen/index.js.map +1 -1
  94. package/dist/processors/codegen/interactive-manager.d.ts +48 -0
  95. package/dist/processors/codegen/interactive-manager.d.ts.map +1 -0
  96. package/dist/processors/codegen/interactive-manager.js +150 -0
  97. package/dist/processors/codegen/interactive-manager.js.map +1 -0
  98. package/dist/tsconfig.tsbuildinfo +1 -1
  99. package/package.json +13 -13
@@ -7,61 +7,72 @@ import { BaseDocumentGen } from "../base-document-gen.js";
7
7
  */
8
8
  export class DocumentEditorGenerator extends BaseDocumentGen {
9
9
  supportedDocumentTypes = "powerhouse/document-editor";
10
- async generate(strand) {
10
+ /**
11
+ * Validate if this document editor strand should be processed
12
+ */
13
+ shouldProcess(strand) {
14
+ // First run base validation
15
+ if (!super.shouldProcess(strand)) {
16
+ return false;
17
+ }
11
18
  const state = strand.state;
19
+ if (!state) {
20
+ logger.debug(`>>> No state found for document editor: ${strand.documentId}`);
21
+ return false;
22
+ }
12
23
  // Check if we have a valid editor name, document types, and it's confirmed
13
- if (state.name &&
14
- state.documentTypes.length > 0 &&
15
- state.status === "CONFIRMED") {
16
- logger.info(`🔄 Starting editor generation for: ${state.name}`);
24
+ if (!state.name) {
25
+ logger.debug(`>>> No name found for document editor: ${strand.documentId}`);
26
+ return false;
27
+ }
28
+ if (!state.documentTypes || state.documentTypes.length === 0) {
29
+ logger.debug(`>>> No document types found for document editor: ${state.name}`);
30
+ return false;
31
+ }
32
+ if (state.status !== "CONFIRMED") {
33
+ logger.debug(`>>> Document editor not confirmed: ${state.name} (status: ${state.status})`);
34
+ return false;
35
+ }
36
+ return true;
37
+ }
38
+ async generate(strand) {
39
+ const state = strand.state;
40
+ // Validation is already done in shouldProcess, so we can proceed directly
41
+ logger.info(`🔄 Starting editor generation for: ${state.name}`);
42
+ try {
43
+ // Extract document types from the state
44
+ const documentTypes = state.documentTypes.map((dt) => dt.documentType);
45
+ // Generate editor ID using kebabCase
46
+ const editorId = kebabCase(state.name);
47
+ // Generate the editor using the codegen function
48
+ await generateEditor(state.name, documentTypes, this.config.PH_CONFIG, editorId);
49
+ logger.info(`✅ Editor generation completed successfully for: ${state.name}`);
50
+ // Update the manifest with the new editor
17
51
  try {
18
- // Extract document types from the state
19
- const documentTypes = state.documentTypes.map((dt) => dt.documentType);
20
- // Generate editor ID using kebabCase
21
- const editorId = kebabCase(state.name);
22
- // Generate the editor using the codegen function
23
- await generateEditor(state.name, documentTypes, this.config.PH_CONFIG, editorId);
24
- logger.info(`✅ Editor generation completed successfully for: ${state.name}`);
25
- // Update the manifest with the new editor
26
- try {
27
- logger.info(`🔄 Updating manifest with editor: ${state.name} (ID: ${editorId})`);
28
- generateManifest({
29
- editors: [
30
- {
31
- id: editorId,
32
- name: state.name,
33
- documentTypes: documentTypes,
34
- },
35
- ],
36
- }, this.config.CURRENT_WORKING_DIR);
37
- logger.info(`✅ Manifest updated successfully for editor: ${state.name}`);
38
- }
39
- catch (manifestError) {
40
- logger.error(`⚠️ Failed to update manifest for editor ${state.name}:`, manifestError);
41
- // Don't throw here - editor generation was successful
42
- }
52
+ logger.info(`🔄 Updating manifest with editor: ${state.name} (ID: ${editorId})`);
53
+ generateManifest({
54
+ editors: [
55
+ {
56
+ id: editorId,
57
+ name: state.name,
58
+ documentTypes: documentTypes,
59
+ },
60
+ ],
61
+ }, this.config.CURRENT_WORKING_DIR);
62
+ logger.info(`✅ Manifest updated successfully for editor: ${state.name}`);
43
63
  }
44
- catch (error) {
45
- logger.error(`❌ Error during editor generation for ${state.name}:`, error);
46
- if (error instanceof Error) {
47
- logger.error(`❌ Error message: ${error.message}`);
48
- }
49
- throw error;
64
+ catch (manifestError) {
65
+ logger.error(`⚠️ Failed to update manifest for editor ${state.name}:`, manifestError);
66
+ // Don't throw here - editor generation was successful
50
67
  }
51
68
  }
52
- else {
53
- if (!state.name) {
54
- logger.debug(`⚠️ Skipping editor generation - missing name for editor`);
55
- throw new Error("Editor name is missing");
56
- }
57
- else if (state.documentTypes.length === 0) {
58
- logger.debug(`⚠️ Skipping editor generation - missing document types for editor "${state.name}"`);
59
- throw new Error(`Editor "${state.name}" has no document types`);
60
- }
61
- else if (state.status !== "CONFIRMED") {
62
- logger.debug(`ℹ️ Skipping editor generation - editor "${state.name}" is not confirmed (status: ${state.status})`);
63
- throw new Error(`Editor "${state.name}" is not confirmed (status: ${state.status})`);
69
+ catch (error) {
70
+ logger.error(`❌ Error during editor generation for ${state.name}:`, error);
71
+ if (error instanceof Error) {
72
+ logger.error(`❌ Error message: ${error.message}`);
64
73
  }
74
+ // Don't throw - let codegen continue with other documents
75
+ return;
65
76
  }
66
77
  }
67
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"document-editor-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-editor-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IACjD,sBAAsB,GAAG,4BAA4B,CAAC;IAE/D,KAAK,CAAC,QAAQ,CACZ,MAAwD;QAExD,MAAM,KAAK,GAAG,MAAM,CAAC,KAA4B,CAAC;QAElD,2EAA2E;QAC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E,CAAC;gBACf,MAAM,CAAC,KAAK,CACV,wCAAwC,KAAK,CAAC,IAAI,GAAG,EACrD,KAAK,CACN,CAAC;gBACF,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;oBAC3B,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpD,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;gBACxE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC5C,CAAC;iBAAM,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5C,MAAM,CAAC,KAAK,CACV,sEAAsE,KAAK,CAAC,IAAI,GAAG,CACpF,CAAC;gBACF,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,CAAC,IAAI,yBAAyB,CAAC,CAAC;YAClE,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,CACV,2CAA2C,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACpG,CAAC;gBACF,MAAM,IAAI,KAAK,CACb,WAAW,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"document-editor-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-editor-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAA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AK,CAAC,OAAO,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,0DAA0D;YAC1D,OAAO;QACT,CAAC;IACH,CAAC;CACF"}
@@ -6,6 +6,10 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export declare class DocumentModelGenerator extends BaseDocumentGen {
8
8
  readonly supportedDocumentTypes = "powerhouse/document-model";
9
+ /**
10
+ * Validate if this document model strand should be processed
11
+ */
12
+ shouldProcess(strand: InternalTransmitterUpdate<DocumentModelDocument>): boolean;
9
13
  generate(strand: InternalTransmitterUpdate<DocumentModelDocument>): Promise<void>;
10
14
  }
11
15
  //# sourceMappingURL=document-model-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-model-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-model-generator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,QAAQ,CAAC,sBAAsB,+BAA+B;IAExD,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAiEjB"}
1
+ {"version":3,"file":"document-model-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-model-generator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,QAAQ,CAAC,sBAAsB,+BAA+B;IAE9D;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GAAG,OAAO;IAyB1E,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CA0DjB"}
@@ -6,43 +6,59 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export class DocumentModelGenerator extends BaseDocumentGen {
8
8
  supportedDocumentTypes = "powerhouse/document-model";
9
- async generate(strand) {
9
+ /**
10
+ * Validate if this document model strand should be processed
11
+ */
12
+ shouldProcess(strand) {
13
+ // First run base validation
14
+ if (!super.shouldProcess(strand)) {
15
+ return false;
16
+ }
17
+ // Validate document model state
10
18
  const state = strand.state;
19
+ if (!state) {
20
+ logger.debug(`>>> No state found for document model: ${strand.documentId}`);
21
+ return false;
22
+ }
11
23
  const validationResult = validateDocumentModelState(state);
12
- if (validationResult.isValid) {
13
- logger.info(`🔄 Starting code generation for document model: ${state.name}`);
24
+ if (!validationResult.isValid) {
25
+ logger.debug(`>>> Validation failed for document model: ${state.name}`, validationResult.errors);
26
+ return false;
27
+ }
28
+ return true;
29
+ }
30
+ async generate(strand) {
31
+ const state = strand.state;
32
+ // Validation is already done in shouldProcess, so we can proceed directly
33
+ logger.info(`🔄 Starting code generation for document model: ${state.name}`);
34
+ try {
35
+ await generateFromDocument(state, this.config.PH_CONFIG, {
36
+ verbose: false,
37
+ });
38
+ await generateSubgraphFromDocumentModel(state.name, state, this.config.PH_CONFIG, { verbose: false });
39
+ logger.info(`✅ Code generation completed successfully for: ${state.name}`);
40
+ // Update the manifest with the new document model
14
41
  try {
15
- await generateFromDocument(state, this.config.PH_CONFIG, {
16
- verbose: false,
17
- });
18
- await generateSubgraphFromDocumentModel(state.name, state, this.config.PH_CONFIG, { verbose: false });
19
- logger.info(`✅ Code generation completed successfully for: ${state.name}`);
20
- // Update the manifest with the new document model
21
- try {
22
- logger.info(`🔄 Updating manifest with document model: ${state.name} (ID: ${state.id})`);
23
- generateManifest({
24
- documentModels: [
25
- {
26
- id: state.id,
27
- name: state.name,
28
- },
29
- ],
30
- }, this.config.CURRENT_WORKING_DIR);
31
- logger.info(`✅ Manifest updated successfully for document model: ${state.name}`);
32
- }
33
- catch (manifestError) {
34
- logger.error(`⚠️ Failed to update manifest for document model ${state.name}:`, manifestError);
35
- // Don't throw here - code generation was successful
36
- }
42
+ logger.info(`🔄 Updating manifest with document model: ${state.name} (ID: ${state.id})`);
43
+ generateManifest({
44
+ documentModels: [
45
+ {
46
+ id: state.id,
47
+ name: state.name,
48
+ },
49
+ ],
50
+ }, this.config.CURRENT_WORKING_DIR);
51
+ logger.info(`✅ Manifest updated successfully for document model: ${state.name}`);
37
52
  }
38
- catch (error) {
39
- logger.error(`❌ Error during code generation for ${state.name}:`, error);
40
- throw error;
53
+ catch (manifestError) {
54
+ logger.error(`⚠️ Failed to update manifest for document model ${state.name}:`, manifestError);
55
+ // Don't throw here - code generation was successful
41
56
  }
42
57
  }
43
- else {
44
- logger.error(`❌ Validation failed for document model: ${state.name}`, validationResult.errors);
45
- throw new Error(`Validation failed for document model: ${state.name}`);
58
+ catch (error) {
59
+ logger.error(`❌ Error during code generation for ${state.name}:`, error);
60
+ // Don't throw - let codegen continue with other documents
61
+ return;
46
62
  }
47
63
  }
48
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"document-model-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-model-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IAChD,sBAAsB,GAAG,2BAA2B,CAA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AK,CACV,sCAAsC,KAAK,CAAC,IAAI,GAAG,EACnD,KAAK,CACN,CAAC;gBACF,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CACV,2CAA2C,KAAK,CAAC,IAAI,EAAE,EACvD,gBAAgB,CAAC,MAAM,CACxB,CAAC;YACF,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"document-model-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-model-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IAChD,sBAAsB,GAAG,2BAA2B,CAAC;IAE9D;;OAEG;IACH,aAAa,CAAC,MAAwD;QACpE,4BAA4B;QAC5B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,gCAAgC;QAChC,MAAM,KAAK,GAAG,MAAM,CAAC,KAA2B,CAAC;QACjD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,0CAA0C,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YAC5E,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,CAAC,KAAK,CACV,6CAA6C,KAAK,CAAC,IAA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CAAC,KAAK,CACV,sCAAsC,KAAK,CAAC,IAAI,GAAG,EACnD,KAAK,CACN,CAAC;YACF,0DAA0D;YAC1D,OAAO;QACT,CAAC;IACH,CAAC;CACF"}
@@ -6,6 +6,10 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export declare class PackageGenerator extends BaseDocumentGen {
8
8
  readonly supportedDocumentTypes = "powerhouse/package";
9
+ /**
10
+ * Validate if this package strand should be processed
11
+ */
12
+ shouldProcess(strand: InternalTransmitterUpdate<DocumentModelDocument>): boolean;
9
13
  generate(strand: InternalTransmitterUpdate<DocumentModelDocument>): Promise<void>;
10
14
  }
11
15
  //# sourceMappingURL=package-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/package-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,QAAQ,CAAC,sBAAsB,wBAAwB;IAEjD,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAkBjB"}
1
+ {"version":3,"file":"package-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/package-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,QAAQ,CAAC,sBAAsB,wBAAwB;IAEvD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GAAG,OAAO;IAe1E,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAkBjB"}
@@ -6,6 +6,21 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export class PackageGenerator extends BaseDocumentGen {
8
8
  supportedDocumentTypes = "powerhouse/package";
9
+ /**
10
+ * Validate if this package strand should be processed
11
+ */
12
+ shouldProcess(strand) {
13
+ // First run base validation
14
+ if (!super.shouldProcess(strand)) {
15
+ return false;
16
+ }
17
+ const state = strand.state;
18
+ if (!state) {
19
+ logger.debug(`>>> No state found for package: ${strand.documentId}`);
20
+ return false;
21
+ }
22
+ return true;
23
+ }
9
24
  async generate(strand) {
10
25
  const state = strand.state;
11
26
  logger.info("🔄 Generating manifest for package");
@@ -1 +1 @@
1
- {"version":3,"file":"package-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/package-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAC1C,sBAAsB,GAAG,oBAAoB,CAAC;IAEvD,KAAK,CAAC,QAAQ,CACZ,MAAwD;QAExD,MAAM,KAAK,GAAG,MAAM,CAAC,KAA0B,CAAC;QAEhD,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QAClD,gBAAgB,CACd;YACE,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE;YACpC,SAAS,EAAE;gBACT,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE;gBAC9B,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE;aACjC;SACF,EACD,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAChC,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IACnD,CAAC;CACF"}
1
+ {"version":3,"file":"package-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/package-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAC1C,sBAAsB,GAAG,oBAAoB,CAAC;IAEvD;;OAEG;IACH,aAAa,CAAC,MAAwD;QACpE,4BAA4B;QAC5B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAA0B,CAAC;QAChD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,mCAAmC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACrE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,MAAwD;QAExD,MAAM,KAAK,GAAG,MAAM,CAAC,KAA0B,CAAC;QAEhD,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QAClD,gBAAgB,CACd;YACE,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE;YACpC,SAAS,EAAE;gBACT,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE;gBAC9B,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE;aACjC;SACF,EACD,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAChC,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -6,6 +6,10 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export declare class ProcessorGenerator extends BaseDocumentGen {
8
8
  readonly supportedDocumentTypes = "powerhouse/processor";
9
+ /**
10
+ * Validate if this processor strand should be processed
11
+ */
12
+ shouldProcess(strand: InternalTransmitterUpdate<DocumentModelDocument>): boolean;
9
13
  generate(strand: InternalTransmitterUpdate<DocumentModelDocument>): Promise<void>;
10
14
  }
11
15
  //# sourceMappingURL=processor-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"processor-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/processor-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,QAAQ,CAAC,sBAAsB,0BAA0B;IAEnD,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAwEjB"}
1
+ {"version":3,"file":"processor-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/processor-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,QAAQ,CAAC,sBAAsB,0BAA0B;IAEzD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GAAG,OAAO;IAoC1E,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAsEjB"}
@@ -6,6 +6,38 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export class ProcessorGenerator extends BaseDocumentGen {
8
8
  supportedDocumentTypes = "powerhouse/processor";
9
+ /**
10
+ * Validate if this processor strand should be processed
11
+ */
12
+ shouldProcess(strand) {
13
+ // First run base validation
14
+ if (!super.shouldProcess(strand)) {
15
+ return false;
16
+ }
17
+ const state = strand.state;
18
+ if (!state) {
19
+ logger.debug(`>>> No state found for processor: ${strand.documentId}`);
20
+ return false;
21
+ }
22
+ // Check if we have a valid processor name, type, document types, and it's confirmed
23
+ if (!state.name) {
24
+ logger.debug(`>>> No name found for processor: ${strand.documentId}`);
25
+ return false;
26
+ }
27
+ if (!state.type) {
28
+ logger.debug(`>>> No type found for processor: ${state.name}`);
29
+ return false;
30
+ }
31
+ if (!state.documentTypes || state.documentTypes.length === 0) {
32
+ logger.debug(`>>> No document types found for processor: ${state.name}`);
33
+ return false;
34
+ }
35
+ if (state.status !== "CONFIRMED") {
36
+ logger.debug(`>>> Processor not confirmed: ${state.name} (status: ${state.status})`);
37
+ return false;
38
+ }
39
+ return true;
40
+ }
9
41
  async generate(strand) {
10
42
  const state = strand.state;
11
43
  // Check if we have a valid processor name, type, document types, and it's confirmed
@@ -24,7 +56,8 @@ export class ProcessorGenerator extends BaseDocumentGen {
24
56
  processorType = "relationalDb";
25
57
  }
26
58
  else {
27
- throw new Error(`Unsupported processor type: ${state.type}`);
59
+ logger.error(`❌ Unsupported processor type: ${state.type}`);
60
+ return;
28
61
  }
29
62
  // Extract document types from the state
30
63
  const documentTypes = state.documentTypes.map((dt) => dt.documentType);
@@ -37,25 +70,24 @@ export class ProcessorGenerator extends BaseDocumentGen {
37
70
  if (error instanceof Error) {
38
71
  logger.error(`❌ Error message: ${error.message}`);
39
72
  }
40
- throw error;
41
73
  }
42
74
  }
43
75
  else {
44
76
  if (!state.name) {
45
- logger.debug(`⚠️ Skipping processor generation - missing name for processor`);
46
- throw new Error("Processor name is missing");
77
+ logger.error(`❌ Skipping processor generation - missing name for processor`);
78
+ return;
47
79
  }
48
80
  else if (!state.type) {
49
- logger.debug(`⚠️ Skipping processor generation - missing type for processor "${state.name}"`);
50
- throw new Error(`Processor "${state.name}" has no type`);
81
+ logger.error(`❌ Skipping processor generation - missing type for processor "${state.name}"`);
82
+ return;
51
83
  }
52
84
  else if (state.documentTypes.length === 0) {
53
- logger.debug(`⚠️ Skipping processor generation - missing document types for processor "${state.name}"`);
54
- throw new Error(`Processor "${state.name}" has no document types`);
85
+ logger.error(`❌ Skipping processor generation - missing document types for processor "${state.name}"`);
86
+ return;
55
87
  }
56
88
  else if (state.status !== "CONFIRMED") {
57
- logger.debug(`ℹ️ Skipping processor generation - processor "${state.name}" is not confirmed (status: ${state.status})`);
58
- throw new Error(`Processor "${state.name}" is not confirmed (status: ${state.status})`);
89
+ logger.error(`❌ Skipping processor generation - processor "${state.name}" is not confirmed (status: ${state.status})`);
90
+ return;
59
91
  }
60
92
  }
61
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"processor-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/processor-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAE,MAAM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AAE,CAAC;gBACf,MAAM,CAAC,KAAK,CACV,2CAA2C,KAAK,CAAC,IAAI,GAAG,EACxD,KAAK,CACN,CAAC;gBACF,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;oBAC3B,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CACV,8DAA8D,CAC/D,CAAC;gBACF,OAAO;YACT,CAAC;iBAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBACvB,MAAM,CAAC,KAAK,CACV,iEAAiE,KAAK,CAAC,IAAI,GAAG,CAC/E,CAAC;gBACF,OAAO;YACT,CAAC;iBAAM,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5C,MAAM,CAAC,KAAK,CACV,2EAA2E,KAAK,CAAC,IAAI,GAAG,CACzF,CAAC;gBACF,OAAO;YACT,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,CACV,gDAAgD,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACzG,CAAC;gBACF,OAAO;YACT,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -6,6 +6,10 @@ import { BaseDocumentGen } from "../base-document-gen.js";
6
6
  */
7
7
  export declare class SubgraphGenerator extends BaseDocumentGen {
8
8
  readonly supportedDocumentTypes = "powerhouse/subgraph";
9
+ /**
10
+ * Validate if this subgraph strand should be processed
11
+ */
12
+ shouldProcess(strand: InternalTransmitterUpdate<DocumentModelDocument>): boolean;
9
13
  generate(strand: InternalTransmitterUpdate<DocumentModelDocument>): Promise<void>;
10
14
  }
11
15
  //# sourceMappingURL=subgraph-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subgraph-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/subgraph-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,QAAQ,CAAC,sBAAsB,yBAAyB;IAElD,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAmEjB"}
1
+ {"version":3,"file":"subgraph-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/subgraph-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,QAAQ,CAAC,sBAAsB,yBAAyB;IAExD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GAAG,OAAO;IA0B1E,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAgEjB"}
@@ -7,6 +7,30 @@ import { BaseDocumentGen } from "../base-document-gen.js";
7
7
  */
8
8
  export class SubgraphGenerator extends BaseDocumentGen {
9
9
  supportedDocumentTypes = "powerhouse/subgraph";
10
+ /**
11
+ * Validate if this subgraph strand should be processed
12
+ */
13
+ shouldProcess(strand) {
14
+ // First run base validation
15
+ if (!super.shouldProcess(strand)) {
16
+ return false;
17
+ }
18
+ const state = strand.state;
19
+ if (!state) {
20
+ logger.debug(`>>> No state found for subgraph: ${strand.documentId}`);
21
+ return false;
22
+ }
23
+ // Check if we have a valid subgraph name and it's confirmed
24
+ if (!state.name) {
25
+ logger.debug(`>>> No name found for subgraph: ${strand.documentId}`);
26
+ return false;
27
+ }
28
+ if (state.status !== "CONFIRMED") {
29
+ logger.debug(`>>> Subgraph not confirmed: ${state.name} (status: ${state.status})`);
30
+ return false;
31
+ }
32
+ return true;
33
+ }
10
34
  async generate(strand) {
11
35
  const state = strand.state;
12
36
  // Check if we have a valid subgraph name and it's confirmed
@@ -38,17 +62,16 @@ export class SubgraphGenerator extends BaseDocumentGen {
38
62
  }
39
63
  catch (error) {
40
64
  logger.error(`❌ Error during subgraph generation for ${state.name}:`, error);
41
- throw error;
42
65
  }
43
66
  }
44
67
  else {
45
68
  if (!state.name) {
46
- logger.debug(`⚠️ Skipping subgraph generation - missing name for subgraph`);
47
- throw new Error("Subgraph name is missing");
69
+ logger.error(`❌ Skipping subgraph generation - missing name for subgraph`);
70
+ return;
48
71
  }
49
72
  else if (state.status !== "CONFIRMED") {
50
- logger.debug(`ℹ️ Skipping subgraph generation - subgraph "${state.name}" is not confirmed (status: ${state.status})`);
51
- throw new Error(`Subgraph "${state.name}" is not confirmed (status: ${state.status})`);
73
+ logger.error(`❌ Skipping subgraph generation - subgraph "${state.name}" is not confirmed (status: ${state.status})`);
74
+ return;
52
75
  }
53
76
  }
54
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"subgraph-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/subgraph-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,E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KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CACV,0CAA0C,KAAK,CAAC,IAAI,GAAG,EACvD,KAAK,CACN,CAAC;gBACF,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CACV,6DAA6D,CAC9D,CAAC;gBACF,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC9C,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,CACV,+CAA+C,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACxG,CAAC;gBACF,MAAM,IAAI,KAAK,CACb,aAAa,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACtE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"subgraph-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/subgraph-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IAC3C,sBAAsB,GAAG,qBAAqB,CAAC;IAExD;;OAEG;IACH,aAAa,CAAC,MAAwD;QACpE,4BAA4B;QAC5B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAA4B,CAAC;QAClD,I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;gCACE,EAAE,EAAE,UAAU;gCACd,IAAI,EAAE,KAAK,CAAC,IAAI;gCAChB,aAAa,EAAE,EAAE;6BAClB;yBACF;qBACF,EACD,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAChC,CAAC;oBAEF,MAAM,CAAC,IAAI,CACT,iDAAiD,KAAK,CAAC,IAAI,EAAE,CAC9D,CAAC;gBACJ,CAAC;gBAAC,OAAO,aAAa,EAAE,CAAC;oBACvB,MAAM,CAAC,KAAK,CACV,6CAA6C,KAAK,CAAC,IAAI,GAAG,EAC1D,aAAa,CACd,CAAC;oBACF,wDAAwD;gBAC1D,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CACV,0CAA0C,KAAK,CAAC,IAAI,GAAG,EACvD,KAAK,CACN,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CACV,4DAA4D,CAC7D,CAAC;gBACF,OAAO;YACT,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,CACV,8CAA8C,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACvG,CAAC;gBACF,OAAO;YACT,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -2,7 +2,12 @@ import { type IProcessor } from "document-drive/processors/types";
2
2
  import { type InternalTransmitterUpdate } from "document-drive/server/listener/transmitter/internal";
3
3
  import { type DocumentModelDocument } from "document-model";
4
4
  export declare class CodegenProcessor implements IProcessor {
5
+ private manager;
6
+ constructor();
5
7
  onStrands<TDocument extends DocumentModelDocument>(strands: InternalTransmitterUpdate<TDocument>[]): Promise<void>;
6
8
  onDisconnect(): Promise<void>;
9
+ setInteractiveMode(enabled: boolean): void;
10
+ isInteractive(): boolean;
11
+ isProcessingInteractive(): boolean;
7
12
  }
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/codegen/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAW5D,qBAAa,gBAAiB,YAAW,UAAU;IAC3C,SAAS,CAAC,SAAS,SAAS,qBAAqB,EACrD,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAAE,GAC9C,OAAO,CAAC,IAAI,CAAC;IAMV,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/codegen/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAQ5D,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,OAAO,CAAyB;;IA0BlC,SAAS,CAAC,SAAS,SAAS,qBAAqB,EACrD,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAAE,GAC9C,OAAO,CAAC,IAAI,CAAC;IA6BV,YAAY;IAGX,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI1C,aAAa,IAAI,OAAO;IAIxB,uBAAuB,IAAI,OAAO;CAG1C"}
@@ -1,17 +1,60 @@
1
1
  import { getConfig } from "@powerhousedao/config/utils";
2
2
  import { DocumentCodegenFactory } from "./document-handlers/index.js";
3
+ import { logger } from "./logger.js";
3
4
  const PH_CONFIG = getConfig();
4
5
  const CURRENT_WORKING_DIR = process.cwd();
5
- const manager = DocumentCodegenFactory.createManager({
6
- PH_CONFIG,
7
- CURRENT_WORKING_DIR,
8
- });
9
6
  export class CodegenProcessor {
7
+ manager;
8
+ constructor() {
9
+ // Determine interactive mode from environment variable
10
+ const isInteractive = process.env.CODEGEN_INTERACTIVE?.toLowerCase() === "true";
11
+ this.manager = DocumentCodegenFactory.createManager({
12
+ PH_CONFIG,
13
+ CURRENT_WORKING_DIR,
14
+ }, isInteractive);
15
+ if (isInteractive) {
16
+ logger.info(`🔔 CodegenProcessor initialized with interactive mode enabled (CODEGEN_INTERACTIVE=${process.env.CODEGEN_INTERACTIVE})`);
17
+ }
18
+ else {
19
+ logger.debug(`CodegenProcessor initialized with interactive mode disabled`);
20
+ }
21
+ }
10
22
  async onStrands(strands) {
11
- for (const strand of strands) {
12
- await manager.routeAndGenerate(strand);
23
+ logger.debug(">>> onStrands", strands);
24
+ // Filter strands to only include those that should be processed
25
+ const validStrands = strands.filter((strand) => {
26
+ const generator = this.manager.getGenerator(strand.documentType);
27
+ if (!generator) {
28
+ logger.debug(`>>> No generator found for document type: ${strand.documentType}`);
29
+ return false;
30
+ }
31
+ // Use the required shouldProcess method for validation
32
+ const shouldProcessResult = generator.shouldProcess(strand);
33
+ if (!shouldProcessResult) {
34
+ logger.debug(`>>> Generator validation failed for ${strand.documentType}:${strand.documentId}, skipping processing`);
35
+ }
36
+ return shouldProcessResult;
37
+ });
38
+ if (validStrands.length > 0) {
39
+ logger.debug(`>>> Processing ${validStrands.length} valid strands (out of ${strands.length} total)`);
40
+ for (const strand of validStrands) {
41
+ await this.manager.routeAndGenerate(strand);
42
+ }
43
+ }
44
+ else {
45
+ logger.debug(`>>> No valid strands to process (${strands.length} strands received)`);
13
46
  }
14
47
  }
15
48
  async onDisconnect() { }
49
+ // Utility methods for external configuration and monitoring
50
+ setInteractiveMode(enabled) {
51
+ this.manager.setInteractiveMode(enabled);
52
+ }
53
+ isInteractive() {
54
+ return this.manager.isInteractiveMode();
55
+ }
56
+ isProcessingInteractive() {
57
+ return this.manager.isProcessingInteractive();
58
+ }
16
59
  }
17
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../processors/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAIxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAC9B,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1C,MAAM,OAAO,GAAG,sBAAsB,CAAC,aAAa,CAAC;IACnD,SAAS;IACT,mBAAmB;CACpB,CAAC,CAAC;AAEH,MAAM,OAAO,gBAAgB;IAC3B,KAAK,CAAC,SAAS,CACb,OAA+C;QAE/C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,KAAI,CAAC;CACxB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../processors/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAIxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAC9B,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1C,MAAM,OAAO,gBAAgB;IACnB,OAAO,CAAyB;IAExC;QACE,uDAAuD;QACvD,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,EAAE,KAAK,MAAM,CAAC;QAE5D,IAAI,CAAC,OAAO,GAAG,sBAAsB,CAAC,aAAa,CACjD;YACE,SAAS;YACT,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