@sixb/server 0.0.1

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 (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +123 -0
  3. package/dist/auth/access-token-boundary.d.ts +23 -0
  4. package/dist/auth/access-token-boundary.d.ts.map +1 -0
  5. package/dist/auth/application-access.d.ts +4 -0
  6. package/dist/auth/application-access.d.ts.map +1 -0
  7. package/dist/auth/browser-origin.d.ts +62 -0
  8. package/dist/auth/browser-origin.d.ts.map +1 -0
  9. package/dist/auth/csrf.d.ts +2 -0
  10. package/dist/auth/csrf.d.ts.map +1 -0
  11. package/dist/auth/guard.d.ts +35 -0
  12. package/dist/auth/guard.d.ts.map +1 -0
  13. package/dist/auth/public-routes.d.ts +8 -0
  14. package/dist/auth/public-routes.d.ts.map +1 -0
  15. package/dist/auth/responses.d.ts +11 -0
  16. package/dist/auth/responses.d.ts.map +1 -0
  17. package/dist/auth/return-to.d.ts +3 -0
  18. package/dist/auth/return-to.d.ts.map +1 -0
  19. package/dist/auth/scope.d.ts +43 -0
  20. package/dist/auth/scope.d.ts.map +1 -0
  21. package/dist/auth/session-activity.d.ts +4 -0
  22. package/dist/auth/session-activity.d.ts.map +1 -0
  23. package/dist/auth/session-cookies.d.ts +12 -0
  24. package/dist/auth/session-cookies.d.ts.map +1 -0
  25. package/dist/files/content.d.ts +141 -0
  26. package/dist/files/content.d.ts.map +1 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +11522 -0
  30. package/dist/index.js.map +78 -0
  31. package/dist/openapi/security.d.ts +26 -0
  32. package/dist/openapi/security.d.ts.map +1 -0
  33. package/dist/openapi/tags.d.ts +151 -0
  34. package/dist/openapi/tags.d.ts.map +1 -0
  35. package/dist/registerRoutes.d.ts +31 -0
  36. package/dist/registerRoutes.d.ts.map +1 -0
  37. package/dist/routes/action-runs.d.ts +244 -0
  38. package/dist/routes/action-runs.d.ts.map +1 -0
  39. package/dist/routes/actions.d.ts +183 -0
  40. package/dist/routes/actions.d.ts.map +1 -0
  41. package/dist/routes/agent-api-gateway.d.ts +4 -0
  42. package/dist/routes/agent-api-gateway.d.ts.map +1 -0
  43. package/dist/routes/agents.d.ts +1061 -0
  44. package/dist/routes/agents.d.ts.map +1 -0
  45. package/dist/routes/auth.d.ts +1366 -0
  46. package/dist/routes/auth.d.ts.map +1 -0
  47. package/dist/routes/connectors.d.ts +108 -0
  48. package/dist/routes/connectors.d.ts.map +1 -0
  49. package/dist/routes/datasets.d.ts +339 -0
  50. package/dist/routes/datasets.d.ts.map +1 -0
  51. package/dist/routes/events.d.ts +116 -0
  52. package/dist/routes/events.d.ts.map +1 -0
  53. package/dist/routes/files.d.ts +340 -0
  54. package/dist/routes/files.d.ts.map +1 -0
  55. package/dist/routes/links.d.ts +175 -0
  56. package/dist/routes/links.d.ts.map +1 -0
  57. package/dist/routes/logs.d.ts +88 -0
  58. package/dist/routes/logs.d.ts.map +1 -0
  59. package/dist/routes/objects.d.ts +450 -0
  60. package/dist/routes/objects.d.ts.map +1 -0
  61. package/dist/routes/ontology.d.ts +240 -0
  62. package/dist/routes/ontology.d.ts.map +1 -0
  63. package/dist/routes/pipelines.d.ts +399 -0
  64. package/dist/routes/pipelines.d.ts.map +1 -0
  65. package/dist/routes/project.d.ts +56 -0
  66. package/dist/routes/project.d.ts.map +1 -0
  67. package/dist/routes/projections.d.ts +916 -0
  68. package/dist/routes/projections.d.ts.map +1 -0
  69. package/dist/routes/rules.d.ts +165 -0
  70. package/dist/routes/rules.d.ts.map +1 -0
  71. package/dist/routes/status.d.ts +81 -0
  72. package/dist/routes/status.d.ts.map +1 -0
  73. package/dist/routes/syncs.d.ts +294 -0
  74. package/dist/routes/syncs.d.ts.map +1 -0
  75. package/dist/routes/telemetry.d.ts +241 -0
  76. package/dist/routes/telemetry.d.ts.map +1 -0
  77. package/dist/routes/webhook-runs.d.ts +89 -0
  78. package/dist/routes/webhook-runs.d.ts.map +1 -0
  79. package/dist/routes/webhooks.d.ts +60 -0
  80. package/dist/routes/webhooks.d.ts.map +1 -0
  81. package/dist/routes/workflows.d.ts +973 -0
  82. package/dist/routes/workflows.d.ts.map +1 -0
  83. package/dist/routes/ws/agents.d.ts +99 -0
  84. package/dist/routes/ws/agents.d.ts.map +1 -0
  85. package/dist/routes/ws/events.d.ts +89 -0
  86. package/dist/routes/ws/events.d.ts.map +1 -0
  87. package/dist/routes/ws/index.d.ts +31 -0
  88. package/dist/routes/ws/index.d.ts.map +1 -0
  89. package/dist/routes/ws/log-subscription-hub.d.ts +47 -0
  90. package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -0
  91. package/dist/routes/ws/logs.d.ts +110 -0
  92. package/dist/routes/ws/logs.d.ts.map +1 -0
  93. package/dist/schemas/actions.d.ts +644 -0
  94. package/dist/schemas/actions.d.ts.map +1 -0
  95. package/dist/schemas/agents.d.ts +3157 -0
  96. package/dist/schemas/agents.d.ts.map +1 -0
  97. package/dist/schemas/auth.d.ts +2023 -0
  98. package/dist/schemas/auth.d.ts.map +1 -0
  99. package/dist/schemas/common.d.ts +30 -0
  100. package/dist/schemas/common.d.ts.map +1 -0
  101. package/dist/schemas/connectors.d.ts +82 -0
  102. package/dist/schemas/connectors.d.ts.map +1 -0
  103. package/dist/schemas/datasets.d.ts +744 -0
  104. package/dist/schemas/datasets.d.ts.map +1 -0
  105. package/dist/schemas/event-payloads.d.ts +477 -0
  106. package/dist/schemas/event-payloads.d.ts.map +1 -0
  107. package/dist/schemas/events.d.ts +665 -0
  108. package/dist/schemas/events.d.ts.map +1 -0
  109. package/dist/schemas/files.d.ts +241 -0
  110. package/dist/schemas/files.d.ts.map +1 -0
  111. package/dist/schemas/links.d.ts +90 -0
  112. package/dist/schemas/links.d.ts.map +1 -0
  113. package/dist/schemas/logs.d.ts +231 -0
  114. package/dist/schemas/logs.d.ts.map +1 -0
  115. package/dist/schemas/objects.d.ts +288 -0
  116. package/dist/schemas/objects.d.ts.map +1 -0
  117. package/dist/schemas/ontology.d.ts +778 -0
  118. package/dist/schemas/ontology.d.ts.map +1 -0
  119. package/dist/schemas/pipelines.d.ts +1373 -0
  120. package/dist/schemas/pipelines.d.ts.map +1 -0
  121. package/dist/schemas/project.d.ts +9 -0
  122. package/dist/schemas/project.d.ts.map +1 -0
  123. package/dist/schemas/projections.d.ts +6992 -0
  124. package/dist/schemas/projections.d.ts.map +1 -0
  125. package/dist/schemas/rules.d.ts +204 -0
  126. package/dist/schemas/rules.d.ts.map +1 -0
  127. package/dist/schemas/status.d.ts +189 -0
  128. package/dist/schemas/status.d.ts.map +1 -0
  129. package/dist/schemas/syncs.d.ts +538 -0
  130. package/dist/schemas/syncs.d.ts.map +1 -0
  131. package/dist/schemas/telemetry.d.ts +265 -0
  132. package/dist/schemas/telemetry.d.ts.map +1 -0
  133. package/dist/schemas/webhook-runs.d.ts +169 -0
  134. package/dist/schemas/webhook-runs.d.ts.map +1 -0
  135. package/dist/schemas/workflows.d.ts +1720 -0
  136. package/dist/schemas/workflows.d.ts.map +1 -0
  137. package/dist/server.d.ts +64 -0
  138. package/dist/server.d.ts.map +1 -0
  139. package/dist/tsconfig.json +5 -0
  140. package/dist/utils/http.d.ts +23 -0
  141. package/dist/utils/http.d.ts.map +1 -0
  142. package/dist/utils/request-body.d.ts +15 -0
  143. package/dist/utils/request-body.d.ts.map +1 -0
  144. package/dist/utils/ws.d.ts +10 -0
  145. package/dist/utils/ws.d.ts.map +1 -0
  146. package/package.json +68 -0
  147. package/src/auth/access-token-boundary.ts +68 -0
  148. package/src/auth/application-access.ts +16 -0
  149. package/src/auth/browser-origin.ts +367 -0
  150. package/src/auth/csrf.ts +1 -0
  151. package/src/auth/guard.ts +169 -0
  152. package/src/auth/public-routes.ts +87 -0
  153. package/src/auth/responses.ts +54 -0
  154. package/src/auth/return-to.ts +21 -0
  155. package/src/auth/scope.ts +64 -0
  156. package/src/auth/session-activity.ts +19 -0
  157. package/src/auth/session-cookies.ts +43 -0
  158. package/src/files/content.ts +419 -0
  159. package/src/index.ts +2 -0
  160. package/src/openapi/security.ts +37 -0
  161. package/src/openapi/tags.ts +151 -0
  162. package/src/registerRoutes.ts +49 -0
  163. package/src/routes/action-runs.ts +238 -0
  164. package/src/routes/actions.ts +126 -0
  165. package/src/routes/agent-api-gateway.ts +260 -0
  166. package/src/routes/agents.ts +943 -0
  167. package/src/routes/auth.ts +2233 -0
  168. package/src/routes/connectors.ts +69 -0
  169. package/src/routes/datasets.ts +402 -0
  170. package/src/routes/events.ts +55 -0
  171. package/src/routes/files.ts +675 -0
  172. package/src/routes/links.ts +143 -0
  173. package/src/routes/logs.ts +65 -0
  174. package/src/routes/objects.ts +838 -0
  175. package/src/routes/ontology.ts +138 -0
  176. package/src/routes/pipelines.ts +332 -0
  177. package/src/routes/project.ts +16 -0
  178. package/src/routes/projections.ts +251 -0
  179. package/src/routes/rules.ts +124 -0
  180. package/src/routes/status.ts +53 -0
  181. package/src/routes/syncs.ts +243 -0
  182. package/src/routes/telemetry.ts +207 -0
  183. package/src/routes/webhook-runs.ts +81 -0
  184. package/src/routes/webhooks.ts +508 -0
  185. package/src/routes/workflows.ts +1333 -0
  186. package/src/routes/ws/agents.ts +301 -0
  187. package/src/routes/ws/events.ts +278 -0
  188. package/src/routes/ws/index.ts +12 -0
  189. package/src/routes/ws/log-subscription-hub.ts +375 -0
  190. package/src/routes/ws/logs.ts +117 -0
  191. package/src/schemas/actions.ts +123 -0
  192. package/src/schemas/agents.ts +293 -0
  193. package/src/schemas/auth.ts +317 -0
  194. package/src/schemas/common.ts +60 -0
  195. package/src/schemas/connectors.ts +21 -0
  196. package/src/schemas/datasets.ts +107 -0
  197. package/src/schemas/event-payloads.ts +79 -0
  198. package/src/schemas/events.ts +117 -0
  199. package/src/schemas/files.ts +82 -0
  200. package/src/schemas/links.ts +38 -0
  201. package/src/schemas/logs.ts +76 -0
  202. package/src/schemas/objects.ts +759 -0
  203. package/src/schemas/ontology.ts +77 -0
  204. package/src/schemas/pipelines.ts +150 -0
  205. package/src/schemas/project.ts +5 -0
  206. package/src/schemas/projections.ts +144 -0
  207. package/src/schemas/rules.ts +98 -0
  208. package/src/schemas/status.ts +51 -0
  209. package/src/schemas/syncs.ts +83 -0
  210. package/src/schemas/telemetry.ts +59 -0
  211. package/src/schemas/webhook-runs.ts +40 -0
  212. package/src/schemas/workflows.ts +229 -0
  213. package/src/server.ts +383 -0
  214. package/src/utils/http.ts +108 -0
  215. package/src/utils/request-body.ts +62 -0
  216. package/src/utils/ws.ts +59 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/routes/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,IAAI,EAGV,MAAM,YAAY,CAAA;AAcnB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAmgBpC,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4xBxF"}
@@ -0,0 +1,99 @@
1
+ import type { AuthorizationContext, OntologySource, Sixb } from "@sixb/core";
2
+ import type { Elysia } from "elysia";
3
+ import { z } from "zod";
4
+ import type { SixbServer } from "../../server";
5
+ declare const AgentStreamMessageSchema: z.ZodUnion<[z.ZodObject<{
6
+ type: z.ZodLiteral<"subscribe">;
7
+ runId: z.ZodString;
8
+ afterCursor: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ type: "subscribe";
11
+ runId: string;
12
+ afterCursor?: string | undefined;
13
+ }, {
14
+ type: "subscribe";
15
+ runId: string;
16
+ afterCursor?: string | undefined;
17
+ }>, z.ZodObject<{
18
+ type: z.ZodLiteral<"replay">;
19
+ runId: z.ZodString;
20
+ afterCursor: z.ZodOptional<z.ZodString>;
21
+ limit: z.ZodOptional<z.ZodNumber>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: "replay";
24
+ runId: string;
25
+ limit?: number | undefined;
26
+ afterCursor?: string | undefined;
27
+ }, {
28
+ type: "replay";
29
+ runId: string;
30
+ limit?: number | undefined;
31
+ afterCursor?: string | undefined;
32
+ }>, z.ZodObject<{
33
+ type: z.ZodLiteral<"unsubscribe">;
34
+ runId: z.ZodOptional<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: "unsubscribe";
37
+ runId?: string | undefined;
38
+ }, {
39
+ type: "unsubscribe";
40
+ runId?: string | undefined;
41
+ }>]>;
42
+ export declare function parseAgentStreamMessage(payload: unknown): {
43
+ ok: true;
44
+ data: z.infer<typeof AgentStreamMessageSchema>;
45
+ } | {
46
+ ok: false;
47
+ error: string;
48
+ };
49
+ export declare function canAccessAgentRunStream(sixb: Sixb<readonly OntologySource[]>, input: {
50
+ readonly runId: string;
51
+ readonly authz: AuthorizationContext | null;
52
+ }): Promise<{
53
+ ok: true;
54
+ } | {
55
+ ok: false;
56
+ message: string;
57
+ }>;
58
+ export declare function registerAgentStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
59
+ decorator: {};
60
+ store: {};
61
+ derive: {};
62
+ resolve: {};
63
+ }, {
64
+ typebox: {};
65
+ error: {};
66
+ }, {
67
+ schema: {};
68
+ standaloneSchema: {};
69
+ macro: {};
70
+ macroFn: {};
71
+ parser: {};
72
+ response: {};
73
+ }, {
74
+ ws: {
75
+ agents: {
76
+ subscribe: {
77
+ body: {};
78
+ params: {};
79
+ query: {};
80
+ headers: {};
81
+ response: {};
82
+ };
83
+ };
84
+ };
85
+ }, {
86
+ derive: {};
87
+ resolve: {};
88
+ schema: {};
89
+ standaloneSchema: {};
90
+ response: {};
91
+ }, {
92
+ derive: {};
93
+ resolve: {};
94
+ schema: {};
95
+ standaloneSchema: {};
96
+ response: {};
97
+ }>;
98
+ export {};
99
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAG5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA2B9C,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA8D,CAAA;AAM5F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GACpD;IACE,EAAE,EAAE,IAAI,CAAA;IACR,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;CAC/C,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd,CAcJ;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC,EACrC,KAAK,EAAE;IACL,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAA;CAC5C,GACA,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBxD;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCxE"}
@@ -0,0 +1,89 @@
1
+ import type { Elysia } from "elysia";
2
+ import { z } from "zod";
3
+ import type { SixbServer } from "../../server";
4
+ declare const SubscriptionMessageSchema: z.ZodUnion<[z.ZodObject<{
5
+ type: z.ZodLiteral<"subscribe">;
6
+ topic: z.ZodOptional<z.ZodEnum<["objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets", ...("objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets")[]]>>;
7
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<["object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed", ...("object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed")[]]>, "many">>;
8
+ objectTypeId: z.ZodOptional<z.ZodString>;
9
+ primaryId: z.ZodOptional<z.ZodString>;
10
+ actionId: z.ZodOptional<z.ZodString>;
11
+ runId: z.ZodOptional<z.ZodString>;
12
+ afterCursor: z.ZodOptional<z.ZodString>;
13
+ limit: z.ZodOptional<z.ZodNumber>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ type: "subscribe";
16
+ limit?: number | undefined;
17
+ objectTypeId?: string | undefined;
18
+ actionId?: string | undefined;
19
+ runId?: string | undefined;
20
+ primaryId?: string | undefined;
21
+ types?: ("object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed")[] | undefined;
22
+ topic?: "objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets" | undefined;
23
+ afterCursor?: string | undefined;
24
+ }, {
25
+ type: "subscribe";
26
+ limit?: number | undefined;
27
+ objectTypeId?: string | undefined;
28
+ actionId?: string | undefined;
29
+ runId?: string | undefined;
30
+ primaryId?: string | undefined;
31
+ types?: ("object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed")[] | undefined;
32
+ topic?: "objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets" | undefined;
33
+ afterCursor?: string | undefined;
34
+ }>, z.ZodObject<{
35
+ type: z.ZodLiteral<"unsubscribe">;
36
+ }, "strip", z.ZodTypeAny, {
37
+ type: "unsubscribe";
38
+ }, {
39
+ type: "unsubscribe";
40
+ }>]>;
41
+ export declare function parseSubscriptionMessage(payload: unknown): {
42
+ ok: true;
43
+ data: z.infer<typeof SubscriptionMessageSchema>;
44
+ } | {
45
+ ok: false;
46
+ error: string;
47
+ };
48
+ export declare function registerEventStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
49
+ decorator: {};
50
+ store: {};
51
+ derive: {};
52
+ resolve: {};
53
+ }, {
54
+ typebox: {};
55
+ error: {};
56
+ }, {
57
+ schema: {};
58
+ standaloneSchema: {};
59
+ macro: {};
60
+ macroFn: {};
61
+ parser: {};
62
+ response: {};
63
+ }, {
64
+ ws: {
65
+ events: {
66
+ subscribe: {
67
+ body: {};
68
+ params: {};
69
+ query: {};
70
+ headers: {};
71
+ response: {};
72
+ };
73
+ };
74
+ };
75
+ }, {
76
+ derive: {};
77
+ resolve: {};
78
+ schema: {};
79
+ standaloneSchema: {};
80
+ response: {};
81
+ }, {
82
+ derive: {};
83
+ resolve: {};
84
+ schema: {};
85
+ standaloneSchema: {};
86
+ response: {};
87
+ }>;
88
+ export {};
89
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAkC9C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAgD,CAAA;AAE/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GACrD;IACE,EAAE,EAAE,IAAI,CAAA;IACR,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAChD,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd,CAcJ;AAuBD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6JxE"}
@@ -0,0 +1,31 @@
1
+ import type { Elysia } from "elysia";
2
+ import type { SixbServer } from "../../server";
3
+ export declare function registerWebSocketRoutes(app: Elysia, server: SixbServer): Elysia<"", {
4
+ decorator: {};
5
+ store: {};
6
+ derive: {};
7
+ resolve: {};
8
+ }, {
9
+ typebox: {};
10
+ error: {};
11
+ }, {
12
+ schema: {};
13
+ standaloneSchema: {};
14
+ macro: {};
15
+ macroFn: {};
16
+ parser: {};
17
+ response: {};
18
+ }, {}, {
19
+ derive: {};
20
+ resolve: {};
21
+ schema: {};
22
+ standaloneSchema: {};
23
+ response: {};
24
+ }, {
25
+ derive: {};
26
+ resolve: {};
27
+ schema: {};
28
+ standaloneSchema: {};
29
+ response: {};
30
+ }>;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAK9C,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKtE"}
@@ -0,0 +1,47 @@
1
+ import type { LogLevel, LogRunRef, OntologySource, Sixb, SixbRunKind } from "@sixb/core";
2
+ interface LogSocket {
3
+ send(message: string): unknown;
4
+ close(code?: number, reason?: string): unknown;
5
+ readonly raw?: unknown;
6
+ }
7
+ export interface LogSubscriptionFilter {
8
+ readonly kinds?: readonly SixbRunKind[];
9
+ readonly levels?: readonly LogLevel[];
10
+ readonly run?: LogRunRef;
11
+ readonly afterCursor?: string;
12
+ }
13
+ /**
14
+ * One broker subscription per server/project, multiplexed to all connected
15
+ * clients. Each client has a bounded queue so a slow socket cannot retain an
16
+ * unbounded portion of the process heap.
17
+ */
18
+ export declare class LogSubscriptionHub {
19
+ private readonly sixb;
20
+ private readonly clients;
21
+ private readonly subscriptionGenerations;
22
+ private startPromise;
23
+ private unsubscribeBroker;
24
+ private closed;
25
+ constructor(sixb: Sixb<readonly OntologySource[]>);
26
+ subscribe(key: object, ws: LogSocket, filter: LogSubscriptionFilter, onSubscribed: () => void): Promise<void>;
27
+ unsubscribe(key: object): void;
28
+ private removeClient;
29
+ private nextSubscriptionGeneration;
30
+ private isCurrentSubscription;
31
+ close(): Promise<void>;
32
+ private ensureStarted;
33
+ private deliverLive;
34
+ private catchUp;
35
+ private enqueue;
36
+ private enqueueReplay;
37
+ private pushQueuedLine;
38
+ private enqueuePendingLive;
39
+ private scheduleFlush;
40
+ private flush;
41
+ private waitForQueueProgress;
42
+ private notifyQueueProgress;
43
+ private send;
44
+ private fail;
45
+ }
46
+ export {};
47
+ //# sourceMappingURL=log-subscription-hub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-subscription-hub.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/log-subscription-hub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EACT,cAAc,EACd,IAAI,EACJ,WAAW,EAEZ,MAAM,YAAY,CAAA;AAUnB,UAAU,SAAS;IACjB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAkBD;;;;GAIG;AACH,qBAAa,kBAAkB;IAOjB,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAgC;IACxE,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,MAAM,CAAQ;gBAEO,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC;IAE5D,SAAS,CACb,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,MAAM,IAAI,GACvB,OAAO,CAAC,IAAI,CAAC;IAoChB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK9B,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,0BAA0B;IAMlC,OAAO,CAAC,qBAAqB;IAIvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAOd,aAAa;IAiB3B,OAAO,CAAC,WAAW;YAUL,OAAO;IAoErB,OAAO,CAAC,OAAO;YAWD,aAAa;IAsB3B,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,KAAK;IAiBb,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,IAAI;CAsBb"}
@@ -0,0 +1,110 @@
1
+ import type { Elysia } from "elysia";
2
+ import { z } from "zod";
3
+ import type { SixbServer } from "../../server";
4
+ declare const SubscriptionMessageSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
5
+ type: z.ZodLiteral<"subscribe">;
6
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["action", "agent", "pipeline", "projection", "sync", "webhook", "workflow"]>, "many">>;
7
+ levels: z.ZodOptional<z.ZodArray<z.ZodEnum<["debug", "info", "warn", "error"]>, "many">>;
8
+ run: z.ZodOptional<z.ZodObject<{
9
+ kind: z.ZodEnum<["action", "agent", "pipeline", "projection", "sync", "webhook", "workflow"]>;
10
+ id: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
13
+ id: string;
14
+ }, {
15
+ kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
16
+ id: string;
17
+ }>>;
18
+ afterCursor: z.ZodOptional<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ type: "subscribe";
21
+ run?: {
22
+ kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
23
+ id: string;
24
+ } | undefined;
25
+ afterCursor?: string | undefined;
26
+ kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
27
+ levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
28
+ }, {
29
+ type: "subscribe";
30
+ run?: {
31
+ kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
32
+ id: string;
33
+ } | undefined;
34
+ afterCursor?: string | undefined;
35
+ kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
36
+ levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
37
+ }>, {
38
+ type: "subscribe";
39
+ run?: {
40
+ kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
41
+ id: string;
42
+ } | undefined;
43
+ afterCursor?: string | undefined;
44
+ kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
45
+ levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
46
+ }, {
47
+ type: "subscribe";
48
+ run?: {
49
+ kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
50
+ id: string;
51
+ } | undefined;
52
+ afterCursor?: string | undefined;
53
+ kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
54
+ levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
55
+ }>, z.ZodObject<{
56
+ type: z.ZodLiteral<"unsubscribe">;
57
+ }, "strip", z.ZodTypeAny, {
58
+ type: "unsubscribe";
59
+ }, {
60
+ type: "unsubscribe";
61
+ }>]>;
62
+ export declare function parseLogSubscriptionMessage(payload: unknown): {
63
+ ok: true;
64
+ data: z.infer<typeof SubscriptionMessageSchema>;
65
+ } | {
66
+ ok: false;
67
+ error: string;
68
+ };
69
+ export declare function registerLogStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
70
+ decorator: {};
71
+ store: {};
72
+ derive: {};
73
+ resolve: {};
74
+ }, {
75
+ typebox: {};
76
+ error: {};
77
+ }, {
78
+ schema: {};
79
+ standaloneSchema: {};
80
+ macro: {};
81
+ macroFn: {};
82
+ parser: {};
83
+ response: {};
84
+ }, {
85
+ ws: {
86
+ logs: {
87
+ subscribe: {
88
+ body: {};
89
+ params: {};
90
+ query: {};
91
+ headers: {};
92
+ response: {};
93
+ };
94
+ };
95
+ };
96
+ }, {
97
+ derive: {};
98
+ resolve: {};
99
+ schema: {};
100
+ standaloneSchema: {};
101
+ response: {};
102
+ }, {
103
+ derive: {};
104
+ resolve: {};
105
+ schema: {};
106
+ standaloneSchema: {};
107
+ response: {};
108
+ }>;
109
+ export {};
110
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/logs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA4B9C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAgD,CAAA;AAE/E,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAY9F;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEtE"}