@sixb/server 0.2.5 → 0.2.7

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 (106) hide show
  1. package/dist/auth/run-token.d.ts.map +1 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +596 -92
  5. package/dist/index.js.map +36 -35
  6. package/dist/registerRoutes.d.ts +1 -0
  7. package/dist/registerRoutes.d.ts.map +1 -1
  8. package/dist/routes/actions.d.ts +2 -0
  9. package/dist/routes/actions.d.ts.map +1 -1
  10. package/dist/routes/agent-approvals.d.ts +23 -1
  11. package/dist/routes/agent-approvals.d.ts.map +1 -1
  12. package/dist/routes/agent-computers.d.ts +36 -0
  13. package/dist/routes/agent-computers.d.ts.map +1 -1
  14. package/dist/routes/agent-thread-reads.d.ts +82 -0
  15. package/dist/routes/agent-thread-reads.d.ts.map +1 -0
  16. package/dist/routes/agents.d.ts +795 -13
  17. package/dist/routes/agents.d.ts.map +1 -1
  18. package/dist/routes/ai-accounting.d.ts.map +1 -1
  19. package/dist/routes/connectors.d.ts +2 -0
  20. package/dist/routes/connectors.d.ts.map +1 -1
  21. package/dist/routes/datasets.d.ts +2 -0
  22. package/dist/routes/datasets.d.ts.map +1 -1
  23. package/dist/routes/model-generations.d.ts +6 -0
  24. package/dist/routes/model-generations.d.ts.map +1 -1
  25. package/dist/routes/observed-agent-threads.d.ts +24 -2
  26. package/dist/routes/observed-agent-threads.d.ts.map +1 -1
  27. package/dist/routes/ontology.d.ts +2 -0
  28. package/dist/routes/ontology.d.ts.map +1 -1
  29. package/dist/routes/pipelines.d.ts +2 -0
  30. package/dist/routes/pipelines.d.ts.map +1 -1
  31. package/dist/routes/projections.d.ts +6 -0
  32. package/dist/routes/projections.d.ts.map +1 -1
  33. package/dist/routes/rules.d.ts +2 -0
  34. package/dist/routes/rules.d.ts.map +1 -1
  35. package/dist/routes/status.d.ts +5 -2
  36. package/dist/routes/status.d.ts.map +1 -1
  37. package/dist/routes/syncs.d.ts +177 -12
  38. package/dist/routes/syncs.d.ts.map +1 -1
  39. package/dist/routes/workflows.d.ts +8 -6
  40. package/dist/routes/workflows.d.ts.map +1 -1
  41. package/dist/routes/ws/agents.d.ts.map +1 -1
  42. package/dist/schemas/actions.d.ts +6 -0
  43. package/dist/schemas/actions.d.ts.map +1 -1
  44. package/dist/schemas/activity.d.ts +4 -4
  45. package/dist/schemas/agents.d.ts +2657 -61
  46. package/dist/schemas/agents.d.ts.map +1 -1
  47. package/dist/schemas/ai-accounting.d.ts +3 -0
  48. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  49. package/dist/schemas/common.d.ts +5 -0
  50. package/dist/schemas/common.d.ts.map +1 -1
  51. package/dist/schemas/connectors.d.ts +3 -0
  52. package/dist/schemas/connectors.d.ts.map +1 -1
  53. package/dist/schemas/datasets.d.ts +3 -0
  54. package/dist/schemas/datasets.d.ts.map +1 -1
  55. package/dist/schemas/models.d.ts +46 -0
  56. package/dist/schemas/models.d.ts.map +1 -1
  57. package/dist/schemas/ontology.d.ts +3 -0
  58. package/dist/schemas/ontology.d.ts.map +1 -1
  59. package/dist/schemas/pipelines.d.ts +3 -0
  60. package/dist/schemas/pipelines.d.ts.map +1 -1
  61. package/dist/schemas/projections.d.ts +33 -0
  62. package/dist/schemas/projections.d.ts.map +1 -1
  63. package/dist/schemas/rules.d.ts +3 -0
  64. package/dist/schemas/rules.d.ts.map +1 -1
  65. package/dist/schemas/status.d.ts +2 -2
  66. package/dist/schemas/syncs.d.ts +727 -25
  67. package/dist/schemas/syncs.d.ts.map +1 -1
  68. package/dist/schemas/workflows.d.ts +25 -22
  69. package/dist/schemas/workflows.d.ts.map +1 -1
  70. package/dist/server.d.ts +16 -1
  71. package/dist/server.d.ts.map +1 -1
  72. package/package.json +5 -5
  73. package/src/auth/run-token.ts +59 -9
  74. package/src/index.ts +6 -1
  75. package/src/registerRoutes.ts +4 -1
  76. package/src/routes/actions.ts +7 -3
  77. package/src/routes/agent-computers.ts +7 -6
  78. package/src/routes/agent-thread-reads.ts +67 -0
  79. package/src/routes/agents.ts +129 -16
  80. package/src/routes/ai-accounting.ts +1 -0
  81. package/src/routes/connectors.ts +1 -0
  82. package/src/routes/datasets.ts +11 -3
  83. package/src/routes/model-generations.ts +1 -1
  84. package/src/routes/observed-agent-threads.ts +3 -4
  85. package/src/routes/ontology.ts +17 -3
  86. package/src/routes/pipelines.ts +13 -3
  87. package/src/routes/projections.ts +14 -9
  88. package/src/routes/rules.ts +9 -3
  89. package/src/routes/status.ts +18 -1
  90. package/src/routes/syncs.ts +139 -8
  91. package/src/routes/workflows.ts +13 -3
  92. package/src/routes/ws/agents.ts +43 -3
  93. package/src/schemas/actions.ts +7 -1
  94. package/src/schemas/agents.ts +80 -10
  95. package/src/schemas/ai-accounting.ts +12 -0
  96. package/src/schemas/common.ts +24 -9
  97. package/src/schemas/connectors.ts +2 -1
  98. package/src/schemas/datasets.ts +2 -1
  99. package/src/schemas/models.ts +10 -0
  100. package/src/schemas/ontology.ts +2 -0
  101. package/src/schemas/pipelines.ts +2 -1
  102. package/src/schemas/projections.ts +4 -1
  103. package/src/schemas/rules.ts +2 -0
  104. package/src/schemas/syncs.ts +65 -2
  105. package/src/schemas/workflows.ts +7 -1
  106. package/src/server.ts +205 -13
