@almadar/std 3.2.3 → 3.3.4

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 (163) hide show
  1. package/LICENSE +72 -21
  2. package/README.md +1 -1
  3. package/behaviors/exports/atoms/std-combat-log.orb +12 -12
  4. package/behaviors/exports/atoms/std-dialogue-box.orb +11 -11
  5. package/behaviors/exports/atoms/std-game-audio.orb +9 -9
  6. package/behaviors/exports/atoms/std-game-canvas3d.orb +24 -24
  7. package/behaviors/exports/atoms/std-game-hud.orb +10 -10
  8. package/behaviors/exports/atoms/std-game-menu.orb +12 -12
  9. package/behaviors/exports/atoms/std-game-over-screen.orb +9 -9
  10. package/behaviors/exports/atoms/std-inventory-panel.orb +13 -13
  11. package/behaviors/exports/atoms/std-isometric-canvas.orb +9 -9
  12. package/behaviors/exports/atoms/std-platformer-canvas.orb +9 -9
  13. package/behaviors/exports/atoms/std-score-board.orb +9 -9
  14. package/behaviors/exports/atoms/std-selection.orb +32 -18
  15. package/behaviors/exports/atoms/std-service-custom-bearer.orb +557 -0
  16. package/behaviors/exports/atoms/std-service-custom-header.orb +559 -0
  17. package/behaviors/exports/atoms/std-service-custom-noauth.orb +553 -0
  18. package/behaviors/exports/atoms/std-service-custom-query.orb +559 -0
  19. package/behaviors/exports/atoms/std-service-email.orb +540 -0
  20. package/behaviors/exports/atoms/std-service-github.orb +586 -0
  21. package/behaviors/exports/atoms/std-service-llm.orb +671 -0
  22. package/behaviors/exports/atoms/std-service-oauth.orb +764 -0
  23. package/behaviors/exports/atoms/std-service-redis.orb +580 -0
  24. package/behaviors/exports/atoms/std-service-storage.orb +664 -0
  25. package/behaviors/exports/atoms/std-service-stripe.orb +639 -0
  26. package/behaviors/exports/atoms/std-service-twilio.orb +611 -0
  27. package/behaviors/exports/atoms/std-service-youtube.orb +696 -0
  28. package/behaviors/exports/atoms/std-simulation-canvas.orb +9 -9
  29. package/behaviors/exports/atoms/std-sprite.orb +17 -17
  30. package/behaviors/exports/atoms/std-validate-on-save.orb +623 -0
  31. package/behaviors/exports/molecules/std-quiz.orb +48 -24
  32. package/behaviors/exports/molecules/std-service-content-pipeline.orb +915 -0
  33. package/behaviors/exports/molecules/std-service-custom-api-tester.orb +860 -0
  34. package/behaviors/exports/molecules/std-service-devops-toolkit.orb +1526 -0
  35. package/behaviors/exports/molecules/std-service-notification-hub.orb +696 -0
  36. package/behaviors/exports/molecules/std-service-payment-flow.orb +873 -0
  37. package/behaviors/exports/organisms/std-service-marketplace.orb +5191 -0
  38. package/behaviors/exports/organisms/std-service-research-assistant.orb +3568 -0
  39. package/behaviors/exports/test-schemas/os-trigger-simulation.orb +202 -0
  40. package/behaviors/exports/validation-report.json +2 -2
  41. package/dist/behaviors/exports/atoms/std-combat-log.orb +12 -12
  42. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +11 -11
  43. package/dist/behaviors/exports/atoms/std-game-audio.orb +9 -9
  44. package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +24 -24
  45. package/dist/behaviors/exports/atoms/std-game-hud.orb +10 -10
  46. package/dist/behaviors/exports/atoms/std-game-menu.orb +12 -12
  47. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +9 -9
  48. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +13 -13
  49. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +9 -9
  50. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +9 -9
  51. package/dist/behaviors/exports/atoms/std-score-board.orb +9 -9
  52. package/dist/behaviors/exports/atoms/std-selection.orb +32 -18
  53. package/dist/behaviors/exports/atoms/std-service-custom-bearer.orb +557 -0
  54. package/dist/behaviors/exports/atoms/std-service-custom-header.orb +559 -0
  55. package/dist/behaviors/exports/atoms/std-service-custom-noauth.orb +553 -0
  56. package/dist/behaviors/exports/atoms/std-service-custom-query.orb +559 -0
  57. package/dist/behaviors/exports/atoms/std-service-email.orb +540 -0
  58. package/dist/behaviors/exports/atoms/std-service-github.orb +586 -0
  59. package/dist/behaviors/exports/atoms/std-service-llm.orb +671 -0
  60. package/dist/behaviors/exports/atoms/std-service-oauth.orb +764 -0
  61. package/dist/behaviors/exports/atoms/std-service-redis.orb +580 -0
  62. package/dist/behaviors/exports/atoms/std-service-storage.orb +664 -0
  63. package/dist/behaviors/exports/atoms/std-service-stripe.orb +639 -0
  64. package/dist/behaviors/exports/atoms/std-service-twilio.orb +611 -0
  65. package/dist/behaviors/exports/atoms/std-service-youtube.orb +696 -0
  66. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +9 -9
  67. package/dist/behaviors/exports/atoms/std-sprite.orb +17 -17
  68. package/dist/behaviors/exports/atoms/std-validate-on-save.orb +623 -0
  69. package/dist/behaviors/exports/molecules/std-quiz.orb +48 -24
  70. package/dist/behaviors/exports/molecules/std-service-content-pipeline.orb +915 -0
  71. package/dist/behaviors/exports/molecules/std-service-custom-api-tester.orb +860 -0
  72. package/dist/behaviors/exports/molecules/std-service-devops-toolkit.orb +1526 -0
  73. package/dist/behaviors/exports/molecules/std-service-notification-hub.orb +696 -0
  74. package/dist/behaviors/exports/molecules/std-service-payment-flow.orb +873 -0
  75. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +5191 -0
  76. package/dist/behaviors/exports/organisms/std-service-research-assistant.orb +3568 -0
  77. package/dist/behaviors/exports/test-schemas/os-trigger-simulation.orb +202 -0
  78. package/dist/behaviors/exports/validation-report.json +2 -2
  79. package/dist/behaviors/functions/index.d.ts +662 -1
  80. package/dist/behaviors/functions/index.js +7638 -2117
  81. package/dist/behaviors/functions/index.js.map +1 -1
  82. package/dist/behaviors/index.d.ts +1 -1
  83. package/dist/behaviors/index.js +7638 -2117
  84. package/dist/behaviors/index.js.map +1 -1
  85. package/dist/exports/atoms/std-combat-log.orb +12 -12
  86. package/dist/exports/atoms/std-dialogue-box.orb +11 -11
  87. package/dist/exports/atoms/std-game-audio.orb +9 -9
  88. package/dist/exports/atoms/std-game-canvas3d.orb +24 -24
  89. package/dist/exports/atoms/std-game-hud.orb +10 -10
  90. package/dist/exports/atoms/std-game-menu.orb +12 -12
  91. package/dist/exports/atoms/std-game-over-screen.orb +9 -9
  92. package/dist/exports/atoms/std-inventory-panel.orb +13 -13
  93. package/dist/exports/atoms/std-isometric-canvas.orb +9 -9
  94. package/dist/exports/atoms/std-platformer-canvas.orb +9 -9
  95. package/dist/exports/atoms/std-score-board.orb +9 -9
  96. package/dist/exports/atoms/std-selection.orb +32 -18
  97. package/dist/exports/atoms/std-service-custom-bearer.orb +557 -0
  98. package/dist/exports/atoms/std-service-custom-header.orb +559 -0
  99. package/dist/exports/atoms/std-service-custom-noauth.orb +553 -0
  100. package/dist/exports/atoms/std-service-custom-query.orb +559 -0
  101. package/dist/exports/atoms/std-service-email.orb +540 -0
  102. package/dist/exports/atoms/std-service-github.orb +586 -0
  103. package/dist/exports/atoms/std-service-llm.orb +671 -0
  104. package/dist/exports/atoms/std-service-oauth.orb +764 -0
  105. package/dist/exports/atoms/std-service-redis.orb +580 -0
  106. package/dist/exports/atoms/std-service-storage.orb +664 -0
  107. package/dist/exports/atoms/std-service-stripe.orb +639 -0
  108. package/dist/exports/atoms/std-service-twilio.orb +611 -0
  109. package/dist/exports/atoms/std-service-youtube.orb +696 -0
  110. package/dist/exports/atoms/std-simulation-canvas.orb +9 -9
  111. package/dist/exports/atoms/std-sprite.orb +17 -17
  112. package/dist/exports/atoms/std-validate-on-save.orb +623 -0
  113. package/dist/exports/molecules/std-quiz.orb +48 -24
  114. package/dist/exports/molecules/std-service-content-pipeline.orb +915 -0
  115. package/dist/exports/molecules/std-service-custom-api-tester.orb +860 -0
  116. package/dist/exports/molecules/std-service-devops-toolkit.orb +1526 -0
  117. package/dist/exports/molecules/std-service-notification-hub.orb +696 -0
  118. package/dist/exports/molecules/std-service-payment-flow.orb +873 -0
  119. package/dist/exports/organisms/std-service-marketplace.orb +5191 -0
  120. package/dist/exports/organisms/std-service-research-assistant.orb +3568 -0
  121. package/dist/exports/test-schemas/os-trigger-simulation.orb +202 -0
  122. package/dist/exports/validation-report.json +2 -2
  123. package/dist/index.d.ts +3 -3
  124. package/dist/index.js +7887 -2216
  125. package/dist/index.js.map +1 -1
  126. package/dist/modules/array.d.ts +1 -1
  127. package/dist/modules/async.d.ts +1 -1
  128. package/dist/modules/contract.d.ts +22 -0
  129. package/dist/modules/contract.js +100 -0
  130. package/dist/modules/contract.js.map +1 -0
  131. package/dist/modules/data.d.ts +22 -0
  132. package/dist/modules/data.js +117 -0
  133. package/dist/modules/data.js.map +1 -0
  134. package/dist/modules/format.d.ts +1 -1
  135. package/dist/modules/graph.d.ts +23 -0
  136. package/dist/modules/graph.js +209 -0
  137. package/dist/modules/graph.js.map +1 -0
  138. package/dist/modules/index.d.ts +5 -1
  139. package/dist/modules/index.js +593 -63
  140. package/dist/modules/index.js.map +1 -1
  141. package/dist/modules/math.d.ts +1 -1
  142. package/dist/modules/nn.d.ts +1 -1
  143. package/dist/modules/nn.js +14 -14
  144. package/dist/modules/nn.js.map +1 -1
  145. package/dist/modules/object.d.ts +1 -1
  146. package/dist/modules/os.d.ts +19 -0
  147. package/dist/modules/os.js +116 -0
  148. package/dist/modules/os.js.map +1 -0
  149. package/dist/modules/prob.d.ts +1 -1
  150. package/dist/modules/str.d.ts +1 -1
  151. package/dist/modules/tensor.d.ts +1 -1
  152. package/dist/modules/tensor.js +29 -29
  153. package/dist/modules/tensor.js.map +1 -1
  154. package/dist/modules/time.d.ts +1 -1
  155. package/dist/modules/train.d.ts +1 -1
  156. package/dist/modules/train.js +19 -19
  157. package/dist/modules/train.js.map +1 -1
  158. package/dist/modules/validate.d.ts +1 -1
  159. package/dist/registry.d.ts +2 -2
  160. package/dist/registry.js +184 -65
  161. package/dist/registry.js.map +1 -1
  162. package/dist/{types-CmNM_IbV.d.ts → types-DOeGXRCm.d.ts} +3 -3
  163. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
