@sixb/server 0.1.12 → 0.1.13

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 (85) hide show
  1. package/README.md +5 -4
  2. package/dist/auth/access-token-boundary.d.ts +13 -9
  3. package/dist/auth/access-token-boundary.d.ts.map +1 -1
  4. package/dist/auth/client-address.d.ts +12 -0
  5. package/dist/auth/client-address.d.ts.map +1 -0
  6. package/dist/auth/guard.d.ts.map +1 -1
  7. package/dist/auth/public-routes.d.ts +5 -0
  8. package/dist/auth/public-routes.d.ts.map +1 -1
  9. package/dist/auth/rate-limit.d.ts +15 -0
  10. package/dist/auth/rate-limit.d.ts.map +1 -0
  11. package/dist/auth/scope.d.ts +8 -3
  12. package/dist/auth/scope.d.ts.map +1 -1
  13. package/dist/auth/shared-access.d.ts.map +1 -1
  14. package/dist/index.js +578 -455
  15. package/dist/index.js.map +40 -38
  16. package/dist/openapi/security.d.ts +34 -10
  17. package/dist/openapi/security.d.ts.map +1 -1
  18. package/dist/routes/auth.d.ts +64 -17
  19. package/dist/routes/auth.d.ts.map +1 -1
  20. package/dist/routes/connectors.d.ts.map +1 -1
  21. package/dist/routes/events.d.ts +0 -4
  22. package/dist/routes/events.d.ts.map +1 -1
  23. package/dist/routes/files.d.ts +15 -2
  24. package/dist/routes/files.d.ts.map +1 -1
  25. package/dist/routes/models.d.ts +7 -7
  26. package/dist/routes/ontology.d.ts +13 -1
  27. package/dist/routes/ontology.d.ts.map +1 -1
  28. package/dist/routes/shared-access.d.ts.map +1 -1
  29. package/dist/routes/workflows.d.ts +30 -30
  30. package/dist/routes/workflows.d.ts.map +1 -1
  31. package/dist/routes/ws/agents.d.ts +2 -3
  32. package/dist/routes/ws/agents.d.ts.map +1 -1
  33. package/dist/schemas/auth.d.ts +241 -85
  34. package/dist/schemas/auth.d.ts.map +1 -1
  35. package/dist/schemas/common.d.ts +11 -0
  36. package/dist/schemas/common.d.ts.map +1 -1
  37. package/dist/schemas/events.d.ts +74 -44
  38. package/dist/schemas/events.d.ts.map +1 -1
  39. package/dist/schemas/models.d.ts +38 -38
  40. package/dist/schemas/ontology.d.ts +160 -0
  41. package/dist/schemas/ontology.d.ts.map +1 -1
  42. package/dist/schemas/workflows.d.ts +180 -190
  43. package/dist/schemas/workflows.d.ts.map +1 -1
  44. package/dist/server.d.ts +6 -0
  45. package/dist/server.d.ts.map +1 -1
  46. package/dist/utils/ws.d.ts +1 -2
  47. package/dist/utils/ws.d.ts.map +1 -1
  48. package/package.json +4 -4
  49. package/src/auth/access-token-boundary.ts +31 -30
  50. package/src/auth/client-address.ts +67 -0
  51. package/src/auth/guard.ts +13 -4
  52. package/src/auth/public-routes.ts +9 -2
  53. package/src/auth/rate-limit.ts +43 -0
  54. package/src/auth/scope.ts +13 -3
  55. package/src/auth/shared-access.ts +0 -3
  56. package/src/openapi/security.ts +37 -17
  57. package/src/routes/action-runs.ts +5 -5
  58. package/src/routes/actions.ts +4 -4
  59. package/src/routes/agents.ts +9 -9
  60. package/src/routes/ai-accounting.ts +10 -10
  61. package/src/routes/auth.ts +331 -432
  62. package/src/routes/connector-connection-runs.ts +5 -5
  63. package/src/routes/connector-connections.ts +3 -3
  64. package/src/routes/connectors.ts +2 -2
  65. package/src/routes/events.ts +2 -2
  66. package/src/routes/files.ts +30 -15
  67. package/src/routes/links.ts +3 -3
  68. package/src/routes/logs.ts +2 -2
  69. package/src/routes/objects.ts +12 -12
  70. package/src/routes/ontology.ts +27 -9
  71. package/src/routes/pipelines.ts +2 -2
  72. package/src/routes/project.ts +2 -2
  73. package/src/routes/share-grants.ts +4 -4
  74. package/src/routes/shared-access.ts +3 -2
  75. package/src/routes/syncs.ts +2 -2
  76. package/src/routes/telemetry.ts +5 -5
  77. package/src/routes/workflows.ts +18 -19
  78. package/src/routes/ws/agents.ts +4 -5
  79. package/src/schemas/auth.ts +27 -8
  80. package/src/schemas/common.ts +6 -0
  81. package/src/schemas/events.ts +35 -7
  82. package/src/schemas/ontology.ts +16 -1
  83. package/src/schemas/workflows.ts +4 -9
  84. package/src/server.ts +35 -5
  85. package/src/utils/ws.ts +2 -3
