@zyraxon-ai/server 19.0.4 → 19.0.5

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 (143) hide show
  1. package/dist/api.d.ts +2 -0
  2. package/dist/api.d.ts.map +1 -0
  3. package/dist/api.js +8 -0
  4. package/dist/api.js.map +1 -0
  5. package/dist/auth.d.ts +26 -0
  6. package/dist/auth.d.ts.map +1 -0
  7. package/dist/auth.js +36 -0
  8. package/dist/auth.js.map +1 -0
  9. package/dist/cors.d.ts +8 -0
  10. package/dist/cors.d.ts.map +1 -0
  11. package/dist/cors.js +36 -0
  12. package/dist/cors.js.map +1 -0
  13. package/dist/handlers/agent.d.ts +2 -0
  14. package/dist/handlers/agent.d.ts.map +1 -0
  15. package/dist/handlers/agent.js +9 -0
  16. package/dist/handlers/agent.js.map +1 -0
  17. package/dist/handlers/command.d.ts +2 -0
  18. package/dist/handlers/command.d.ts.map +1 -0
  19. package/dist/handlers/command.js +6 -0
  20. package/dist/handlers/command.js.map +1 -0
  21. package/dist/handlers/credential.d.ts +2 -0
  22. package/dist/handlers/credential.d.ts.map +1 -0
  23. package/dist/handlers/credential.js +14 -0
  24. package/dist/handlers/credential.js.map +1 -0
  25. package/dist/handlers/event.d.ts +2 -0
  26. package/dist/handlers/event.d.ts.map +1 -0
  27. package/dist/handlers/event.js +41 -0
  28. package/dist/handlers/event.js.map +1 -0
  29. package/dist/handlers/fs.d.ts +2 -0
  30. package/dist/handlers/fs.d.ts.map +1 -0
  31. package/dist/handlers/fs.js +25 -0
  32. package/dist/handlers/fs.js.map +1 -0
  33. package/dist/handlers/health.d.ts +2 -0
  34. package/dist/handlers/health.d.ts.map +1 -0
  35. package/dist/handlers/health.js +5 -0
  36. package/dist/handlers/health.js.map +1 -0
  37. package/dist/handlers/integration.d.ts +2 -0
  38. package/dist/handlers/integration.d.ts.map +1 -0
  39. package/dist/handlers/integration.js +61 -0
  40. package/dist/handlers/integration.js.map +1 -0
  41. package/dist/handlers/location.d.ts +2 -0
  42. package/dist/handlers/location.d.ts.map +1 -0
  43. package/dist/handlers/location.js +13 -0
  44. package/dist/handlers/location.js.map +1 -0
  45. package/dist/handlers/message.d.ts +2 -0
  46. package/dist/handlers/message.d.ts.map +1 -0
  47. package/dist/handlers/message.js +57 -0
  48. package/dist/handlers/message.js.map +1 -0
  49. package/dist/handlers/model.d.ts +2 -0
  50. package/dist/handlers/model.d.ts.map +1 -0
  51. package/dist/handlers/model.js +12 -0
  52. package/dist/handlers/model.js.map +1 -0
  53. package/dist/handlers/permission.d.ts +2 -0
  54. package/dist/handlers/permission.d.ts.map +1 -0
  55. package/dist/handlers/permission.js +70 -0
  56. package/dist/handlers/permission.js.map +1 -0
  57. package/dist/handlers/project-copy.d.ts +2 -0
  58. package/dist/handlers/project-copy.d.ts.map +1 -0
  59. package/dist/handlers/project-copy.js +42 -0
  60. package/dist/handlers/project-copy.js.map +1 -0
  61. package/dist/handlers/provider.d.ts +2 -0
  62. package/dist/handlers/provider.d.ts.map +1 -0
  63. package/dist/handlers/provider.js +24 -0
  64. package/dist/handlers/provider.js.map +1 -0
  65. package/dist/handlers/pty.d.ts +2 -0
  66. package/dist/handlers/pty.d.ts.map +1 -0
  67. package/dist/handlers/pty.js +142 -0
  68. package/dist/handlers/pty.js.map +1 -0
  69. package/dist/handlers/question.d.ts +2 -0
  70. package/dist/handlers/question.d.ts.map +1 -0
  71. package/dist/handlers/question.js +39 -0
  72. package/dist/handlers/question.js.map +1 -0
  73. package/dist/handlers/reference.d.ts +2 -0
  74. package/dist/handlers/reference.d.ts.map +1 -0
  75. package/dist/handlers/reference.js +6 -0
  76. package/dist/handlers/reference.js.map +1 -0
  77. package/dist/handlers/session.d.ts +2 -0
  78. package/dist/handlers/session.d.ts.map +1 -0
  79. package/dist/handlers/session.js +206 -0
  80. package/dist/handlers/session.js.map +1 -0
  81. package/dist/handlers/skill.d.ts +2 -0
  82. package/dist/handlers/skill.d.ts.map +1 -0
  83. package/dist/handlers/skill.js +6 -0
  84. package/dist/handlers/skill.js.map +1 -0
  85. package/dist/handlers.d.ts +3 -0
  86. package/dist/handlers.d.ts.map +1 -0
  87. package/dist/handlers.js +21 -0
  88. package/dist/handlers.js.map +1 -0
  89. package/dist/location.d.ts +21 -0
  90. package/dist/location.d.ts.map +1 -0
  91. package/dist/location.js +48 -0
  92. package/dist/location.js.map +1 -0
  93. package/dist/middleware/authorization.d.ts +6 -0
  94. package/dist/middleware/authorization.d.ts.map +1 -0
  95. package/dist/middleware/authorization.js +51 -0
  96. package/dist/middleware/authorization.js.map +1 -0
  97. package/dist/middleware/schema-error.d.ts +4 -0
  98. package/dist/middleware/schema-error.d.ts.map +1 -0
  99. package/dist/middleware/schema-error.js +16 -0
  100. package/dist/middleware/schema-error.js.map +1 -0
  101. package/dist/middleware/session-location.d.ts +16 -0
  102. package/dist/middleware/session-location.d.ts.map +1 -0
  103. package/dist/middleware/session-location.js +44 -0
  104. package/dist/middleware/session-location.js.map +1 -0
  105. package/dist/pty-environment.d.ts +14 -0
  106. package/dist/pty-environment.d.ts.map +1 -0
  107. package/dist/pty-environment.js +10 -0
  108. package/dist/pty-environment.js.map +1 -0
  109. package/dist/routes.d.ts +9 -0
  110. package/dist/routes.d.ts.map +1 -0
  111. package/dist/routes.js +51 -0
  112. package/dist/routes.js.map +1 -0
  113. package/package.json +10 -6
  114. package/src/api.ts +0 -8
  115. package/src/auth.ts +0 -63
  116. package/src/cors.ts +0 -34
  117. package/src/handlers/agent.ts +0 -13
  118. package/src/handlers/command.ts +0 -8
  119. package/src/handlers/credential.ts +0 -22
  120. package/src/handlers/event.ts +0 -52
  121. package/src/handlers/fs.ts +0 -39
  122. package/src/handlers/health.ts +0 -7
  123. package/src/handlers/integration.ts +0 -104
  124. package/src/handlers/location.ts +0 -18
  125. package/src/handlers/message.ts +0 -81
  126. package/src/handlers/model.ts +0 -17
  127. package/src/handlers/permission.ts +0 -98
  128. package/src/handlers/project-copy.ts +0 -68
  129. package/src/handlers/provider.ts +0 -32
  130. package/src/handlers/pty.ts +0 -223
  131. package/src/handlers/question.ts +0 -62
  132. package/src/handlers/reference.ts +0 -8
  133. package/src/handlers/session.ts +0 -385
  134. package/src/handlers/skill.ts +0 -8
  135. package/src/handlers.ts +0 -40
  136. package/src/location.ts +0 -60
  137. package/src/middleware/authorization.ts +0 -58
  138. package/src/middleware/schema-error.ts +0 -20
  139. package/src/middleware/session-location.ts +0 -67
  140. package/src/pty-environment.ts +0 -19
  141. package/src/routes.ts +0 -68
  142. package/sst-env.d.ts +0 -10
  143. package/tsconfig.json +0 -8
