@bluelibs/runner-dev 4.0.0

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 (215) hide show
  1. package/AI.md +411 -0
  2. package/README.md +1103 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +58 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/client/documentation.d.ts +8 -0
  7. package/dist/client/documentation.js +144 -0
  8. package/dist/client/documentation.js.map +1 -0
  9. package/dist/components/Documentation/Documentation.d.ts +8 -0
  10. package/dist/components/Documentation/Documentation.js +283 -0
  11. package/dist/components/Documentation/Documentation.js.map +1 -0
  12. package/dist/components/Documentation/components/DiagnosticsPanel.d.ts +7 -0
  13. package/dist/components/Documentation/components/DiagnosticsPanel.js +126 -0
  14. package/dist/components/Documentation/components/DiagnosticsPanel.js.map +1 -0
  15. package/dist/components/Documentation/components/EventCard.d.ts +8 -0
  16. package/dist/components/Documentation/components/EventCard.js +164 -0
  17. package/dist/components/Documentation/components/EventCard.js.map +1 -0
  18. package/dist/components/Documentation/components/HookCard.d.ts +8 -0
  19. package/dist/components/Documentation/components/HookCard.js +111 -0
  20. package/dist/components/Documentation/components/HookCard.js.map +1 -0
  21. package/dist/components/Documentation/components/MiddlewareCard.d.ts +8 -0
  22. package/dist/components/Documentation/components/MiddlewareCard.js +159 -0
  23. package/dist/components/Documentation/components/MiddlewareCard.js.map +1 -0
  24. package/dist/components/Documentation/components/ResourceCard.d.ts +8 -0
  25. package/dist/components/Documentation/components/ResourceCard.js +94 -0
  26. package/dist/components/Documentation/components/ResourceCard.js.map +1 -0
  27. package/dist/components/Documentation/components/Sidebar.d.ts +13 -0
  28. package/dist/components/Documentation/components/Sidebar.js +129 -0
  29. package/dist/components/Documentation/components/Sidebar.js.map +1 -0
  30. package/dist/components/Documentation/components/TagCard.d.ts +7 -0
  31. package/dist/components/Documentation/components/TagCard.js +75 -0
  32. package/dist/components/Documentation/components/TagCard.js.map +1 -0
  33. package/dist/components/Documentation/components/TaskCard.d.ts +8 -0
  34. package/dist/components/Documentation/components/TaskCard.js +77 -0
  35. package/dist/components/Documentation/components/TaskCard.js.map +1 -0
  36. package/dist/components/Documentation/index.d.ts +2 -0
  37. package/dist/components/Documentation/index.js +6 -0
  38. package/dist/components/Documentation/index.js.map +1 -0
  39. package/dist/components/Documentation/utils/formatting.d.ts +8 -0
  40. package/dist/components/Documentation/utils/formatting.js +84 -0
  41. package/dist/components/Documentation/utils/formatting.js.map +1 -0
  42. package/dist/components/ExampleComponent.d.ts +10 -0
  43. package/dist/components/ExampleComponent.js +48 -0
  44. package/dist/components/ExampleComponent.js.map +1 -0
  45. package/dist/generated/resolvers-types.d.ts +1523 -0
  46. package/dist/generated/resolvers-types.js +3 -0
  47. package/dist/generated/resolvers-types.js.map +1 -0
  48. package/dist/index.d.ts +61 -0
  49. package/dist/index.js +22 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/main.d.ts +1 -0
  52. package/dist/main.js +3 -0
  53. package/dist/main.js.map +1 -0
  54. package/dist/mcp/env.d.ts +5 -0
  55. package/dist/mcp/env.js +42 -0
  56. package/dist/mcp/env.js.map +1 -0
  57. package/dist/mcp/format.d.ts +50 -0
  58. package/dist/mcp/format.js +249 -0
  59. package/dist/mcp/format.js.map +1 -0
  60. package/dist/mcp/help.d.ts +20 -0
  61. package/dist/mcp/help.js +121 -0
  62. package/dist/mcp/help.js.map +1 -0
  63. package/dist/mcp/http.d.ts +6 -0
  64. package/dist/mcp/http.js +47 -0
  65. package/dist/mcp/http.js.map +1 -0
  66. package/dist/mcp/projectOverview.d.ts +2 -0
  67. package/dist/mcp/projectOverview.js +210 -0
  68. package/dist/mcp/projectOverview.js.map +1 -0
  69. package/dist/mcp/schema.d.ts +1 -0
  70. package/dist/mcp/schema.js +17 -0
  71. package/dist/mcp/schema.js.map +1 -0
  72. package/dist/mcp/tools/graphql.introspect.d.ts +2 -0
  73. package/dist/mcp/tools/graphql.introspect.js +19 -0
  74. package/dist/mcp/tools/graphql.introspect.js.map +1 -0
  75. package/dist/mcp/tools/graphql.mutation.d.ts +2 -0
  76. package/dist/mcp/tools/graphql.mutation.js +43 -0
  77. package/dist/mcp/tools/graphql.mutation.js.map +1 -0
  78. package/dist/mcp/tools/graphql.ping.d.ts +2 -0
  79. package/dist/mcp/tools/graphql.ping.js +23 -0
  80. package/dist/mcp/tools/graphql.ping.js.map +1 -0
  81. package/dist/mcp/tools/graphql.query.d.ts +2 -0
  82. package/dist/mcp/tools/graphql.query.js +42 -0
  83. package/dist/mcp/tools/graphql.query.js.map +1 -0
  84. package/dist/mcp/tools/graphql.schemaSdl.d.ts +2 -0
  85. package/dist/mcp/tools/graphql.schemaSdl.js +15 -0
  86. package/dist/mcp/tools/graphql.schemaSdl.js.map +1 -0
  87. package/dist/mcp/tools/help.read.d.ts +2 -0
  88. package/dist/mcp/tools/help.read.js +67 -0
  89. package/dist/mcp/tools/help.read.js.map +1 -0
  90. package/dist/mcp/tools/help.runner.d.ts +2 -0
  91. package/dist/mcp/tools/help.runner.js +55 -0
  92. package/dist/mcp/tools/help.runner.js.map +1 -0
  93. package/dist/mcp/tools/help.runnerDev.d.ts +2 -0
  94. package/dist/mcp/tools/help.runnerDev.js +56 -0
  95. package/dist/mcp/tools/help.runnerDev.js.map +1 -0
  96. package/dist/mcp.d.ts +1 -0
  97. package/dist/mcp.js +75 -0
  98. package/dist/mcp.js.map +1 -0
  99. package/dist/resources/dev.resource.d.ts +5 -0
  100. package/dist/resources/dev.resource.js +26 -0
  101. package/dist/resources/dev.resource.js.map +1 -0
  102. package/dist/resources/docs.generator.resource.d.ts +17 -0
  103. package/dist/resources/docs.generator.resource.js +230 -0
  104. package/dist/resources/docs.generator.resource.js.map +1 -0
  105. package/dist/resources/graphql-accumulator.resource.d.ts +7 -0
  106. package/dist/resources/graphql-accumulator.resource.js +41 -0
  107. package/dist/resources/graphql-accumulator.resource.js.map +1 -0
  108. package/dist/resources/introspector.resource.d.ts +129 -0
  109. package/dist/resources/introspector.resource.js +266 -0
  110. package/dist/resources/introspector.resource.js.map +1 -0
  111. package/dist/resources/introspector.tools.d.ts +47 -0
  112. package/dist/resources/introspector.tools.js +505 -0
  113. package/dist/resources/introspector.tools.js.map +1 -0
  114. package/dist/resources/live.resource.d.ts +80 -0
  115. package/dist/resources/live.resource.js +231 -0
  116. package/dist/resources/live.resource.js.map +1 -0
  117. package/dist/resources/server.resource.d.ts +38 -0
  118. package/dist/resources/server.resource.js +106 -0
  119. package/dist/resources/server.resource.js.map +1 -0
  120. package/dist/resources/swap.resource.d.ts +43 -0
  121. package/dist/resources/swap.resource.js +251 -0
  122. package/dist/resources/swap.resource.js.map +1 -0
  123. package/dist/resources/swap.tools.d.ts +31 -0
  124. package/dist/resources/swap.tools.js +207 -0
  125. package/dist/resources/swap.tools.js.map +1 -0
  126. package/dist/resources/telemetry.chain.d.ts +13 -0
  127. package/dist/resources/telemetry.chain.js +32 -0
  128. package/dist/resources/telemetry.chain.js.map +1 -0
  129. package/dist/resources/telemetry.resource.d.ts +1 -0
  130. package/dist/resources/telemetry.resource.js +90 -0
  131. package/dist/resources/telemetry.resource.js.map +1 -0
  132. package/dist/schema/context.d.ts +11 -0
  133. package/dist/schema/context.js +3 -0
  134. package/dist/schema/context.js.map +1 -0
  135. package/dist/schema/index.d.ts +7 -0
  136. package/dist/schema/index.js +72 -0
  137. package/dist/schema/index.js.map +1 -0
  138. package/dist/schema/model.d.ts +97 -0
  139. package/dist/schema/model.js +5 -0
  140. package/dist/schema/model.js.map +1 -0
  141. package/dist/schema/mutation.d.ts +3 -0
  142. package/dist/schema/mutation.js +112 -0
  143. package/dist/schema/mutation.js.map +1 -0
  144. package/dist/schema/query.d.ts +3 -0
  145. package/dist/schema/query.js +295 -0
  146. package/dist/schema/query.js.map +1 -0
  147. package/dist/schema/types/AllType.d.ts +3 -0
  148. package/dist/schema/types/AllType.js +149 -0
  149. package/dist/schema/types/AllType.js.map +1 -0
  150. package/dist/schema/types/BaseElementCommon.d.ts +11 -0
  151. package/dist/schema/types/BaseElementCommon.js +61 -0
  152. package/dist/schema/types/BaseElementCommon.js.map +1 -0
  153. package/dist/schema/types/DiagnosticsType.d.ts +2 -0
  154. package/dist/schema/types/DiagnosticsType.js +15 -0
  155. package/dist/schema/types/DiagnosticsType.js.map +1 -0
  156. package/dist/schema/types/EventType.d.ts +4 -0
  157. package/dist/schema/types/EventType.js +97 -0
  158. package/dist/schema/types/EventType.js.map +1 -0
  159. package/dist/schema/types/HookType.d.ts +4 -0
  160. package/dist/schema/types/HookType.js +123 -0
  161. package/dist/schema/types/HookType.js.map +1 -0
  162. package/dist/schema/types/LiveType.d.ts +33 -0
  163. package/dist/schema/types/LiveType.js +553 -0
  164. package/dist/schema/types/LiveType.js.map +1 -0
  165. package/dist/schema/types/MetaType.d.ts +3 -0
  166. package/dist/schema/types/MetaType.js +31 -0
  167. package/dist/schema/types/MetaType.js.map +1 -0
  168. package/dist/schema/types/MiddlewareType.d.ts +4 -0
  169. package/dist/schema/types/MiddlewareType.js +26 -0
  170. package/dist/schema/types/MiddlewareType.js.map +1 -0
  171. package/dist/schema/types/ResourceType.d.ts +2 -0
  172. package/dist/schema/types/ResourceType.js +145 -0
  173. package/dist/schema/types/ResourceType.js.map +1 -0
  174. package/dist/schema/types/RunTypes.d.ts +7 -0
  175. package/dist/schema/types/RunTypes.js +95 -0
  176. package/dist/schema/types/RunTypes.js.map +1 -0
  177. package/dist/schema/types/SwapType.d.ts +5 -0
  178. package/dist/schema/types/SwapType.js +42 -0
  179. package/dist/schema/types/SwapType.js.map +1 -0
  180. package/dist/schema/types/TagType.d.ts +6 -0
  181. package/dist/schema/types/TagType.js +48 -0
  182. package/dist/schema/types/TagType.js.map +1 -0
  183. package/dist/schema/types/TaskLikeCommon.d.ts +7 -0
  184. package/dist/schema/types/TaskLikeCommon.js +86 -0
  185. package/dist/schema/types/TaskLikeCommon.js.map +1 -0
  186. package/dist/schema/types/TaskType.d.ts +11 -0
  187. package/dist/schema/types/TaskType.js +188 -0
  188. package/dist/schema/types/TaskType.js.map +1 -0
  189. package/dist/schema/types/index.d.ts +13 -0
  190. package/dist/schema/types/index.js +44 -0
  191. package/dist/schema/types/index.js.map +1 -0
  192. package/dist/schema/types/middleware/UsageTypes.d.ts +3 -0
  193. package/dist/schema/types/middleware/UsageTypes.js +23 -0
  194. package/dist/schema/types/middleware/UsageTypes.js.map +1 -0
  195. package/dist/schema/types/middleware/common.d.ts +6 -0
  196. package/dist/schema/types/middleware/common.js +156 -0
  197. package/dist/schema/types/middleware/common.js.map +1 -0
  198. package/dist/schema/utils.d.ts +12 -0
  199. package/dist/schema/utils.js +35 -0
  200. package/dist/schema/utils.js.map +1 -0
  201. package/dist/ui/index.html +20 -0
  202. package/dist/ui/static/index-D-NS5aw1.js +40 -0
  203. package/dist/utils/json-schema-to-readable.d.ts +1 -0
  204. package/dist/utils/json-schema-to-readable.js +256 -0
  205. package/dist/utils/json-schema-to-readable.js.map +1 -0
  206. package/dist/utils/path.d.ts +16 -0
  207. package/dist/utils/path.js +101 -0
  208. package/dist/utils/path.js.map +1 -0
  209. package/dist/utils/react-ssr.d.ts +9 -0
  210. package/dist/utils/react-ssr.js +36 -0
  211. package/dist/utils/react-ssr.js.map +1 -0
  212. package/dist/utils/zod.d.ts +6 -0
  213. package/dist/utils/zod.js +39 -0
  214. package/dist/utils/zod.js.map +1 -0
  215. package/package.json +83 -0
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AllType = exports.BaseElementInterface = void 0;
4
+ const graphql_1 = require("graphql");
5
+ const model_1 = require("../model");
6
+ const path_1 = require("../../utils/path");
7
+ const MetaType_1 = require("./MetaType");
8
+ const BaseElementCommon_1 = require("./BaseElementCommon");
9
+ exports.BaseElementInterface = new graphql_1.GraphQLInterfaceType({
10
+ name: "BaseElement",
11
+ description: "Common fields for all runner elements",
12
+ fields: () => ({
13
+ id: {
14
+ description: "Stable identifier",
15
+ type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLID),
16
+ },
17
+ meta: {
18
+ description: "Optional metadata (title, description, tags)",
19
+ type: MetaType_1.MetaType,
20
+ },
21
+ filePath: {
22
+ description: "Source file path when available",
23
+ type: graphql_1.GraphQLString,
24
+ },
25
+ fileContents: {
26
+ description: "Contents of the file at filePath (if accessible). Optionally slice by 1-based inclusive line numbers via startLine/endLine.",
27
+ type: graphql_1.GraphQLString,
28
+ args: {
29
+ startLine: {
30
+ description: "1-based inclusive start line",
31
+ type: graphql_1.GraphQLInt,
32
+ },
33
+ endLine: {
34
+ description: "1-based inclusive end line",
35
+ type: graphql_1.GraphQLInt,
36
+ },
37
+ },
38
+ },
39
+ markdownDescription: {
40
+ description: "Markdown composed from meta.title and meta.description (if present)",
41
+ type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString),
42
+ },
43
+ }),
44
+ resolveType: (value) => {
45
+ const kind = (value && value[model_1.elementKindSymbol]);
46
+ switch (kind) {
47
+ case "TASK":
48
+ return "Task";
49
+ case "HOOK":
50
+ return "Hook";
51
+ case "RESOURCE":
52
+ return "Resource";
53
+ case "MIDDLEWARE": {
54
+ // Decide specific middleware type based on usage shape
55
+ const usedByTasks = Array.isArray(value?.usedByTasks)
56
+ ? value?.usedByTasks
57
+ : [];
58
+ const usedByResources = Array.isArray(value?.usedByResources)
59
+ ? value?.usedByResources
60
+ : [];
61
+ if (usedByTasks.length > 0 || usedByResources.length === 0) {
62
+ return "TaskMiddleware";
63
+ }
64
+ return "ResourceMiddleware";
65
+ }
66
+ case "EVENT":
67
+ return "Event";
68
+ default:
69
+ break;
70
+ }
71
+ // Fallback to structural checks if no stamp present
72
+ if (Array.isArray(value?.registers) && Array.isArray(value?.overrides)) {
73
+ return "Resource";
74
+ }
75
+ if (Array.isArray(value?.usedByTasks) ||
76
+ Array.isArray(value?.usedByResources)) {
77
+ const usedByTasks = Array.isArray(value?.usedByTasks)
78
+ ? value?.usedByTasks
79
+ : [];
80
+ const usedByResources = Array.isArray(value?.usedByResources)
81
+ ? value?.usedByResources
82
+ : [];
83
+ if (usedByTasks.length > 0 || usedByResources.length === 0) {
84
+ return "TaskMiddleware";
85
+ }
86
+ return "ResourceMiddleware";
87
+ }
88
+ if (Array.isArray(value?.listenedToBy)) {
89
+ return "Event";
90
+ }
91
+ if (typeof value?.event === "string") {
92
+ return "Hook";
93
+ }
94
+ if (Array.isArray(value?.emits) && Array.isArray(value?.dependsOn)) {
95
+ return "Task";
96
+ }
97
+ return "All";
98
+ },
99
+ });
100
+ exports.AllType = new graphql_1.GraphQLObjectType({
101
+ name: "All",
102
+ description: "Minimal, generic element used for root and as a fallback when a specific concrete type cannot be resolved.",
103
+ interfaces: [exports.BaseElementInterface],
104
+ isTypeOf: (value) => {
105
+ // Only use All type as fallback when no specific type can be determined
106
+ const kind = (value && value[model_1.elementKindSymbol]);
107
+ // If it has a kind symbol, it should resolve to a specific type, not All
108
+ if (kind === "TASK" ||
109
+ kind === "HOOK" ||
110
+ kind === "RESOURCE" ||
111
+ kind === "MIDDLEWARE" ||
112
+ kind === "EVENT") {
113
+ return false;
114
+ }
115
+ // Structural checks - if it matches a specific type, don't use All
116
+ if (Array.isArray(value?.registers) && Array.isArray(value?.overrides)) {
117
+ return false; // Resource
118
+ }
119
+ if (Array.isArray(value?.usedByTasks) &&
120
+ Array.isArray(value?.usedByResources)) {
121
+ return false; // Middleware
122
+ }
123
+ if (Array.isArray(value?.listenedToBy)) {
124
+ return false; // Event
125
+ }
126
+ if (typeof value?.event === "string") {
127
+ return false; // Hook
128
+ }
129
+ if (Array.isArray(value?.emits) && Array.isArray(value?.dependsOn)) {
130
+ return false; // Task
131
+ }
132
+ // Only use All type for objects that truly can't be resolved to a specific type
133
+ return typeof value?.id === "string";
134
+ },
135
+ fields: () => ({
136
+ id: {
137
+ description: "Element ID",
138
+ type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLID),
139
+ },
140
+ meta: { description: "Element metadata", type: MetaType_1.MetaType },
141
+ filePath: {
142
+ description: "Path to element file",
143
+ type: graphql_1.GraphQLString,
144
+ resolve: (node) => (0, path_1.sanitizePath)(node?.filePath ?? null),
145
+ },
146
+ ...(0, BaseElementCommon_1.baseElementCommonFields)(),
147
+ }),
148
+ });
149
+ //# sourceMappingURL=AllType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllType.js","sourceRoot":"","sources":["../../../src/schema/types/AllType.ts"],"names":[],"mappings":";;;AAAA,qCAQiB;AACjB,oCAA+D;AAC/D,2CAAgD;AAChD,yCAAsC;AACtC,2DAA8D;AAEjD,QAAA,oBAAoB,GAC/B,IAAI,8BAAoB,CAAC;IACvB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,uCAAuC;IACpD,MAAM,EAAE,GAAoC,EAAE,CAAC,CAAC;QAC9C,EAAE,EAAE;YACF,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,IAAI,wBAAc,CAAC,mBAAS,CAAC;SACpC;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,8CAA8C;YAC3D,IAAI,EAAE,mBAAQ;SACf;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,uBAAa;SACpB;QACD,YAAY,EAAE;YACZ,WAAW,EACT,6HAA6H;YAC/H,IAAI,EAAE,uBAAa;YACnB,IAAI,EAAE;gBACJ,SAAS,EAAE;oBACT,WAAW,EAAE,8BAA8B;oBAC3C,IAAI,EAAE,oBAAU;iBACjB;gBACD,OAAO,EAAE;oBACP,WAAW,EAAE,4BAA4B;oBACzC,IAAI,EAAE,oBAAU;iBACjB;aACF;SACF;QACD,mBAAmB,EAAE;YACnB,WAAW,EACT,qEAAqE;YACvE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC;SACxC;KACF,CAAC;IACF,WAAW,EAAE,CAAC,KAAU,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,CAAC,KAAK,IAAK,KAAa,CAAC,yBAAiB,CAAC,C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,11 @@
1
+ import { type GraphQLFieldConfigMap } from "graphql";
2
+ import type { BaseElement } from "../model";
3
+ import type { Introspector } from "../../resources/introspector.resource";
4
+ /**
5
+ * Shared fields that we want available on all concrete element types.
6
+ * - fileContents(startLine?, endLine?)
7
+ * - markdownDescription
8
+ */
9
+ export declare function baseElementCommonFields(): GraphQLFieldConfigMap<BaseElement, {
10
+ introspector: Introspector;
11
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.baseElementCommonFields = baseElementCommonFields;
4
+ const graphql_1 = require("graphql");
5
+ const utils_1 = require("../utils");
6
+ const TagType_1 = require("./TagType");
7
+ /**
8
+ * Shared fields that we want available on all concrete element types.
9
+ * - fileContents(startLine?, endLine?)
10
+ * - markdownDescription
11
+ */
12
+ function baseElementCommonFields() {
13
+ return {
14
+ fileContents: {
15
+ description: "Contents of the file at filePath (if accessible). Optionally slice by 1-based inclusive line numbers via startLine/endLine. Caution: avoid querying this in bulk; prefer fetching one file at a time.",
16
+ type: graphql_1.GraphQLString,
17
+ args: {
18
+ startLine: {
19
+ description: "1-based inclusive start line",
20
+ type: graphql_1.GraphQLInt,
21
+ },
22
+ endLine: {
23
+ description: "1-based inclusive end line",
24
+ type: graphql_1.GraphQLInt,
25
+ },
26
+ },
27
+ resolve: async (node, args) => {
28
+ if (!node?.filePath)
29
+ return null;
30
+ // Note: we keep reading from the real path, only redacting what we expose elsewhere
31
+ return await (0, utils_1.readFile)(node.filePath, args);
32
+ },
33
+ },
34
+ markdownDescription: {
35
+ description: "Markdown composed from meta.title and meta.description (if present)",
36
+ type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString),
37
+ resolve: (node) => {
38
+ const title = node.meta?.title ?? node.id;
39
+ const description = node.meta?.description ?? "N/A";
40
+ const titlePart = `# ${title}\n`;
41
+ const descPart = `\n${description}`;
42
+ const result = `${titlePart}${descPart}`.trim();
43
+ return result;
44
+ },
45
+ },
46
+ tags: {
47
+ description: "Tags associated with this element.",
48
+ type: new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(TagType_1.TagType)),
49
+ resolve: (node, _, { introspector }) => {
50
+ const tagIds = node.meta?.tags ?? [];
51
+ if (!tagIds.length) {
52
+ return [];
53
+ }
54
+ return tagIds
55
+ .map((id) => introspector.getTag(id))
56
+ .filter((t) => t !== null);
57
+ },
58
+ },
59
+ };
60
+ }
61
+ //# sourceMappingURL=BaseElementCommon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseElementCommon.js","sourceRoot":"","sources":["../../../src/schema/types/BaseElementCommon.ts"],"names":[],"mappings":";;AAkBA,0DAoDC;AAtED,qCAMiB;AACjB,oCAA0D;AAI1D,uCAAoC;AAEpC;;;;GAIG;AACH,SAAgB,uBAAuB;IAIrC,OAAO;QACL,YAAY,EAAE;YACZ,WAAW,EACT,uMAAuM;YACzM,IAAI,EAAE,uBAAa;YACnB,IAAI,EAAE;gBACJ,SAAS,EAAE;oBACT,WAAW,EAAE,8BAA8B;oBAC3C,IAAI,EAAE,oBAAU;iBACjB;gBACD,OAAO,EAAE;oBACP,WAAW,EAAE,4BAA4B;oBACzC,IAAI,EAAE,oBAAU;iBACjB;aACF;YACD,OAAO,EAAE,KAAK,EAAE,IAAiB,EAAE,IAAqB,EAAE,EAAE;gBAC1D,IAAI,CAAC,IAAI,EAAE,QAAQ;oBAAE,OAAO,IAAI,CAAC;gBACjC,oFAAoF;gBACpF,OAAO,MAAM,IAAA,gBAAQ,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC7C,CAAC;SACF;QACD,mBAAmB,EAAE;YACnB,WAAW,EACT,qEAAqE;YACvE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC;YACvC,OAAO,EAAE,CAAC,IAAiB,EAAE,EAAE;gBAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC;gBAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,IAAI,KAAK,CAAC;gBACpD,MAAM,SAAS,GAAG,KAAK,KAAK,IAAI,CAAC;gBACjC,MAAM,QAAQ,GAAG,KAAK,WAAW,EAAE,CAAC;gBACpC,MAAM,MAAM,GAAG,GAAG,SAAS,GAAG,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;gBAChD,OAAO,MAAM,CAAC;YAChB,CAAC;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,IAAI,qBAAW,CAAC,IAAI,wBAAc,CAAC,iBAAO,CAAC,CAAC;YAClD,OAAO,EAAE,CAAC,IAAiB,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;gBAClD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;gBACrC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBACnB,OAAO,EAAE,CAAC;gBACZ,CAAC;gBACD,OAAO,MAAM;qBACV,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;qBACpC,MAAM,CAAC,CAAC,CAAC,EAA8B,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;YAC3D,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { GraphQLObjectType } from "graphql";
2
+ export declare const DiagnosticType: GraphQLObjectType<any, any>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagnosticType = void 0;
4
+ const graphql_1 = require("graphql");
5
+ exports.DiagnosticType = new graphql_1.GraphQLObjectType({
6
+ name: "Diagnostic",
7
+ fields: () => ({
8
+ severity: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
9
+ code: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
10
+ message: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
11
+ nodeId: { type: graphql_1.GraphQLID },
12
+ nodeKind: { type: graphql_1.GraphQLString },
13
+ }),
14
+ });
15
+ //# sourceMappingURL=DiagnosticsType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticsType.js","sourceRoot":"","sources":["../../../src/schema/types/DiagnosticsType.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AAEJ,QAAA,cAAc,GAAG,IAAI,2BAAiB,CAAC;IAClD,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACb,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC,EAAE;QACrD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC,EAAE;QACjD,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC,EAAE;QACpD,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAS,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAa,EAAE;KAClC,CAAC;CACH,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { GraphQLObjectType } from "graphql";
2
+ import { GraphQLInputObjectType } from "graphql";
3
+ export declare const EventType: GraphQLObjectType;
4
+ export declare const EventFilterInput: GraphQLInputObjectType;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventFilterInput = exports.EventType = void 0;
4
+ const graphql_1 = require("graphql");
5
+ const graphql_2 = require("graphql");
6
+ const AllType_1 = require("./AllType");
7
+ const MetaType_1 = require("./MetaType");
8
+ const ResourceType_1 = require("./ResourceType");
9
+ const BaseElementCommon_1 = require("./BaseElementCommon");
10
+ const path_1 = require("../../utils/path");
11
+ const zod_1 = require("../../utils/zod");
12
+ const HookType_1 = require("./HookType");
13
+ exports.EventType = new graphql_1.GraphQLObjectType({
14
+ name: "Event",
15
+ interfaces: () => [AllType_1.BaseElementInterface],
16
+ isTypeOf: (value) => Array.isArray(value?.listenedToBy),
17
+ fields: () => ({
18
+ id: { description: "Event id", type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLID) },
19
+ meta: { description: "Event metadata", type: MetaType_1.MetaType },
20
+ filePath: {
21
+ description: "Path to event file",
22
+ type: graphql_1.GraphQLString,
23
+ resolve: (node) => (0, path_1.sanitizePath)(node?.filePath ?? null),
24
+ },
25
+ payloadSchema: {
26
+ description: "Prettified Zod JSON structure for the event payload schema, if provided",
27
+ type: graphql_1.GraphQLString,
28
+ },
29
+ payloadSchemaReadable: {
30
+ description: "Readable text representation of the event payload schema, if provided",
31
+ type: graphql_1.GraphQLString,
32
+ resolve: (node) => (0, zod_1.convertJsonSchemaToReadable)(node.payloadSchema),
33
+ },
34
+ emittedBy: {
35
+ description: "Ids of task/hook/resource nodes that emit this event",
36
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(graphql_1.GraphQLString))),
37
+ resolve: (node, _args, ctx) => ctx.introspector.getEmittersOfEvent(node.id).map((t) => t.id),
38
+ },
39
+ emittedByResolved: {
40
+ description: "Nodes that emit this event (resolved). Can be Task, Hook or Resource.",
41
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(AllType_1.BaseElementInterface))),
42
+ resolve: (node, _args, ctx) => ctx.introspector.getEmittersOfEvent(node.id),
43
+ },
44
+ listenedToBy: {
45
+ description: "Ids of task/hook nodes listening to this event",
46
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(graphql_1.GraphQLString))),
47
+ },
48
+ listenedToByResolved: {
49
+ description: "Task/hook nodes listening to this event (resolved)",
50
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(HookType_1.HookType))),
51
+ resolve: (node, _args, ctx) => ctx.introspector.getHooksOfEvent(node.id),
52
+ },
53
+ registeredBy: {
54
+ description: "Id of the resource that registered this event (if any)",
55
+ type: graphql_1.GraphQLString,
56
+ resolve: (node, _args, ctx) => {
57
+ if (node.registeredBy)
58
+ return node.registeredBy;
59
+ const allResources = ctx.introspector.getResources();
60
+ const found = allResources.find((r) => (r.registers || []).includes(node.id));
61
+ return found?.id ?? null;
62
+ },
63
+ },
64
+ registeredByResolved: {
65
+ description: "Resource that registered this event (resolved, if any)",
66
+ type: ResourceType_1.ResourceType,
67
+ resolve: (node, _args, ctx) => {
68
+ if (node.registeredBy) {
69
+ return ctx.introspector.getResource(node.registeredBy);
70
+ }
71
+ const allResources = ctx.introspector.getResources();
72
+ return (allResources.find((r) => (r.registers || []).includes(node.id)) ||
73
+ null);
74
+ },
75
+ },
76
+ ...(0, BaseElementCommon_1.baseElementCommonFields)(),
77
+ }),
78
+ });
79
+ exports.EventFilterInput = new graphql_2.GraphQLInputObjectType({
80
+ name: "EventFilterInput",
81
+ description: "Filters for events in the system",
82
+ fields: {
83
+ hasNoHooks: {
84
+ description: "When true, only events without hooks are returned.",
85
+ type: graphql_2.GraphQLBoolean,
86
+ },
87
+ hideSystem: {
88
+ description: "When true, hides internal/system events (runner-dev/globals).",
89
+ type: graphql_2.GraphQLBoolean,
90
+ },
91
+ idIncludes: {
92
+ description: "Return only events whose id contains this substring.",
93
+ type: graphql_1.GraphQLString,
94
+ },
95
+ },
96
+ });
97
+ //# sourceMappingURL=EventType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventType.js","sourceRoot":"","sources":["../../../src/schema/types/EventType.ts"],"names":[],"mappings":";;;AAAA,qCAOiB;AACjB,qCAAiE;AAEjE,uCAAiD;AACjD,yCAAsC;AAEtC,iDAA8C;AAC9C,2DAA8D;AAC9D,2CAAgD;AAChD,yCAA8D;AAC9D,yCAAsC;AAEzB,QAAA,SAAS,GAAsB,IAAI,2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AAE,wDAAwD;YACrE,IAAI,EAAE,2BAAY;YAClB,OAAO,EAAE,CAAC,IAAS,EAAE,KAAK,EAAE,GAAyB,EAAE,EAAE;gBACvD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtB,OAAO,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACzD,CAAC;gBACD,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;gBACrD,OAAO,CACL,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBAC/D,IAAI,CACL,CAAC;YACJ,CAAC;SACF;QACD,GAAG,IAAA,2CAAuB,GAAE;KAC7B,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,gBAAgB,GAAG,IAAI,gCAAsB,CAAC;IACzD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kCAAkC;IAC/C,MAAM,EAAE;QACN,UAAU,EAAE;YACV,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,wBAAc;SACrB;QACD,UAAU,EAAE;YACV,WAAW,EACT,+DAA+D;YACjE,IAAI,EAAE,wBAAc;SACrB;QACD,UAAU,EAAE;YACV,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,uBAAa;SACpB;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { GraphQLObjectType } from "graphql";
2
+ import type { Hook } from "../model";
3
+ import type { CustomGraphQLContext } from "../context";
4
+ export declare const HookType: GraphQLObjectType<Hook, CustomGraphQLContext>;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HookType = void 0;
4
+ const graphql_1 = require("graphql");
5
+ const AllType_1 = require("./AllType");
6
+ const MetaType_1 = require("./MetaType");
7
+ const ResourceType_1 = require("./ResourceType");
8
+ const EventType_1 = require("./EventType");
9
+ const BaseElementCommon_1 = require("./BaseElementCommon");
10
+ const MiddlewareType_1 = require("./MiddlewareType");
11
+ const TaskType_1 = require("./TaskType");
12
+ const path_1 = require("../../utils/path");
13
+ const zod_1 = require("../../utils/zod");
14
+ const RunTypes_1 = require("./RunTypes");
15
+ exports.HookType = new graphql_1.GraphQLObjectType({
16
+ name: "Hook",
17
+ interfaces: () => [AllType_1.BaseElementInterface],
18
+ isTypeOf: (value) => typeof value?.event === "string",
19
+ fields: () => ({
20
+ id: { description: "Hook id", type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLID) },
21
+ meta: { description: "Hook metadata", type: MetaType_1.MetaType },
22
+ filePath: {
23
+ description: "Path to hook file",
24
+ type: graphql_1.GraphQLString,
25
+ resolve: (node) => (0, path_1.sanitizePath)(node?.filePath ?? null),
26
+ },
27
+ inputSchema: {
28
+ description: "Prettified Zod JSON structure for the input schema, if provided",
29
+ type: graphql_1.GraphQLString,
30
+ },
31
+ inputSchemaReadable: {
32
+ description: "Readable text representation of the input schema, if provided",
33
+ type: graphql_1.GraphQLString,
34
+ resolve: (node) => (0, zod_1.convertJsonSchemaToReadable)(node.inputSchema),
35
+ },
36
+ emits: {
37
+ description: "Event ids this hook may emit (from dependencies)",
38
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(graphql_1.GraphQLString))),
39
+ },
40
+ dependsOn: {
41
+ description: "Ids of resources/tasks this hook depends on",
42
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(graphql_1.GraphQLString))),
43
+ },
44
+ middleware: {
45
+ description: "Ids of middlewares applied to this hook",
46
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(graphql_1.GraphQLString))),
47
+ },
48
+ middlewareResolved: {
49
+ description: "Middlewares applied to this hook (resolved)",
50
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(MiddlewareType_1.TaskMiddlewareType))),
51
+ resolve: async (node, _args, ctx) => {
52
+ return ctx.introspector.getMiddlewaresByIds(node.middleware);
53
+ },
54
+ },
55
+ middlewareResolvedDetailed: {
56
+ description: "Middlewares applied to this hook with per-usage config",
57
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(TaskType_1.TaskMiddlewareUsageType))),
58
+ resolve: (node, _args, ctx) => ctx.introspector.getMiddlewareUsagesForTask(node.id),
59
+ },
60
+ emitsResolved: {
61
+ description: "Events emitted by this hook (resolved)",
62
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(EventType_1.EventType))),
63
+ resolve: (node, _args, ctx) => ctx.introspector.getEventsByIds(node.emits),
64
+ },
65
+ event: {
66
+ description: "The event id this hook listens to",
67
+ type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString),
68
+ },
69
+ hookOrder: {
70
+ description: "Execution order among hooks for the same event",
71
+ type: graphql_1.GraphQLInt,
72
+ },
73
+ depenendsOnResolved: {
74
+ description: "Flattened dependencies resolved to All (tasks, hooks, resources)",
75
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(AllType_1.BaseElementInterface))),
76
+ resolve: async (node, _args, ctx) => {
77
+ const { tasks, resources, emitters } = await ctx.introspector.getDependencies(node);
78
+ return [...tasks, ...resources, ...emitters];
79
+ },
80
+ },
81
+ overriddenBy: {
82
+ description: "Id of the resource that overrides this hook (if any). Overriding replaces registrations at runtime.",
83
+ type: graphql_1.GraphQLString,
84
+ },
85
+ registeredBy: {
86
+ description: "Id of the resource that registered this hook (if any). Useful to trace provenance.",
87
+ type: graphql_1.GraphQLString,
88
+ resolve: (node, _args, ctx) => {
89
+ if (node.registeredBy != null)
90
+ return node.registeredBy;
91
+ const allResources = ctx.introspector.getResources();
92
+ const found = allResources.find((r) => (r.registers || []).includes(node.id));
93
+ return found?.id ?? null;
94
+ },
95
+ },
96
+ registeredByResolved: {
97
+ description: "Resource that registered this hook (resolved, if any)",
98
+ type: ResourceType_1.ResourceType,
99
+ resolve: (node, _args, ctx) => {
100
+ if (node.registeredBy != null) {
101
+ return ctx.introspector.getResource(node.registeredBy);
102
+ }
103
+ const allResources = ctx.introspector.getResources();
104
+ return (allResources.find((r) => (r.registers || []).includes(node.id)) || null);
105
+ },
106
+ },
107
+ runs: {
108
+ description: "Execution run records for this hook",
109
+ args: {
110
+ afterTimestamp: { type: graphql_1.GraphQLInt },
111
+ last: { type: graphql_1.GraphQLInt },
112
+ filter: { type: RunTypes_1.RunFilterInput },
113
+ },
114
+ type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(RunTypes_1.RunRecordType))),
115
+ resolve: (node, args, ctx) => {
116
+ const opts = ctx.introspector.buildRunOptionsForHook(node.id, args);
117
+ return ctx.live.getRuns(opts);
118
+ },
119
+ },
120
+ ...(0, BaseElementCommon_1.baseElementCommonFields)(),
121
+ }),
122
+ });
123
+ //# sourceMappingURL=HookType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HookType.js","sourceRoot":"","sources":["../../../src/schema/types/HookType.ts"],"names":[],"mappings":";;;AAAA,qCAOiB;AAGjB,uCAAiD;AACjD,yCAAsC;AACtC,iDAA8C;AAC9C,2CAAwC;AACxC,2DAA8D;AAC9D,qDAAsD;AACtD,yCAAqD;AACrD,2CAAgD;AAChD,yCAA8D;AAC9D,yCAA2D;AAE9C,QAAA,QAAQ,GAAG,IAAI,2BAAiB,CAAC;IAC5C,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,8BAAoB,CAAC;IACxC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAQ,KAAa,EAAE,KAAK,KAAK,QAAQ;IAC9D,MAAM,EAAE,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,IAAI,IAAI,CACV,CAAC;YACJ,CAAC;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE;gBACJ,cAAc,EAAE,EAAE,IAAI,EAAE,oBAAU,EAAE;gBACpC,IAAI,EAAE,EAAE,IAAI,EAAE,oBAAU,EAAE;gBAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,yBAAc,EAAE;aACjC;YACD,IAAI,EAAE,IAAI,wBAAc,CACtB,IAAI,qBAAW,CAAC,IAAI,wBAAc,CAAC,wBAAa,CAAC,CAAC,CACnD;YACD,OAAO,EAAE,CAAC,IAAU,EAAE,IAAS,EAAE,GAAyB,EAAE,EAAE;gBAC5D,MAAM,IAAI,GAAI,GAAG,CAAC,YAAoB,CAAC,sBAAsB,CAC1D,IAAY,CAAC,EAAE,EAChB,IAAI,CACL,CAAC;gBACF,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;SACF;QACD,GAAG,IAAA,2CAAuB,GAAE;KAC7B,CAAC;CACH,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { GraphQLObjectType, GraphQLEnumType, GraphQLInputObjectType } from "graphql";
2
+ import type { CustomGraphQLContext } from "../context";
3
+ import type { LogEntry as LiveLogEntry, EmissionEntry as LiveEmissionEntry, ErrorEntry as LiveErrorEntry } from "../../resources/live.resource";
4
+ export declare const LogEntryType: GraphQLObjectType<LiveLogEntry, CustomGraphQLContext>;
5
+ export declare const EmissionEntryType: GraphQLObjectType<LiveEmissionEntry, CustomGraphQLContext>;
6
+ export declare const ErrorEntryType: GraphQLObjectType<LiveErrorEntry, CustomGraphQLContext>;
7
+ type MemoryStats = {
8
+ heapUsed: number;
9
+ heapTotal: number;
10
+ rss: number;
11
+ };
12
+ type CpuStats = {
13
+ usage: number;
14
+ loadAverage: number;
15
+ };
16
+ type EventLoopStats = {
17
+ lag: number;
18
+ };
19
+ type GcStats = {
20
+ collections: number;
21
+ duration: number;
22
+ };
23
+ export declare const MemoryStatsType: GraphQLObjectType<MemoryStats, CustomGraphQLContext>;
24
+ export declare const CpuStatsType: GraphQLObjectType<CpuStats, CustomGraphQLContext>;
25
+ export declare const EventLoopStatsType: GraphQLObjectType<EventLoopStats, CustomGraphQLContext>;
26
+ export declare const GcStatsType: GraphQLObjectType<GcStats, CustomGraphQLContext>;
27
+ export declare const LiveType: GraphQLObjectType<unknown, CustomGraphQLContext>;
28
+ export declare const LogLevelEnum: GraphQLEnumType;
29
+ export declare const SourceKindEnum: GraphQLEnumType;
30
+ export declare const LogFilterInput: GraphQLInputObjectType;
31
+ export declare const EmissionFilterInput: GraphQLInputObjectType;
32
+ export declare const ErrorFilterInput: GraphQLInputObjectType;
33
+ export {};