@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.
- package/README.md +5 -4
- package/dist/auth/access-token-boundary.d.ts +13 -9
- package/dist/auth/access-token-boundary.d.ts.map +1 -1
- package/dist/auth/client-address.d.ts +12 -0
- package/dist/auth/client-address.d.ts.map +1 -0
- package/dist/auth/guard.d.ts.map +1 -1
- package/dist/auth/public-routes.d.ts +5 -0
- package/dist/auth/public-routes.d.ts.map +1 -1
- package/dist/auth/rate-limit.d.ts +15 -0
- package/dist/auth/rate-limit.d.ts.map +1 -0
- package/dist/auth/scope.d.ts +8 -3
- package/dist/auth/scope.d.ts.map +1 -1
- package/dist/auth/shared-access.d.ts.map +1 -1
- package/dist/index.js +578 -455
- package/dist/index.js.map +40 -38
- package/dist/openapi/security.d.ts +34 -10
- package/dist/openapi/security.d.ts.map +1 -1
- package/dist/routes/auth.d.ts +64 -17
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/routes/connectors.d.ts.map +1 -1
- package/dist/routes/events.d.ts +0 -4
- package/dist/routes/events.d.ts.map +1 -1
- package/dist/routes/files.d.ts +15 -2
- package/dist/routes/files.d.ts.map +1 -1
- package/dist/routes/models.d.ts +7 -7
- package/dist/routes/ontology.d.ts +13 -1
- package/dist/routes/ontology.d.ts.map +1 -1
- package/dist/routes/shared-access.d.ts.map +1 -1
- package/dist/routes/workflows.d.ts +30 -30
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/routes/ws/agents.d.ts +2 -3
- package/dist/routes/ws/agents.d.ts.map +1 -1
- package/dist/schemas/auth.d.ts +241 -85
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/common.d.ts +11 -0
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/events.d.ts +74 -44
- package/dist/schemas/events.d.ts.map +1 -1
- package/dist/schemas/models.d.ts +38 -38
- package/dist/schemas/ontology.d.ts +160 -0
- package/dist/schemas/ontology.d.ts.map +1 -1
- package/dist/schemas/workflows.d.ts +180 -190
- package/dist/schemas/workflows.d.ts.map +1 -1
- package/dist/server.d.ts +6 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/utils/ws.d.ts +1 -2
- package/dist/utils/ws.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/auth/access-token-boundary.ts +31 -30
- package/src/auth/client-address.ts +67 -0
- package/src/auth/guard.ts +13 -4
- package/src/auth/public-routes.ts +9 -2
- package/src/auth/rate-limit.ts +43 -0
- package/src/auth/scope.ts +13 -3
- package/src/auth/shared-access.ts +0 -3
- package/src/openapi/security.ts +37 -17
- package/src/routes/action-runs.ts +5 -5
- package/src/routes/actions.ts +4 -4
- package/src/routes/agents.ts +9 -9
- package/src/routes/ai-accounting.ts +10 -10
- package/src/routes/auth.ts +331 -432
- package/src/routes/connector-connection-runs.ts +5 -5
- package/src/routes/connector-connections.ts +3 -3
- package/src/routes/connectors.ts +2 -2
- package/src/routes/events.ts +2 -2
- package/src/routes/files.ts +30 -15
- package/src/routes/links.ts +3 -3
- package/src/routes/logs.ts +2 -2
- package/src/routes/objects.ts +12 -12
- package/src/routes/ontology.ts +27 -9
- package/src/routes/pipelines.ts +2 -2
- package/src/routes/project.ts +2 -2
- package/src/routes/share-grants.ts +4 -4
- package/src/routes/shared-access.ts +3 -2
- package/src/routes/syncs.ts +2 -2
- package/src/routes/telemetry.ts +5 -5
- package/src/routes/workflows.ts +18 -19
- package/src/routes/ws/agents.ts +4 -5
- package/src/schemas/auth.ts +27 -8
- package/src/schemas/common.ts +6 -0
- package/src/schemas/events.ts +35 -7
- package/src/schemas/ontology.ts +16 -1
- package/src/schemas/workflows.ts +4 -9
- package/src/server.ts +35 -5
- package/src/utils/ws.ts +2 -3
package/src/routes/agents.ts
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 {
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
552
|
+
security: accessTokenSecurityRequirement("listAiModelCallGroups"),
|
|
553
553
|
},
|
|
554
554
|
}
|
|
555
555
|
)
|