@powerhousedao/vetra 6.2.0-dev.3 → 6.2.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/index.d.ts +6 -91
- package/dist/codegen/index.d.ts.map +1 -1
- package/dist/codegen/index.js +2 -632
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/spec.d.ts +2 -0
- package/dist/codegen/spec.js +2 -0
- package/dist/{connect-Bbz4cL8F.js → connect-CjGVphlq.js} +1 -1
- package/dist/{connect-Bbz4cL8F.js.map → connect-CjGVphlq.js.map} +1 -1
- package/dist/document-models/app-module/index.d.ts +1 -1
- package/dist/document-models/document-editor/index.d.ts +1 -1
- package/dist/document-models/index.d.ts +5 -5
- package/dist/document-models/processor-module/index.d.ts +1 -1
- package/dist/document-models/subgraph-module/index.d.ts +1 -1
- package/dist/document-models/vetra-package/index.d.ts +1 -1
- package/dist/{editor-Dz3cXtzn.js → editor-BmYxPe_4.js} +56 -56
- package/dist/editor-BmYxPe_4.js.map +1 -0
- package/dist/{editor-BamOOi9L.js → editor-CtN1Sy88.js} +11 -11
- package/dist/editor-CtN1Sy88.js.map +1 -0
- package/dist/{editor-je4HFt2f.js → editor-De5XaIXa.js} +32 -32
- package/dist/editor-De5XaIXa.js.map +1 -0
- package/dist/{editor-D-QqGEkw.js → editor-bA5TTxfU.js} +15 -15
- package/dist/editor-bA5TTxfU.js.map +1 -0
- package/dist/{editor-rYCWiter.js → editor-fNaLqnMc.js} +8 -8
- package/dist/editor-fNaLqnMc.js.map +1 -0
- package/dist/{editor-CM9tpwzR.js → editor-saGUzfCl.js} +17 -17
- package/dist/editor-saGUzfCl.js.map +1 -0
- package/dist/editors/components/index.js +1 -1
- package/dist/editors/components/index.js.map +1 -1
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/{factory-DcPyqWkY.js → factory-B6hBnFAf.js} +3 -3
- package/dist/{factory-DcPyqWkY.js.map → factory-B6hBnFAf.js.map} +1 -1
- package/dist/{factory-BkA-IvkR.js → factory-Cn0UwIFB.js} +2 -2
- package/dist/{factory-BkA-IvkR.js.map → factory-Cn0UwIFB.js.map} +1 -1
- package/dist/{hooks-Btogj1f0.js → hooks-D_8Uwk1s.js} +1 -1
- package/dist/{hooks-Btogj1f0.js.map → hooks-D_8Uwk1s.js.map} +1 -1
- package/dist/{index-BzDZOr5P.d.ts → index-BES2zg3c.d.ts} +4 -4
- package/dist/index-BES2zg3c.d.ts.map +1 -0
- package/dist/{index-DE_s19VI.d.ts → index-D2tNV62S.d.ts} +4 -4
- package/dist/index-D2tNV62S.d.ts.map +1 -0
- package/dist/{index-6u5B5ORH.d.ts → index-DMMMQaUe.d.ts} +4 -4
- package/dist/index-DMMMQaUe.d.ts.map +1 -0
- package/dist/{index-BL4jGAtJ.d.ts → index-HHjpYUNP.d.ts} +4 -4
- package/dist/index-HHjpYUNP.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{logger-CYkStoEb.js → logger-DLnGUZk9.js} +1 -1
- package/dist/{logger-CYkStoEb.js.map → logger-DLnGUZk9.js.map} +1 -1
- package/dist/module-1hr_ne9w.js.map +1 -1
- package/dist/{module-DvO77TZz.js → module-BhsG8kkn.js} +7 -7
- package/dist/{module-DvO77TZz.js.map → module-BhsG8kkn.js.map} +1 -1
- package/dist/{module-rS5YXFpM.d.ts → module-D3n9Z2mN.d.ts} +4 -4
- package/dist/module-D3n9Z2mN.d.ts.map +1 -0
- package/dist/{processor-BfQ_DU7u.js → processor-D2z8Eq93.js} +2 -2
- package/dist/{processor-BfQ_DU7u.js.map → processor-D2z8Eq93.js.map} +1 -1
- package/dist/processors/codegen/index.js +2 -2
- package/dist/processors/index.js +1 -1
- package/dist/processors/vetra-read-model/index.js +1 -1
- package/dist/spec-api-CT1DqmgF.js +640 -0
- package/dist/spec-api-CT1DqmgF.js.map +1 -0
- package/dist/specs-_7A7Tl_N.d.ts +90 -0
- package/dist/specs-_7A7Tl_N.d.ts.map +1 -0
- package/dist/switchboard-CvWiUgBP.js +8 -0
- package/dist/{switchboard-C_BapCdk.js.map → switchboard-CvWiUgBP.js.map} +1 -1
- package/dist/{useVetraDocument-tpjMF571.js → useVetraDocument-BpPD6DKR.js} +1 -1
- package/dist/{useVetraDocument-tpjMF571.js.map → useVetraDocument-BpPD6DKR.js.map} +1 -1
- package/dist/utils-B4KdjDnp.js.map +1 -1
- package/dist/utils-BiV3cs9Y.js.map +1 -1
- package/dist/utils-CkWB3DRk.js.map +1 -1
- package/dist/utils-D0ejTHeY.js.map +1 -1
- package/package.json +30 -11
- package/dist/editor-BamOOi9L.js.map +0 -1
- package/dist/editor-CM9tpwzR.js.map +0 -1
- package/dist/editor-D-QqGEkw.js.map +0 -1
- package/dist/editor-Dz3cXtzn.js.map +0 -1
- package/dist/editor-je4HFt2f.js.map +0 -1
- package/dist/editor-rYCWiter.js.map +0 -1
- package/dist/index-6u5B5ORH.d.ts.map +0 -1
- package/dist/index-BL4jGAtJ.d.ts.map +0 -1
- package/dist/index-BzDZOr5P.d.ts.map +0 -1
- package/dist/index-DE_s19VI.d.ts.map +0 -1
- package/dist/module-rS5YXFpM.d.ts.map +0 -1
- package/dist/switchboard-C_BapCdk.js +0 -8
package/dist/codegen/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { tt as AppModuleDocument } from "../index-
|
|
2
|
-
import { q as DocumentEditorDocument } from "../index-
|
|
3
|
-
import { nt as ProcessorModuleDocument } from "../index-
|
|
4
|
-
import { B as SubgraphModuleDocument } from "../index-
|
|
5
|
-
import {
|
|
1
|
+
import { tt as AppModuleDocument } from "../index-BES2zg3c.js";
|
|
2
|
+
import { q as DocumentEditorDocument } from "../index-DMMMQaUe.js";
|
|
3
|
+
import { nt as ProcessorModuleDocument } from "../index-D2tNV62S.js";
|
|
4
|
+
import { B as SubgraphModuleDocument } from "../index-HHjpYUNP.js";
|
|
5
|
+
import { _ as getDocumentModels, a as specDir, c as ActionInput, d as addActions, f as addActionsAndSave, g as getDocumentModelSchema, h as getDocument, i as saveSpec, l as ActionValidationError, m as deleteDocument, n as getSpecEntry, o as specPath, p as createDocument, r as listSpecDocumentTypes, s as stripLeadingDot, t as SPECS_DIRNAME, u as DocumentModelInfo, v as getDocuments, y as validateActions } from "../specs-_7A7Tl_N.js";
|
|
6
|
+
import { DocumentModelDocument } from "@powerhousedao/shared/document-model";
|
|
6
7
|
import { Project } from "ts-morph";
|
|
7
8
|
|
|
8
9
|
//#region codegen/extract.d.ts
|
|
@@ -27,91 +28,5 @@ declare function generateProcessorFromDocument(doc: ProcessorModuleDocument, pro
|
|
|
27
28
|
declare function generateSubgraphFromDocument(doc: SubgraphModuleDocument, project: Project): Promise<void>;
|
|
28
29
|
declare function generateAppFromDocument(doc: AppModuleDocument, project: Project): Promise<void>;
|
|
29
30
|
//#endregion
|
|
30
|
-
//#region codegen/spec-api.d.ts
|
|
31
|
-
type DocumentModelInfo = {
|
|
32
|
-
name: string;
|
|
33
|
-
type: string;
|
|
34
|
-
description: string;
|
|
35
|
-
extension: string;
|
|
36
|
-
authorName: string;
|
|
37
|
-
authorWebsite: string;
|
|
38
|
-
};
|
|
39
|
-
/** Mirrors reactor-mcp `getDocumentModels`. */
|
|
40
|
-
declare function getDocumentModels(): DocumentModelInfo[];
|
|
41
|
-
/** Mirrors reactor-mcp `getDocumentModelSchema`. Returns the full
|
|
42
|
-
* `DocumentModelGlobalState` (schema + operations + errors), same payload
|
|
43
|
-
* shape reactor-mcp serves. */
|
|
44
|
-
declare function getDocumentModelSchema(documentType: string): DocumentModelGlobalState;
|
|
45
|
-
/** Mirrors reactor-mcp `getDocument`. Path = file location on disk. */
|
|
46
|
-
declare function getDocument(path: string): Promise<PHDocument>;
|
|
47
|
-
/** Mirrors reactor-mcp `getDocuments`. `parentId` is the project directory
|
|
48
|
-
* containing `specs/`. */
|
|
49
|
-
declare function getDocuments(projectDir: string, opts?: {
|
|
50
|
-
documentType?: string;
|
|
51
|
-
}): Promise<PHDocument[]>;
|
|
52
|
-
/** Mirrors reactor-mcp `createDocument`. Returns an in-memory document; the
|
|
53
|
-
* caller persists with `saveSpec`. */
|
|
54
|
-
declare function createDocument(documentType: string, opts?: {
|
|
55
|
-
name?: string;
|
|
56
|
-
initialState?: {
|
|
57
|
-
global?: unknown;
|
|
58
|
-
local?: unknown;
|
|
59
|
-
};
|
|
60
|
-
}): PHDocument;
|
|
61
|
-
type ActionInput = {
|
|
62
|
-
type: string;
|
|
63
|
-
input?: unknown;
|
|
64
|
-
scope?: string;
|
|
65
|
-
};
|
|
66
|
-
/** Mirrors reactor-mcp `addActions`. Validates every action up front against
|
|
67
|
-
* the document model's latest specification, then applies them in order via
|
|
68
|
-
* the reducer. If any action is invalid, throws an aggregated error and
|
|
69
|
-
* leaves `doc` untouched. */
|
|
70
|
-
declare function addActions(doc: PHDocument, actions: ActionInput[]): PHDocument;
|
|
71
|
-
type ActionValidationError = {
|
|
72
|
-
/** Position in the input array. */index: number; /** The action's `type` field (or `<missing>` when not a string). */
|
|
73
|
-
type: string; /** Human-readable reasons the action was rejected. */
|
|
74
|
-
errors: string[];
|
|
75
|
-
};
|
|
76
|
-
/** Validate a list of actions without applying them. Returns one entry per
|
|
77
|
-
* invalid action with all of its problems aggregated. Used by `addActions`
|
|
78
|
-
* and exposed for callers that want a dry-run check. */
|
|
79
|
-
declare function validateActions(documentType: string, actions: ActionInput[]): ActionValidationError[];
|
|
80
|
-
/** Mirrors reactor-mcp `deleteDocument`. Removes the spec file from disk. */
|
|
81
|
-
declare function deleteDocument(path: string): Promise<{
|
|
82
|
-
success: boolean;
|
|
83
|
-
}>;
|
|
84
|
-
declare function addActionsAndSave(path: string, projectDir: string, actions: ActionInput[]): Promise<{
|
|
85
|
-
doc: PHDocument;
|
|
86
|
-
savedPath: string;
|
|
87
|
-
}>;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region codegen/specs.d.ts
|
|
90
|
-
declare const SPECS_DIRNAME = "specs";
|
|
91
|
-
type ActionsModule = Record<string, (input?: any) => Action>;
|
|
92
|
-
type SpecEntry = {
|
|
93
|
-
documentType: string;
|
|
94
|
-
subdir: string;
|
|
95
|
-
reducer: Reducer<any>;
|
|
96
|
-
utils: {
|
|
97
|
-
fileExtension: string;
|
|
98
|
-
};
|
|
99
|
-
actions: ActionsModule;
|
|
100
|
-
createDocument: (state?: any) => PHDocument;
|
|
101
|
-
jsonSpec: DocumentModelGlobalState;
|
|
102
|
-
};
|
|
103
|
-
declare function getSpecEntry(documentType: string): SpecEntry;
|
|
104
|
-
declare function listSpecDocumentTypes(): string[];
|
|
105
|
-
/** Returns the directory that holds specs for a given document type. */
|
|
106
|
-
declare function specDir(projectDir: string, documentType: string): string;
|
|
107
|
-
/**
|
|
108
|
-
* Deterministic path for a doc-type + display name.
|
|
109
|
-
* Format: `<projectDir>/<specsDir>/<subdir>/<kebab-name>.<ext>.phd`.
|
|
110
|
-
*/
|
|
111
|
-
declare function specPath(projectDir: string, documentType: string, name: string): string;
|
|
112
|
-
declare function stripLeadingDot(ext: string): string;
|
|
113
|
-
/** Saves a document into `<projectDir>/specs/<subdir>/<kebab-name>.<ext>.phd`. */
|
|
114
|
-
declare function saveSpec(doc: PHDocument, projectDir: string): Promise<string>;
|
|
115
|
-
//#endregion
|
|
116
31
|
export { ActionInput, ActionValidationError, DocumentModelInfo, ExtractedDocuments, SPECS_DIRNAME, addActions, addActionsAndSave, createDocument, deleteDocument, extractAllDocuments, extractAppDocuments, extractDocumentModelDocuments, extractEditorDocuments, extractProcessorDocuments, extractSubgraphDocuments, generateAppFromDocument, generateDocumentModelFromDocument, generateEditorFromDocument, generateProcessorFromDocument, generateSubgraphFromDocument, getDocument, getDocumentModelSchema, getDocumentModels, getDocuments, getSpecEntry, listSpecDocumentTypes, saveSpec, specDir, specPath, stripLeadingDot, validateActions };
|
|
117
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../codegen/extract.ts","../../codegen/generate-from-document.ts"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../codegen/extract.ts","../../codegen/generate-from-document.ts"],"mappings":";;;;;;;;;iBA0DgB,sBAAA,CACd,OAAA,EAAS,OAAA,GACR,sBAAA;AAAA,iBA6Ba,mBAAA,CAAoB,OAAA,EAAS,OAAA,GAAU,iBAAA;AAAA,iBAoBvC,yBAAA,CACd,OAAA,EAAS,OAAA,GACR,uBAAA;AAAA,iBA2Ba,wBAAA,CACd,OAAA,EAAS,OAAA,GACR,sBAAA;AAAA,iBAiBa,6BAAA,CACd,OAAA,EAAS,OAAA,GACR,qBAAA;AAAA,KAsBS,kBAAA;EACV,cAAA,EAAgB,qBAAA;EAChB,OAAA,EAAS,sBAAA;EACT,IAAA,EAAM,iBAAA;EACN,UAAA,EAAY,uBAAA;EACZ,SAAA,EAAW,sBAAA;AAAA;AAAA,iBAMG,mBAAA,CAAoB,OAAA,EAAS,OAAA,GAAU,kBAAA;;;iBCvJjC,iCAAA,CACpB,GAAA,EAAK,qBAAA,EACL,OAAA,EAAS,OAAA,GACR,OAAA;AAAA,iBAImB,0BAAA,CACpB,GAAA,EAAK,sBAAA,EACL,OAAA,EAAS,OAAA,GACR,OAAA;AAAA,iBAemB,6BAAA,CACpB,GAAA,EAAK,uBAAA,EACL,OAAA,EAAS,OAAA,GACR,OAAA;AAAA,iBA+BmB,4BAAA,CACpB,GAAA,EAAK,sBAAA,EACL,OAAA,EAAS,OAAA,GACR,OAAA;AAAA,iBAImB,uBAAA,CACpB,GAAA,EAAK,iBAAA,EACL,OAAA,EAAS,OAAA,GACR,OAAA"}
|