@sixb/server 0.1.17 → 0.1.18
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/dist/auth/experience.d.ts +5 -1
- package/dist/auth/experience.d.ts.map +1 -1
- package/dist/files/content.d.ts +0 -1
- package/dist/files/content.d.ts.map +1 -1
- package/dist/index.js +204 -136
- package/dist/index.js.map +24 -24
- package/dist/routes/agents.d.ts +48 -28
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/auth.d.ts +3 -2
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/routes/datasets.d.ts +4 -1
- package/dist/routes/datasets.d.ts.map +1 -1
- package/dist/routes/files.d.ts.map +1 -1
- package/dist/routes/models.d.ts +1 -0
- package/dist/routes/models.d.ts.map +1 -1
- package/dist/routes/objects.d.ts +21 -4
- package/dist/routes/objects.d.ts.map +1 -1
- package/dist/routes/project.d.ts +2 -0
- package/dist/routes/project.d.ts.map +1 -1
- package/dist/routes/workflows.d.ts +3 -0
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/routes/ws/events.d.ts.map +1 -1
- package/dist/routes/ws/subscription-hub.d.ts +5 -0
- package/dist/routes/ws/subscription-hub.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +222 -123
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/ai-accounting.d.ts +10 -10
- package/dist/schemas/auth.d.ts +7 -0
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/common.d.ts +8 -0
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/datasets.d.ts +18 -3
- package/dist/schemas/datasets.d.ts.map +1 -1
- package/dist/schemas/event-payloads.d.ts +39 -0
- package/dist/schemas/event-payloads.d.ts.map +1 -1
- package/dist/schemas/files.d.ts +1 -1
- package/dist/schemas/files.d.ts.map +1 -1
- package/dist/schemas/models.d.ts +10 -0
- package/dist/schemas/models.d.ts.map +1 -1
- package/dist/schemas/objects.d.ts +32 -0
- package/dist/schemas/objects.d.ts.map +1 -1
- package/dist/schemas/project.d.ts +8 -0
- package/dist/schemas/project.d.ts.map +1 -1
- package/dist/schemas/workflows.d.ts +17 -0
- package/dist/schemas/workflows.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/auth/experience.ts +20 -2
- package/src/files/content.ts +43 -88
- package/src/routes/agents.ts +29 -9
- package/src/routes/auth.ts +84 -19
- package/src/routes/datasets.ts +12 -43
- package/src/routes/files.ts +3 -1
- package/src/routes/models.ts +3 -0
- package/src/routes/objects.ts +12 -2
- package/src/routes/project.ts +2 -1
- package/src/routes/workflows.ts +5 -0
- package/src/routes/ws/events.ts +5 -3
- package/src/routes/ws/subscription-hub.ts +20 -5
- package/src/schemas/agents.ts +28 -3
- package/src/schemas/auth.ts +5 -0
- package/src/schemas/common.ts +3 -0
- package/src/schemas/datasets.ts +23 -1
- package/src/schemas/event-payloads.ts +3 -1
- package/src/schemas/files.ts +7 -1
- package/src/schemas/models.ts +2 -0
- package/src/schemas/objects.ts +13 -0
- package/src/schemas/project.ts +4 -0
- package/src/server.ts +2 -1
package/src/schemas/files.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { canonicalMediaType } from "@sixb/core/internal/blob-storage"
|
|
1
2
|
import { z } from "zod"
|
|
2
3
|
|
|
3
4
|
export const BlobDigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/)
|
|
@@ -13,7 +14,12 @@ export const FileRefSchema = z.object({
|
|
|
13
14
|
|
|
14
15
|
export const CreateFileUploadBodySchema = z.object({
|
|
15
16
|
fileName: z.string().optional(),
|
|
16
|
-
mediaType: z
|
|
17
|
+
mediaType: z
|
|
18
|
+
.string()
|
|
19
|
+
.refine((value) => canonicalMediaType(value) !== null, {
|
|
20
|
+
message: 'Expected a single media type, such as "application/pdf"',
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
17
23
|
sizeBytes: z.number().int().nonnegative().optional(),
|
|
18
24
|
digest: BlobDigestSchema.optional(),
|
|
19
25
|
logicalPath: z.string().optional(),
|
package/src/schemas/models.ts
CHANGED
|
@@ -29,6 +29,8 @@ export const LanguageModelSchema = LanguageModelRefSchema.extend({
|
|
|
29
29
|
contextWindowTokens: z.number().int().positive().optional(),
|
|
30
30
|
}),
|
|
31
31
|
reasoningLevels: z.array(z.enum(MODEL_REASONING_LEVELS)),
|
|
32
|
+
/** Reasoning the project applies when a request selects this model without choosing one. */
|
|
33
|
+
defaultReasoning: z.enum(MODEL_REASONING_LEVELS).optional(),
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
export const ModelCatalogSchema = z.object({
|
package/src/schemas/objects.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
AiUsageLimitErrorResponseSchema,
|
|
6
6
|
JsonValueSchema,
|
|
7
7
|
jsonValueOpenApiOverride,
|
|
8
|
+
RedactionsSchema,
|
|
8
9
|
} from "./common"
|
|
9
10
|
|
|
10
11
|
type OpenApiSchema = NonNullable<
|
|
@@ -350,6 +351,7 @@ export const TwinObjectSchema = z.object({
|
|
|
350
351
|
primaryId: z.string(),
|
|
351
352
|
objectTypeId: z.string(),
|
|
352
353
|
properties: z.record(z.unknown()),
|
|
354
|
+
redactions: RedactionsSchema.optional(),
|
|
353
355
|
createdAt: z.string(),
|
|
354
356
|
updatedAt: z.string(),
|
|
355
357
|
})
|
|
@@ -385,6 +387,16 @@ export const ObjectQueryOpenApiSchemas: OpenApiSchemas = {
|
|
|
385
387
|
error: { type: "string" },
|
|
386
388
|
},
|
|
387
389
|
},
|
|
390
|
+
// Values omitted because the caller lacks a clearance for their markings.
|
|
391
|
+
Redactions: {
|
|
392
|
+
type: "object",
|
|
393
|
+
additionalProperties: {
|
|
394
|
+
type: "object",
|
|
395
|
+
required: ["reason"],
|
|
396
|
+
additionalProperties: false,
|
|
397
|
+
properties: { reason: { type: "string", enum: ["missing_clearance"] } },
|
|
398
|
+
},
|
|
399
|
+
},
|
|
388
400
|
ObjectQueryObject: {
|
|
389
401
|
type: "object",
|
|
390
402
|
required: ["primaryId", "objectTypeId", "properties", "createdAt", "updatedAt"],
|
|
@@ -394,6 +406,7 @@ export const ObjectQueryOpenApiSchemas: OpenApiSchemas = {
|
|
|
394
406
|
primaryId: { type: "string" },
|
|
395
407
|
objectTypeId: { type: "string" },
|
|
396
408
|
properties: { type: "object", additionalProperties: true },
|
|
409
|
+
redactions: { $ref: "#/components/schemas/Redactions" },
|
|
397
410
|
createdAt: { type: "string" },
|
|
398
411
|
updatedAt: { type: "string" },
|
|
399
412
|
// Populated only on the query route, by an `expand` node: linked objects
|
package/src/schemas/project.ts
CHANGED
|
@@ -2,4 +2,8 @@ import { z } from "zod"
|
|
|
2
2
|
|
|
3
3
|
export const ProjectInfoResponseSchema = z.object({
|
|
4
4
|
id: z.string(),
|
|
5
|
+
/** Canonical BCP 47 language of the project, `"en"` unless configured. */
|
|
6
|
+
locale: z.string(),
|
|
7
|
+
/** Canonical IANA time zone of the project, `"UTC"` unless configured. */
|
|
8
|
+
timeZone: z.string(),
|
|
5
9
|
})
|
package/src/server.ts
CHANGED
|
@@ -425,13 +425,14 @@ export function createSixbApi(server: SixbServer) {
|
|
|
425
425
|
})
|
|
426
426
|
)
|
|
427
427
|
|
|
428
|
+
const authExperience = server.getAuthExperience()
|
|
428
429
|
registerAuthRoutes(app, host, {
|
|
429
430
|
resolveAuthContext: (request) => server.resolveAuthContext(request),
|
|
430
431
|
resolveAuthRedirectContext: (request, input) =>
|
|
431
432
|
server.resolveAuthRedirectContext(request, input),
|
|
432
433
|
getInvitationDestinationOptions: (request) => server.getInvitationDestinationOptions(request),
|
|
433
434
|
resolveAuthRequestOrigin: (request) => server.resolveAuthRequestOrigin(request),
|
|
434
|
-
authExperience:
|
|
435
|
+
authExperience: authExperience && { ...authExperience, locale: host.locale },
|
|
435
436
|
resolveInvitationRedirectContext: (request, input) =>
|
|
436
437
|
server.resolveInvitationRedirectContext(request, input),
|
|
437
438
|
})
|