@@ -13,7 +13,7 @@ import {
13
13
  } from "@sixb/core/storage"
14
14
  import type { Elysia } from "elysia"
15
15
  import { ZodError, z } from "zod"
16
- import { bearerSecurityRequirement } from "../auth/access-token-boundary"
16
+ import { accessTokenSecurityRequirement } from "../auth/access-token-boundary"
17
17
  import { type RequestAuthState, requestAuthState, requireRequestSixb } from "../auth/scope"
18
18
  import {
19
19
  createFileContentResponse,
@@ -21,7 +21,7 @@ import {
21
21
  fileContentHeadResponses,
22
22
  resolveFileRefAtPath,
23
23
  } from "../files/content"
24
- import { SIXB_CSRF_SECURITY_REQUIREMENT } from "../openapi/security"
24
+ import { SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT } from "../openapi/security"
25
25
  import { OPENAPI_TAGS } from "../openapi/tags"
26
26
  import {
27
27
  AgentDescriptorSchema,
@@ -388,7 +388,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
388
388
  summary: "Create an agent thread",
389
389
  tags: [OPENAPI_TAGS.agentThreads.name],
390
390
  operationId: "createAgentThread",
391
- security: SIXB_CSRF_SECURITY_REQUIREMENT,
391
+ security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
392
392
  },
393
393
  }
394
394
  )
@@ -461,7 +461,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
461
461
  "Explicitly recreate an unavailable or uncertain workspace without deleting its previous state",
462
462
  operationId: "recreateAgentThreadSandbox",
463
463
  tags: [OPENAPI_TAGS.agentThreads.name],
464
- security: SIXB_CSRF_SECURITY_REQUIREMENT,
464
+ security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
465
465
  },
466
466
  }
467
467
  )
@@ -553,7 +553,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
553
553
  summary: "Get agent message file content",
554
554
  tags: ["Agents"],
555
555
  operationId: "getAgentMessageFileContent",
556
- security: bearerSecurityRequirement("getAgentMessageFileContent"),
556
+ security: accessTokenSecurityRequirement("getAgentMessageFileContent"),
557
557
  responses: fileContentGetResponses({ optionalStorage: true }),
558
558
  },
559
559
  }
@@ -568,7 +568,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
568
568
  summary: "Head agent message file content",
569
569
  tags: ["Agents"],
570
570
  operationId: "headAgentMessageFileContent",
571
- security: bearerSecurityRequirement("headAgentMessageFileContent"),
571
+ security: accessTokenSecurityRequirement("headAgentMessageFileContent"),
572
572
  responses: fileContentHeadResponses({ optionalStorage: true }),
573
573
  },
574
574
  }
@@ -626,7 +626,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
626
626
  summary: "Post an agent thread message",
627
627
  tags: [OPENAPI_TAGS.agentThreads.name],
628
628
  operationId: "postAgentThreadMessage",
629
- security: SIXB_CSRF_SECURITY_REQUIREMENT,
629
+ security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
630
630
  },
631
631
  }
632
632
  )
@@ -721,7 +721,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
721
721
  summary: "Cancel an agent thread's active run",
722
722
  tags: [OPENAPI_TAGS.agentRuns.name],
723
723
  operationId: "cancelAgentRun",
724
- security: SIXB_CSRF_SECURITY_REQUIREMENT,
724
+ security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
725
725
  },
726
726
  }
727
727
  )
@@ -776,7 +776,7 @@ export function registerAgentRoutes(app: Elysia, host: SixbHostView) {
776
776
  summary: "Retry a failed agent run",
777
777
  tags: [OPENAPI_TAGS.agentRuns.name],
778
778
  operationId: "retryAgentRun",
779
- security: SIXB_CSRF_SECURITY_REQUIREMENT,
779
+ security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
780
780
  },
781
781
  }
782
782
  )
@@ -10,7 +10,7 @@ import type {
10
10
  } from "@sixb/core/storage"
