@sixb/server 0.1.7 → 0.1.9

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 (79) hide show
  1. package/dist/auth/access-token-boundary.d.ts +3 -0
  2. package/dist/auth/access-token-boundary.d.ts.map +1 -1
  3. package/dist/auth/public-routes.d.ts.map +1 -1
  4. package/dist/auth/shared-access.d.ts +66 -0
  5. package/dist/auth/shared-access.d.ts.map +1 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1454 -658
  9. package/dist/index.js.map +25 -20
  10. package/dist/openapi/security.d.ts +15 -1
  11. package/dist/openapi/security.d.ts.map +1 -1
  12. package/dist/openapi/tags.d.ts +6 -2
  13. package/dist/openapi/tags.d.ts.map +1 -1
  14. package/dist/registerRoutes.d.ts +2 -0
  15. package/dist/registerRoutes.d.ts.map +1 -1
  16. package/dist/routes/actions.d.ts.map +1 -1
  17. package/dist/routes/agents.d.ts +5 -5
  18. package/dist/routes/auth.d.ts +9 -9
  19. package/dist/routes/connector-connection-runs.d.ts +8 -8
  20. package/dist/routes/connector-connections.d.ts +4 -4
  21. package/dist/routes/datasets.d.ts +5 -3
  22. package/dist/routes/datasets.d.ts.map +1 -1
  23. package/dist/routes/files.d.ts.map +1 -1
  24. package/dist/routes/logs.d.ts +3 -3
  25. package/dist/routes/pipelines.d.ts +4 -0
  26. package/dist/routes/pipelines.d.ts.map +1 -1
  27. package/dist/routes/share-grants.d.ts +264 -0
  28. package/dist/routes/share-grants.d.ts.map +1 -0
  29. package/dist/routes/shared-access.d.ts +155 -0
  30. package/dist/routes/shared-access.d.ts.map +1 -0
  31. package/dist/routes/syncs.d.ts +2 -0
  32. package/dist/routes/syncs.d.ts.map +1 -1
  33. package/dist/routes/workflows.d.ts +7 -7
  34. package/dist/routes/ws/agents.d.ts.map +1 -1
  35. package/dist/routes/ws/logs.d.ts +10 -10
  36. package/dist/schemas/agents.d.ts +22 -30
  37. package/dist/schemas/agents.d.ts.map +1 -1
  38. package/dist/schemas/ai-accounting.d.ts +332 -24
  39. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  40. package/dist/schemas/auth.d.ts +40 -40
  41. package/dist/schemas/common.d.ts +6 -0
  42. package/dist/schemas/common.d.ts.map +1 -1
  43. package/dist/schemas/datasets.d.ts +28 -22
  44. package/dist/schemas/datasets.d.ts.map +1 -1
  45. package/dist/schemas/logs.d.ts +24 -24
  46. package/dist/schemas/pipelines.d.ts +36 -0
  47. package/dist/schemas/pipelines.d.ts.map +1 -1
  48. package/dist/schemas/share-grants.d.ts +518 -0
  49. package/dist/schemas/share-grants.d.ts.map +1 -0
  50. package/dist/schemas/shared-access.d.ts +42 -0
  51. package/dist/schemas/shared-access.d.ts.map +1 -0
  52. package/dist/schemas/syncs.d.ts +7 -0
  53. package/dist/schemas/syncs.d.ts.map +1 -1
  54. package/dist/schemas/workflows.d.ts +20 -20
  55. package/dist/server.d.ts +5 -0
  56. package/dist/server.d.ts.map +1 -1
  57. package/package.json +7 -7
  58. package/src/auth/access-token-boundary.ts +17 -2
  59. package/src/auth/public-routes.ts +5 -0
  60. package/src/auth/shared-access.ts +376 -0
  61. package/src/index.ts +1 -0
  62. package/src/openapi/security.ts +20 -1
  63. package/src/openapi/tags.ts +4 -0
  64. package/src/registerRoutes.ts +6 -0
  65. package/src/routes/actions.ts +5 -10
  66. package/src/routes/agent-api-gateway.ts +1 -1
  67. package/src/routes/agents.ts +1 -1
  68. package/src/routes/files.ts +2 -6
  69. package/src/routes/share-grants.ts +238 -0
  70. package/src/routes/shared-access.ts +165 -0
  71. package/src/routes/ws/agents.ts +5 -3
  72. package/src/routes/ws/events.ts +1 -1
  73. package/src/schemas/agents.ts +1 -4
  74. package/src/schemas/ai-accounting.ts +3 -0
  75. package/src/schemas/common.ts +2 -0
  76. package/src/schemas/datasets.ts +2 -1
  77. package/src/schemas/share-grants.ts +109 -0
  78. package/src/schemas/shared-access.ts +31 -0
  79. package/src/server.ts +91 -1
