@jotx-labs/core 2.2.0 → 2.4.82

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 (46) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/links/LinkIndexer.d.ts +85 -0
  6. package/dist/links/LinkIndexer.d.ts.map +1 -0
  7. package/dist/links/LinkIndexer.js +238 -0
  8. package/dist/links/LinkIndexer.js.map +1 -0
  9. package/dist/links/LinkParser.d.ts +41 -0
  10. package/dist/links/LinkParser.d.ts.map +1 -0
  11. package/dist/links/LinkParser.js +162 -0
  12. package/dist/links/LinkParser.js.map +1 -0
  13. package/dist/links/index.d.ts +12 -0
  14. package/dist/links/index.d.ts.map +1 -0
  15. package/dist/links/index.js +28 -0
  16. package/dist/links/index.js.map +1 -0
  17. package/dist/links/types.d.ts +66 -0
  18. package/dist/links/types.d.ts.map +1 -0
  19. package/dist/links/types.js +7 -0
  20. package/dist/links/types.js.map +1 -0
  21. package/dist/parser/serializer.d.ts.map +1 -1
  22. package/dist/parser/serializer.js +11 -5
  23. package/dist/parser/serializer.js.map +1 -1
  24. package/dist/parser/tokenizer.new.d.ts +1 -0
  25. package/dist/parser/tokenizer.new.d.ts.map +1 -1
  26. package/dist/parser/tokenizer.new.js +14 -0
  27. package/dist/parser/tokenizer.new.js.map +1 -1
  28. package/dist/parser/v3/BlockParser.js +1 -1
  29. package/dist/parser/v3/BlockParser.js.map +1 -1
  30. package/dist/parser/v3/DocumentParser.d.ts.map +1 -1
  31. package/dist/parser/v3/DocumentParser.js +7 -0
  32. package/dist/parser/v3/DocumentParser.js.map +1 -1
  33. package/dist/parser/validator.js +1 -1
  34. package/dist/parser/validator.js.map +1 -1
  35. package/dist/types/ast.d.ts.map +1 -1
  36. package/dist/types/ast.js +48 -1
  37. package/dist/types/ast.js.map +1 -1
  38. package/dist/types/enums.d.ts +2 -2
  39. package/dist/types/enums.d.ts.map +1 -1
  40. package/dist/types/enums.js +9 -2
  41. package/dist/types/enums.js.map +1 -1
  42. package/dist/types/nodeManager.d.ts +86 -0
  43. package/dist/types/nodeManager.d.ts.map +1 -0
  44. package/dist/types/nodeManager.js +7 -0
  45. package/dist/types/nodeManager.js.map +1 -0
  46. package/package.json +4 -4
@@ -0,0 +1,86 @@
1
+ /**
2
+ * NodeManager - Core types and interfaces
3
+ * Platform-agnostic definitions for node management
4
+ */
5
+ /**
6
+ * Represents a single node (block) in the knowledge graph
7
+ */
8
+ export interface NodeEntry {
9
+ /** Unique identifier (shortUUID) - MUST be unique across entire workspace */
10
+ id: string;
11
+ /** Block type (def, mermaid, heading, paragraph, etc.) */
12
+ type: string;
13
+ /** Absolute path to the .jot file containing this node */
14
+ filePath: string;
15
+ /** Display label (def name, heading text, etc.) */
16
+ label: string;
17
+ /** Block properties from AST */
18
+ properties: Record<string, any>;
19
+ /** Content for preview (text/src/json) */
20
+ content?: string;
21
+ /** Parent node ID (for def hierarchy) */
22
+ parentId?: string;
23
+ /** Child node IDs (for def hierarchy) */
24
+ children: string[];
25
+ }
26
+ /**
27
+ * Represents a def block in the hierarchy tree
28
+ */
29
+ export interface DefTreeNode {
30
+ /** ID of the NodeEntry */
31
+ nodeId: string;
32
+ /** Child def nodes */
33
+ children: DefTreeNode[];
34
+ }
35
+ /**
36
+ * Platform-agnostic NodeManager interface
37
+ * Implemented by VSCodeNodeManager, BrowserNodeManager, etc.
38
+ */
39
+ export interface INodeManager {
40
+ /**
41
+ * Get node by ID - O(1)
42
+ */
43
+ getNode(id: string): NodeEntry | undefined;
44
+ /**
45
+ * Get all nodes in a file - O(1)
46
+ */
47
+ getNodesByFile(filePath: string): NodeEntry[];
48
+ /**
49
+ * Get all nodes of a type - O(1)
50
+ */
51
+ getNodesByType(type: string): NodeEntry[];
52
+ /**
53
+ * Get def tree for a document
54
+ */
55
+ getDefTree(filePath: string): DefTreeNode | undefined;
56
+ /**
57
+ * Get nodes this node links to
58
+ */
59
+ getLinkedNodes(nodeId: string): NodeEntry[];
60
+ /**
61
+ * Get nodes that link to this node (backlinks)
62
+ */
63
+ getBacklinks(nodeId: string): NodeEntry[];
64
+ /**
65
+ * Validate unique IDs across workspace
66
+ * @returns Map of duplicate IDs to file paths
67
+ */
68
+ validateUniqueIds(): Map<string, string[]>;
69
+ /**
70
+ * Re-index a specific file
71
+ */
72
+ reindexFile(filePath: string): Promise<void>;
73
+ /**
74
+ * Full workspace reindex
75
+ */
76
+ fullReindex(): Promise<void>;
77
+ }
78
+ /**
79
+ * Event emitted when graph changes
80
+ */
81
+ export interface NodeManagerChangeEvent {
82
+ type: 'add' | 'update' | 'delete';
83
+ nodeIds: string[];
84
+ filePath: string;
85
+ }
86
+ //# sourceMappingURL=nodeManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeManager.d.ts","sourceRoot":"","sources":["../../src/types/nodeManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAA;IAEV,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IAEZ,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAA;IAEhB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAA;IAEb,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE/B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,EAAE,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAA;IAEd,sBAAsB;IACtB,QAAQ,EAAE,WAAW,EAAE,CAAA;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IAE1C;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;IAE7C;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;IAEzC;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;IAErD;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;IAE3C;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;IAEzC;;;OAGG;IACH,iBAAiB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAE1C;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACjC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACnB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * NodeManager - Core types and interfaces
4
+ * Platform-agnostic definitions for node management
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=nodeManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeManager.js","sourceRoot":"","sources":["../../src/types/nodeManager.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jotx-labs/core",
3
- "version": "2.2.0",
3
+ "version": "2.4.82",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -25,7 +25,7 @@
25
25
  "jotx"
26
26
  ],
27
27
  "author": "jotx",
28
- "license": "MIT",
28
+ "license": "Apache-2.0",
29
29
  "devDependencies": {
30
30
  "@types/jest": "^29.5.0",
31
31
  "@types/node": "^20.0.0",
@@ -36,6 +36,6 @@
36
36
  "dependencies": {
37
37
  "@types/marked": "^6.0.0",
38
38
  "marked": "^17.0.1",
39
- "@jotx/registry": "file:../registry"
39
+ "@jotx-labs/registry": "file:../registry"
40
40
  }
41
- }
41
+ }