11
11
  import { AiLimitStorageError } from "@sixb/core/storage"
12
12
  import type { Elysia } from "elysia"
13
- import { bearerSecurityRequirement } from "../auth/access-token-boundary"
13
+ import { accessTokenSecurityRequirement } from "../auth/access-token-boundary"
14
14
  import type { RequestAuthState } from "../auth/scope"
15
15
  import { requireRequestSixb } from "../auth/scope"
16
16
  import { OPENAPI_TAGS } from "../openapi/tags"
@@ -240,7 +240,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
240
240
  summary: "Get project AI usage and cost analytics",
241
241
  tags: [OPENAPI_TAGS.aiAccounting.name],
242
242
  operationId: "getAiAccountingOverview",
243
- security: bearerSecurityRequirement("getAiAccountingOverview"),
243
+ security: accessTokenSecurityRequirement("getAiAccountingOverview"),
244
244
  },
245
245
  }
246
246
  )
@@ -288,7 +288,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
288
288
  summary: "List project AI model-call accounting records",
289
289
  tags: [OPENAPI_TAGS.aiAccounting.name],
290
290
  operationId: "listAiModelCalls",
291
- security: bearerSecurityRequirement("listAiModelCalls"),
291
+ security: accessTokenSecurityRequirement("listAiModelCalls"),
292
292
  },
293
293
  }
294
294
  )
@@ -326,7 +326,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
326
326
  summary: "List project AI usage-limit policies",
327
327
  tags: [OPENAPI_TAGS.aiAccounting.name],
328
328
  operationId: "listAiLimitPolicies",
329
- security: bearerSecurityRequirement("listAiLimitPolicies"),
329
+ security: accessTokenSecurityRequirement("listAiLimitPolicies"),
330
330
  },
331
331
  }
332
332
  )
@@ -365,7 +365,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
365
365
  summary: "Get current project AI usage-limit status",
366
366
  tags: [OPENAPI_TAGS.aiAccounting.name],
367
367
  operationId: "getAiLimitStatus",
368
- security: bearerSecurityRequirement("getAiLimitStatus"),
368
+ security: accessTokenSecurityRequirement("getAiLimitStatus"),
369
369
  },
370
370
  }
371
371
  )
@@ -395,7 +395,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
395
395
  "Lists registered groups and auth principals available for AI usage-limit policies.",
396
396
  tags: [OPENAPI_TAGS.aiAccounting.name],
397
397
  operationId: "getAiLimitSubjectOptions",
398
- security: bearerSecurityRequirement("getAiLimitSubjectOptions"),
398
+ security: accessTokenSecurityRequirement("getAiLimitSubjectOptions"),
399
399
  },
400
400
  }
401
401
  )
@@ -429,7 +429,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
429
429
  summary: "Create an AI usage-limit policy",
430
430
  tags: [OPENAPI_TAGS.aiAccounting.name],
431
431
  operationId: "createAiLimitPolicy",
432
- security: bearerSecurityRequirement("createAiLimitPolicy"),
432
+ security: accessTokenSecurityRequirement("createAiLimitPolicy"),
433
433
  },
434
434
  }
435
435
  )
@@ -467,7 +467,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
467
467
  summary: "Update an AI usage-limit policy",
468
468
  tags: [OPENAPI_TAGS.aiAccounting.name],
469
469
  operationId: "updateAiLimitPolicy",
470
- security: bearerSecurityRequirement("updateAiLimitPolicy"),
470
+ security: accessTokenSecurityRequirement("updateAiLimitPolicy"),
471
471
  },
472
472
  }
473
473
  )
@@ -505,7 +505,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
505
505
  summary: "Delete an AI usage-limit policy",
506
506
  tags: [OPENAPI_TAGS.aiAccounting.name],
507
507
  operationId: "deleteAiLimitPolicy",
508
- security: bearerSecurityRequirement("deleteAiLimitPolicy"),
508
+ security: accessTokenSecurityRequirement("deleteAiLimitPolicy"),
509
509
  },
510
510
  }
511
511
  )
@@ -549,7 +549,7 @@ export function registerAiAccountingRoutes(app: Elysia, host: SixbHostView) {
549
549
  summary: "List AI model calls grouped by initiating execution",
550
550
  tags: [OPENAPI_TAGS.aiAccounting.name],
551
551
  operationId: "listAiModelCallGroups",
552
- security: bearerSecurityRequirement("listAiModelCallGroups"),
552
+ security: accessTokenSecurityRequirement("listAiModelCallGroups"),
553
553
  },
554
554
  }
555
555
  )