2
 
3
3
  /**
4
4
  * Array Module - Collection Operations
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
2
 
3
3
  /**
4
4
  * Async Module - Asynchronous Operations
@@ -0,0 +1,22 @@
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
+
3
+ /**
4
+ * Contract Module - ML Contract Validation Operations
5
+ *
6
+ * Provides operators for validating tensors against input/output contracts
7
+ * and converting between entity fields and tensors via contract mappings.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ /**
13
+ * Contract module operators.
14
+ * These operators validate and transform data using contract specifications.
15
+ */
16
+ declare const CONTRACT_OPERATORS: Record<string, StdOperatorMeta>;
17
+ /**
18
+ * Get all contract operator names.
19
+ */
20
+ declare function getContractOperators(): string[];
21
+
22
+ export { CONTRACT_OPERATORS, getContractOperators };
@@ -0,0 +1,100 @@
1
+ // modules/contract.ts
2
+ var CONTRACT_OPERATORS = {
3
+ // ============================================================================
4
+ // Validation
5
+ // ============================================================================
6
+ "contract/validate-input": {
7
+ module: "contract",
8
+ category: "ml-contract",
9
+ minArity: 2,
10
+ maxArity: 2,
11
+ description: "Validate tensor against input contract",
12
+ hasSideEffects: false,
13
+ returnType: "boolean",
14
+ params: [
15
+ { name: "tensor", type: "tensor", description: "Input tensor" },
16
+ { name: "contract", type: "object", description: "Input contract spec" }
17
+ ],
18
+ example: '["contract/validate-input", "@payload.input", "@entity.inputContract"]'
19
+ },
20
+ "contract/validate-output": {
21
+ module: "contract",
22
+ category: "ml-contract",
23
+ minArity: 2,
24
+ maxArity: 2,
25
+ description: "Validate tensor against output contract",
26
+ hasSideEffects: false,
27
+ returnType: "boolean",
28
+ params: [
29
+ { name: "tensor", type: "tensor", description: "Output tensor" },
30
+ { name: "contract", type: "object", description: "Output contract spec" }
31
+ ],
32
+ example: '["contract/validate-output", "@entity.output", "@entity.outputContract"]'
33
+ },
34
+ "contract/clamp-output": {
35
+ module: "contract",
36
+ category: "ml-contract",
37
+ minArity: 2,
38
+ maxArity: 2,
39
+ description: "Clamp output tensor to contract ranges",
40
+ hasSideEffects: false,
41
+ returnType: "tensor",
42
+ params: [
43
+ { name: "tensor", type: "tensor", description: "Output tensor" },
44
+ { name: "contract", type: "object", description: "Output contract spec" }
45
+ ],
46
+ example: '["contract/clamp-output", "@entity.output", "@entity.outputContract"]'
47
+ },
48
+ "contract/violations": {
49
+ module: "contract",
50
+ category: "ml-contract",
51
+ minArity: 2,
52
+ maxArity: 2,
53
+ description: "List contract violations",
54
+ hasSideEffects: false,
55
+ returnType: "array",
56
+ params: [
57
+ { name: "tensor", type: "tensor", description: "Tensor to check" },
58
+ { name: "contract", type: "object", description: "Contract spec" }
59
+ ],
60
+ example: '["contract/violations", "@entity.output", "@entity.outputContract"]'
61
+ },
62
+ // ============================================================================
63
+ // Conversion
64
+ // ============================================================================
65
+ "contract/entity-to-tensor": {
66
+ module: "contract",
67
+ category: "ml-contract",
68
+ minArity: 2,
69
+ maxArity: 2,
70
+ description: "Convert entity fields to tensor via contract",
71
+ hasSideEffects: false,
72
+ returnType: "tensor",
73
+ params: [
74
+ { name: "entity", type: "object", description: "Entity data" },
75
+ { name: "contract", type: "object", description: "Input contract mapping fields to dims" }
76
+ ],
77
+ example: '["contract/entity-to-tensor", "@entity", "@entity.inputContract"]'
78
+ },
79
+ "contract/tensor-to-payload": {
80
+ module: "contract",
81
+ category: "ml-contract",
82
+ minArity: 2,
83
+ maxArity: 2,
84
+ description: "Convert output tensor to event payload via contract",
85
+ hasSideEffects: false,
86
+ returnType: "object",
87
+ params: [
88
+ { name: "tensor", type: "tensor", description: "Output tensor" },
89
+ { name: "contract", type: "object", description: "Output contract mapping dims to fields" }
90
+ ],
91
+ example: '["contract/tensor-to-payload", "@entity.output", "@entity.outputContract"]'
92
+ }
93
+ };
94
+ function getContractOperators() {
95
+ return Object.keys(CONTRACT_OPERATORS);
96
+ }
97
+
98
+ export { CONTRACT_OPERATORS, getContractOperators };
99
+ //# sourceMappingURL=contract.js.map
100
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../modules/contract.ts"],"names":[],"mappings":";AAeO,IAAM,kBAAA,GAAsD;AAAA;AAAA;AAAA;AAAA,EAKjE,yBAAA,EAA2B;AAAA,IACzB,MAAA,EAAQ,UAAA;AAAA,IACR,QAAA,EAAU,aAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,wCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,SAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,cAAA,EAAe;AAAA,MAC9D,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,QAAA,EAAU,aAAa,qBAAA;AAAsB,KACzE;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,0BAAA,EAA4B;AAAA,IAC1B,MAAA,EAAQ,UAAA;AAAA,IACR,QAAA,EAAU,aAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,yCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,SAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,eAAA,EAAgB;AAAA,MAC/D,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,QAAA,EAAU,aAAa,sBAAA;AAAuB,KAC1E;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,uBAAA,EAAyB;AAAA,IACvB,MAAA,EAAQ,UAAA;AAA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AAA,EAAc;AAAA,MAC7D,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,QAAA,EAAU,aAAa,uCAAA;AAAwC,KAC3F;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,4BAAA,EAA8B;AAAA,IAC5B,MAAA,EAAQ,UAAA;AAAA,IACR,QAAA,EAAU,aAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,qDAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,eAAA,EAAgB;AAAA,MAC/D,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,QAAA,EAAU,aAAa,wCAAA;AAAyC,KAC5F;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,oBAAA,GAAiC;AAC/C,EAAA,OAAO,MAAA,CAAO,KAAK,kBAAkB,CAAA;AACvC","file":"contract.js","sourcesContent":["/**\n * Contract Module - ML Contract Validation Operations\n *\n * Provides operators for validating tensors against input/output contracts\n * and converting between entity fields and tensors via contract mappings.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Contract module operators.\n * These operators validate and transform data using contract specifications.\n */\nexport const CONTRACT_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Validation\n // ============================================================================\n\n 'contract/validate-input': {\n module: 'contract',\n category: 'ml-contract',\n minArity: 2,\n maxArity: 2,\n description: 'Validate tensor against input contract',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'tensor', type: 'tensor', description: 'Input tensor' },\n { name: 'contract', type: 'object', description: 'Input contract spec' },\n ],\n example: '[\"contract/validate-input\", \"@payload.input\", \"@entity.inputContract\"]',\n },\n 'contract/validate-output': {\n module: 'contract',\n category: 'ml-contract',\n minArity: 2,\n maxArity: 2,\n description: 'Validate tensor against output contract',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'tensor', type: 'tensor', description: 'Output tensor' },\n { name: 'contract', type: 'object', description: 'Output contract spec' },\n ],\n example: '[\"contract/validate-output\", \"@entity.output\", \"@entity.outputContract\"]',\n },\n 'contract/clamp-output': {\n module: 'contract',\n category: 'ml-contract',\n minArity: 2,\n maxArity: 2,\n description: 'Clamp output tensor to contract ranges',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'Output tensor' },\n { name: 'contract', type: 'object', description: 'Output contract spec' },\n ],\n example: '[\"contract/clamp-output\", \"@entity.output\", \"@entity.outputContract\"]',\n },\n 'contract/violations': {\n module: 'contract',\n category: 'ml-contract',\n minArity: 2,\n maxArity: 2,\n description: 'List contract violations',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'tensor', type: 'tensor', description: 'Tensor to check' },\n { name: 'contract', type: 'object', description: 'Contract spec' },\n ],\n example: '[\"contract/violations\", \"@entity.output\", \"@entity.outputContract\"]',\n },\n\n // ============================================================================\n // Conversion\n // ============================================================================\n\n 'contract/entity-to-tensor': {\n module: 'contract',\n category: 'ml-contract',\n minArity: 2,\n maxArity: 2,\n description: 'Convert entity fields to tensor via contract',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'entity', type: 'object', description: 'Entity data' },\n { name: 'contract', type: 'object', description: 'Input contract mapping fields to dims' },\n ],\n example: '[\"contract/entity-to-tensor\", \"@entity\", \"@entity.inputContract\"]',\n },\n 'contract/tensor-to-payload': {\n module: 'contract',\n category: 'ml-contract',\n minArity: 2,\n maxArity: 2,\n description: 'Convert output tensor to event payload via contract',\n hasSideEffects: false,\n returnType: 'object',\n params: [\n { name: 'tensor', type: 'tensor', description: 'Output tensor' },\n { name: 'contract', type: 'object', description: 'Output contract mapping dims to fields' },\n ],\n example: '[\"contract/tensor-to-payload\", \"@entity.output\", \"@entity.outputContract\"]',\n },\n};\n\n/**\n * Get all contract operator names.\n */\nexport function getContractOperators(): string[] {\n return Object.keys(CONTRACT_OPERATORS);\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
+
3
+ /**
4
+ * Data Module - ML Data Preprocessing Operations
5
+ *
6
+ * Provides operators for creating datasets, dataloaders, and preprocessing
7
+ * pipelines for ML training workflows.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ /**
13
+ * Data module operators.
14
+ * These operators handle dataset creation, splitting, normalization, and augmentation.
15
+ */
16
+ declare const DATA_OPERATORS: Record<string, StdOperatorMeta>;
17
+ /**
18
+ * Get all data operator names.
19
+ */
20
+ declare function getDataOperators(): string[];
21
+
22
+ export { DATA_OPERATORS, getDataOperators };
@@ -0,0 +1,117 @@
1
+ // modules/data.ts
2
+ var DATA_OPERATORS = {
3
+ // ============================================================================
4
+ // Dataset Creation
5
+ // ============================================================================
6
+ "data/dataset": {
7
+ module: "data",
8
+ category: "ml-data",
9
+ minArity: 2,
10
+ maxArity: 2,
11
+ description: "Create dataset from entity collection and contracts",
12
+ hasSideEffects: false,
13
+ returnType: "object",
14
+ params: [
15
+ { name: "entities", type: "array", description: "Entity collection" },
16
+ { name: "contracts", type: "object", description: "Input/output contract pair" }
17
+ ],
18
+ example: '["data/dataset", "@entity.trainingData", "@entity.contracts"]'
19
+ },
20
+ "data/dataloader": {
21
+ module: "data",
22
+ category: "ml-data",
23
+ minArity: 2,
24
+ maxArity: 2,
25
+ description: "Create batched dataloader from dataset",
26
+ hasSideEffects: false,
27
+ returnType: "object",
28
+ params: [
29
+ { name: "dataset", type: "object", description: "Dataset" },
30
+ { name: "config", type: "object", description: "Config with batch_size, shuffle, etc." }
31
+ ],
32
+ example: '["data/dataloader", "@entity.dataset", { "batch-size": 32, "shuffle": true }]'
33
+ },
34
+ "data/split": {
35
+ module: "data",
36
+ category: "ml-data",
37
+ minArity: 2,
38
+ maxArity: 2,
39
+ description: "Train/val/test split",
40
+ hasSideEffects: false,
41
+ returnType: "array",
42
+ params: [
43
+ { name: "dataset", type: "object", description: "Dataset" },
44
+ { name: "ratios", type: "array", description: "Split ratios e.g. [0.8, 0.1, 0.1]" }
45
+ ],
46
+ example: '["data/split", "@entity.dataset", [0.8, 0.1, 0.1]]'
47
+ },
48
+ // ============================================================================
49
+ // Preprocessing
50
+ // ============================================================================
51
+ "data/normalize": {
52
+ module: "data",
53
+ category: "ml-data",
54
+ minArity: 2,
55
+ maxArity: 2,
56
+ description: "Normalize features (mean/std or min/max)",
57
+ hasSideEffects: false,
58
+ returnType: "tensor",
59
+ params: [
60
+ { name: "tensor", type: "tensor", description: "Feature tensor" },
61
+ { name: "config", type: "object", description: "Normalization config (method, per_dim, etc.)" }
62
+ ],
63
+ example: '["data/normalize", "@entity.features", { "method": "standard" }]'
64
+ },
65
+ "data/augment": {
66
+ module: "data",
67
+ category: "ml-data",
68
+ minArity: 2,
69
+ maxArity: 2,
70
+ description: "Apply data augmentation",
71
+ hasSideEffects: false,
72
+ returnType: "object",
73
+ params: [
74
+ { name: "dataset", type: "object", description: "Dataset" },
75
+ { name: "config", type: "object", description: "Augmentation config" }
76
+ ],
77
+ example: '["data/augment", "@entity.dataset", { "flip": true, "rotate": 15 }]'
78
+ },
79
+ // ============================================================================
80
+ // Tokenization & Padding
81
+ // ============================================================================
82
+ "data/tokenize": {
83
+ module: "data",
84
+ category: "ml-data",
85
+ minArity: 2,
86
+ maxArity: 2,
87
+ description: "Tokenize text fields",
88
+ hasSideEffects: false,
89
+ returnType: "tensor",
90
+ params: [
91
+ { name: "text", type: "string", description: "Text to tokenize" },
92
+ { name: "config", type: "object", description: "Tokenizer config (method, vocab_size, max_length)" }
93
+ ],
94
+ example: '["data/tokenize", "@entity.text", { "method": "bpe", "max-length": 512 }]'
95
+ },
96
+ "data/pad": {
97
+ module: "data",
98
+ category: "ml-data",
99
+ minArity: 2,
100
+ maxArity: 2,
101
+ description: "Pad sequences to uniform length",
102
+ hasSideEffects: false,
103
+ returnType: "tensor",
104
+ params: [
105
+ { name: "sequences", type: "array", description: "List of token sequences" },
106
+ { name: "config", type: "object", description: "Padding config (max_length, pad_value)" }
107
+ ],
108
+ example: '["data/pad", "@entity.sequences", { "max-length": 512, "pad-value": 0 }]'
109
+ }
110
+ };
111
+ function getDataOperators() {
112
+ return Object.keys(DATA_OPERATORS);
113
+ }
114
+
115
+ export { DATA_OPERATORS, getDataOperators };
116
+ //# sourceMappingURL=data.js.map
117
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../modules/data.ts"],"names":[],"mappings":";AAeO,IAAM,cAAA,GAAkD;AAAA;AAAA;AAAA;AAAA,EAK7D,cAAA,EAAgB;AAAA,IACd,MAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAU,SAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,qDAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAS,aAAa,mBAAA,EAAoB;AAAA,MACpE,EAAE,IAAA,EAAM,WAAA,EAAa,IAAA,EAAM,QAAA,EAAU,aAAa,4BAAA;AAA6B,KACjF;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,MAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAU,SAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,wCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,E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EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,wCAAA;AAAyC,KAC1F;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,gBAAA,GAA6B;AAC3C,EAAA,OAAO,MAAA,CAAO,KAAK,cAAc,CAAA;AACnC","file":"data.js","sourcesContent":["/**\n * Data Module - ML Data Preprocessing Operations\n *\n * Provides operators for creating datasets, dataloaders, and preprocessing\n * pipelines for ML training workflows.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Data module operators.\n * These operators handle dataset creation, splitting, normalization, and augmentation.\n */\nexport const DATA_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Dataset Creation\n // ============================================================================\n\n 'data/dataset': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Create dataset from entity collection and contracts',\n hasSideEffects: false,\n returnType: 'object',\n params: [\n { name: 'entities', type: 'array', description: 'Entity collection' },\n { name: 'contracts', type: 'object', description: 'Input/output contract pair' },\n ],\n example: '[\"data/dataset\", \"@entity.trainingData\", \"@entity.contracts\"]',\n },\n 'data/dataloader': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Create batched dataloader from dataset',\n hasSideEffects: false,\n returnType: 'object',\n params: [\n { name: 'dataset', type: 'object', description: 'Dataset' },\n { name: 'config', type: 'object', description: 'Config with batch_size, shuffle, etc.' },\n ],\n example: '[\"data/dataloader\", \"@entity.dataset\", { \"batch-size\": 32, \"shuffle\": true }]',\n },\n 'data/split': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Train/val/test split',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'dataset', type: 'object', description: 'Dataset' },\n { name: 'ratios', type: 'array', description: 'Split ratios e.g. [0.8, 0.1, 0.1]' },\n ],\n example: '[\"data/split\", \"@entity.dataset\", [0.8, 0.1, 0.1]]',\n },\n\n // ============================================================================\n // Preprocessing\n // ============================================================================\n\n 'data/normalize': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Normalize features (mean/std or min/max)',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'Feature tensor' },\n { name: 'config', type: 'object', description: 'Normalization config (method, per_dim, etc.)' },\n ],\n example: '[\"data/normalize\", \"@entity.features\", { \"method\": \"standard\" }]',\n },\n 'data/augment': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Apply data augmentation',\n hasSideEffects: false,\n returnType: 'object',\n params: [\n { name: 'dataset', type: 'object', description: 'Dataset' },\n { name: 'config', type: 'object', description: 'Augmentation config' },\n ],\n example: '[\"data/augment\", \"@entity.dataset\", { \"flip\": true, \"rotate\": 15 }]',\n },\n\n // ============================================================================\n // Tokenization & Padding\n // ============================================================================\n\n 'data/tokenize': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Tokenize text fields',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'text', type: 'string', description: 'Text to tokenize' },\n { name: 'config', type: 'object', description: 'Tokenizer config (method, vocab_size, max_length)' },\n ],\n example: '[\"data/tokenize\", \"@entity.text\", { \"method\": \"bpe\", \"max-length\": 512 }]',\n },\n 'data/pad': {\n module: 'data',\n category: 'ml-data',\n minArity: 2,\n maxArity: 2,\n description: 'Pad sequences to uniform length',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'sequences', type: 'array', description: 'List of token sequences' },\n { name: 'config', type: 'object', description: 'Padding config (max_length, pad_value)' },\n ],\n example: '[\"data/pad\", \"@entity.sequences\", { \"max-length\": 512, \"pad-value\": 0 }]',\n },\n};\n\n/**\n * Get all data operator names.\n */\nexport function getDataOperators(): string[] {\n return Object.keys(DATA_OPERATORS);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
2
 
