@sixb/server 0.1.16 → 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/README.md +6 -0
- package/dist/auth/experience.d.ts +5 -1
- package/dist/auth/experience.d.ts.map +1 -1
- package/dist/auth/public-routes.d.ts.map +1 -1
- package/dist/auth/shared-access.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 +603 -456
- package/dist/index.js.map +34 -33
- package/dist/registerRoutes.d.ts.map +1 -1
- package/dist/routes/agents.d.ts +56 -28
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/ai-accounting.d.ts.map +1 -1
- package/dist/routes/auth.d.ts +4 -3
- 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/file-downloads.d.ts +98 -0
- package/dist/routes/file-downloads.d.ts.map +1 -0
- 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 +24 -4
- package/dist/routes/objects.d.ts.map +1 -1
- package/dist/routes/ontology.d.ts +4 -4
- package/dist/routes/project.d.ts +2 -0
- package/dist/routes/project.d.ts.map +1 -1
- package/dist/routes/status.d.ts +0 -4
- package/dist/routes/status.d.ts.map +1 -1
- package/dist/routes/workflows.d.ts +6 -0
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/routes/ws/events.d.ts.map +1 -1
- package/dist/routes/ws/logs.d.ts +11 -0
- package/dist/routes/ws/logs.d.ts.map +1 -1
- package/dist/routes/ws/subscription-hub.d.ts +71 -0
- package/dist/routes/ws/subscription-hub.d.ts.map +1 -0
- package/dist/schemas/agents.d.ts +255 -123
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/ai-accounting.d.ts +234 -110
- package/dist/schemas/ai-accounting.d.ts.map +1 -1
- package/dist/schemas/ai-usage.d.ts +3 -0
- package/dist/schemas/ai-usage.d.ts.map +1 -1
- package/dist/schemas/auth.d.ts +9 -2
- 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/ontology.d.ts +18 -18
- package/dist/schemas/project.d.ts +8 -0
- package/dist/schemas/project.d.ts.map +1 -1
- package/dist/schemas/status.d.ts +0 -26
- package/dist/schemas/status.d.ts.map +1 -1
- package/dist/schemas/workflows.d.ts +52 -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/auth/public-routes.ts +10 -0
- package/src/auth/shared-access.ts +48 -6
- package/src/files/content.ts +43 -88
- package/src/registerRoutes.ts +2 -0
- package/src/routes/agents.ts +29 -9
- package/src/routes/ai-accounting.ts +1 -0
- package/src/routes/auth.ts +84 -19
- package/src/routes/datasets.ts +12 -43
- package/src/routes/file-downloads.ts +48 -0
- package/src/routes/files.ts +3 -1
- package/src/routes/models.ts +3 -0
- package/src/routes/objects.ts +25 -5
- package/src/routes/project.ts +2 -1
- package/src/routes/workflows.ts +5 -0
- package/src/routes/ws/events.ts +98 -133
- package/src/routes/ws/logs.ts +67 -5
- package/src/routes/ws/subscription-hub.ts +394 -0
- package/src/schemas/agents.ts +28 -3
- package/src/schemas/ai-accounting.ts +5 -0
- package/src/schemas/ai-usage.ts +3 -0
- 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 +41 -2
- package/src/schemas/project.ts +4 -0
- package/src/schemas/status.ts +0 -6
- package/src/server.ts +7 -1
- package/dist/routes/ws/log-subscription-hub.d.ts +0 -50
- package/dist/routes/ws/log-subscription-hub.d.ts.map +0 -1
- package/src/routes/ws/log-subscription-hub.ts +0 -369
|
@@ -218,6 +218,7 @@ export declare const WorkflowAgentNodeExecutionSummarySchema: z.ZodObject<{
|
|
|
218
218
|
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
219
219
|
textOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
220
220
|
reasoningOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
audioDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
221
222
|
reportingStatus: z.ZodEnum<["complete", "partial", "unavailable"]>;
|
|
222
223
|
}, "strip", z.ZodTypeAny, {
|
|
223
224
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
@@ -229,6 +230,7 @@ export declare const WorkflowAgentNodeExecutionSummarySchema: z.ZodObject<{
|
|
|
229
230
|
cacheWriteInputTokens?: number | undefined;
|
|
230
231
|
textOutputTokens?: number | undefined;
|
|
231
232
|
reasoningOutputTokens?: number | undefined;
|
|
233
|
+
audioDurationMs?: number | undefined;
|
|
232
234
|
}, {
|
|
233
235
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
234
236
|
inputTokens?: number | undefined;
|
|
@@ -239,6 +241,7 @@ export declare const WorkflowAgentNodeExecutionSummarySchema: z.ZodObject<{
|
|
|
239
241
|
cacheWriteInputTokens?: number | undefined;
|
|
240
242
|
textOutputTokens?: number | undefined;
|
|
241
243
|
reasoningOutputTokens?: number | undefined;
|
|
244
|
+
audioDurationMs?: number | undefined;
|
|
242
245
|
}>>;
|
|
243
246
|
cost: z.ZodOptional<z.ZodObject<{
|
|
244
247
|
amounts: z.ZodArray<z.ZodObject<{
|
|
@@ -289,6 +292,7 @@ export declare const WorkflowAgentNodeExecutionSummarySchema: z.ZodObject<{
|
|
|
289
292
|
cacheWriteInputTokens?: number | undefined;
|
|
290
293
|
textOutputTokens?: number | undefined;
|
|
291
294
|
reasoningOutputTokens?: number | undefined;
|
|
295
|
+
audioDurationMs?: number | undefined;
|
|
292
296
|
} | undefined;
|
|
293
297
|
cost?: {
|
|
294
298
|
amounts: {
|
|
@@ -316,6 +320,7 @@ export declare const WorkflowAgentNodeExecutionSummarySchema: z.ZodObject<{
|
|
|
316
320
|
cacheWriteInputTokens?: number | undefined;
|
|
317
321
|
textOutputTokens?: number | undefined;
|
|
318
322
|
reasoningOutputTokens?: number | undefined;
|
|
323
|
+
audioDurationMs?: number | undefined;
|
|
319
324
|
} | undefined;
|
|
320
325
|
cost?: {
|
|
321
326
|
amounts: {
|
|
@@ -343,6 +348,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
343
348
|
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
344
349
|
textOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
345
350
|
reasoningOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
audioDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
346
352
|
reportingStatus: z.ZodEnum<["complete", "partial", "unavailable"]>;
|
|
347
353
|
}, "strip", z.ZodTypeAny, {
|
|
348
354
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
@@ -354,6 +360,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
354
360
|
cacheWriteInputTokens?: number | undefined;
|
|
355
361
|
textOutputTokens?: number | undefined;
|
|
356
362
|
reasoningOutputTokens?: number | undefined;
|
|
363
|
+
audioDurationMs?: number | undefined;
|
|
357
364
|
}, {
|
|
358
365
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
359
366
|
inputTokens?: number | undefined;
|
|
@@ -364,6 +371,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
364
371
|
cacheWriteInputTokens?: number | undefined;
|
|
365
372
|
textOutputTokens?: number | undefined;
|
|
366
373
|
reasoningOutputTokens?: number | undefined;
|
|
374
|
+
audioDurationMs?: number | undefined;
|
|
367
375
|
}>>;
|
|
368
376
|
cost: z.ZodOptional<z.ZodObject<{
|
|
369
377
|
amounts: z.ZodArray<z.ZodObject<{
|
|
@@ -413,6 +421,12 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
413
421
|
type: "text";
|
|
414
422
|
text: string;
|
|
415
423
|
providerMetadata?: import("./common").JsonValue | undefined;
|
|
424
|
+
}>, z.ZodObject<{
|
|
425
|
+
type: z.ZodLiteral<"continuation">;
|
|
426
|
+
}, "strip", z.ZodTypeAny, {
|
|
427
|
+
type: "continuation";
|
|
428
|
+
}, {
|
|
429
|
+
type: "continuation";
|
|
416
430
|
}>, z.ZodObject<{
|
|
417
431
|
type: z.ZodLiteral<"reasoning">;
|
|
418
432
|
text: z.ZodString;
|
|
@@ -503,18 +517,21 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
503
517
|
objectTypeId: string;
|
|
504
518
|
primaryId: string;
|
|
505
519
|
}>;
|
|
520
|
+
label: z.ZodOptional<z.ZodString>;
|
|
506
521
|
}, "strip", z.ZodTypeAny, {
|
|
507
522
|
kind: "object";
|
|
508
523
|
ref: {
|
|
509
524
|
objectTypeId: string;
|
|
510
525
|
primaryId: string;
|
|
511
526
|
};
|
|
527
|
+
label?: string | undefined;
|
|
512
528
|
}, {
|
|
513
529
|
kind: "object";
|
|
514
530
|
ref: {
|
|
515
531
|
objectTypeId: string;
|
|
516
532
|
primaryId: string;
|
|
517
533
|
};
|
|
534
|
+
label?: string | undefined;
|
|
518
535
|
}>, z.ZodObject<{
|
|
519
536
|
kind: z.ZodLiteral<"app-state">;
|
|
520
537
|
id: z.ZodString;
|
|
@@ -545,6 +562,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
545
562
|
objectTypeId: string;
|
|
546
563
|
primaryId: string;
|
|
547
564
|
};
|
|
565
|
+
label?: string | undefined;
|
|
548
566
|
} | {
|
|
549
567
|
id: string;
|
|
550
568
|
kind: "app-state";
|
|
@@ -561,6 +579,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
561
579
|
objectTypeId: string;
|
|
562
580
|
primaryId: string;
|
|
563
581
|
};
|
|
582
|
+
label?: string | undefined;
|
|
564
583
|
} | {
|
|
565
584
|
id: string;
|
|
566
585
|
kind: "app-state";
|
|
@@ -656,6 +675,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
656
675
|
cacheWriteInputTokens?: number | undefined;
|
|
657
676
|
textOutputTokens?: number | undefined;
|
|
658
677
|
reasoningOutputTokens?: number | undefined;
|
|
678
|
+
audioDurationMs?: number | undefined;
|
|
659
679
|
} | undefined;
|
|
660
680
|
cost?: {
|
|
661
681
|
amounts: {
|
|
@@ -676,6 +696,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
676
696
|
objectTypeId: string;
|
|
677
697
|
primaryId: string;
|
|
678
698
|
};
|
|
699
|
+
label?: string | undefined;
|
|
679
700
|
} | {
|
|
680
701
|
id: string;
|
|
681
702
|
kind: "app-state";
|
|
@@ -729,6 +750,8 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
729
750
|
providerMetadata?: import("./common").JsonValue | undefined;
|
|
730
751
|
dynamic?: boolean | undefined;
|
|
731
752
|
providerExecuted?: boolean | undefined;
|
|
753
|
+
} | {
|
|
754
|
+
type: "continuation";
|
|
732
755
|
})[] | undefined;
|
|
733
756
|
failurePhase?: "agent-loop" | "structured-finalizer" | undefined;
|
|
734
757
|
}, {
|
|
@@ -751,6 +774,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
751
774
|
cacheWriteInputTokens?: number | undefined;
|
|
752
775
|
textOutputTokens?: number | undefined;
|
|
753
776
|
reasoningOutputTokens?: number | undefined;
|
|
777
|
+
audioDurationMs?: number | undefined;
|
|
754
778
|
} | undefined;
|
|
755
779
|
cost?: {
|
|
756
780
|
amounts: {
|
|
@@ -771,6 +795,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
771
795
|
objectTypeId: string;
|
|
772
796
|
primaryId: string;
|
|
773
797
|
};
|
|
798
|
+
label?: string | undefined;
|
|
774
799
|
} | {
|
|
775
800
|
id: string;
|
|
776
801
|
kind: "app-state";
|
|
@@ -824,6 +849,8 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
|
|
|
824
849
|
providerMetadata?: import("./common").JsonValue | undefined;
|
|
825
850
|
dynamic?: boolean | undefined;
|
|
826
851
|
providerExecuted?: boolean | undefined;
|
|
852
|
+
} | {
|
|
853
|
+
type: "continuation";
|
|
827
854
|
})[] | undefined;
|
|
828
855
|
failurePhase?: "agent-loop" | "structured-finalizer" | undefined;
|
|
829
856
|
}>;
|
|
@@ -856,6 +883,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
856
883
|
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
857
884
|
textOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
858
885
|
reasoningOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
886
|
+
audioDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
859
887
|
reportingStatus: z.ZodEnum<["complete", "partial", "unavailable"]>;
|
|
860
888
|
}, "strip", z.ZodTypeAny, {
|
|
861
889
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
@@ -867,6 +895,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
867
895
|
cacheWriteInputTokens?: number | undefined;
|
|
868
896
|
textOutputTokens?: number | undefined;
|
|
869
897
|
reasoningOutputTokens?: number | undefined;
|
|
898
|
+
audioDurationMs?: number | undefined;
|
|
870
899
|
}, {
|
|
871
900
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
872
901
|
inputTokens?: number | undefined;
|
|
@@ -877,6 +906,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
877
906
|
cacheWriteInputTokens?: number | undefined;
|
|
878
907
|
textOutputTokens?: number | undefined;
|
|
879
908
|
reasoningOutputTokens?: number | undefined;
|
|
909
|
+
audioDurationMs?: number | undefined;
|
|
880
910
|
}>>;
|
|
881
911
|
cost: z.ZodOptional<z.ZodObject<{
|
|
882
912
|
amounts: z.ZodArray<z.ZodObject<{
|
|
@@ -927,6 +957,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
927
957
|
cacheWriteInputTokens?: number | undefined;
|
|
928
958
|
textOutputTokens?: number | undefined;
|
|
929
959
|
reasoningOutputTokens?: number | undefined;
|
|
960
|
+
audioDurationMs?: number | undefined;
|
|
930
961
|
} | undefined;
|
|
931
962
|
cost?: {
|
|
932
963
|
amounts: {
|
|
@@ -954,6 +985,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
954
985
|
cacheWriteInputTokens?: number | undefined;
|
|
955
986
|
textOutputTokens?: number | undefined;
|
|
956
987
|
reasoningOutputTokens?: number | undefined;
|
|
988
|
+
audioDurationMs?: number | undefined;
|
|
957
989
|
} | undefined;
|
|
958
990
|
cost?: {
|
|
959
991
|
amounts: {
|
|
@@ -995,6 +1027,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
995
1027
|
cacheWriteInputTokens?: number | undefined;
|
|
996
1028
|
textOutputTokens?: number | undefined;
|
|
997
1029
|
reasoningOutputTokens?: number | undefined;
|
|
1030
|
+
audioDurationMs?: number | undefined;
|
|
998
1031
|
} | undefined;
|
|
999
1032
|
cost?: {
|
|
1000
1033
|
amounts: {
|
|
@@ -1038,6 +1071,7 @@ export declare const WorkflowNodeRunSchema: z.ZodObject<{
|
|
|
1038
1071
|
cacheWriteInputTokens?: number | undefined;
|
|
1039
1072
|
textOutputTokens?: number | undefined;
|
|
1040
1073
|
reasoningOutputTokens?: number | undefined;
|
|
1074
|
+
audioDurationMs?: number | undefined;
|
|
1041
1075
|
} | undefined;
|
|
1042
1076
|
cost?: {
|
|
1043
1077
|
amounts: {
|
|
@@ -1544,6 +1578,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1544
1578
|
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1545
1579
|
textOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1546
1580
|
reasoningOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1581
|
+
audioDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
1547
1582
|
reportingStatus: z.ZodEnum<["complete", "partial", "unavailable"]>;
|
|
1548
1583
|
}, "strip", z.ZodTypeAny, {
|
|
1549
1584
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
@@ -1555,6 +1590,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1555
1590
|
cacheWriteInputTokens?: number | undefined;
|
|
1556
1591
|
textOutputTokens?: number | undefined;
|
|
1557
1592
|
reasoningOutputTokens?: number | undefined;
|
|
1593
|
+
audioDurationMs?: number | undefined;
|
|
1558
1594
|
}, {
|
|
1559
1595
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
1560
1596
|
inputTokens?: number | undefined;
|
|
@@ -1565,6 +1601,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1565
1601
|
cacheWriteInputTokens?: number | undefined;
|
|
1566
1602
|
textOutputTokens?: number | undefined;
|
|
1567
1603
|
reasoningOutputTokens?: number | undefined;
|
|
1604
|
+
audioDurationMs?: number | undefined;
|
|
1568
1605
|
}>>;
|
|
1569
1606
|
cost: z.ZodOptional<z.ZodObject<{
|
|
1570
1607
|
amounts: z.ZodArray<z.ZodObject<{
|
|
@@ -1615,6 +1652,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1615
1652
|
cacheWriteInputTokens?: number | undefined;
|
|
1616
1653
|
textOutputTokens?: number | undefined;
|
|
1617
1654
|
reasoningOutputTokens?: number | undefined;
|
|
1655
|
+
audioDurationMs?: number | undefined;
|
|
1618
1656
|
} | undefined;
|
|
1619
1657
|
cost?: {
|
|
1620
1658
|
amounts: {
|
|
@@ -1642,6 +1680,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1642
1680
|
cacheWriteInputTokens?: number | undefined;
|
|
1643
1681
|
textOutputTokens?: number | undefined;
|
|
1644
1682
|
reasoningOutputTokens?: number | undefined;
|
|
1683
|
+
audioDurationMs?: number | undefined;
|
|
1645
1684
|
} | undefined;
|
|
1646
1685
|
cost?: {
|
|
1647
1686
|
amounts: {
|
|
@@ -1683,6 +1722,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1683
1722
|
cacheWriteInputTokens?: number | undefined;
|
|
1684
1723
|
textOutputTokens?: number | undefined;
|
|
1685
1724
|
reasoningOutputTokens?: number | undefined;
|
|
1725
|
+
audioDurationMs?: number | undefined;
|
|
1686
1726
|
} | undefined;
|
|
1687
1727
|
cost?: {
|
|
1688
1728
|
amounts: {
|
|
@@ -1726,6 +1766,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1726
1766
|
cacheWriteInputTokens?: number | undefined;
|
|
1727
1767
|
textOutputTokens?: number | undefined;
|
|
1728
1768
|
reasoningOutputTokens?: number | undefined;
|
|
1769
|
+
audioDurationMs?: number | undefined;
|
|
1729
1770
|
} | undefined;
|
|
1730
1771
|
cost?: {
|
|
1731
1772
|
amounts: {
|
|
@@ -1787,6 +1828,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1787
1828
|
cacheWriteInputTokens?: number | undefined;
|
|
1788
1829
|
textOutputTokens?: number | undefined;
|
|
1789
1830
|
reasoningOutputTokens?: number | undefined;
|
|
1831
|
+
audioDurationMs?: number | undefined;
|
|
1790
1832
|
} | undefined;
|
|
1791
1833
|
cost?: {
|
|
1792
1834
|
amounts: {
|
|
@@ -1848,6 +1890,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
|
|
|
1848
1890
|
cacheWriteInputTokens?: number | undefined;
|
|
1849
1891
|
textOutputTokens?: number | undefined;
|
|
1850
1892
|
reasoningOutputTokens?: number | undefined;
|
|
1893
|
+
audioDurationMs?: number | undefined;
|
|
1851
1894
|
} | undefined;
|
|
1852
1895
|
cost?: {
|
|
1853
1896
|
amounts: {
|
|
@@ -1947,6 +1990,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
1947
1990
|
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1948
1991
|
textOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1949
1992
|
reasoningOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1993
|
+
audioDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
1950
1994
|
reportingStatus: z.ZodEnum<["complete", "partial", "unavailable"]>;
|
|
1951
1995
|
}, "strip", z.ZodTypeAny, {
|
|
1952
1996
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
@@ -1958,6 +2002,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
1958
2002
|
cacheWriteInputTokens?: number | undefined;
|
|
1959
2003
|
textOutputTokens?: number | undefined;
|
|
1960
2004
|
reasoningOutputTokens?: number | undefined;
|
|
2005
|
+
audioDurationMs?: number | undefined;
|
|
1961
2006
|
}, {
|
|
1962
2007
|
reportingStatus: "partial" | "complete" | "unavailable";
|
|
1963
2008
|
inputTokens?: number | undefined;
|
|
@@ -1968,6 +2013,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
1968
2013
|
cacheWriteInputTokens?: number | undefined;
|
|
1969
2014
|
textOutputTokens?: number | undefined;
|
|
1970
2015
|
reasoningOutputTokens?: number | undefined;
|
|
2016
|
+
audioDurationMs?: number | undefined;
|
|
1971
2017
|
}>>;
|
|
1972
2018
|
cost: z.ZodOptional<z.ZodObject<{
|
|
1973
2019
|
amounts: z.ZodArray<z.ZodObject<{
|
|
@@ -2018,6 +2064,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
2018
2064
|
cacheWriteInputTokens?: number | undefined;
|
|
2019
2065
|
textOutputTokens?: number | undefined;
|
|
2020
2066
|
reasoningOutputTokens?: number | undefined;
|
|
2067
|
+
audioDurationMs?: number | undefined;
|
|
2021
2068
|
} | undefined;
|
|
2022
2069
|
cost?: {
|
|
2023
2070
|
amounts: {
|
|
@@ -2045,6 +2092,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
2045
2092
|
cacheWriteInputTokens?: number | undefined;
|
|
2046
2093
|
textOutputTokens?: number | undefined;
|
|
2047
2094
|
reasoningOutputTokens?: number | undefined;
|
|
2095
|
+
audioDurationMs?: number | undefined;
|
|
2048
2096
|
} | undefined;
|
|
2049
2097
|
cost?: {
|
|
2050
2098
|
amounts: {
|
|
@@ -2086,6 +2134,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
2086
2134
|
cacheWriteInputTokens?: number | undefined;
|
|
2087
2135
|
textOutputTokens?: number | undefined;
|
|
2088
2136
|
reasoningOutputTokens?: number | undefined;
|
|
2137
|
+
audioDurationMs?: number | undefined;
|
|
2089
2138
|
} | undefined;
|
|
2090
2139
|
cost?: {
|
|
2091
2140
|
amounts: {
|
|
@@ -2129,6 +2178,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
2129
2178
|
cacheWriteInputTokens?: number | undefined;
|
|
2130
2179
|
textOutputTokens?: number | undefined;
|
|
2131
2180
|
reasoningOutputTokens?: number | undefined;
|
|
2181
|
+
audioDurationMs?: number | undefined;
|
|
2132
2182
|
} | undefined;
|
|
2133
2183
|
cost?: {
|
|
2134
2184
|
amounts: {
|
|
@@ -2190,6 +2240,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
2190
2240
|
cacheWriteInputTokens?: number | undefined;
|
|
2191
2241
|
textOutputTokens?: number | undefined;
|
|
2192
2242
|
reasoningOutputTokens?: number | undefined;
|
|
2243
|
+
audioDurationMs?: number | undefined;
|
|
2193
2244
|
} | undefined;
|
|
2194
2245
|
cost?: {
|
|
2195
2246
|
amounts: {
|
|
@@ -2251,6 +2302,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
|
|
|
2251
2302
|
cacheWriteInputTokens?: number | undefined;
|
|
2252
2303
|
textOutputTokens?: number | undefined;
|
|
2253
2304
|
reasoningOutputTokens?: number | undefined;
|
|
2305
|
+
audioDurationMs?: number | undefined;
|
|
2254
2306
|
} | undefined;
|
|
2255
2307
|
cost?: {
|
|
2256
2308
|
amounts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/schemas/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,wBAAwB,+GAA4B,CAAA;AAMjE,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;EAE3C,CAAA;AAEF,eAAO,MAAM,uBAAuB,iFAOlC,CAAA;AAEF,eAAO,MAAM,gCAAgC,6DAK3C,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;EAQlC,CAAA;AAEF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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnD,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;EAK3C,CAAA"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,YAAY,CAAA;AAKzE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAMhC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EAKjC,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAA;AAO9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAKlE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAA;AAoB7B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,oBAAoB,CAAA;IAC7B,8EAA8E;IAC9E,cAAc,CAAC,EAAE,yBAAyB,CAAA;IAC1C,qEAAqE;IACrE,YAAY,CAAC,EAAE,uBAAuB,CAAA;IACtC;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GA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IAAI,CAAC;IA+BtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAe5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkP/C;AAiED,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "HTTP and WebSocket API server for Sixb",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -38,13 +38,14 @@
|
|
|
38
38
|
"zod-to-json-schema": "^3.24.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@sixb/core": "0.1.
|
|
41
|
+
"@sixb/core": "0.1.18"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@sixb/auth-magic-link": "0.1.5",
|
|
45
|
-
"@sixb/auth-oidc": "0.1.
|
|
46
|
-
"@sixb/core": "0.1.
|
|
47
|
-
"@sixb/
|
|
45
|
+
"@sixb/auth-oidc": "0.1.5",
|
|
46
|
+
"@sixb/cli-core": "0.1.7",
|
|
47
|
+
"@sixb/core": "0.1.18",
|
|
48
|
+
"@sixb/sqlite": "0.1.18",
|
|
48
49
|
"@types/bun": "latest",
|
|
49
50
|
"typescript": "^5.7.0"
|
|
50
51
|
},
|
package/src/auth/experience.ts
CHANGED
|
@@ -9,6 +9,11 @@ export interface SixbAuthExperienceOptions {
|
|
|
9
9
|
readonly audience?: AuthSessionAudience
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/** The configured experience with the project's language, which its pages declare. */
|
|
13
|
+
export interface ProjectAuthExperience extends SixbAuthExperienceOptions {
|
|
14
|
+
readonly locale: string
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
export type AuthExperiencePageState =
|
|
13
18
|
| { readonly kind: "signIn" }
|
|
14
19
|
| { readonly kind: "checkEmail" }
|
|
@@ -23,7 +28,7 @@ export interface AuthExperienceSubmission {
|
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
export async function customAuthExperienceResponse(
|
|
26
|
-
options:
|
|
31
|
+
options: ProjectAuthExperience | undefined,
|
|
27
32
|
input: {
|
|
28
33
|
readonly audience: AuthSessionAudience
|
|
29
34
|
readonly state: AuthExperiencePageState
|
|
@@ -62,7 +67,11 @@ export async function customAuthExperienceResponse(
|
|
|
62
67
|
" "
|
|
63
68
|
)
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
const page = withDocumentLanguage(
|
|
71
|
+
html.replace(AUTH_BOOTSTRAP_PLACEHOLDER, bootstrap),
|
|
72
|
+
options.locale
|
|
73
|
+
)
|
|
74
|
+
return new Response(page, {
|
|
66
75
|
status: input.status ?? 200,
|
|
67
76
|
headers: {
|
|
68
77
|
"content-type": "text/html; charset=utf-8",
|
|
@@ -83,6 +92,15 @@ export async function customAuthExperienceResponse(
|
|
|
83
92
|
})
|
|
84
93
|
}
|
|
85
94
|
|
|
95
|
+
// The page is built without loading the project, so its language is set when it is served.
|
|
96
|
+
function withDocumentLanguage(html: string, locale: string): string {
|
|
97
|
+
return html.replace(
|
|
98
|
+
/<html\b([^>]*)>/i,
|
|
99
|
+
(_tag, attributes: string) =>
|
|
100
|
+
`<html${attributes.replace(/\s+lang\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/i, "")} lang="${locale}">`
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
86
104
|
function normalizeCspOrigin(value: string): string {
|
|
87
105
|
let url: URL
|
|
88
106
|
try {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AGENT_API_GATEWAY_PREFIX } from "@sixb/core/internal/agents"
|
|
2
2
|
import { isCsrfExemptMethod } from "@sixb/core/internal/auth"
|
|
3
|
+
import { FILE_DOWNLOAD_ROUTE_PREFIX } from "@sixb/core/internal/blob-storage"
|
|
3
4
|
import { isSharedAccessPublicPath } from "./shared-access"
|
|
4
5
|
|
|
5
6
|
const CONNECTOR_OAUTH_CALLBACK_PATH = "/auth/connectors/callback"
|
|
@@ -70,6 +71,15 @@ export function isPublicRoute(pathname: string, method: string): boolean {
|
|
|
70
71
|
return true
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
// A signed download URL is read by services that cannot hold a session, such as a social network
|
|
75
|
+
// fetching media to publish. The signed token in the path is the credential.
|
|
76
|
+
if (
|
|
77
|
+
pathname.startsWith(FILE_DOWNLOAD_ROUTE_PREFIX) &&
|
|
78
|
+
(normalizedMethod === "GET" || normalizedMethod === "HEAD")
|
|
79
|
+
) {
|
|
80
|
+
return true
|
|
81
|
+
}
|
|
82
|
+
|
|
73
83
|
// Public because a webhook cannot carry a session: the signature its connector
|
|
74
84
|
// verifies is the credential. POST only — `WebhookDefinition.method` is the literal
|
|
75
85
|
// `"POST"`, so nothing else is ever registered here, and the allow-list should not be
|
|
@@ -11,6 +11,7 @@ import { type SharedSessionContext, SharedSessionProtocol } from "@sixb/core/int
|
|
|
11
11
|
import { hasForegroundSessionActivity } from "./session-activity"
|
|
12
12
|
|
|
13
13
|
export const SHARED_ACCESS_GRANT_HEADER_NAME = "x-sixb-share-grant"
|
|
14
|
+
const SHARED_ACCESS_GRANT_QUERY_PARAM = "shareGrant"
|
|
14
15
|
|
|
15
16
|
const SHARED_SESSION_COOKIE_PREFIX = "sixb_share_session_"
|
|
16
17
|
const SHARED_CSRF_COOKIE_PREFIX = "sixb_share_csrf_"
|
|
@@ -18,6 +19,10 @@ const SHARED_COOKIE_PATH = "/api"
|
|
|
18
19
|
const STORED_IDENTIFIER_MAX_LENGTH = 128
|
|
19
20
|
|
|
20
21
|
const SHARED_SESSION_ROUTES = SIXB_API_ROUTES.filter((route) => route.sharedSession)
|
|
22
|
+
const SHARED_FILE_CONTENT_ROUTES = SHARED_SESSION_ROUTES.filter(
|
|
23
|
+
(route) =>
|
|
24
|
+
(route.method === "GET" || route.method === "HEAD") && route.path.endsWith("/files/content")
|
|
25
|
+
)
|
|
21
26
|
|
|
22
27
|
export interface SixbSharedAccessOptions {
|
|
23
28
|
/** Sliding inactivity window, always bounded by the grant's absolute expiration. */
|
|
@@ -34,6 +39,11 @@ export interface ResolvedSharedAccess {
|
|
|
34
39
|
readonly cookies: SharedAccessCookieHeaders
|
|
35
40
|
}
|
|
36
41
|
|
|
42
|
+
type SharedAccessGrantSelection =
|
|
43
|
+
| { readonly kind: "absent" }
|
|
44
|
+
| { readonly kind: "conflict" }
|
|
45
|
+
| { readonly kind: "selected"; readonly grantId: string }
|
|
46
|
+
|
|
37
47
|
export type SharedAccessRequestDecision =
|
|
38
48
|
| { readonly kind: "absent" }
|
|
39
49
|
| { readonly kind: "deny"; readonly response: Response }
|
|
@@ -63,22 +73,30 @@ export class SharedAccessBoundary {
|
|
|
63
73
|
/** Fail closed before route parsing can emit a route-specific validation response. */
|
|
64
74
|
preflightResponse(request: Request): Response | undefined {
|
|
65
75
|
if (isSharedAccessPublicRoute(request)) return
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
if (
|
|
76
|
+
const selection = selectSharedAccessGrant(request)
|
|
77
|
+
if (selection.kind === "absent") return
|
|
78
|
+
if (
|
|
79
|
+
selection.kind === "conflict" ||
|
|
80
|
+
request.headers.has("authorization") ||
|
|
81
|
+
!isSharedSessionRoute(request)
|
|
82
|
+
) {
|
|
69
83
|
return sharedAccessForbiddenResponse()
|
|
70
84
|
}
|
|
71
|
-
if (!isStoredIdentifier(
|
|
85
|
+
if (!isStoredIdentifier(selection.grantId)) return sharedAccessUnauthenticatedResponse()
|
|
72
86
|
}
|
|
73
87
|
|
|
74
88
|
async resolveRequest(request: Request): Promise<SharedAccessRequestDecision> {
|
|
75
89
|
if (isSharedAccessPublicRoute(request)) return { kind: "absent" }
|
|
76
90
|
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
91
|
+
const selection = selectSharedAccessGrant(request)
|
|
92
|
+
if (selection.kind === "absent") return { kind: "absent" }
|
|
93
|
+
if (selection.kind === "conflict") {
|
|
94
|
+
return { kind: "deny", response: sharedAccessForbiddenResponse() }
|
|
95
|
+
}
|
|
79
96
|
|
|
80
97
|
const preflight = this.preflightResponse(request)
|
|
81
98
|
if (preflight) return { kind: "deny", response: preflight }
|
|
99
|
+
const selectedGrantId = selection.grantId
|
|
82
100
|
|
|
83
101
|
let resolved: ResolvedSharedAccess | null
|
|
84
102
|
try {
|
|
@@ -278,6 +296,30 @@ export function isSharedAccessPublicPath(pathname: string, requestMethod: string
|
|
|
278
296
|
return matchesPathPattern(normalizedPathname, `/api/shared-access/:grantId/${suffix}`)
|
|
279
297
|
}
|
|
280
298
|
|
|
299
|
+
/**
|
|
300
|
+
* The header selects the grant. File GET/HEAD routes also accept the selector in the query, because
|
|
301
|
+
* `<img>`, `<video>`, and download links cannot send headers. Either way it only names which
|
|
302
|
+
* grant cookie to read; the HttpOnly cookie remains the credential, as with a file `audience`.
|
|
303
|
+
*/
|
|
304
|
+
function selectSharedAccessGrant(request: Request): SharedAccessGrantSelection {
|
|
305
|
+
const header = request.headers.get(SHARED_ACCESS_GRANT_HEADER_NAME)
|
|
306
|
+
const url = new URL(request.url)
|
|
307
|
+
const method = request.method.toUpperCase()
|
|
308
|
+
const pathname = normalizeRoutePath(url.pathname)
|
|
309
|
+
const queryValues = SHARED_FILE_CONTENT_ROUTES.some(
|
|
310
|
+
(route) => route.method === method && matchesPathPattern(pathname, route.path)
|
|
311
|
+
)
|
|
312
|
+
? url.searchParams.getAll(SHARED_ACCESS_GRANT_QUERY_PARAM)
|
|
313
|
+
: []
|
|
314
|
+
|
|
315
|
+
const [query, ...extra] = queryValues
|
|
316
|
+
if (query === undefined) {
|
|
317
|
+
return header === null ? { kind: "absent" } : { kind: "selected", grantId: header }
|
|
318
|
+
}
|
|
319
|
+
if (extra.length > 0 || (header !== null && header !== query)) return { kind: "conflict" }
|
|
320
|
+
return { kind: "selected", grantId: query }
|
|
321
|
+
}
|
|
322
|
+
|
|
281
323
|
export function isSharedSessionRoute(request: Request): boolean {
|
|
282
324
|
const method = request.method.toUpperCase()
|
|
283
325
|
const pathname = normalizeRoutePath(new URL(request.url).pathname)
|