@@ -68,8 +68,8 @@ export declare const WorkflowInterventionsQuerySchema: z.ZodObject<{
68
68
  offset?: string | undefined;
69
69
  order?: "asc" | "desc" | undefined;
70
70
  workflowId?: string | undefined;
71
- nodeRunId?: string | undefined;
72
71
  workflowRunId?: string | undefined;
72
+ nodeRunId?: string | undefined;
73
73
  interventionId?: string | undefined;
74
74
  nodeId?: string | undefined;
75
75
  nodeKey?: string | undefined;
@@ -81,8 +81,8 @@ export declare const WorkflowInterventionsQuerySchema: z.ZodObject<{
81
81
  offset?: string | undefined;
82
82
  order?: "asc" | "desc" | undefined;
83
83
  workflowId?: string | undefined;
84
- nodeRunId?: string | undefined;
85
84
  workflowRunId?: string | undefined;
85
+ nodeRunId?: string | undefined;
86
86
  interventionId?: string | undefined;
87
87
  nodeId?: string | undefined;
88
88
  nodeKey?: string | undefined;
@@ -549,7 +549,6 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
549
549
  type: z.ZodLiteral<"context">;
550
550
  }, "strip", z.ZodTypeAny, {
551
551
  origin: "ambient" | "explicit";
552
- type: "context";
553
552
  context: {
554
553
  kind: "object";
555
554
  ref: {
@@ -563,9 +562,9 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
563
562
  value: import("./common").JsonValue;
564
563
  label: string;
565
564
  };
565
+ type: "context";
566
566
  }, {
567
567
  origin: "ambient" | "explicit";
568
- type: "context";
569
568
  context: {
570
569
  kind: "object";
571
570
  ref: {
@@ -579,6 +578,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
579
578
  value: import("./common").JsonValue;
580
579
  label: string;
581
580
  };
581
+ type: "context";
582
582
  }>, z.ZodObject<{
583
583
  type: z.ZodLiteral<"tool-call">;
584
584
  toolCallId: z.ZodString;
@@ -680,7 +680,6 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
680
680
  diagnostics?: import("./common").JsonValue[] | undefined;
681
681
  trace?: ({
682
682
  origin: "ambient" | "explicit";
683
- type: "context";
684
683
  context: {
685
684
  kind: "object";
686
685
  ref: {
@@ -694,6 +693,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
694
693
  value: import("./common").JsonValue;
695
694
  label: string;
696
695
  };
696
+ type: "context";
697
697
  } | {
698
698
  type: "text";
699
699
  text: string;
@@ -775,7 +775,6 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
775
775
  diagnostics?: import("./common").JsonValue[] | undefined;
776
776
  trace?: ({
777
777
  origin: "ambient" | "explicit";
778
- type: "context";
779
778
  context: {
780
779
  kind: "object";
781
780
  ref: {
@@ -789,6 +788,7 @@ export declare const WorkflowAgentNodeExecutionSchema: z.ZodObject<{
789
788
  value: import("./common").JsonValue;
790
789
  label: string;
791
790
  };
791
+ type: "context";
792
792
  } | {
793
793
  type: "text";
794
794
  text: string;
@@ -1108,8 +1108,8 @@ export declare const WorkflowInterventionSchema: z.ZodObject<{
1108
1108
  id: string;
1109
1109
  input: Record<string, import("./common").JsonValue>;
1110
1110
  workflowId: string;
1111
- nodeRunId: string;
1112
1111
  workflowRunId: string;
1112
+ nodeRunId: string;
1113
1113
  interventionId: string;
1114
1114
  nodeId: string;
1115
1115
  nodeKey: string;
@@ -1135,8 +1135,8 @@ export declare const WorkflowInterventionSchema: z.ZodObject<{
1135
1135
  id: string;
1136
1136
  input: Record<string, import("./common").JsonValue>;
1137
1137
  workflowId: string;
1138
- nodeRunId: string;
1139
1138
  workflowRunId: string;
1139
+ nodeRunId: string;
1140
1140
  interventionId: string;
1141
1141
  nodeId: string;
1142
1142
  nodeKey: string;
@@ -2323,8 +2323,8 @@ export declare const WorkflowInterventionListResponseSchema: z.ZodObject<{
2323
2323
  id: string;
2324
2324
  input: Record<string, import("./common").JsonValue>;
2325
2325
  workflowId: string;
2326
- nodeRunId: string;
2327
2326
  workflowRunId: string;
2327
+ nodeRunId: string;
2328
2328
  interventionId: string;
2329
2329
  nodeId: string;
2330
2330
  nodeKey: string;
@@ -2350,8 +2350,8 @@ export declare const WorkflowInterventionListResponseSchema: z.ZodObject<{
2350
2350
  id: string;
2351
2351
  input: Record<string, import("./common").JsonValue>;
2352
2352
  workflowId: string;
2353
- nodeRunId: string;
2354
2353
  workflowRunId: string;
2354
+ nodeRunId: string;
2355
2355
  interventionId: string;
2356
2356
  nodeId: string;
2357
2357
  nodeKey: string;
@@ -2383,8 +2383,8 @@ export declare const WorkflowInterventionListResponseSchema: z.ZodObject<{
2383
2383
  id: string;
2384
2384
  input: Record<string, import("./common").JsonValue>;
2385
2385
  workflowId: string;
2386
- nodeRunId: string;
2387
2386
  workflowRunId: string;
2387
+ nodeRunId: string;
2388
2388
  interventionId: string;
2389
2389
  nodeId: string;
2390
2390
  nodeKey: string;
@@ -2414,8 +2414,8 @@ export declare const WorkflowInterventionListResponseSchema: z.ZodObject<{
2414
2414
  id: string;
2415
2415
  input: Record<string, import("./common").JsonValue>;
2416
2416
  workflowId: string;
2417
- nodeRunId: string;
2418
2417
  workflowRunId: string;
2418
+ nodeRunId: string;
2419
2419
  interventionId: string;
2420
2420
  nodeId: string;
2421
2421
  nodeKey: string;
@@ -2483,8 +2483,8 @@ export declare const SubmitWorkflowInterventionResponseSchema: z.ZodObject<{
2483
2483
  id: string;
2484
2484
  input: Record<string, import("./common").JsonValue>;
2485
2485
  workflowId: string;
2486
- nodeRunId: string;
2487
2486
  workflowRunId: string;
2487
+ nodeRunId: string;
2488
2488
  interventionId: string;
2489
2489
  nodeId: string;
2490
2490
  nodeKey: string;
@@ -2510,8 +2510,8 @@ export declare const SubmitWorkflowInterventionResponseSchema: z.ZodObject<{
2510
2510
  id: string;
2511
2511
  input: Record<string, import("./common").JsonValue>;
2512
2512
  workflowId: string;
2513
- nodeRunId: string;
2514
2513
  workflowRunId: string;
2514
+ nodeRunId: string;
2515
2515
  interventionId: string;
2516
2516
  nodeId: string;
2517
2517
  nodeKey: string;
@@ -2541,8 +2541,8 @@ export declare const SubmitWorkflowInterventionResponseSchema: z.ZodObject<{
2541
2541
  id: string;
2542
2542
  input: Record<string, import("./common").JsonValue>;
2543
2543
  workflowId: string;
2544
- nodeRunId: string;
2545
2544
  workflowRunId: string;
2545
+ nodeRunId: string;
2546
2546
  interventionId: string;
2547
2547
  nodeId: string;
2548
2548
  nodeKey: string;
@@ -2571,8 +2571,8 @@ export declare const SubmitWorkflowInterventionResponseSchema: z.ZodObject<{
2571
2571
  id: string;
2572
2572
  input: Record<string, import("./common").JsonValue>;
2573
2573
  workflowId: string;
2574
- nodeRunId: string;
2575
2574
  workflowRunId: string;
2575
+ nodeRunId: string;
2576
2576
  interventionId: string;
2577
2577
  nodeId: string;
2578
2578
  nodeKey: string;
@@ -2640,8 +2640,8 @@ export declare const CancelWorkflowInterventionResponseSchema: z.ZodObject<{
2640
2640
  id: string;
2641
2641
  input: Record<string, import("./common").JsonValue>;
2642
2642
  workflowId: string;
2643
- nodeRunId: string;
2644
2643
  workflowRunId: string;
2644
+ nodeRunId: string;
2645
2645
  interventionId: string;
2646
2646
  nodeId: string;
2647
2647
  nodeKey: string;
@@ -2667,8 +2667,8 @@ export declare const CancelWorkflowInterventionResponseSchema: z.ZodObject<{
2667
2667
  id: string;
2668
2668
  input: Record<string, import("./common").JsonValue>;
2669
2669
  workflowId: string;
2670
- nodeRunId: string;
2671
2670
  workflowRunId: string;
2671
+ nodeRunId: string;
2672
2672
  interventionId: string;
2673
2673
  nodeId: string;
2674
2674
  nodeKey: string;
@@ -2696,8 +2696,8 @@ export declare const CancelWorkflowInterventionResponseSchema: z.ZodObject<{
2696
2696
  id: string;
2697
2697
  input: Record<string, import("./common").JsonValue>;
2698
2698
  workflowId: string;
2699
- nodeRunId: string;
2700
2699
  workflowRunId: string;
2700
+ nodeRunId: string;
2701
2701
  interventionId: string;
2702
2702
  nodeId: string;
2703
2703
  nodeKey: string;
@@ -2725,8 +2725,8 @@ export declare const CancelWorkflowInterventionResponseSchema: z.ZodObject<{
2725
2725
  id: string;
2726
2726
  input: Record<string, import("./common").JsonValue>;
2727
2727
  workflowId: string;
2728
- nodeRunId: string;
2729
2728
  workflowRunId: string;
2729
+ nodeRunId: string;
2730
2730
  interventionId: string;
2731
2731
  nodeId: string;
2732
2732
  nodeKey: string;
package/dist/server.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { SixbHostView } from "@sixb/core";
2
2
  import { Elysia } from "elysia";
3
3
  import { type AuthInvitationDestinationOptions, type AuthInvitationRedirectContext, type AuthInvitationRedirectInput, type RequestAuthContext, type ResolveAuthRedirectContext, type ResolvedSixbApiBrowserPolicy, type SixbApiBrowserPolicy } from "./auth/browser-origin";
4
4
  import type { SixbAuthExperienceOptions } from "./auth/experience";
5
+ import { type SixbSharedAccessOptions } from "./auth/shared-access";
5
6
  export interface SixbServerOptions {
6
7
  host: SixbHostView;
7
8
  port?: number;
@@ -10,6 +11,8 @@ export interface SixbServerOptions {
10
11
  browser: SixbApiBrowserPolicy;
11
12
  /** Optional custom-app auth bundle mounted under the API's `/auth` routes. */
12
13
  authExperience?: SixbAuthExperienceOptions;
14
+ /** Optional server limits for short-lived shared-access sessions. */
15
+ sharedAccess?: SixbSharedAccessOptions;
13
16
  }
14
17
  export declare function createSixbServer(options: SixbServerOptions): SixbServer;
15
18
  export declare class SixbServer {
@@ -21,6 +24,7 @@ export declare class SixbServer {
21
24
  private readonly authContextResolver;
22
25
  private readonly authRedirectContextResolver;
23
26
  private readonly authExperience?;
27
+ private readonly sharedAccessOptions;
24
28
  private app;
25
29
  private bunServer;
26
30
  private maintenance;
@@ -34,6 +38,7 @@ export declare class SixbServer {
34
38
  resolveInvitationRedirectContext(request: Request, input: AuthInvitationRedirectInput): AuthInvitationRedirectContext;
35
39
  getApiBrowserPolicy(): ResolvedSixbApiBrowserPolicy;
36
40
  getAuthExperience(): SixbAuthExperienceOptions | undefined;
41
+ getSharedAccessOptions(): SixbSharedAccessOptions;
37
42
  start(): Promise<void>;
38
43
  stop(): Promise<void>;
39
44
  }
@@ -1 +1 @@
1
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AAC,CAAC,CAAC,GAC/C,UAAU,CAAC,0BAA0B,CAAC;IAIzC,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAIlD,+BAA+B,CAAC,QAAQ,EAAE,OAAO,GAAG,gCAAgC;IAIpF,gCAAgC,CAC9B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,2BAA2B,GACjC,6BAA6B;IAIhC,mBAAmB,IAAI,4BAA4B;IAInD,iBAAiB,IAAI,yBAAyB,GAAG,SAAS;IAI1D,sBAAsB,IAAI,uBAAuB;IAI3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAe5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4O/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.7",
3
+ "version": "0.1.9",
4
4
  "description": "HTTP and WebSocket API server for Sixb",
5
5
  "keywords": [
6
6
  "sixb",
@@ -37,19 +37,19 @@
37
37
  "zod-to-json-schema": "^3.24.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@sixb/core": "0.1.7"
40
+ "@sixb/core": "0.1.9"
41
41
  },
42
42
  "devDependencies": {
43
- "@sixb/auth-magic-link": "0.1.3",
44
- "@sixb/auth-oidc": "0.1.2",
45
- "@sixb/core": "0.1.7",
46
- "@sixb/sqlite": "0.1.7",
43
+ "@sixb/auth-magic-link": "0.1.4",
44
+ "@sixb/auth-oidc": "0.1.3",
45
+ "@sixb/core": "0.1.9",
46
+ "@sixb/sqlite": "0.1.9",
47
47
  "@types/bun": "latest",
48
48
  "typescript": "^5.7.0"
49
49
  },
50
50
  "license": "MIT",
51
51
  "engines": {
52
- "bun": ">=1.3.0"
52
+ "bun": ">=1.4.2"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"
@@ -3,6 +3,8 @@ import { matchesPathPattern, normalizeRoutePath, SIXB_API_ROUTES } from "@sixb/c
3
3
  import {
4
4
  SIXB_BEARER_SECURITY_REQUIREMENT,
5
5
  SIXB_CSRF_OR_BEARER_SECURITY_REQUIREMENT,
6
+ SIXB_SHARED_MUTATION_SECURITY_REQUIREMENT,
7
+ SIXB_SHARED_READ_SECURITY_REQUIREMENT,
6
8
  } from "../openapi/security"
7
9
  import type { RouteAccess } from "./public-routes"
8
10
 
@@ -12,6 +14,7 @@ export interface AccessTokenRoute {
12
14
  readonly operationId: string
13
15
  readonly method: string
14
16
  readonly path: string
17
+ readonly sharedSession: boolean
15
18
  }
16
19
 
17
20
  // The routes that accept bearer access tokens: the `accessToken` projection of the canonical
@@ -26,7 +29,12 @@ export interface AccessTokenRoute {
26
29
  // from SIXB_API_ROUTES.
27
30
  export const ACCESS_TOKEN_ROUTES: readonly AccessTokenRoute[] = SIXB_API_ROUTES.filter(
28
31
  (route) => route.accessToken
29
- ).map((route) => ({ operationId: route.operationId, method: route.method, path: route.path }))
32
+ ).map((route) => ({
33
+ operationId: route.operationId,
34
+ method: route.method,
35
+ path: route.path,
36
+ sharedSession: route.sharedSession ?? false,
37
+ }))
30
38
 
31
39
  /**
32
40
  * OpenAPI security requirement for a bearer-capable route, derived from the
@@ -43,9 +51,16 @@ export function bearerSecurityRequirement(operationId: string) {
43
51
  )
44
52
  }
45
53
 
46
- return isCsrfExemptMethod(route.method)
54
+ const standard = isCsrfExemptMethod(route.method)
47
55
  ? SIXB_BEARER_SECURITY_REQUIREMENT
48
56
  : SIXB_CSRF_OR_BEARER_SECURITY_REQUIREMENT
57
+ if (!route.sharedSession) return standard
58
+ return [
59
+ ...standard,
60
+ isCsrfExemptMethod(route.method)
61
+ ? SIXB_SHARED_READ_SECURITY_REQUIREMENT
62
+ : SIXB_SHARED_MUTATION_SECURITY_REQUIREMENT,
63
+ ]
49
64
  }
50
65
 
51
66
  export function isAccessTokenRoute(request: Request): boolean {
@@ -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 { isSharedAccessPublicPath } from "./shared-access"
3
4
 
4
5
  const CONNECTOR_OAUTH_CALLBACK_PATH = "/auth/connectors/callback"
5
6
 
@@ -47,6 +48,10 @@ export function isPublicRoute(pathname: string, method: string): boolean {
47
48
  return true
48
49
  }
49
50
 
51
+ if (isSharedAccessPublicPath(pathname, method)) {
52
+ return true
53
+ }
54
+
50
55
  if ((pathname === "/favicon.svg" || pathname === "/favicon.ico") && normalizedMethod === "GET") {
51
56
  return true
52
57
  }