package/dist/api.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const Api: any;
2
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,GAAG,KAGd,CAAA"}
package/dist/api.js ADDED
@@ -0,0 +1,8 @@
1
+ import { makeDefaultApi } from "@zyraxon-ai/protocol/api";
2
+ import { LocationMiddleware } from "./location";
3
+ import { SessionLocationMiddleware } from "./middleware/session-location";
4
+ export const Api = makeDefaultApi({
5
+ locationMiddleware: LocationMiddleware,
6
+ sessionLocationMiddleware: SessionLocationMiddleware,
7
+ });
8
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAEzE,MAAM,CAAC,MAAM,GAAG,GAAG,cAAc,CAAC;IAChC,kBAAkB,EAAE,kBAAkB;IACtC,yBAAyB,EAAE,yBAAyB;CACrD,CAAC,CAAA"}
package/dist/auth.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ export * as ServerAuth from "./auth";
2
+ import { Config as EffectConfig, Context, Layer, Option, Redacted } from "effect";
3
+ export type Credentials = {
4
+ password?: string;
5
+ username?: string;
6
+ };
7
+ export type DecodedCredentials = {
8
+ readonly username: string;
9
+ readonly password: Redacted.Redacted;
10
+ };
11
+ export type Info = {
12
+ readonly password: Option.Option<string>;
13
+ readonly username: string;
14
+ };
15
+ declare const Config_base: Context.ServiceClass<Config, "@zyraxon/ServerAuthConfig", Info>;
16
+ export declare class Config extends Config_base {
17
+ static configLayer(input: Info): Layer.Layer<Config, never, never>;
18
+ static get layer(): Layer.Layer<Config, EffectConfig.ConfigError, never>;
19
+ }
20
+ export declare function required(config: Info): boolean;
21
+ export declare function authorized(credentials: DecodedCredentials, config: Info): boolean;
22
+ export declare function header(credentials?: Credentials): string;
23
+ export declare function headers(credentials?: Credentials): {
24
+ Authorization: string;
25
+ };
26
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,OAAO,EAAU,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEzF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,CAAA;;AAED,qBAAa,MAAO,SAAQ,WAA4D;IACtF,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI;IAI9B,MAAM,KAAK,KAAK,yDAYf;CACF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,IAAI,WAEpC;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,WAMvE;AAED,wBAAgB,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW,UAK/C;AAED,wBAAgB,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW;;EAIhD"}
package/dist/auth.js ADDED
@@ -0,0 +1,36 @@
1
+ export * as ServerAuth from "./auth";
2
+ import { Config as EffectConfig, Context, Effect, Layer, Option, Redacted } from "effect";
3
+ export class Config extends Context.Service()("@zyraxon/ServerAuthConfig") {
4
+ static configLayer(input) {
5
+ return Layer.succeed(this, this.of(input));
6
+ }
7
+ static get layer() {
8
+ return Layer.effect(this, Effect.gen(function* () {
9
+ return Config.of(yield* EffectConfig.all({
10
+ password: EffectConfig.string("ZYRAXON_SERVER_PASSWORD").pipe(EffectConfig.option),
11
+ username: EffectConfig.string("ZYRAXON_SERVER_USERNAME").pipe(EffectConfig.withDefault("zyraxon")),
12
+ }));
13
+ }));
14
+ }
15
+ }
16
+ export function required(config) {
17
+ return Option.isSome(config.password) && config.password.value !== "";
18
+ }
19
+ export function authorized(credentials, config) {
20
+ return (Option.isSome(config.password) &&
21
+ credentials.username === config.username &&
22
+ Redacted.value(credentials.password) === config.password.value);
23
+ }
24
+ export function header(credentials) {
25
+ const password = credentials?.password ?? process.env.ZYRAXON_SERVER_PASSWORD;
26
+ if (!password)
27
+ return undefined;
28
+ return `Basic ${Buffer.from(`${credentials?.username ?? process.env.ZYRAXON_SERVER_USERNAME ?? "zyraxon"}:${password}`).toString("base64")}`;
29
+ }
30
+ export function headers(credentials) {
31
+ const authorization = header(credentials);
32
+ if (!authorization)
33
+ return undefined;
34
+ return {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MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC9B,WAAW,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ;QACxC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAC/D,CAAA;AACH,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,WAAyB;IAC9C,MAAM,QAAQ,GAAG,WAAW,EAAE,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAA;IAC7E,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAA;IAE/B,OAAO,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,EAAE,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;AAC9I,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,WAAyB;IAC/C,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;IACzC,IAAI,CAAC,aAAa;QAAE,OAAO,SAAS,CAAA;IACpC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA;AACzC,CAAC"}
package/dist/cors.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { Context } from "effect";
2
+ export type CorsOptions = {
3
+ readonly cors?: ReadonlyArray<string>;
4
+ };
5
+ export declare const CorsConfig: Context.Reference<CorsOptions>;
6
+ export declare function isAllowedCorsOrigin(input: string | undefined, opts?: CorsOptions): boolean;
7
+ export declare function isAllowedRequestOrigin(input: string | undefined, host: string | undefined, opts?: CorsOptions): boolean;
8
+ //# sourceMappingURL=cors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../src/cors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAIhC,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAAE,CAAA;AAEnE,eAAO,MAAM,UAAU,gCAErB,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,WAAW,WAShF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,WAAW,WAI7G"}
package/dist/cors.js ADDED
@@ -0,0 +1,36 @@
1
+ import { Context } from "effect";
2
+ const zyraxonOrigin = /^https:\/\/([a-z0-9-]+\.)*zyraxon\.ai$/;
3
+ export const CorsConfig = Context.Reference("@zyraxon/ServerCorsConfig", {
4
+ defaultValue: () => undefined,
5
+ });
6
+ export function isAllowedCorsOrigin(input, opts) {
7
+ if (!input)
8
+ return true;
9
+ if (input.startsWith("http://localhost:"))
10
+ return true;
11
+ if (input.startsWith("http://127.0.0.1:"))
12
+ return true;
13
+ if (input.startsWith("oc://renderer"))
14
+ return true;
15
+ if (input === "tauri://localhost" || input === "http://tauri.localhost" || input === "https://tauri.localhost")
16
+ return true;
17
+ if (zyraxonOrigin.test(input))
18
+ return true;
19
+ return opts?.cors?.includes(input) ?? false;
20
+ }
21
+ export function isAllowedRequestOrigin(input, host, opts) {
22
+ if (!input)
23
+ return true;
24
+ if (host && sameHost(input, host))
25
+ return true;
26
+ return isAllowedCorsOrigin(input, opts);
27
+ }
28
+ function sameHost(origin, host) {
29
+ try {
30
+ return new URL(origin).host === host;
31
+ }
32
+ catch {
33
+ return false;
34
+ }
35
+ }
36
+ //# sourceMappingURL=cors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.js","sourceRoot":"","sources":["../src/cors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,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AC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const AgentHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/handlers/agent.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oHAMxB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { AgentV2 } from "@zyraxon-ai/core/agent";
2
+ import { Effect } from "effect";
3
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
4
+ import { Api } from "../api";
5
+ import { response } from "../location";
6
+ export const AgentHandler = HttpApiBuilder.group(Api, "server.agent", (handlers) => handlers.handle("agent.list", () => Effect.gen(function* () {
7
+ return yield* response(AgentV2.Service.use((agent) => agent.all()));
8
+ })));
9
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/handlers/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,QAAQ,EAAE,EAAE,CACjF,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,EAAE,CACjC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,OAAO,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AACrE,CAAC,CAAC,CACH,CACF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const CommandHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/handlers/command.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,oHAE1B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { CommandV2 } from "@zyraxon-ai/core/command";
2
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
3
+ import { Api } from "../api";
4
+ import { response } from "../location";
5
+ export const CommandHandler = HttpApiBuilder.group(Api, "server.command", (handlers) => handlers.handle("command.list", () => response(CommandV2.Service.use((command) => command.list()))));
6
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/handlers/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE,CACrF,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACpG,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const CredentialHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=credential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential.d.ts","sourceRoot":"","sources":["../../src/handlers/credential.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,oHAgB7B,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { Integration } from "@zyraxon-ai/core/integration";
2
+ import { Effect } from "effect";
3
+ import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
4
+ import { Api } from "../api";
5
+ export const CredentialHandler = HttpApiBuilder.group(Api, "server.credential", (handlers) => handlers
6
+ .handle("credential.update", Effect.fn(function* (ctx) {
7
+ yield* (yield* Integration.Service).connection.update(ctx.params.credentialID, { label: ctx.payload.label });
8
+ return HttpApiSchema.NoContent.make();
9
+ }))
10
+ .handle("credential.remove", Effect.fn(function* (ctx) {
11
+ yield* (yield* Integration.Service).connection.remove(ctx.params.credentialID);
12
+ return HttpApiSchema.NoContent.make();
13
+ })));
14
+ //# sourceMappingURL=credential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential.js","sourceRoot":"","sources":["../../src/handlers/credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAC3F,QAAQ;KACL,MAAM,CACL,mBAAmB,EACnB,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG;IACtB,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;IAC5G,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;AACvC,CAAC,CAAC,CACH;KACA,MAAM,CACL,mBAAmB,EACnB,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG;IACtB,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAC9E,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;AACvC,CAAC,CAAC,CACH,CACJ,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const EventHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/handlers/event.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,YAAY,oHAgCxB,CAAA"}
@@ -0,0 +1,41 @@
1
+ import { EventV2 } from "@zyraxon-ai/core/event";
2
+ import { ZyraxonEvent } from "@zyraxon-ai/protocol/groups/event";
3
+ import { Effect, Schema, Stream } from "effect";
4
+ import { HttpServerResponse } from "effect/unstable/http";
5
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
6
+ import * as Sse from "effect/unstable/encoding/Sse";
7
+ import { Api } from "../api";
8
+ const subscriberCapacity = 256;
9
+ function eventData(data) {
10
+ return {
11
+ _tag: "Event",
12
+ event: "message",
13
+ id: undefined,
14
+ data: JSON.stringify(Schema.encodeUnknownSync(ZyraxonEvent)(data)),
15
+ };
16
+ }
17
+ export const EventHandler = HttpApiBuilder.group(Api, "server.event", (handlers) => Effect.gen(function* () {
18
+ const events = yield* EventV2.Service;
19
+ return handlers.handleRaw("event.subscribe", () => Effect.gen(function* () {
20
+ const connected = {
21
+ id: EventV2.ID.create(),
22
+ type: "server.connected",
23
+ data: {},
24
+ };
25
+ const output = Stream.unwrap(Effect.gen(function* () {
26
+ // Acquiring the bounded stream installs its listener before readiness is observable.
27
+ const live = yield* EventV2.allBounded(events, subscriberCapacity);
28
+ return Stream.make(connected).pipe(Stream.concat(live));
29
+ })).pipe(Stream.map(eventData), Stream.pipeThroughChannel(Sse.encode()));
30
+ const heartbeat = Stream.tick("15 seconds").pipe(Stream.map(() => ": heartbeat\n\n"));
31
+ return HttpServerResponse.stream(output.pipe(Stream.merge(heartbeat, { haltStrategy: "left" }), Stream.encodeText), {
32
+ contentType: "text/event-stream",
33
+ headers: {
34
+ "Cache-Control": "no-cache, no-transform",
35
+ "X-Accel-Buffering": "no",
36
+ "X-Content-Type-Options": "nosniff",
37
+ },
38
+ });
39
+ }));
40
+ }));
41
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/handlers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAE9B,SAAS,SAAS,CAAC,IAAa;IAC9B,OAAO;QACL,IAAI,EAA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BAAiB,CAAC,CAAC,CAAA;QACrF,OAAO,kBAAkB,CAAC,MAAM,CAC9B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,EACjF;YACE,WAAW,EAAE,mBAAmB;YAChC,OAAO,EAAE;gBACP,eAAe,EAAE,wBAAwB;gBACzC,mBAAmB,EAAE,IAAI;gBACzB,wBAAwB,EAAE,SAAS;aACpC;SACF,CACF,CAAA;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC,CAAC,CACH,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const FileSystemHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/handlers/fs.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB,oHA8B7B,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { FileSystem } from "@zyraxon-ai/core/filesystem";
2
+ import { RelativePath } from "@zyraxon-ai/core/schema";
3
+ import { Effect } from "effect";
4
+ import { HttpServerResponse } from "effect/unstable/http";
5
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
6
+ import { Api } from "../api";
7
+ import { response } from "../location";
8
+ export const FileSystemHandler = HttpApiBuilder.group(Api, "server.fs", (handlers) => Effect.gen(function* () {
9
+ return handlers
10
+ .handleRaw("fs.read", (ctx) => Effect.gen(function* () {
11
+ const file = yield* (yield* FileSystem.Service).read({
12
+ path: RelativePath.make(decodeURIComponent(new URL(ctx.request.url, "http://localhost").pathname.slice(13))),
13
+ });
14
+ return HttpServerResponse.uint8Array(file.content, { contentType: file.mime });
15
+ }))
16
+ .handle("fs.list", (ctx) => response(Effect.gen(function* () {
17
+ const fs = yield* FileSystem.Service;
18
+ return yield* fs.list(ctx.query);
19
+ })))
20
+ .handle("fs.find", (ctx) => response(Effect.gen(function* () {
21
+ const fs = yield* FileSystem.Service;
22
+ return yield* fs.find(ctx.query);
23
+ })));
24
+ }));
25
+ //# sourceMappingURL=fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/handlers/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CACnF,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,OAAO,QAAQ;SACZ,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAC5B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;YACnD,IAAI,EAAE,YAAY,CAAC,IAAI,CACrB,kBAAkB,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CACpF;SACF,CAAC,CAAA;QACF,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IAChF,CAAC,CAAC,CACH;SACA,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACzB,QAAQ,CACN,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAA;QACpC,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC,CAAC,CACH,CACF;SACA,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACzB,QAAQ,CACN,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAA;QACpC,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC,CAAC,CACH,CACF,CAAA;AACL,CAAC,CAAC,CACH,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const HealthHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/handlers/health.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,oHAEzB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
3
+ import { Api } from "../api";
4
+ export const HealthHandler = HttpApiBuilder.group(Api, "server.health", (handlers) => handlers.handle("health.get", () => Effect.succeed({ healthy: true })));
5
+ //# sourceMappingURL=health.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/handlers/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,EAAE,CACnF,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC,CAAC,CAChF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const IntegrationHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/handlers/integration.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,oHAqF9B,CAAA"}
@@ -0,0 +1,61 @@
1
+ import { Integration } from "@zyraxon-ai/core/integration";
2
+ import { Effect } from "effect";
3
+ import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
4
+ import { Api } from "../api";
5
+ import { InvalidRequestError } from "@zyraxon-ai/protocol/errors";
6
+ import { response } from "../location";
7
+ const authorize = (effect) => effect.pipe(Effect.mapError(() => new InvalidRequestError({
8
+ message: "Authentication failed",
9
+ kind: "integration_authorization",
10
+ })));
11
+ export const IntegrationHandler = HttpApiBuilder.group(Api, "server.integration", (handlers) => Effect.gen(function* () {
12
+ return handlers
13
+ .handle("integration.list", Effect.fn(function* () {
14
+ const service = yield* Integration.Service;
15
+ return yield* response(service.list());
16
+ }))
17
+ .handle("integration.get", Effect.fn(function* (ctx) {
18
+ const service = yield* Integration.Service;
19
+ return yield* response(service.get(ctx.params.integrationID));
20
+ }))
21
+ .handle("integration.connect.key", Effect.fn(function* (ctx) {
22
+ const service = yield* Integration.Service;
23
+ yield* authorize(service.connection.key({
24
+ integrationID: ctx.params.integrationID,
25
+ key: ctx.payload.key,
26
+ label: ctx.payload.label,
27
+ }));
28
+ return HttpApiSchema.NoContent.make();
29
+ }))
30
+ .handle("integration.connect.oauth", Effect.fn(function* (ctx) {
31
+ const service = yield* Integration.Service;
32
+ return yield* response(authorize(service.connection.oauth({
33
+ integrationID: ctx.params.integrationID,
34
+ methodID: ctx.payload.methodID,
35
+ inputs: ctx.payload.inputs,
36
+ label: ctx.payload.label,
37
+ })));
38
+ }))
39
+ .handle("integration.attempt.status", Effect.fn(function* (ctx) {
40
+ const service = yield* Integration.Service;
41
+ return yield* response(service.attempt.status(ctx.params.attemptID));
42
+ }))
43
+ .handle("integration.attempt.complete", Effect.fn(function* (ctx) {
44
+ const service = yield* Integration.Service;
45
+ yield* service.attempt.complete({ attemptID: ctx.params.attemptID, code: ctx.payload.code }).pipe(Effect.mapError((error) => new InvalidRequestError({
46
+ message: error._tag === "Integration.CodeRequired"
47
+ ? "Authorization code is required"
48
+ : "Authentication failed",
49
+ kind: error._tag === "Integration.CodeRequired"
50
+ ? "integration_code_required"
51
+ : "integration_authorization",
52
+ })));
53
+ return HttpApiSchema.NoContent.make();
54
+ }))
55
+ .handle("integration.attempt.cancel", Effect.fn(function* (ctx) {
56
+ const service = yield* Integration.Service;
57
+ yield* service.attempt.cancel(ctx.params.attemptID);
58
+ return HttpApiSchema.NoContent.make();
59
+ }));
60
+ }));
61
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../src/handlers/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;A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A;QAC1C,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAC/F,MAAM,CAAC,QAAQ,CACb,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,mBAAmB,CAAC;YACtB,OAAO,EACL,KAAK,CAAC,IAAI,KAAK,0BAA0B;gBACvC,CAAC,CAAC,gCAAgC;gBAClC,CAAC,CAAC,uBAAuB;YAC7B,IAAI,EACF,KAAK,CAAC,IAAI,KAAK,0BAA0B;gBACvC,CAAC,CAAC,2BAA2B;gBAC7B,CAAC,CAAC,2BAA2B;SAClC,CAAC,CACL,CACF,CAAA;QACD,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IACvC,CAAC,CAAC,CACH;SACA,MAAM,CACL,4BAA4B,EAC5B,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG;QACtB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,CAAA;QAC1C,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QACnD,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IACvC,CAAC,CAAC,CACH,CAAA;AACL,CAAC,CAAC,CACH,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const LocationHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/handlers/location.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,oHAY3B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { Location } from "@zyraxon-ai/core/location";
2
+ import { Effect } from "effect";
3
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
4
+ import { Api } from "../api";
5
+ export const LocationHandler = HttpApiBuilder.group(Api, "server.location", (handlers) => handlers.handle("location.get", Effect.fn(function* () {
6
+ const location = yield* Location.Service;
7
+ return new Location.Info({
8
+ directory: location.directory,
9
+ workspaceID: location.workspaceID,
10
+ project: location.project,
11
+ });
12
+ })));
13
+ //# sourceMappingURL=location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/handlers/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,iBAAiB,EAAE,CAAC,QAAQ,EAAE,EAAE,CACvF,QAAQ,CAAC,MAAM,CACb,cAAc,EACd,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC;IACjB,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAA;IACxC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC;QACvB,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC,CAAA;AACJ,CAAC,CAAC,CACH,CACF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const MessageHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/handlers/message.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,cAAc,oHAsD1B,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { SessionMessage } from "@zyraxon-ai/core/session/message";
2
+ import { SessionV2 } from "@zyraxon-ai/core/session";
3
+ import { Effect, Schema } from "effect";
4
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
5
+ import { Api } from "../api";
6
+ import { InvalidCursorError, SessionNotFoundError, UnknownError } from "@zyraxon-ai/protocol/errors";
7
+ const DefaultMessagesLimit = 50;
8
+ const Cursor = Schema.Struct({
9
+ id: SessionMessage.ID,
10
+ order: Schema.Union([Schema.Literal("asc"), Schema.Literal("desc")]),
11
+ direction: Schema.Union([Schema.Literal("previous"), Schema.Literal("next")]),
12
+ });
13
+ const decodeCursor = Schema.decodeUnknownSync(Cursor);
14
+ const cursor = {
15
+ encode(message, order, direction) {
16
+ return Buffer.from(JSON.stringify({ id: message.id, order, direction })).toString("base64url");
17
+ },
18
+ decode(input) {
19
+ return decodeCursor(JSON.parse(Buffer.from(input, "base64url").toString("utf8")));
20
+ },
21
+ };
22
+ export const MessageHandler = HttpApiBuilder.group(Api, "server.message", (handlers) => Effect.gen(function* () {
23
+ const session = yield* SessionV2.Service;
24
+ return handlers.handle("session.messages", Effect.fn(function* (ctx) {
25
+ if (ctx.query.cursor && ctx.query.order !== undefined)
26
+ return yield* new InvalidCursorError({ message: "Cursor cannot be combined with order" });
27
+ const decoded = yield* Effect.try({
28
+ try: () => (ctx.query.cursor ? cursor.decode(ctx.query.cursor) : undefined),
29
+ catch: () => new InvalidCursorError({ message: "Invalid cursor" }),
30
+ });
31
+ const order = decoded?.order ?? ctx.query.order ?? "desc";
32
+ const messages = yield* session
33
+ .messages({
34
+ sessionID: ctx.params.sessionID,
35
+ limit: ctx.query.limit ?? DefaultMessagesLimit,
36
+ order,
37
+ cursor: decoded ? { id: decoded.id, direction: decoded.direction } : undefined,
38
+ })
39
+ .pipe(Effect.catchTag("Session.NotFoundError", (error) => Effect.fail(new SessionNotFoundError({
40
+ sessionID: error.sessionID,
41
+ message: `Session not found: ${error.sessionID}`,
42
+ }))), Effect.catchTag("Session.MessageDecodeError", (error) => {
43
+ const ref = `err_${crypto.randomUUID().slice(0, 8)}`;
44
+ return Effect.logError("failed to decode session message").pipe(Effect.annotateLogs({ ref, sessionID: error.sessionID, messageID: error.messageID }), Effect.andThen(Effect.fail(new UnknownError({ message: "Unexpected server error. Check server logs for details.", ref }))));
45
+ }));
46
+ const first = messages[0];
47
+ const last = messages.at(-1);
48
+ return {
49
+ data: messages,
50
+ cursor: {
51
+ previous: first ? cursor.encode(first, order, "previous") : undefined,
52
+ next: last ? cursor.encode(last, order, "next") : undefined,
53
+ },
54
+ };
55
+ }));
56
+ }));
57
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/handlers/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAEpG,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAE/B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,cAAc,CAAC,EAAE;IACrB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACpE,SAAS,EAAE,MAAM,CA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C,YAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,EACpF,MAAM,CAAC,OAAO,CACZ,MAAM,CAAC,IAAI,CACT,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,yDAAyD,EAAE,GAAG,EAAE,CAAC,CAC9F,CACF,CACF,CAAA;QACH,CAAC,CAAC,CACH,CAAA;QACH,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QAC5B,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;gBACrE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;aAC5D;SACF,CAAA;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC,CAAC,CACH,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const ModelHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/handlers/model.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oHAUxB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Catalog } from "@zyraxon-ai/core/catalog";
2
+ import { Effect } from "effect";
3
+ import { HttpApiBuilder } from "effect/unstable/httpapi";
4
+ import { Api } from "../api";
5
+ import { response } from "../location";
6
+ export const ModelHandler = HttpApiBuilder.group(Api, "server.model", (handlers) => Effect.gen(function* () {
7
+ return handlers.handle("model.list", Effect.fn(function* () {
8
+ const catalog = yield* Catalog.Service;
9
+ return yield* response(catalog.model.available());
10
+ }));
11
+ }));
12
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/handlers/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,QAAQ,EAAE,EAAE,CACjF,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,OAAO,QAAQ,CAAC,MAAM,CACpB,YAAY,EACZ,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC;QACjB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;QACtC,OAAO,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAA;IACnD,CAAC,CAAC,CACH,CAAA;AACH,CAAC,CAAC,CACH,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const PermissionHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<string, never>, never, never>;
2
+ //# sourceMappingURL=permission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/handlers/permission.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,iBAAiB,oHAoF7B,CAAA"}