@@ -1 +1 @@
1
- {"version":3,"file":"syncs.d.ts","sourceRoot":"","sources":["../../src/schemas/syncs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAA;AAEF,eAAO,MAAM,mBAAmB,sEAAoE,CAAA;AAGpG,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9B,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAA;AAOF,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DAA8D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB9D,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;QApF3C,qEAAqE;;;;;QAKrE,uFAAuF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFvF,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;QAxFpC,qEAAqE;;;;;QAKrE,uFAAuF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuFvF,CAAA;AAWF,+FAA+F;AAC/F,eAAO,MAAM,4BAA4B;;;;;QANvC,qEAAqE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrE,CAAA"}
@@ -33,7 +33,7 @@ export declare const WorkflowRunsQuerySchema: z.ZodObject<{
33
33
  offset: z.ZodOptional<z.ZodString>;
34
34
  order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
35
35
  }, "strip", z.ZodTypeAny, {
36
- status?: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued" | undefined;
36
+ status?: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting" | undefined;
37
37
  startedAfter?: string | undefined;
38
38
  startedBefore?: string | undefined;
39
39
  limit?: string | undefined;
@@ -41,7 +41,7 @@ export declare const WorkflowRunsQuerySchema: z.ZodObject<{
41
41
  order?: "asc" | "desc" | undefined;
42
42
  workflowId?: string | undefined;
43
43
  }, {
44
- status?: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued" | undefined;
44
+ status?: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting" | undefined;
45
45
  startedAfter?: string | undefined;
46
46
  startedBefore?: string | undefined;
47
47
  limit?: string | undefined;
@@ -129,7 +129,7 @@ export declare const WorkflowRunSummarySchema: z.ZodObject<{
129
129
  type: "user" | "serviceAccount" | "system";
130
130
  }>;
131
131
  }, "strip", z.ZodTypeAny, {
132
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
132
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
133
133
  projectId: string;
134
134
  id: string;
135
135
  requestedBy: {
@@ -142,7 +142,7 @@ export declare const WorkflowRunSummarySchema: z.ZodObject<{
142
142
  finishedAt?: string | undefined;
143
143
  queuedAt?: string | undefined;
144
144
  }, {
145
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
145
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
146
146
  projectId: string;
147
147
  id: string;
148
148
  requestedBy: {
@@ -178,7 +178,7 @@ export declare const WorkflowRunDetailSchema: z.ZodObject<{
178
178
  input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
179
179
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>>;
180
180
  }, "strip", z.ZodTypeAny, {
181
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
181
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
182
182
  projectId: string;
183
183
  id: string;
184
184
  requestedBy: {
@@ -193,7 +193,7 @@ export declare const WorkflowRunDetailSchema: z.ZodObject<{
193
193
  queuedAt?: string | undefined;
194
194
  output?: Record<string, import("./common").JsonValue> | undefined;
195
195
  }, {
196
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
196
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
197
197
  projectId: string;
198
198
  id: string;
199
199
  requestedBy: {
@@ -1715,6 +1715,7 @@ export declare const WorkflowInterventionSchema: z.ZodObject<{
1715
1715
  }>;
1716
1716
  export declare const WorkflowSchema: z.ZodObject<{
1717
1717
  id: z.ZodString;
1718
+ folder: z.ZodOptional<z.ZodString>;
1718
1719
  input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
1719
1720
  triggers: z.ZodArray<z.ZodObject<{
1720
1721
  type: z.ZodLiteral<"schedule">;
@@ -1822,7 +1823,7 @@ export declare const WorkflowSchema: z.ZodObject<{
1822
1823
  type: "user" | "serviceAccount" | "system";
1823
1824
  }>;
1824
1825
  }, "strip", z.ZodTypeAny, {
1825
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
1826
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1826
1827
  projectId: string;
1827
1828
  id: string;
1828
1829
  requestedBy: {
@@ -1835,7 +1836,7 @@ export declare const WorkflowSchema: z.ZodObject<{
1835
1836
  finishedAt?: string | undefined;
1836
1837
  queuedAt?: string | undefined;
1837
1838
  }, {
1838
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
1839
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1839
1840
  projectId: string;
1840
1841
  id: string;
1841
1842
  requestedBy: {
@@ -1882,7 +1883,7 @@ export declare const WorkflowSchema: z.ZodObject<{
1882
1883
  output: Record<string, import("./common").JsonValue>;
1883
1884
  })[];
1884
1885
  latestRun: {
1885
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
1886
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1886
1887
  projectId: string;
1887
1888
  id: string;
1888
1889
  requestedBy: {
@@ -1895,6 +1896,7 @@ export declare const WorkflowSchema: z.ZodObject<{
1895
1896
  finishedAt?: string | undefined;
1896
1897
  queuedAt?: string | undefined;
1897
1898
  } | null;
1899
+ folder?: string | undefined;
1898
1900
  }, {
1899
1901
  id: string;
1900
1902
  input: Record<string, import("./common").JsonValue>;
@@ -1929,7 +1931,7 @@ export declare const WorkflowSchema: z.ZodObject<{
1929
1931
  output: Record<string, import("./common").JsonValue>;
1930
1932
  })[];
1931
1933
  latestRun: {
1932
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
1934
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1933
1935
  projectId: string;
1934
1936
  id: string;
1935
1937
  requestedBy: {
@@ -1942,6 +1944,7 @@ export declare const WorkflowSchema: z.ZodObject<{
1942
1944
  finishedAt?: string | undefined;
1943
1945
  queuedAt?: string | undefined;
1944
1946
  } | null;
1947
+ folder?: string | undefined;
1945
1948
  }>;
1946
1949
  export declare const WorkflowRunListResponseSchema: z.ZodObject<{
1947
1950
  runs: z.ZodArray<z.ZodObject<{
@@ -1964,7 +1967,7 @@ export declare const WorkflowRunListResponseSchema: z.ZodObject<{
1964
1967
  type: "user" | "serviceAccount" | "system";
1965
1968
  }>;
1966
1969
  }, "strip", z.ZodTypeAny, {
1967
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
1970
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1968
1971
  projectId: string;
1969
1972
  id: string;
1970
1973
  requestedBy: {
@@ -1977,7 +1980,7 @@ export declare const WorkflowRunListResponseSchema: z.ZodObject<{
1977
1980
  finishedAt?: string | undefined;
1978
1981
  queuedAt?: string | undefined;
1979
1982
  }, {
1980
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
1983
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1981
1984
  projectId: string;
1982
1985
  id: string;
1983
1986
  requestedBy: {
@@ -1994,7 +1997,7 @@ export declare const WorkflowRunListResponseSchema: z.ZodObject<{
1994
1997
  total: z.ZodNumber;
1995
1998
  }, "strip", z.ZodTypeAny, {
1996
1999
  runs: {
1997
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2000
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
1998
2001
  projectId: string;
1999
2002
  id: string;
2000
2003
  requestedBy: {
@@ -2011,7 +2014,7 @@ export declare const WorkflowRunListResponseSchema: z.ZodObject<{
2011
2014
  total: number;
2012
2015
  }, {
2013
2016
  runs: {
2014
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2017
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2015
2018
  projectId: string;
2016
2019
  id: string;
2017
2020
  requestedBy: {
@@ -2051,7 +2054,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
2051
2054
  input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
2052
2055
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>>;
2053
2056
  }, "strip", z.ZodTypeAny, {
2054
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2057
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2055
2058
  projectId: string;
2056
2059
  id: string;
2057
2060
  requestedBy: {
@@ -2066,7 +2069,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
2066
2069
  queuedAt?: string | undefined;
2067
2070
  output?: Record<string, import("./common").JsonValue> | undefined;
2068
2071
  }, {
2069
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2072
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2070
2073
  projectId: string;
2071
2074
  id: string;
2072
2075
  requestedBy: {
@@ -2344,7 +2347,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
2344
2347
  }>, "many">;
2345
2348
  }, "strip", z.ZodTypeAny, {
2346
2349
  run: {
2347
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2350
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2348
2351
  projectId: string;
2349
2352
  id: string;
2350
2353
  requestedBy: {
@@ -2410,7 +2413,7 @@ export declare const WorkflowRunDetailResponseSchema: z.ZodObject<{
2410
2413
  }[];
2411
2414
  }, {
2412
2415
  run: {
2413
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2416
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2414
2417
  projectId: string;
2415
2418
  id: string;
2416
2419
  requestedBy: {
@@ -2499,7 +2502,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
2499
2502
  input: z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>;
2500
2503
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, z.ZodTypeDef, import("./common").JsonValue>>>;
2501
2504
  }, "strip", z.ZodTypeAny, {
2502
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2505
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2503
2506
  projectId: string;
2504
2507
  id: string;
2505
2508
  requestedBy: {
@@ -2514,7 +2517,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
2514
2517
  queuedAt?: string | undefined;
2515
2518
  output?: Record<string, import("./common").JsonValue> | undefined;
2516
2519
  }, {
2517
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2520
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2518
2521
  projectId: string;
2519
2522
  id: string;
2520
2523
  requestedBy: {
@@ -2792,7 +2795,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
2792
2795
  }>, "many">;
2793
2796
  }, "strip", z.ZodTypeAny, {
2794
2797
  run: {
2795
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2798
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2796
2799
  projectId: string;
2797
2800
  id: string;
2798
2801
  requestedBy: {
@@ -2858,7 +2861,7 @@ export declare const CancelWorkflowRunResponseSchema: z.ZodObject<{
2858
2861
  }[];
2859
2862
  }, {
2860
2863
  run: {
2861
- status: "succeeded" | "failed" | "cancelled" | "running" | "waiting" | "queued";
2864
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued" | "waiting";
2862
2865
  projectId: string;
2863
2866
  id: string;
2864
2867
  requestedBy: {
@@ -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,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa3C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;IAGrC,8FAA8F;;;;;;;;GAGpF,CAAA;AAEd,eAAO,MAAM,2BAA2B,8DAA2B,CAAA;AAEnE,eAAO,MAAM,oCAAoC;;;;;;EAE/C,CAAA;AAEF,eAAO,MAAM,oCAAoC,8DAA2B,CAAA;AAuC5E,eAAO,MAAM,wBAAwB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.ts CHANGED
@@ -33,6 +33,14 @@ export interface SixbServerOptions {
33
33
  */
34
34
  ingestFlush?: boolean;
35
35
  }
36
+ export interface SixbServerStopOptions {
37
+ /**
38
+ * How long in-flight HTTP requests may take to finish before remaining connections are closed.
39
+ * Defaults to 65 seconds, matching the Action drain window; `0` closes them at once. A stop
40
+ * called while another one drains joins it, and a shorter timeout brings its deadline closer.
41
+ */
42
+ readonly timeoutMs?: number;
43
+ }
36
44
  export declare function createSixbServer(options: SixbServerOptions): SixbServer;
37
45
  export declare class SixbServer {
38
46
  private readonly hostRuntime;
@@ -48,10 +56,13 @@ export declare class SixbServer {
48
56
  private readonly timing;
49
57
  private app;
50
58
  private bunServer;
59
+ private closeWebSockets;
60
+ private stopping;
51
61
  private readonly hostsOntologyMaintenance;
52
62
  private readonly flushesIngestion;
53
63
  private maintenance;
54
64
  private stopSweeper;
65
+ private inProgressStop;
55
66
  constructor(options: SixbServerOptions);
56
67
  getHost(): SixbHostView;
57
68
  /** The port the server listens on once started, so `port: 0` reports the one it bound. */
@@ -63,9 +74,13 @@ export declare class SixbServer {
63
74
  getApiBrowserPolicy(): ResolvedSixbApiBrowserPolicy;
64
75
  getAuthExperience(): SixbAuthExperienceOptions | undefined;
65
76
  getSharedAccessOptions(): SixbSharedAccessOptions;
77
+ /** Marks the server as stopping so `/ready` answers `503` before connections close. */
78
+ markStopping(): void;
79
+ isStopping(): boolean;
66
80
  start(): Promise<void>;
67
81
  private setIngestFlush;
68
- stop(): Promise<void>;
82
+ stop(options?: SixbServerStopOptions): Promise<void>;
83
+ private stopUntil;
69
84
  }
70
85
  export declare function createSixbApi(server: SixbServer): Elysia<"", {
71
86
  decorator: {};
@@ -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;AAQzE,OAAO,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAA;AAE3C,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C,0BAA0B,CAAC,CAAC,CAAC,CAAC,GAC/C,UAAU,CAAC,0BAA0B,CAAC;IAIzC,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAIlD,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;IAIjD,uFAAuF;IACvF,YAAY,IAAI,IAAI;IAIpB,UAAU,IAAI,OAAO;IAIf,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsD5B,OAAO,CAAC,cAAc;IAKhB,IAAI,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;YAkBhD,SAAS;CA+BxB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwQ/C;AAqED,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.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "HTTP and WebSocket API server for Sixb",
5
5
  "keywords": [
6
6
  "sixb",
@@ -40,15 +40,15 @@
40
40
  "zod-to-json-schema": "^3.24.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@sixb/core": "0.2.5",
43
+ "@sixb/core": "0.2.7",
44
44
  "yjs": "^13.6.33"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@sixb/auth-magic-link": "0.2.0",
48
48
  "@sixb/auth-oidc": "0.2.3",
49
- "@sixb/cli-core": "0.2.3",
50
- "@sixb/core": "0.2.5",
51
- "@sixb/sqlite": "0.2.5",
49
+ "@sixb/cli-core": "0.2.5",
50
+ "@sixb/core": "0.2.7",
51
+ "@sixb/sqlite": "0.2.7",
52
52
  "@types/bun": "latest",
53
53
  "typescript": "^5.7.0",
54
54
  "yjs": "13.6.33"
@@ -1,5 +1,6 @@
1
1
  import type { SixbHostView } from "@sixb/core"
2
2
  import {
3
+ AGENT_RUN_HEADER,
3
4
  type AgentRunExecutionScope,
4
5
  AgentRunScopeError,
5
6
  agentRunTokenRunId,
@@ -25,6 +26,12 @@ import type { AgentRunRequestExecution, RequestAuthState } from "./scope"
25
26
  // own execution, restored from server-side records: what it starts is a child of the run and keeps
26
27
  // the run's requester, whatever the request's headers say. What a run may do there depends on its
27
28
  // kind, and on its conversation's approval mode, as decided below.
29
+ //
30
+ // A child that works in its parent's workspace runs its commands in its parent's session, which
31
+ // adds its parent's token; they name the child in `AGENT_RUN_HEADER`. That header only narrows the
32
+ // token's authority to one of its run's own children still at work, which the request is then
33
+ // admitted as, exactly as with the child's own token. The token stays the authority: parent and
34
+ // child share a machine and act for the same user, so the header is no boundary between them.
28
35
 
29
36
  /** What a run-token request is allowed as, or the answer that refuses or holds it. */
30
37
  export type RunTokenDecision =
@@ -63,7 +70,11 @@ export async function resolveRunTokenRequest(input: {
63
70
  return deny(403, `A run token cannot call ${method} ${path}.`)
64
71
  }
65
72
 
66
- const resolved = await resolveRunState(host, input.token)
73
+ const resolved = await resolveRunState(
74
+ host,
75
+ input.token,
76
+ request.headers.get(AGENT_RUN_HEADER) ?? undefined
77
+ )
67
78
  if (resolved.kind === "deny") return resolved
68
79
  const { state, run } = resolved
69
80
 
@@ -150,7 +161,9 @@ async function runPolicyRefusal(
150
161
 
151
162
  async function resolveRunState(
152
163
  host: SixbHostView,
153
- token: string
164
+ token: string,
165
+ /** The run the request names itself as, when not the token's: one of its children. */
166
+ actingRunId: string | undefined
154
167
  ): Promise<
155
168
  | { readonly kind: "deny"; readonly response: Response }
156
169
  | {
@@ -175,24 +188,37 @@ async function resolveRunState(
175
188
  runId && !storedAgentRun
176
189
  ? await workflowRuns?.agentNodes.getByNodeRunId({ projectId: host.id, nodeRunId: runId })
177
190
  : undefined
178
- const runState = toRunState(storedAgentRun ?? null, workflowRun ?? null)
191
+ const tokenState = toRunState(storedAgentRun ?? null, workflowRun ?? null)
179
192
  if (
180
193
  !runId ||
181
- !runState ||
182
- runState.run.status !== "running" ||
183
- ("cancelRequestedAt" in runState.run && runState.run.cancelRequestedAt) ||
184
- !runState.run.execution ||
185
- runState.run.execution.queueLeaseExpiresAt.getTime() <= Date.now() ||
194
+ !tokenState ||
195
+ tokenState.run.status !== "running" ||
196
+ ("cancelRequestedAt" in tokenState.run && tokenState.run.cancelRequestedAt) ||
197
+ !tokenState.run.execution ||
198
+ tokenState.run.execution.queueLeaseExpiresAt.getTime() <= Date.now() ||
186
199
  !isValidAgentRunToken({
187
200
  projectId: host.id,
188
201
  runId,
189
- executionToken: runState.run.execution.token,
202
+ executionToken: tokenState.run.execution.token,
190
203
  token,
191
204
  })
192
205
  ) {
193
206
  return deny(403, "The run token is not valid: its run has ended, moved or been stopped.")
194
207
  }
195
208
 
209
+ // The request acts as the run it names, when that is one of the token's run's children.
210
+ let runState = tokenState
211
+ if (actingRunId !== undefined && actingRunId !== runId) {
212
+ const child = await childActingFor(host, tokenState, actingRunId)
213
+ if (!child) {
214
+ return deny(
215
+ 403,
216
+ `The run token cannot act as run '${actingRunId}': only as a sub-agent of its own run still at work.`
217
+ )
218
+ }
219
+ runState = child
220
+ }
221
+
196
222
  let scope: AgentRunExecutionScope
197
223
  try {
198
224
  scope = await resolveAgentRunExecutionScope(host, {
@@ -271,6 +297,30 @@ function toRunState(
271
297
  }
272
298
  }
273
299
 
300
+ /**
301
+ * One of the token's run's own children still at work, as a request naming it is admitted: a child
302
+ * of a conversation turn, running under its own execution.
303
+ */
304
+ async function childActingFor(
305
+ host: SixbHostView,
306
+ parent: RunState,
307
+ childRunId: string
308
+ ): Promise<RunState | null> {
309
+ if (!parent.agentRun) return null
310
+
311
+ const child = await host.storage.agents?.runs.getById({ projectId: host.id, id: childRunId })
312
+ if (
313
+ child?.kind !== "subagent" ||
314
+ child.parentRunId !== parent.runId ||
315
+ child.status !== "running" ||
316
+ child.cancelRequestedAt ||
317
+ !child.execution
318
+ ) {
319
+ return null
320
+ }
321
+ return toRunState(child, null)
322
+ }
323
+
274
324
  function scopeErrorResponse(
275
325
  error: AgentRunScopeError
276
326
  ): RunTokenDecision & { readonly kind: "deny" } {
package/src/index.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  export type { SixbApiBrowserPolicy } from "./auth/browser-origin"
2
2
  export type { SixbAuthExperienceOptions } from "./auth/experience"
3
3
  export type { SixbSharedAccessOptions } from "./auth/shared-access"
4
- export { createSixbServer, SixbServer, type SixbServerOptions } from "./server"
4
+ export {
5
+ createSixbServer,
6
+ SixbServer,
7
+ type SixbServerOptions,
8
+ type SixbServerStopOptions,
9
+ } from "./server"
5
10
  export { requestTimingOptionsFromEnv, type SixbRequestTimingOptions } from "./utils/request-timing"
@@ -10,6 +10,7 @@ import { registerAgentChildRoutes } from "./routes/agent-children"
10
10
  import { registerAgentComputerRoutes } from "./routes/agent-computers"
11
11
  import { registerAgentMemoryRoutes } from "./routes/agent-memory"
12
12
  import { registerAgentRunnerRoutes } from "./routes/agent-runners"
13
+ import { registerAgentThreadReadRoutes } from "./routes/agent-thread-reads"
13
14
  import { registerAgentRoutes } from "./routes/agents"
14
15
  import { registerAiAccountingRoutes } from "./routes/ai-accounting"
15
16
  import { registerArtifactFrameRoutes } from "./routes/artifact-frames"
@@ -51,6 +52,7 @@ export interface HttpRouteOptions {
51
52
  readonly sharedAccess: SharedAccessBoundary
52
53
  /** Where frames are served from and which app origins may show them. */
53
54
  readonly browserPolicy: ResolvedSixbApiBrowserPolicy
55
+ readonly isStopping?: () => boolean
54
56
  }
55
57
 
56
58
  export function registerHttpRoutes(app: Elysia, host: SixbHostView, options: HttpRouteOptions) {
@@ -58,7 +60,7 @@ export function registerHttpRoutes(app: Elysia, host: SixbHostView, options: Htt
58
60
  registerModelCallRoutes(app, host)
59
61
  registerModelGenerationRoutes(app, host)
60
62
  registerProjectRoutes(app, host)
61
- registerStatusRoutes(app, host)
63
+ registerStatusRoutes(app, host, { isStopping: options.isStopping })
62
64
  registerConnectorRoutes(app, host)
63
65
  registerConnectorConnectionRoutes(app, host)
64
66
  registerConnectorConnectionRunRoutes(app, host, options.connectorConnections)
@@ -77,6 +79,7 @@ export function registerHttpRoutes(app: Elysia, host: SixbHostView, options: Htt
77
79
  registerFileDownloadRoutes(app, host)
78
80
  registerActionRunRoutes(app, host)
79
81
  registerAgentRoutes(app, host)
82
+ registerAgentThreadReadRoutes(app, host)
80
83
  registerAgentChildRoutes(app, host)
81
84
  registerAgentRunnerRoutes(app, host)
82
85
  registerAgentComputerRoutes(app, host)
@@ -19,10 +19,12 @@ import { ErrorResponseSchema } from "../schemas/common"
19
19
  import { handleRouteError } from "../utils/http"
20
20
 
21
21
  function serializeAction(
22
- action: ActionDescriptor
22
+ action: ActionDescriptor,
23
+ folder: string | undefined
23
24
  ): ReturnType<typeof ActionCatalogItemSchema.parse> {
24
25
  return ActionCatalogItemSchema.parse({
25
26
  id: action.id,
27
+ folder,
26
28
  name: action.id,
27
29
  description: action.description,
28
30
  ...(action.binding.kind === "object" ? { objectTypeId: action.binding.objectTypeId } : {}),
@@ -44,7 +46,7 @@ function serializeActionDetail(
44
46
  host: SixbHostView
45
47
  ): ReturnType<typeof ActionDetailSchema.parse> {
46
48
  return ActionDetailSchema.parse({
47
- ...serializeAction(action),
49
+ ...serializeAction(action, host.definitions.folders.actions?.get(action.id)),
48
50
  inputSchema: schemaFieldsToJsonSchema({
49
51
  fields: action.params,
50
52
  valueTypesById: host.definitions.ontology.getValueTypesById(),
@@ -58,7 +60,9 @@ export function registerActionRoutes(app: Elysia, host: SixbHostView) {
58
60
  "/api/actions",
59
61
  async (context) => {
60
62
  const actions = requireRequestSixb(context).actions.list()
61
- return actions.map(serializeAction)
63
+ return actions.map((action) =>
64
+ serializeAction(action, host.definitions.folders.actions?.get(action.id))
65
+ )
62
66
  },
63
67
  {
64
68
  response: { 200: ActionCatalogItemSchema.array() },
@@ -46,10 +46,11 @@ import {
46
46
  serializeThreadRead,
47
47
  } from "./agents"
48
48
 
49
- // A computer's thread runs on one of its owner's computers, in one folder there: only `sixb` open
50
- // in that folder claims its turns. Each open `sixb` holds a session, a lease it renews, so the
51
- // thread reads as online while one is live, and its owner can send from anywhere. Moving it to
52
- // another folder, or to the cloud, is its owner's call.
49
+ // A thread runs in the cloud, or on one of its owner's computers in one folder there: only
50
+ // `sixb` open in that folder claims the turns of one that runs there. Each open `sixb` holds a
51
+ // session, a lease it renews, so the thread reads as online while one is live, and its owner can
52
+ // send from anywhere. Moving it between the cloud, a computer and a folder is its owner's call,
53
+ // as often as they like.
53
54
 
54
55
  /** How long a session stays live without a renewal; `sixb` renews it three times as often. */
55
56
  const SESSION_MS = 60_000
@@ -188,7 +189,7 @@ export function registerAgentComputerRoutes(app: Elysia, host: SixbHostView) {
188
189
  detail: {
189
190
  summary: "Move a thread to one of your computers, in a folder there",
190
191
  description:
191
- "A thread that runs on its owner's computer runs there alone, in one folder: only `sixb` open in that folder claims its turns. Its owner moves it to another folder or computer. Refused while a turn runs or waits on approvals.",
192
+ "Its turns run there alone from now on, in that folder: only `sixb` open in it claims them. Its owner moves it from the cloud or from another folder or computer, as often as they need; files from where it ran before stay there. Refused while a turn runs or waits on approvals.",
192
193
  tags: [OPENAPI_TAGS.agentThreads.name],
193
194
  operationId: "moveAgentThreadToComputer",
194
195
  security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
@@ -222,7 +223,7 @@ export function registerAgentComputerRoutes(app: Elysia, host: SixbHostView) {
222
223
  detail: {
223
224
  summary: "Move a thread from your computer to the cloud",
224
225
  description:
225
- "Its turns run in the cloud from now on, starting with the one waiting for the computer, if any. The files it worked on stay on the computer. Refused while a turn runs there or waits on approvals.",
226
+ "Its turns run in the cloud from now on, starting with the one waiting for the computer, if any, and its owner can move it to a computer or folder again later. The files it worked on stay on the computer. Refused while a turn runs there or waits on approvals.",
226
227
  tags: [OPENAPI_TAGS.agentThreads.name],
227
228
  operationId: "moveAgentThreadToCloud",
228
229
  security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
@@ -0,0 +1,67 @@
1
+ import type { SixbHostView } from "@sixb/core"
2
+ import type { Elysia } from "elysia"
3
+ import { requireRequestSixb } from "../auth/scope"
4
+ import { SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT } from "../openapi/security"
5
+ import { OPENAPI_TAGS } from "../openapi/tags"
6
+ import {
7
+ AgentRequestErrorResponseSchema,
8
+ AgentThreadParamsSchema,
9
+ MarkAgentThreadReadBodySchema,
10
+ MarkAgentThreadReadResponseSchema,
11
+ } from "../schemas/agents"
12
+ import { ErrorResponseSchema } from "../schemas/common"
13
+ import { toIsoString, unconfiguredStorageResponse } from "../utils/http"
14
+ import { handleAgentRouteError } from "./agents"
15
+
16
+ const MARKING =
17
+ "Record that your reading of a conversation reached a message, or its newest when `throughMessageId` is omitted, which is what a Done button sends. It never moves backwards, so another device that read further keeps its place; a message a retry or an edit took away marks nothing. Session routes only: a runner has no reading."
18
+
19
+ /** Where the caller's reading of a conversation has reached. One route: the write. */
20
+ export function registerAgentThreadReadRoutes(app: Elysia, host: SixbHostView) {
21
+ return app.put(
22
+ "/api/agent-threads/:threadId/read",
23
+ async (context) => {
24
+ const { set } = context
25
+ try {
26
+ if (!host.storage.agents) {
27
+ return unconfiguredStorageResponse(set, "Agent storage")
28
+ }
29
+
30
+ const body = MarkAgentThreadReadBodySchema.parse(context.body ?? {})
31
+ const read = await requireRequestSixb(context).agent.threads.markRead(
32
+ context.params.threadId,
33
+ body
34
+ )
35
+
36
+ return MarkAgentThreadReadResponseSchema.parse({
37
+ read: {
38
+ threadId: read.threadId,
39
+ throughSeq: read.throughSeq,
40
+ headSeq: read.headSeq,
41
+ unread: read.unread,
42
+ readAt: read.readAt ? toIsoString(read.readAt) : undefined,
43
+ },
44
+ })
45
+ } catch (error) {
46
+ return handleAgentRouteError(error, set)
47
+ }
48
+ },
49
+ {
50
+ params: AgentThreadParamsSchema,
51
+ body: MarkAgentThreadReadBodySchema,
52
+ response: {
53
+ 200: MarkAgentThreadReadResponseSchema,
54
+ 400: AgentRequestErrorResponseSchema,
55
+ 404: AgentRequestErrorResponseSchema,
56
+ 501: ErrorResponseSchema,
57
+ },
58
+ detail: {
59
+ summary: "Mark how far you have read an Agent thread",
60
+ description: MARKING,
61
+ tags: [OPENAPI_TAGS.agentThreads.name],
62
+ operationId: "markAgentThreadRead",
63
+ security: SIXB_SESSION_MUTATION_SECURITY_REQUIREMENT,
64
+ },
65
+ }
66
+ )
67
+ }