3
3
  /**
4
4
  * Format Module - Display Formatting
@@ -0,0 +1,23 @@
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
+
3
+ /**
4
+ * Graph Module - Graph Neural Network Operations
5
+ *
6
+ * Provides operators for building and manipulating graphs for GNN workloads.
7
+ * Graphs are PyG-style data structures with node features, edge indices,
8
+ * and optional edge features.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+
13
+ /**
14
+ * Graph module operators.
15
+ * These operators build and manipulate graph data structures.
16
+ */
17
+ declare const GRAPH_OPERATORS: Record<string, StdOperatorMeta>;
18
+ /**
19
+ * Get all graph operator names.
20
+ */
21
+ declare function getGraphOperators(): string[];
22
+
23
+ export { GRAPH_OPERATORS, getGraphOperators };
@@ -0,0 +1,209 @@
1
+ // modules/graph.ts
2
+ var GRAPH_OPERATORS = {
3
+ // ============================================================================
4
+ // Construction
5
+ // ============================================================================
6
+ "graph/from-entities": {
7
+ module: "graph",
8
+ category: "ml-graph",
9
+ minArity: 1,
10
+ maxArity: 1,
11
+ description: "Build PyG graph from entity collections",
12
+ hasSideEffects: false,
13
+ returnType: "graph",
14
+ params: [
15
+ { name: "config", type: "object", description: "Graph construction config (nodes, edges, node-features, edge-features, directed)" }
16
+ ],
17
+ example: '["graph/from-entities", { "nodes": "User", "edges": "Follows" }]'
18
+ },
19
+ "graph/from-adjacency": {
20
+ module: "graph",
21
+ category: "ml-graph",
22
+ minArity: 2,
23
+ maxArity: 2,
24
+ description: "Build graph from adjacency matrix and features",
25
+ hasSideEffects: false,
26
+ returnType: "graph",
27
+ params: [
28
+ { name: "adjacency", type: "tensor", description: "Adjacency matrix" },
29
+ { name: "features", type: "tensor", description: "Node feature matrix" }
30
+ ],
31
+ example: '["graph/from-adjacency", "@entity.adj", "@entity.features"]'
32
+ },
33
+ "graph/from-edge-list": {
34
+ module: "graph",
35
+ category: "ml-graph",
36
+ minArity: 2,
37
+ maxArity: 2,
38
+ description: "Build graph from edge list and features",
39
+ hasSideEffects: false,
40
+ returnType: "graph",
41
+ params: [
42
+ { name: "edges", type: "tensor", description: "Edge index tensor [2, num_edges]" },
43
+ { name: "features", type: "tensor", description: "Node feature matrix" }
44
+ ],
45
+ example: '["graph/from-edge-list", "@entity.edges", "@entity.features"]'
46
+ },
47
+ // ============================================================================
48
+ // Transforms
49
+ // ============================================================================
50
+ "graph/add-self-loops": {
51
+ module: "graph",
52
+ category: "ml-graph",
53
+ minArity: 1,
54
+ maxArity: 1,
55
+ description: "Add self-loop edges to graph",
56
+ hasSideEffects: false,
57
+ returnType: "graph",
58
+ params: [
59
+ { name: "graph", type: "graph", description: "Input graph" }
60
+ ],
61
+ example: '["graph/add-self-loops", "@entity.graph"]'
62
+ },
63
+ "graph/to-undirected": {
64
+ module: "graph",
65
+ category: "ml-graph",
66
+ minArity: 1,
67
+ maxArity: 1,
68
+ description: "Convert directed graph to undirected",
69
+ hasSideEffects: false,
70
+ returnType: "graph",
71
+ params: [
72
+ { name: "graph", type: "graph", description: "Input graph" }
73
+ ],
74
+ example: '["graph/to-undirected", "@entity.graph"]'
75
+ },
76
+ "graph/subgraph": {
77
+ module: "graph",
78
+ category: "ml-graph",
79
+ minArity: 2,
80
+ maxArity: 2,
81
+ description: "Extract subgraph by node mask",
82
+ hasSideEffects: false,
83
+ returnType: "graph",
84
+ params: [
85
+ { name: "graph", type: "graph", description: "Input graph" },
86
+ { name: "mask", type: "tensor", description: "Boolean node mask" }
87
+ ],
88
+ example: '["graph/subgraph", "@entity.graph", "@entity.mask"]'
89
+ },
90
+ "graph/k-hop": {
91
+ module: "graph",
92
+ category: "ml-graph",
93
+ minArity: 3,
94
+ maxArity: 3,
95
+ description: "K-hop neighborhood subgraph",
96
+ hasSideEffects: false,
97
+ returnType: "graph",
98
+ params: [
99
+ { name: "graph", type: "graph", description: "Input graph" },
100
+ { name: "node", type: "number", description: "Center node index" },
101
+ { name: "k", type: "number", description: "Number of hops" }
102
+ ],
103
+ example: '["graph/k-hop", "@entity.graph", 0, 2]'
104
+ },
105
+ // ============================================================================
106
+ // Accessors
107
+ // ============================================================================
108
+ "graph/node-features": {
109
+ module: "graph",
110
+ category: "ml-graph",
111
+ minArity: 1,
112
+ maxArity: 1,
113
+ description: "Get node feature matrix",
114
+ hasSideEffects: false,
115
+ returnType: "tensor",
116
+ params: [
117
+ { name: "graph", type: "graph", description: "Input graph" }
118
+ ],
119
+ example: '["graph/node-features", "@entity.graph"]'
120
+ },
121
+ "graph/edge-index": {
122
+ module: "graph",
123
+ category: "ml-graph",
124
+ minArity: 1,
125
+ maxArity: 1,
126
+ description: "Get edge index tensor",
127
+ hasSideEffects: false,
128
+ returnType: "tensor",
129
+ params: [
130
+ { name: "graph", type: "graph", description: "Input graph" }
131
+ ],
132
+ example: '["graph/edge-index", "@entity.graph"]'
133
+ },
134
+ "graph/edge-features": {
135
+ module: "graph",
136
+ category: "ml-graph",
137
+ minArity: 1,
138
+ maxArity: 1,
139
+ description: "Get edge feature matrix",
140
+ hasSideEffects: false,
141
+ returnType: "tensor",
142
+ params: [
143
+ { name: "graph", type: "graph", description: "Input graph" }
144
+ ],
145
+ example: '["graph/edge-features", "@entity.graph"]'
146
+ },
147
+ "graph/num-nodes": {
148
+ module: "graph",
149
+ category: "ml-graph",
150
+ minArity: 1,
151
+ maxArity: 1,
152
+ description: "Get node count",
153
+ hasSideEffects: false,
154
+ returnType: "number",
155
+ params: [
156
+ { name: "graph", type: "graph", description: "Input graph" }
157
+ ],
158
+ example: '["graph/num-nodes", "@entity.graph"]'
159
+ },
160
+ "graph/num-edges": {
161
+ module: "graph",
162
+ category: "ml-graph",
163
+ minArity: 1,
164
+ maxArity: 1,
165
+ description: "Get edge count",
166
+ hasSideEffects: false,
167
+ returnType: "number",
168
+ params: [
169
+ { name: "graph", type: "graph", description: "Input graph" }
170
+ ],
171
+ example: '["graph/num-edges", "@entity.graph"]'
172
+ },
173
+ "graph/degree": {
174
+ module: "graph",
175
+ category: "ml-graph",
176
+ minArity: 1,
177
+ maxArity: 1,
178
+ description: "Get node degree tensor",
179
+ hasSideEffects: false,
180
+ returnType: "tensor",
181
+ params: [
182
+ { name: "graph", type: "graph", description: "Input graph" }
183
+ ],
184
+ example: '["graph/degree", "@entity.graph"]'
185
+ },
186
+ // ============================================================================
187
+ // Batching
188
+ // ============================================================================
189
+ "graph/batch": {
190
+ module: "graph",
191
+ category: "ml-graph",
192
+ minArity: 1,
193
+ maxArity: 1,
194
+ description: "Batch multiple graphs into one",
195
+ hasSideEffects: false,
196
+ returnType: "graph",
197
+ params: [
198
+ { name: "graphs", type: "array", description: "List of graphs" }
199
+ ],
200
+ example: '["graph/batch", "@entity.graphs"]'
201
+ }
202
+ };
203
+ function getGraphOperators() {
204
+ return Object.keys(GRAPH_OPERATORS);
205
+ }
206
+
207
+ export { GRAPH_OPERATORS, getGraphOperators };
208
+ //# sourceMappingURL=graph.js.map
209
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../modules/graph.ts"],"names":[],"mappings":";AAgBO,IAAM,eAAA,GAAmD;AAAA;AAAA;AAAA;AAAA,EAK9D,qBAAA,EAAuB;AAAA,IACrB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,UAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,yCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,kFAAA;AAAmF,KACpI;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,sBAAA,EAAwB;AAAA,IACtB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,UAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,Q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AA,GACX;AAAA;AAAA;AAAA;AAAA,EAMA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,UAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,gCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,OAAA,EAAS,aAAa,gBAAA;AAAiB,KACjE;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"graph.js","sourcesContent":["/**\n * Graph Module - Graph Neural Network Operations\n *\n * Provides operators for building and manipulating graphs for GNN workloads.\n * Graphs are PyG-style data structures with node features, edge indices,\n * and optional edge features.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Graph module operators.\n * These operators build and manipulate graph data structures.\n */\nexport const GRAPH_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Construction\n // ============================================================================\n\n 'graph/from-entities': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Build PyG graph from entity collections',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'config', type: 'object', description: 'Graph construction config (nodes, edges, node-features, edge-features, directed)' },\n ],\n example: '[\"graph/from-entities\", { \"nodes\": \"User\", \"edges\": \"Follows\" }]',\n },\n 'graph/from-adjacency': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 2,\n maxArity: 2,\n description: 'Build graph from adjacency matrix and features',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'adjacency', type: 'tensor', description: 'Adjacency matrix' },\n { name: 'features', type: 'tensor', description: 'Node feature matrix' },\n ],\n example: '[\"graph/from-adjacency\", \"@entity.adj\", \"@entity.features\"]',\n },\n 'graph/from-edge-list': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 2,\n maxArity: 2,\n description: 'Build graph from edge list and features',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'edges', type: 'tensor', description: 'Edge index tensor [2, num_edges]' },\n { name: 'features', type: 'tensor', description: 'Node feature matrix' },\n ],\n example: '[\"graph/from-edge-list\", \"@entity.edges\", \"@entity.features\"]',\n },\n\n // ============================================================================\n // Transforms\n // ============================================================================\n\n 'graph/add-self-loops': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Add self-loop edges to graph',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/add-self-loops\", \"@entity.graph\"]',\n },\n 'graph/to-undirected': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Convert directed graph to undirected',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/to-undirected\", \"@entity.graph\"]',\n },\n 'graph/subgraph': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 2,\n maxArity: 2,\n description: 'Extract subgraph by node mask',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n { name: 'mask', type: 'tensor', description: 'Boolean node mask' },\n ],\n example: '[\"graph/subgraph\", \"@entity.graph\", \"@entity.mask\"]',\n },\n 'graph/k-hop': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 3,\n maxArity: 3,\n description: 'K-hop neighborhood subgraph',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n { name: 'node', type: 'number', description: 'Center node index' },\n { name: 'k', type: 'number', description: 'Number of hops' },\n ],\n example: '[\"graph/k-hop\", \"@entity.graph\", 0, 2]',\n },\n\n // ============================================================================\n // Accessors\n // ============================================================================\n\n 'graph/node-features': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Get node feature matrix',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/node-features\", \"@entity.graph\"]',\n },\n 'graph/edge-index': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Get edge index tensor',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/edge-index\", \"@entity.graph\"]',\n },\n 'graph/edge-features': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Get edge feature matrix',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/edge-features\", \"@entity.graph\"]',\n },\n 'graph/num-nodes': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Get node count',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/num-nodes\", \"@entity.graph\"]',\n },\n 'graph/num-edges': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Get edge count',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/num-edges\", \"@entity.graph\"]',\n },\n 'graph/degree': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Get node degree tensor',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'graph', type: 'graph', description: 'Input graph' },\n ],\n example: '[\"graph/degree\", \"@entity.graph\"]',\n },\n\n // ============================================================================\n // Batching\n // ============================================================================\n\n 'graph/batch': {\n module: 'graph',\n category: 'ml-graph',\n minArity: 1,\n maxArity: 1,\n description: 'Batch multiple graphs into one',\n hasSideEffects: false,\n returnType: 'graph',\n params: [\n { name: 'graphs', type: 'array', description: 'List of graphs' },\n ],\n example: '[\"graph/batch\", \"@entity.graphs\"]',\n },\n};\n\n/**\n * Get all graph operator names.\n */\nexport function getGraphOperators(): string[] {\n return Object.keys(GRAPH_OPERATORS);\n}\n"]}
@@ -9,5 +9,9 @@ export { ASYNC_OPERATORS, getAsyncOperators } from './async.js';
9
9
  export { NN_OPERATORS, getNnOperators } from './nn.js';
10
10
  export { TENSOR_OPERATORS, getTensorOperators } from './tensor.js';
11
11
  export { TRAIN_OPERATORS, getTrainOperators } from './train.js';
12
+ export { GRAPH_OPERATORS, getGraphOperators } from './graph.js';
13
+ export { CONTRACT_OPERATORS, getContractOperators } from './contract.js';
14
+ export { DATA_OPERATORS, getDataOperators } from './data.js';
12
15
  export { PROB_OPERATORS, getProbOperators } from './prob.js';
13
- import '../types-CmNM_IbV.js';
16
+ export { OS_OPERATORS } from './os.js';
17
+ import '../types-DOeGXRCm.js';