@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.
- package/dist/document-models/app-module/gen/object.d.ts +2 -2
- package/dist/document-models/app-module/gen/object.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/object.js.map +1 -1
- package/dist/document-models/app-module/gen/types.d.ts +2 -2
- package/dist/document-models/app-module/gen/types.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/utils.js +3 -6
- package/dist/document-models/app-module/gen/utils.js.map +1 -1
- package/dist/document-models/app-module/index.d.ts +0 -1
- package/dist/document-models/app-module/index.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/object.d.ts +2 -2
- package/dist/document-models/document-editor/gen/object.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/object.js.map +1 -1
- package/dist/document-models/document-editor/gen/types.d.ts +2 -2
- package/dist/document-models/document-editor/gen/types.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/utils.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/utils.js +3 -6
- package/dist/document-models/document-editor/gen/utils.js.map +1 -1
- package/dist/document-models/document-editor/index.d.ts +0 -1
- package/dist/document-models/document-editor/index.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/object.d.ts +2 -2
- package/dist/document-models/processor-module/gen/object.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/object.js.map +1 -1
- package/dist/document-models/processor-module/gen/types.d.ts +2 -2
- package/dist/document-models/processor-module/gen/types.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/utils.js +3 -6
- package/dist/document-models/processor-module/gen/utils.js.map +1 -1
- package/dist/document-models/processor-module/index.d.ts +0 -1
- package/dist/document-models/processor-module/index.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/object.d.ts +2 -2
- package/dist/document-models/subgraph-module/gen/object.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/object.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/types.d.ts +2 -2
- package/dist/document-models/subgraph-module/gen/types.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/utils.js +3 -6
- package/dist/document-models/subgraph-module/gen/utils.js.map +1 -1
- package/dist/document-models/subgraph-module/index.d.ts +0 -1
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/object.d.ts +2 -2
- package/dist/document-models/vetra-package/gen/object.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/object.js.map +1 -1
- package/dist/document-models/vetra-package/gen/types.d.ts +2 -2
- package/dist/document-models/vetra-package/gen/types.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/utils.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/utils.js +3 -6
- package/dist/document-models/vetra-package/gen/utils.js.map +1 -1
- package/dist/document-models/vetra-package/index.d.ts +0 -1
- package/dist/document-models/vetra-package/index.d.ts.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.js +18 -14
- package/dist/editors/document-editor/components/DocumentEditorForm.js.map +1 -1
- package/dist/processors/codegen/document-handlers/base-document-gen.d.ts +5 -0
- package/dist/processors/codegen/document-handlers/base-document-gen.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/base-document-gen.js +16 -0
- package/dist/processors/codegen/document-handlers/base-document-gen.js.map +1 -1
- package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts +2 -2
- package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/document-codegen-factory.js +4 -4
- package/dist/processors/codegen/document-handlers/document-codegen-factory.js.map +1 -1
- package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts +24 -1
- package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/document-codegen-manager.js +121 -21
- package/dist/processors/codegen/document-handlers/document-codegen-manager.js.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts +4 -0
- package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/app-generator.js +28 -5
- package/dist/processors/codegen/document-handlers/generators/app-generator.js.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts +4 -0
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js +59 -48
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts +4 -0
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.js +47 -31
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.js.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts +4 -0
- package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/package-generator.js +15 -0
- package/dist/processors/codegen/document-handlers/generators/package-generator.js.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts +4 -0
- package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/processor-generator.js +42 -10
- package/dist/processors/codegen/document-handlers/generators/processor-generator.js.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts +4 -0
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js +28 -5
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js.map +1 -1
- package/dist/processors/codegen/index.d.ts +5 -0
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +49 -6
- package/dist/processors/codegen/index.js.map +1 -1
- package/dist/processors/codegen/interactive-manager.d.ts +48 -0
- package/dist/processors/codegen/interactive-manager.d.ts.map +1 -0
- package/dist/processors/codegen/interactive-manager.js +150 -0
- package/dist/processors/codegen/interactive-manager.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
|
@@ -3,7 +3,7 @@ import { useReactor } from "@powerhousedao/reactor-browser";
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { StatusPill } from "../../components/index.js";
|
|
5
5
|
import { useDebounce } from "../../hooks/index.js";
|
|
6
|
-
export const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes: initialDocumentTypes = [], status = "DRAFT", onEditorNameChange, onAddDocumentType, onRemoveDocumentType, onConfirm }) => {
|
|
6
|
+
export const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes: initialDocumentTypes = [], status = "DRAFT", onEditorNameChange, onAddDocumentType, onRemoveDocumentType, onConfirm, }) => {
|
|
7
7
|
const [editorName, setEditorName] = useState(initialEditorName);
|
|
8
8
|
const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
|
|
9
9
|
const [selectedDocumentType, setSelectedDocumentType] = useState("");
|
|
@@ -24,10 +24,10 @@ export const DocumentEditorForm = ({ editorName: initialEditorName = "", documen
|
|
|
24
24
|
return documentModel.state.global.id;
|
|
25
25
|
}
|
|
26
26
|
return null;
|
|
27
|
-
}))).filter(e => e !== null);
|
|
27
|
+
}))).filter((e) => e !== null);
|
|
28
28
|
setAvailableDocumentTypes(docTypes);
|
|
29
29
|
}
|
|
30
|
-
loadData();
|
|
30
|
+
void loadData();
|
|
31
31
|
}, [reactor]);
|
|
32
32
|
// Use the debounce hook for name changes
|
|
33
33
|
useDebounce(editorName, onEditorNameChange, 300);
|
|
@@ -52,26 +52,30 @@ export const DocumentEditorForm = ({ editorName: initialEditorName = "", documen
|
|
|
52
52
|
onConfirm?.();
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
return (_jsxs("div", { className: "space-y-6 p-6
|
|
55
|
+
return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Editor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? "confirmed" : "draft", label: status === "CONFIRMED" ? "Confirmed" : "Draft" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Editor Name" }), _jsx("input", { type: "text", value: editorName, onChange: (e) => setEditorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}` })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Supported Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && availableDocumentTypes.length > 0 && (_jsxs("select", { value: selectedDocumentType, onChange: (e) => {
|
|
56
56
|
const selectedValue = e.target.value;
|
|
57
|
-
if (selectedValue
|
|
57
|
+
if (selectedValue) {
|
|
58
|
+
// Remove existing document type if any
|
|
59
|
+
if (documentTypes.length > 0) {
|
|
60
|
+
const existingType = documentTypes[0];
|
|
61
|
+
onRemoveDocumentType?.({ id: existingType.id });
|
|
62
|
+
}
|
|
63
|
+
// Add the new document type
|
|
58
64
|
const newTypeInput = {
|
|
59
65
|
id: Date.now().toString(), // Generate a unique ID
|
|
60
|
-
documentType: selectedValue
|
|
66
|
+
documentType: selectedValue,
|
|
61
67
|
};
|
|
62
68
|
const newType = {
|
|
63
69
|
id: newTypeInput.id,
|
|
64
|
-
documentType: newTypeInput.documentType
|
|
70
|
+
documentType: newTypeInput.documentType,
|
|
65
71
|
};
|
|
66
|
-
setDocumentTypes([
|
|
72
|
+
setDocumentTypes([newType]); // Replace with single item array
|
|
67
73
|
onAddDocumentType?.(newTypeInput);
|
|
68
74
|
}
|
|
69
|
-
setSelectedDocumentType(
|
|
70
|
-
}, className: "w-full
|
|
71
|
-
|
|
72
|
-
.map((docType) => (_jsx("option", { value: docType, children: docType }, docType)))] })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => {
|
|
73
|
-
setDocumentTypes(documentTypes.filter((dt) => dt.id !== type.id));
|
|
75
|
+
setSelectedDocumentType("");
|
|
76
|
+
}, className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500", children: [_jsx("option", { value: "", children: "Select a document type" }), availableDocumentTypes.map((docType) => (_jsx("option", { value: docType, children: docType }, docType)))] })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => {
|
|
77
|
+
setDocumentTypes([]);
|
|
74
78
|
onRemoveDocumentType?.({ id: type.id });
|
|
75
|
-
}, className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) })] })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !editorName.trim() || documentTypes.length === 0, className: "px-4 py-2
|
|
79
|
+
}, className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) })] })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !editorName.trim() || documentTypes.length === 0, className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:bg-gray-300", children: "Confirm" }) }))] }));
|
|
76
80
|
};
|
|
77
81
|
//# sourceMappingURL=DocumentEditorForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAYnD,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,UAAU,EAAE,iBAAiB,GAAG,EAAE,EAClC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,MAAM,GAAG,OAAO,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAChE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACrC,QAAQ,CAAqB,oBAAoB,CAAC,CAAC;IACrD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MA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AmB,SAAS,EAAC,wBAAwB,aACnD,eAAM,SAAS,EAAC,uBAAuB,YACpC,IAAI,CAAC,YAAY,GACb,EACN,CAAC,UAAU,IAAI,CACd,iBACE,OAAO,EAAE,GAAG,EAAE;gDACZ,gBAAgB,CAAC,EAAE,CAAC,CAAC;gDACrB,oBAAoB,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;4CAC1C,CAAC,EACD,SAAS,EAAC,2DAA2D,uBAG9D,CACV,KAdO,IAAI,CAAC,EAAE,CAeX,CACP,CAAC,GACE,IACF,IACF,EAGL,CAAC,UAAU,IAAI,CACd,wBACE,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAC1D,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -26,5 +26,10 @@ export declare abstract class BaseDocumentGen {
|
|
|
26
26
|
* Get all supported document types as an array
|
|
27
27
|
*/
|
|
28
28
|
getSupportedDocumentTypes(): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Validate if this strand should be processed
|
|
31
|
+
* Override this method in specific generators to add custom validation logic
|
|
32
|
+
*/
|
|
33
|
+
shouldProcess(strand: InternalTransmitterUpdate<DocumentModelDocument>): boolean;
|
|
29
34
|
}
|
|
30
35
|
//# sourceMappingURL=base-document-gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-document-gen.d.ts","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/base-document-gen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,8BAAsB,eAAe;IAOvB,SAAS,CAAC,MAAM,EAAE,MAAM;IANpC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;gBAEtC,MAAM,EAAE,MAAM;IAEpC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CACf,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;IAEhB;;OAEG;IACH,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAOnD;;OAEG;IACH,yBAAyB,IAAI,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"base-document-gen.d.ts","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/base-document-gen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,8BAAsB,eAAe;IAOvB,SAAS,CAAC,MAAM,EAAE,MAAM;IANpC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;gBAEtC,MAAM,EAAE,MAAM;IAEpC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CACf,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;IAEhB;;OAEG;IACH,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAOnD;;OAEG;IACH,yBAAyB,IAAI,MAAM,EAAE;IAOrC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GAAG,OAAO;CAcjF"}
|
|
@@ -25,5 +25,21 @@ export class BaseDocumentGen {
|
|
|
25
25
|
}
|
|
26
26
|
return [...this.supportedDocumentTypes];
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Validate if this strand should be processed
|
|
30
|
+
* Override this method in specific generators to add custom validation logic
|
|
31
|
+
*/
|
|
32
|
+
shouldProcess(strand) {
|
|
33
|
+
// Basic validation: ensure strand has required properties
|
|
34
|
+
if (!strand.documentId || !strand.documentType) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
// Basic validation: check if document type is supported
|
|
38
|
+
if (!this.supportsDocumentType(strand.documentType)) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
// Default to processing if basic validation passes
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
28
44
|
}
|
|
29
45
|
//# sourceMappingURL=base-document-gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-document-gen.js","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/base-document-gen.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,OAAgB,eAAe;IAOb;IAAtB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAUxC;;OAEG;IACH,oBAAoB,CAAC,YAAoB;QACvC,IAAI,OAAO,IAAI,CAAC,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC,sBAAsB,KAAK,YAAY,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,yBAAyB;QACvB,IAAI,OAAO,IAAI,CAAC,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YACpD,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"base-document-gen.js","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/base-document-gen.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,OAAgB,eAAe;IAOb;IAAtB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAUxC;;OAEG;IACH,oBAAoB,CAAC,YAAoB;QACvC,IAAI,OAAO,IAAI,CAAC,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC,sBAAsB,KAAK,YAAY,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,yBAAyB;QACvB,IAAI,OAAO,IAAI,CAAC,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YACpD,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,aAAa,CAAC,MAAwD;QACnE,0DAA0D;QAC1D,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,wDAAwD;QACxD,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YACpD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,mDAAmD;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -9,11 +9,11 @@ export declare class DocumentCodegenFactory {
|
|
|
9
9
|
/**
|
|
10
10
|
* Create a DocumentCodegenManager with all standard generators registered
|
|
11
11
|
*/
|
|
12
|
-
static createManager(config: Config): DocumentCodegenManager;
|
|
12
|
+
static createManager(config: Config, interactiveMode?: boolean): DocumentCodegenManager;
|
|
13
13
|
/**
|
|
14
14
|
* Create a DocumentCodegenManager with only specific generators
|
|
15
15
|
*/
|
|
16
|
-
static createManagerWithGenerators(config: Config, generators: Array<new (config: Config) => any
|
|
16
|
+
static createManagerWithGenerators(config: Config, generators: Array<new (config: Config) => any>, interactiveMode?: boolean): DocumentCodegenManager;
|
|
17
17
|
/**
|
|
18
18
|
* Get all available generator classes
|
|
19
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-codegen-factory.d.ts","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB;
|
|
1
|
+
{"version":3,"file":"document-codegen-factory.d.ts","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,GAAE,OAAe,GAAG,sBAAsB;IAoB9F;;OAEG;IACH,MAAM,CAAC,2BAA2B,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,CAAC,KAAK,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC,EAC9C,eAAe,GAAE,OAAe,GAC/B,sBAAsB;IAezB;;OAEG;IACH,MAAM,CAAC,sBAAsB;;;;;;;;CAU9B"}
|
|
@@ -8,8 +8,8 @@ export class DocumentCodegenFactory {
|
|
|
8
8
|
/**
|
|
9
9
|
* Create a DocumentCodegenManager with all standard generators registered
|
|
10
10
|
*/
|
|
11
|
-
static createManager(config) {
|
|
12
|
-
const manager = new DocumentCodegenManager(config);
|
|
11
|
+
static createManager(config, interactiveMode = false) {
|
|
12
|
+
const manager = new DocumentCodegenManager(config, interactiveMode);
|
|
13
13
|
// Register all the standard generators
|
|
14
14
|
manager.registerGenerator("powerhouse/document-model", DocumentModelGenerator);
|
|
15
15
|
manager.registerGenerator("powerhouse/package", PackageGenerator);
|
|
@@ -22,8 +22,8 @@ export class DocumentCodegenFactory {
|
|
|
22
22
|
/**
|
|
23
23
|
* Create a DocumentCodegenManager with only specific generators
|
|
24
24
|
*/
|
|
25
|
-
static createManagerWithGenerators(config, generators) {
|
|
26
|
-
const manager = new DocumentCodegenManager(config);
|
|
25
|
+
static createManagerWithGenerators(config, generators, interactiveMode = false) {
|
|
26
|
+
const manager = new DocumentCodegenManager(config, interactiveMode);
|
|
27
27
|
for (const generatorClass of generators) {
|
|
28
28
|
const generator = new generatorClass(config);
|
|
29
29
|
const supportedTypes = generator.getSupportedDocumentTypes();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-codegen-factory.js","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAc;
|
|
1
|
+
{"version":3,"file":"document-codegen-factory.js","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAc,EAAE,kBAA2B,KAAK;QACnE,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAEpE,uCAAuC;QACvC,OAAO,CAAC,iBAAiB,CACvB,2BAA2B,EAC3B,sBAAsB,CACvB,CAAC;QACF,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;QAClE,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;QAC1D,OAAO,CAAC,iBAAiB,CACvB,4BAA4B,EAC5B,uBAAuB,CACxB,CAAC;QACF,OAAO,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;QACpE,OAAO,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;QAEtE,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,2BAA2B,CAChC,MAAc,EACd,UAA8C,EAC9C,kBAA2B,KAAK;QAEhC,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAEpE,KAAK,MAAM,cAAc,IAAI,UAAU,EAAE,CAAC;YACxC,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,MAAM,CAAoB,CAAC;YAChE,MAAM,cAAc,GAAG,SAAS,CAAC,yBAAyB,EAAE,CAAC;YAE7D,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;gBAC1C,OAAO,CAAC,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,sBAAsB;QAC3B,OAAO;YACL,sBAAsB;YACtB,gBAAgB;YAChB,YAAY;YACZ,uBAAuB;YACvB,iBAAiB;YACjB,kBAAkB;SACnB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -10,7 +10,8 @@ export declare class DocumentCodegenManager {
|
|
|
10
10
|
private config;
|
|
11
11
|
private generators;
|
|
12
12
|
private debounceTimers;
|
|
13
|
-
|
|
13
|
+
private interactiveManager;
|
|
14
|
+
constructor(config: Config, interactiveMode?: boolean);
|
|
14
15
|
/**
|
|
15
16
|
* Register a generator class for a specific document type
|
|
16
17
|
*/
|
|
@@ -21,6 +22,7 @@ export declare class DocumentCodegenManager {
|
|
|
21
22
|
registerMultiTypeGenerator(generatorClass: new (config: Config) => BaseDocumentGen): void;
|
|
22
23
|
/**
|
|
23
24
|
* Get a generator instance for the given document type
|
|
25
|
+
* Public method to allow external access for validation
|
|
24
26
|
*/
|
|
25
27
|
getGenerator(documentType: string): BaseDocumentGen | undefined;
|
|
26
28
|
/**
|
|
@@ -33,8 +35,17 @@ export declare class DocumentCodegenManager {
|
|
|
33
35
|
isDocumentTypeSupported(documentType: string): boolean;
|
|
34
36
|
/**
|
|
35
37
|
* Route a document to the appropriate generator and handle the generation
|
|
38
|
+
* Handles both interactive and non-interactive modes with queue-based processing
|
|
36
39
|
*/
|
|
37
40
|
routeAndGenerate(strand: InternalTransmitterUpdate<DocumentModelDocument>): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Process multiple strands in priority order (document-model types first)
|
|
43
|
+
*/
|
|
44
|
+
private processQueuedStrands;
|
|
45
|
+
/**
|
|
46
|
+
* Process a single strand (used internally by processQueuedStrands)
|
|
47
|
+
*/
|
|
48
|
+
private processStrand;
|
|
38
49
|
/**
|
|
39
50
|
* Clear all registered generators
|
|
40
51
|
*/
|
|
@@ -46,5 +57,17 @@ export declare class DocumentCodegenManager {
|
|
|
46
57
|
totalGenerators: number;
|
|
47
58
|
supportedTypes: string[];
|
|
48
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Set interactive mode for code generation
|
|
62
|
+
*/
|
|
63
|
+
setInteractiveMode(enabled: boolean): void;
|
|
64
|
+
/**
|
|
65
|
+
* Check if interactive mode is enabled
|
|
66
|
+
*/
|
|
67
|
+
isInteractiveMode(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if the manager is currently processing an interactive confirmation
|
|
70
|
+
*/
|
|
71
|
+
isProcessingInteractive(): boolean;
|
|
49
72
|
}
|
|
50
73
|
//# sourceMappingURL=document-codegen-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-codegen-manager.d.ts","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"document-codegen-manager.d.ts","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAIzC;;;GAGG;AACH,qBAAa,sBAAsB;IAM/B,OAAO,CAAC,MAAM;IALhB,OAAO,CAAC,UAAU,CAAsC;IACxD,OAAO,CAAC,cAAc,CAAqC;IAC3D,OAAO,CAAC,kBAAkB,CAAqB;gBAGrC,MAAM,EAAE,MAAM,EACtB,eAAe,GAAE,OAAe;IAKlC;;OAEG;IACH,iBAAiB,CACf,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,KAAK,eAAe,GACtD,IAAI;IAWP;;OAEG;IACH,0BAA0B,CACxB,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,KAAK,eAAe,GACtD,IAAI;IAkBP;;;OAGG;IACI,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAItE;;OAEG;IACH,0BAA0B,IAAI,MAAM,EAAE;IAItC;;OAEG;IACH,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAItD;;;OAGG;IACG,gBAAgB,CACpB,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;IA6FhB;;OAEG;YACW,oBAAoB;IAwBlC;;OAEG;YACW,aAAa;IAmB3B;;OAEG;IACH,eAAe,IAAI,IAAI;IAKvB;;OAEG;IACH,QAAQ,IAAI;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,EAAE,CAAA;KAAE;IAOjE;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI1C;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,uBAAuB,IAAI,OAAO;CAGnC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { InteractiveManager } from "../interactive-manager.js";
|
|
1
2
|
import { logger } from "../logger.js";
|
|
3
|
+
const DEFAULT_DEBOUNCE_TIME = 1000; // 1 second
|
|
2
4
|
/**
|
|
3
5
|
* Manager class responsible for routing documents to the correct generator
|
|
4
6
|
* and managing generator registration and instantiation
|
|
@@ -7,8 +9,10 @@ export class DocumentCodegenManager {
|
|
|
7
9
|
config;
|
|
8
10
|
generators = new Map();
|
|
9
11
|
debounceTimers = new Map();
|
|
10
|
-
|
|
12
|
+
interactiveManager;
|
|
13
|
+
constructor(config, interactiveMode = false) {
|
|
11
14
|
this.config = config;
|
|
15
|
+
this.interactiveManager = new InteractiveManager(interactiveMode);
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Register a generator class for a specific document type
|
|
@@ -36,6 +40,7 @@ export class DocumentCodegenManager {
|
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Get a generator instance for the given document type
|
|
43
|
+
* Public method to allow external access for validation
|
|
39
44
|
*/
|
|
40
45
|
getGenerator(documentType) {
|
|
41
46
|
return this.generators.get(documentType);
|
|
@@ -54,6 +59,7 @@ export class DocumentCodegenManager {
|
|
|
54
59
|
}
|
|
55
60
|
/**
|
|
56
61
|
* Route a document to the appropriate generator and handle the generation
|
|
62
|
+
* Handles both interactive and non-interactive modes with queue-based processing
|
|
57
63
|
*/
|
|
58
64
|
async routeAndGenerate(strand) {
|
|
59
65
|
const documentType = strand.documentType;
|
|
@@ -67,29 +73,105 @@ export class DocumentCodegenManager {
|
|
|
67
73
|
logger.info(`ℹ️ Supported document types: ${this.getRegisteredDocumentTypes().join(", ")}`);
|
|
68
74
|
throw new Error(`Unsupported document type: ${documentType}`);
|
|
69
75
|
}
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
// Validate if this strand should be processed
|
|
77
|
+
if (!generator.shouldProcess(strand)) {
|
|
78
|
+
logger.debug(`>>> Generator validation failed for ${documentType}:${strand.documentId}, skipping processing`);
|
|
79
|
+
return;
|
|
74
80
|
}
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
// Different flow for interactive vs non-interactive mode
|
|
82
|
+
if (this.interactiveManager.isInteractive()) {
|
|
83
|
+
// Interactive mode: queue strands and use debounce timer to trigger batch processing
|
|
84
|
+
logger.debug(`>>> Queueing strand for interactive processing: ${documentType}:${strand.documentId}`);
|
|
85
|
+
// Add strand to queue (will replace any existing strand for same document)
|
|
86
|
+
this.interactiveManager.queueStrand(strand);
|
|
87
|
+
// Clear any existing debounce timer for interactive processing
|
|
88
|
+
const existingTimer = this.debounceTimers.get('interactive');
|
|
89
|
+
if (existingTimer) {
|
|
90
|
+
clearTimeout(existingTimer);
|
|
81
91
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
// Set up debounce timer for batch interactive processing
|
|
93
|
+
const debounceTimer = setTimeout(async () => {
|
|
94
|
+
try {
|
|
95
|
+
await this.interactiveManager.processQueueWithConfirmation(async (queuedStrands) => {
|
|
96
|
+
await this.processQueuedStrands(queuedStrands);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
logger.error("❌ Error during interactive batch processing:", error);
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
// Clean up the timer reference
|
|
104
|
+
this.debounceTimers.delete('interactive');
|
|
105
|
+
}
|
|
106
|
+
}, DEFAULT_DEBOUNCE_TIME);
|
|
107
|
+
// Store the timer reference using 'interactive' key
|
|
108
|
+
this.debounceTimers.set('interactive', debounceTimer);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// Non-interactive mode: use debouncing per document type
|
|
112
|
+
// Clear any existing debounce timer for this document type
|
|
113
|
+
const existingTimer = this.debounceTimers.get(documentType);
|
|
114
|
+
if (existingTimer) {
|
|
115
|
+
clearTimeout(existingTimer);
|
|
89
116
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
117
|
+
// Set up new debounced generation (no interactive confirmation)
|
|
118
|
+
const debounceTimer = setTimeout(async () => {
|
|
119
|
+
try {
|
|
120
|
+
logger.info(`🔄 Routing document type "${documentType}" to generator (debounced)`);
|
|
121
|
+
// Direct generation, no interactive confirmation
|
|
122
|
+
await generator.generate(strand);
|
|
123
|
+
logger.info(`✅ Successfully generated code for document type: ${documentType}`);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
logger.error(`❌ Error generating code for document type "${documentType}":`, error);
|
|
127
|
+
// Don't throw - let codegen continue with other documents
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
// Clean up the timer reference
|
|
131
|
+
this.debounceTimers.delete(documentType);
|
|
132
|
+
}
|
|
133
|
+
}, DEFAULT_DEBOUNCE_TIME);
|
|
134
|
+
// Store the timer reference
|
|
135
|
+
this.debounceTimers.set(documentType, debounceTimer);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Process multiple strands in priority order (document-model types first)
|
|
140
|
+
*/
|
|
141
|
+
async processQueuedStrands(queuedStrands) {
|
|
142
|
+
logger.info(`🔄 Processing ${queuedStrands.length} queued strand(s)`);
|
|
143
|
+
// Sort by priority (document-model first to ensure dependencies exist)
|
|
144
|
+
const documentModelStrands = queuedStrands.filter((qs) => qs.strand.documentType === "powerhouse/document-model");
|
|
145
|
+
const otherStrands = queuedStrands.filter((qs) => qs.strand.documentType !== "powerhouse/document-model");
|
|
146
|
+
// Process document models first
|
|
147
|
+
for (const queuedStrand of documentModelStrands) {
|
|
148
|
+
await this.processStrand(queuedStrand.strand);
|
|
149
|
+
}
|
|
150
|
+
// Then process other document types
|
|
151
|
+
for (const queuedStrand of otherStrands) {
|
|
152
|
+
await this.processStrand(queuedStrand.strand);
|
|
153
|
+
}
|
|
154
|
+
logger.info(`✅ Successfully processed all ${queuedStrands.length} queued strand(s)`);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Process a single strand (used internally by processQueuedStrands)
|
|
158
|
+
*/
|
|
159
|
+
async processStrand(strand) {
|
|
160
|
+
const documentType = strand.documentType;
|
|
161
|
+
const generator = this.getGenerator(documentType);
|
|
162
|
+
if (!generator) {
|
|
163
|
+
logger.warn(`⚠️ No generator found for document type: ${documentType}`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
logger.info(`🔄 Generating code for document type: ${documentType}`);
|
|
168
|
+
await generator.generate(strand);
|
|
169
|
+
logger.info(`✅ Successfully generated code for document type: ${documentType}`);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
logger.error(`❌ Error generating code for document type "${documentType}":`, error);
|
|
173
|
+
// Don't throw here to allow other strands to be processed
|
|
174
|
+
}
|
|
93
175
|
}
|
|
94
176
|
/**
|
|
95
177
|
* Clear all registered generators
|
|
@@ -107,5 +189,23 @@ export class DocumentCodegenManager {
|
|
|
107
189
|
supportedTypes: this.getRegisteredDocumentTypes(),
|
|
108
190
|
};
|
|
109
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Set interactive mode for code generation
|
|
194
|
+
*/
|
|
195
|
+
setInteractiveMode(enabled) {
|
|
196
|
+
this.interactiveManager.setInteractiveMode(enabled);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Check if interactive mode is enabled
|
|
200
|
+
*/
|
|
201
|
+
isInteractiveMode() {
|
|
202
|
+
return this.interactiveManager.isInteractive();
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Check if the manager is currently processing an interactive confirmation
|
|
206
|
+
*/
|
|
207
|
+
isProcessingInteractive() {
|
|
208
|
+
return this.interactiveManager.isProcessing();
|
|
209
|
+
}
|
|
110
210
|
}
|
|
111
211
|
//# sourceMappingURL=document-codegen-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-codegen-manager.js","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC;;;GAGG;AACH,MAAM,OAAO,sBAAsB;
|
|
1
|
+
{"version":3,"file":"document-codegen-manager.js","sourceRoot":"","sources":["../../../../processors/codegen/document-handlers/document-codegen-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAqB,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,qBAAqB,GAAG,IAAI,CAAC,CAAC,WAAW;AAE/C;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAMvB;IALF,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;IAChD,cAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;IACnD,kBAAkB,CAAqB;IAE/C,YACU,MAAc,EACtB,kBAA2B,KAAK;QADxB,WAAM,GAAN,MAAM,CAAQ;QAGtB,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,iBAAiB,CACf,YAAoB,EACpB,cAAuD;QAEvD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YACtC,MAAM,CAAC,IAAI,CACT,mCAAmC,YAAY,uCAAuC,CACvF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,6CAA6C,YAAY,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,0BAA0B,CACxB,cAAuD;QAEvD,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,cAAc,GAAG,SAAS,CAAC,yBAAyB,EAAE,CAAC;QAE7D,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,UAAU,C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AAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO;YACL,eAAe,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;YACrC,cAAc,EAAE,IAAI,CAAC,0BAA0B,EAAE;SAClD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,kBAAkB,CAAC,OAAgB;QACjC,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,uBAAuB;QACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -6,6 +6,10 @@ import { BaseDocumentGen } from "../base-document-gen.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class AppGenerator extends BaseDocumentGen {
|
|
8
8
|
readonly supportedDocumentTypes = "powerhouse/app";
|
|
9
|
+
/**
|
|
10
|
+
* Validate if this app strand should be processed
|
|
11
|
+
*/
|
|
12
|
+
shouldProcess(strand: InternalTransmitterUpdate<DocumentModelDocument>): boolean;
|
|
9
13
|
generate(strand: InternalTransmitterUpdate<DocumentModelDocument>): Promise<void>;
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=app-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/app-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,YAAa,SAAQ,eAAe;IAC/C,QAAQ,CAAC,sBAAsB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"app-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/app-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,YAAa,SAAQ,eAAe;IAC/C,QAAQ,CAAC,sBAAsB,oBAAoB;IAEnD;;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;CAqEjB"}
|
|
@@ -7,6 +7,30 @@ import { BaseDocumentGen } from "../base-document-gen.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export class AppGenerator extends BaseDocumentGen {
|
|
9
9
|
supportedDocumentTypes = "powerhouse/app";
|
|
10
|
+
/**
|
|
11
|
+
* Validate if this app 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 app: ${strand.documentId}`);
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
// Check if we have a valid app name and it's confirmed
|
|
24
|
+
if (!state.name) {
|
|
25
|
+
logger.debug(`>>> No name found for app: ${strand.documentId}`);
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (state.status !== "CONFIRMED") {
|
|
29
|
+
logger.debug(`>>> App 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 app name and it's confirmed
|
|
@@ -42,17 +66,16 @@ export class AppGenerator extends BaseDocumentGen {
|
|
|
42
66
|
if (error instanceof Error) {
|
|
43
67
|
logger.error(`❌ Error message: ${error.message}`);
|
|
44
68
|
}
|
|
45
|
-
throw error;
|
|
46
69
|
}
|
|
47
70
|
}
|
|
48
71
|
else {
|
|
49
72
|
if (!state.name) {
|
|
50
|
-
logger.
|
|
51
|
-
|
|
73
|
+
logger.error(`❌ Skipping drive editor generation - missing name for app`);
|
|
74
|
+
return;
|
|
52
75
|
}
|
|
53
76
|
else if (state.status !== "CONFIRMED") {
|
|
54
|
-
logger.
|
|
55
|
-
|
|
77
|
+
logger.error(`❌ Skipping drive editor generation - app "${state.name}" is not confirmed (status: ${state.status})`);
|
|
78
|
+
return;
|
|
56
79
|
}
|
|
57
80
|
}
|
|
58
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-generator.js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/app-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,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,YAAa,SAAQ,eAAe;IACtC,sBAAsB,GAAG,gBAAgB,CAAC;IAEnD,KAAK,CAAC,QAAQ,CACZ,MAAwD;QAExD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAuB,CAAC;QAE7C,uDAAuD;QACvD,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,E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js","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/app-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,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,YAAa,SAAQ,eAAe;IACtC,sBAAsB,GAAG,gBAAgB,CAAC;IAEnD;;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,KAAuB,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,+BAA+B,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,uDAAuD;QACvD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC,8BAA8B,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACjC,MAAM,CAAC,KAAK,CAAC,0BAA0B,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YAC/E,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,MAAwD;QAExD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAuB,CAAC;QAE7C,uDAAuD;QACvD,IAAI,KAAK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CAAC;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CACV,2DAA2D,CAC5D,CAAC;gBACF,OAAO;YACT,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,CACV,6CAA6C,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,GAAG,CACtG,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 DocumentEditorGenerator extends BaseDocumentGen {
|
|
8
8
|
readonly supportedDocumentTypes = "powerhouse/document-editor";
|
|
9
|
+
/**
|
|
10
|
+
* Validate if this document editor 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-editor-generator.d.ts.map
|
package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-editor-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-editor-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,uBAAwB,SAAQ,eAAe;IAC1D,QAAQ,CAAC,sBAAsB,gCAAgC;
|
|
1
|
+
{"version":3,"file":"document-editor-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/document-editor-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,uBAAwB,SAAQ,eAAe;IAC1D,QAAQ,CAAC,sBAAsB,gCAAgC;IAE/D;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GAAG,OAAO;IA+B1E,QAAQ,CACZ,MAAM,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC;CAiEjB"}
|