@sixb/server 0.2.3 → 0.2.5

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 (45) hide show
  1. package/dist/index.js +354 -30
  2. package/dist/index.js.map +12 -12
  3. package/dist/live/room.d.ts +2 -0
  4. package/dist/live/room.d.ts.map +1 -1
  5. package/dist/routes/agent-runners.d.ts +5 -1
  6. package/dist/routes/agent-runners.d.ts.map +1 -1
  7. package/dist/routes/agents.d.ts +898 -6
  8. package/dist/routes/agents.d.ts.map +1 -1
  9. package/dist/routes/artifact-frames.d.ts +3 -3
  10. package/dist/routes/artifact-frames.d.ts.map +1 -1
  11. package/dist/routes/artifacts.d.ts +287 -21
  12. package/dist/routes/artifacts.d.ts.map +1 -1
  13. package/dist/routes/auth.d.ts +7 -7
  14. package/dist/routes/events.d.ts +4 -4
  15. package/dist/routes/links.d.ts +8 -0
  16. package/dist/routes/links.d.ts.map +1 -1
  17. package/dist/routes/objects.d.ts +8 -0
  18. package/dist/routes/objects.d.ts.map +1 -1
  19. package/dist/routes/projections.d.ts +2 -0
  20. package/dist/routes/projections.d.ts.map +1 -1
  21. package/dist/routes/ws/events.d.ts +6 -6
  22. package/dist/schemas/agents.d.ts +5089 -250
  23. package/dist/schemas/agents.d.ts.map +1 -1
  24. package/dist/schemas/artifacts.d.ts +676 -36
  25. package/dist/schemas/artifacts.d.ts.map +1 -1
  26. package/dist/schemas/auth.d.ts +8 -8
  27. package/dist/schemas/events.d.ts +36 -24
  28. package/dist/schemas/events.d.ts.map +1 -1
  29. package/dist/schemas/lineage.d.ts +112 -0
  30. package/dist/schemas/lineage.d.ts.map +1 -1
  31. package/dist/schemas/projections.d.ts +11 -0
  32. package/dist/schemas/projections.d.ts.map +1 -1
  33. package/dist/server.d.ts.map +1 -1
  34. package/package.json +4 -4
  35. package/src/live/README.md +9 -6
  36. package/src/live/room.ts +16 -8
  37. package/src/routes/agent-runners.ts +15 -4
  38. package/src/routes/agents.ts +203 -5
  39. package/src/routes/artifact-frames.ts +22 -9
  40. package/src/routes/artifacts.ts +124 -3
  41. package/src/schemas/agents.ts +68 -2
  42. package/src/schemas/artifacts.ts +66 -1
  43. package/src/schemas/events.ts +1 -0
  44. package/src/schemas/projections.ts +1 -0
  45. package/src/server.ts +3 -1
@@ -1,9 +1,9 @@
1
1
  import { type AgentRequestErrorCode, type AgentRunView, type AgentThreadView, type SixbHostView } from "@sixb/core";
2
- import { type AgentBackgroundCommandRef, type AgentStorage, type AgentThreadRecord, type Principal } from "@sixb/core/storage";
2
+ import { type AgentBackgroundCommandRef, type AgentInboxItemRecord, type AgentStorage, type AgentThreadRecord, type Principal } from "@sixb/core/storage";
3
3
  import type { Elysia } from "elysia";
4
4
  import { z } from "zod";
5
5
  import { requireRequestSixb } from "../auth/scope";
6
- import { AgentMessagesQuerySchema, AgentRunSchema, AgentThreadSchema } from "../schemas/agents";
6
+ import { AgentInboxItemSchema, AgentMessagesQuerySchema, AgentRunSchema, AgentThreadSchema } from "../schemas/agents";
7
7
  import { handleRouteError } from "../utils/http";
8
8
  /**
9
9
  * Threads as the API returns them to `viewer`, their owner and participants named by their
@@ -13,6 +13,7 @@ export declare function serializeThreads(host: SixbHostView, threads: readonly A
13
13
  export declare function serializeThread(host: SixbHostView, thread: AgentThreadView, viewer: Principal): Promise<ReturnType<typeof AgentThreadSchema.parse>>;
14
14
  /** Whether a reported background command is the one `ref` names: by its start, as ids repeat. */
15
15
  export declare function sameBackgroundCommand(command: AgentBackgroundCommandRef, ref: AgentBackgroundCommandRef): boolean;
16
+ export declare function serializeAgentInboxItem(item: AgentInboxItemRecord): ReturnType<typeof AgentInboxItemSchema.parse>;
16
17
  export declare function serializeAgentRun(run: AgentRunView): ReturnType<typeof AgentRunSchema.parse>;
17
18
  export declare function handleAgentRouteError(error: unknown, set: {
18
19
  status?: number | string;
@@ -1154,6 +1155,116 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1154
1155
  };
1155
1156
  };
1156
1157
  };
1158
+ } & {
1159
+ api: {
1160
+ "agent-threads": {
1161
+ ":threadId": {
1162
+ sandbox: {
1163
+ restore: {
1164
+ post: {
1165
+ body: {
1166
+ expectedSandboxName: string;
1167
+ };
1168
+ params: {
1169
+ threadId: string;
1170
+ };
1171
+ query: unknown;
1172
+ headers: unknown;
1173
+ response: {
1174
+ 200: {
1175
+ status: "active" | "archived";
1176
+ projectId: string;
1177
+ id: string;
1178
+ kind: "conversation" | "subagent";
1179
+ createdAt: string;
1180
+ ownerPrincipal: {
1181
+ id: string;
1182
+ type: "user" | "serviceAccount" | "system";
1183
+ };
1184
+ owner: {
1185
+ id: string;
1186
+ type: "user" | "serviceAccount" | "system";
1187
+ displayName?: string | undefined;
1188
+ };
1189
+ participants: {
1190
+ principal: {
1191
+ id: string;
1192
+ type: "user";
1193
+ displayName?: string | undefined;
1194
+ };
1195
+ addedAt: string;
1196
+ addedBy: {
1197
+ id: string;
1198
+ type: "user" | "serviceAccount" | "system";
1199
+ };
1200
+ }[];
1201
+ activeRunId: string | null;
1202
+ messageCount: number;
1203
+ updatedAt: string;
1204
+ title?: string | undefined;
1205
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1206
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
1207
+ computer?: {
1208
+ id: string;
1209
+ name: string;
1210
+ folder: string;
1211
+ online: boolean;
1212
+ } | undefined;
1213
+ runsOn?: "computer" | undefined;
1214
+ sandboxState?: {
1215
+ status: "unavailable" | "new" | "busy" | "ready" | "blocked";
1216
+ name: string;
1217
+ initialized: boolean;
1218
+ } | undefined;
1219
+ parent?: {
1220
+ threadId: string;
1221
+ key: string;
1222
+ spawnedBy: string;
1223
+ } | undefined;
1224
+ sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
1225
+ backgroundCommands?: {
1226
+ status: "running" | "exited" | "stopped";
1227
+ id: string;
1228
+ startedAt: string;
1229
+ threadId: string;
1230
+ command: string;
1231
+ exitCode?: number | undefined;
1232
+ endedAt?: string | undefined;
1233
+ stopping?: boolean | undefined;
1234
+ }[] | undefined;
1235
+ movedAt?: string | undefined;
1236
+ lastMessageAt?: string | undefined;
1237
+ };
1238
+ 404: {
1239
+ error: string;
1240
+ };
1241
+ 403: {
1242
+ error: string;
1243
+ code?: string | undefined;
1244
+ };
1245
+ 409: {
1246
+ error: string;
1247
+ code?: string | undefined;
1248
+ };
1249
+ 400: {
1250
+ error: string;
1251
+ };
1252
+ 422: {
1253
+ type: "validation";
1254
+ on: string;
1255
+ summary?: string;
1256
+ message?: string;
1257
+ found?: unknown;
1258
+ property?: string;
1259
+ expected?: string;
1260
+ };
1261
+ };
1262
+ };
1263
+ };
1264
+ };
1265
+ };
1266
+ };
1267
+ };
1157
1268
  } & {
1158
1269
  api: {
1159
1270
  "agent-threads": {
@@ -1491,6 +1602,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1491
1602
  } | undefined;
1492
1603
  messageId?: string | undefined;
1493
1604
  continue?: true | undefined;
1605
+ delivery?: "auto" | "steer" | "queue" | "send_now" | undefined;
1494
1606
  };
1495
1607
  params: {
1496
1608
  threadId: string;
@@ -1499,7 +1611,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1499
1611
  headers: unknown;
1500
1612
  response: {
1501
1613
  200: {
1502
- run: {
1614
+ run?: {
1503
1615
  status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1504
1616
  projectId: string;
1505
1617
  id: string;
@@ -1560,10 +1672,169 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1560
1672
  severity: "error" | "warning";
1561
1673
  scope: "run";
1562
1674
  }[] | undefined;
1563
- };
1675
+ } | undefined;
1676
+ item?: {
1677
+ projectId: string;
1678
+ id: string;
1679
+ mode: "steer" | "queue";
1680
+ threadId: string;
1681
+ createdAt: string;
1682
+ parts: ({
1683
+ origin: "ambient" | "explicit";
1684
+ context: {
1685
+ kind: "object";
1686
+ ref: {
1687
+ objectTypeId: string;
1688
+ primaryId: string;
1689
+ };
1690
+ label?: string | undefined;
1691
+ } | {
1692
+ id: string;
1693
+ kind: "app-state";
1694
+ value: import("../schemas/common").JsonValue;
1695
+ description: string;
1696
+ label: string;
1697
+ };
1698
+ type: "context";
1699
+ } | {
1700
+ type: "text";
1701
+ text: string;
1702
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1703
+ } | {
1704
+ type: "reasoning";
1705
+ text: string;
1706
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1707
+ } | {
1708
+ type: "step-start";
1709
+ } | {
1710
+ type: "file";
1711
+ fileRef: {
1712
+ blobId: string;
1713
+ digest: string;
1714
+ sizeBytes: number;
1715
+ fileName?: string | undefined;
1716
+ mediaType?: string | undefined;
1717
+ logicalPath?: string | undefined;
1718
+ };
1719
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1720
+ } | {
1721
+ type: "provider-state";
1722
+ providerId: string;
1723
+ data: import("../schemas/common").JsonValue;
1724
+ } | {
1725
+ type: "tool-call";
1726
+ input: import("../schemas/common").JsonValue;
1727
+ output: import("../schemas/common").JsonValue;
1728
+ toolCallId: string;
1729
+ toolName: string;
1730
+ state: "output-available";
1731
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1732
+ dynamic?: boolean | undefined;
1733
+ providerExecuted?: boolean | undefined;
1734
+ outputFile?: {
1735
+ path: string;
1736
+ fileRef: {
1737
+ blobId: string;
1738
+ digest: string;
1739
+ sizeBytes: number;
1740
+ fileName?: string | undefined;
1741
+ mediaType?: string | undefined;
1742
+ logicalPath?: string | undefined;
1743
+ };
1744
+ } | undefined;
1745
+ } | {
1746
+ type: "tool-call";
1747
+ input: import("../schemas/common").JsonValue;
1748
+ toolCallId: string;
1749
+ toolName: string;
1750
+ state: "output-error";
1751
+ errorText: string;
1752
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1753
+ dynamic?: boolean | undefined;
1754
+ providerExecuted?: boolean | undefined;
1755
+ } | {
1756
+ type: "continuation";
1757
+ } | {
1758
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
1759
+ type: "approval-outcome";
1760
+ call: {
1761
+ kind: "action";
1762
+ actionId: string;
1763
+ subject: {
1764
+ kind: "none";
1765
+ } | {
1766
+ kind: "object";
1767
+ objectTypeId: string;
1768
+ primaryId: string;
1769
+ };
1770
+ } | {
1771
+ kind: "workflow";
1772
+ workflowId: string;
1773
+ };
1774
+ approvalId: string;
1775
+ caller?: {
1776
+ runId: string;
1777
+ key: string;
1778
+ continues?: true | undefined;
1779
+ } | undefined;
1780
+ outcome?: {
1781
+ status: "succeeded" | "failed";
1782
+ kind: "action-run";
1783
+ runId: string;
1784
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
1785
+ } | {
1786
+ kind: "workflow-run";
1787
+ runId: string;
1788
+ queuedAt: string;
1789
+ } | {
1790
+ error: {
1791
+ at: string;
1792
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
1793
+ message: string;
1794
+ retryable: boolean;
1795
+ details?: import("../schemas/common").JsonValue | undefined;
1796
+ httpStatus?: number | undefined;
1797
+ redacted?: true | undefined;
1798
+ truncated?: true | undefined;
1799
+ };
1800
+ kind: "error";
1801
+ } | undefined;
1802
+ } | {
1803
+ id: string;
1804
+ kind: "message" | "answer";
1805
+ type: "mail";
1806
+ text: string;
1807
+ from: "parent";
1808
+ inReplyTo?: string | undefined;
1809
+ afterAnswer?: true | undefined;
1810
+ })[];
1811
+ messageId: string;
1812
+ updatedAt: string;
1813
+ authorPrincipal: {
1814
+ id: string;
1815
+ type: "user" | "serviceAccount" | "system";
1816
+ };
1817
+ seq: number;
1818
+ locale?: string | undefined;
1819
+ timeZone?: string | undefined;
1820
+ spec?: {
1821
+ model?: {
1822
+ modelId: string;
1823
+ provider: string;
1824
+ } | undefined;
1825
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1826
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
1827
+ budgetTokens: number;
1828
+ } | undefined;
1829
+ } | undefined;
1830
+ immediate?: boolean | undefined;
1831
+ } | undefined;
1564
1832
  } | {
1565
1833
  readonly error: string;
1566
1834
  readonly code: AgentRequestErrorCode;
1835
+ } | {
1836
+ readonly error: string;
1837
+ readonly code: "invalid_state" | "inbox_limit";
1567
1838
  } | {
1568
1839
  error: string;
1569
1840
  };
@@ -1591,7 +1862,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1591
1862
  error: string;
1592
1863
  };
1593
1864
  202: {
1594
- run: {
1865
+ run?: {
1595
1866
  status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1596
1867
  projectId: string;
1597
1868
  id: string;
@@ -1652,7 +1923,163 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1652
1923
  severity: "error" | "warning";
1653
1924
  scope: "run";
1654
1925
  }[] | undefined;
1655
- };
1926
+ } | undefined;
1927
+ item?: {
1928
+ projectId: string;
1929
+ id: string;
1930
+ mode: "steer" | "queue";
1931
+ threadId: string;
1932
+ createdAt: string;
1933
+ parts: ({
1934
+ origin: "ambient" | "explicit";
1935
+ context: {
1936
+ kind: "object";
1937
+ ref: {
1938
+ objectTypeId: string;
1939
+ primaryId: string;
1940
+ };
1941
+ label?: string | undefined;
1942
+ } | {
1943
+ id: string;
1944
+ kind: "app-state";
1945
+ value: import("../schemas/common").JsonValue;
1946
+ description: string;
1947
+ label: string;
1948
+ };
1949
+ type: "context";
1950
+ } | {
1951
+ type: "text";
1952
+ text: string;
1953
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1954
+ } | {
1955
+ type: "reasoning";
1956
+ text: string;
1957
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1958
+ } | {
1959
+ type: "step-start";
1960
+ } | {
1961
+ type: "file";
1962
+ fileRef: {
1963
+ blobId: string;
1964
+ digest: string;
1965
+ sizeBytes: number;
1966
+ fileName?: string | undefined;
1967
+ mediaType?: string | undefined;
1968
+ logicalPath?: string | undefined;
1969
+ };
1970
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1971
+ } | {
1972
+ type: "provider-state";
1973
+ providerId: string;
1974
+ data: import("../schemas/common").JsonValue;
1975
+ } | {
1976
+ type: "tool-call";
1977
+ input: import("../schemas/common").JsonValue;
1978
+ output: import("../schemas/common").JsonValue;
1979
+ toolCallId: string;
1980
+ toolName: string;
1981
+ state: "output-available";
1982
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1983
+ dynamic?: boolean | undefined;
1984
+ providerExecuted?: boolean | undefined;
1985
+ outputFile?: {
1986
+ path: string;
1987
+ fileRef: {
1988
+ blobId: string;
1989
+ digest: string;
1990
+ sizeBytes: number;
1991
+ fileName?: string | undefined;
1992
+ mediaType?: string | undefined;
1993
+ logicalPath?: string | undefined;
1994
+ };
1995
+ } | undefined;
1996
+ } | {
1997
+ type: "tool-call";
1998
+ input: import("../schemas/common").JsonValue;
1999
+ toolCallId: string;
2000
+ toolName: string;
2001
+ state: "output-error";
2002
+ errorText: string;
2003
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2004
+ dynamic?: boolean | undefined;
2005
+ providerExecuted?: boolean | undefined;
2006
+ } | {
2007
+ type: "continuation";
2008
+ } | {
2009
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2010
+ type: "approval-outcome";
2011
+ call: {
2012
+ kind: "action";
2013
+ actionId: string;
2014
+ subject: {
2015
+ kind: "none";
2016
+ } | {
2017
+ kind: "object";
2018
+ objectTypeId: string;
2019
+ primaryId: string;
2020
+ };
2021
+ } | {
2022
+ kind: "workflow";
2023
+ workflowId: string;
2024
+ };
2025
+ approvalId: string;
2026
+ caller?: {
2027
+ runId: string;
2028
+ key: string;
2029
+ continues?: true | undefined;
2030
+ } | undefined;
2031
+ outcome?: {
2032
+ status: "succeeded" | "failed";
2033
+ kind: "action-run";
2034
+ runId: string;
2035
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2036
+ } | {
2037
+ kind: "workflow-run";
2038
+ runId: string;
2039
+ queuedAt: string;
2040
+ } | {
2041
+ error: {
2042
+ at: string;
2043
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
2044
+ message: string;
2045
+ retryable: boolean;
2046
+ details?: import("../schemas/common").JsonValue | undefined;
2047
+ httpStatus?: number | undefined;
2048
+ redacted?: true | undefined;
2049
+ truncated?: true | undefined;
2050
+ };
2051
+ kind: "error";
2052
+ } | undefined;
2053
+ } | {
2054
+ id: string;
2055
+ kind: "message" | "answer";
2056
+ type: "mail";
2057
+ text: string;
2058
+ from: "parent";
2059
+ inReplyTo?: string | undefined;
2060
+ afterAnswer?: true | undefined;
2061
+ })[];
2062
+ messageId: string;
2063
+ updatedAt: string;
2064
+ authorPrincipal: {
2065
+ id: string;
2066
+ type: "user" | "serviceAccount" | "system";
2067
+ };
2068
+ seq: number;
2069
+ locale?: string | undefined;
2070
+ timeZone?: string | undefined;
2071
+ spec?: {
2072
+ model?: {
2073
+ modelId: string;
2074
+ provider: string;
2075
+ } | undefined;
2076
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2077
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2078
+ budgetTokens: number;
2079
+ } | undefined;
2080
+ } | undefined;
2081
+ immediate?: boolean | undefined;
2082
+ } | undefined;
1656
2083
  };
1657
2084
  422: {
1658
2085
  type: "validation";
@@ -1669,6 +2096,471 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1669
2096
  };
1670
2097
  };
1671
2098
  };
2099
+ } & {
2100
+ api: {
2101
+ "agent-threads": {
2102
+ ":threadId": {
2103
+ inbox: {
2104
+ get: {
2105
+ body: unknown;
2106
+ params: {
2107
+ threadId: string;
2108
+ };
2109
+ query: unknown;
2110
+ headers: unknown;
2111
+ response: {
2112
+ 200: {
2113
+ items: {
2114
+ projectId: string;
2115
+ id: string;
2116
+ mode: "steer" | "queue";
2117
+ threadId: string;
2118
+ createdAt: string;
2119
+ parts: ({
2120
+ origin: "ambient" | "explicit";
2121
+ context: {
2122
+ kind: "object";
2123
+ ref: {
2124
+ objectTypeId: string;
2125
+ primaryId: string;
2126
+ };
2127
+ label?: string | undefined;
2128
+ } | {
2129
+ id: string;
2130
+ kind: "app-state";
2131
+ value: import("../schemas/common").JsonValue;
2132
+ description: string;
2133
+ label: string;
2134
+ };
2135
+ type: "context";
2136
+ } | {
2137
+ type: "text";
2138
+ text: string;
2139
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2140
+ } | {
2141
+ type: "reasoning";
2142
+ text: string;
2143
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2144
+ } | {
2145
+ type: "step-start";
2146
+ } | {
2147
+ type: "file";
2148
+ fileRef: {
2149
+ blobId: string;
2150
+ digest: string;
2151
+ sizeBytes: number;
2152
+ fileName?: string | undefined;
2153
+ mediaType?: string | undefined;
2154
+ logicalPath?: string | undefined;
2155
+ };
2156
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2157
+ } | {
2158
+ type: "provider-state";
2159
+ providerId: string;
2160
+ data: import("../schemas/common").JsonValue;
2161
+ } | {
2162
+ type: "tool-call";
2163
+ input: import("../schemas/common").JsonValue;
2164
+ output: import("../schemas/common").JsonValue;
2165
+ toolCallId: string;
2166
+ toolName: string;
2167
+ state: "output-available";
2168
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2169
+ dynamic?: boolean | undefined;
2170
+ providerExecuted?: boolean | undefined;
2171
+ outputFile?: {
2172
+ path: string;
2173
+ fileRef: {
2174
+ blobId: string;
2175
+ digest: string;
2176
+ sizeBytes: number;
2177
+ fileName?: string | undefined;
2178
+ mediaType?: string | undefined;
2179
+ logicalPath?: string | undefined;
2180
+ };
2181
+ } | undefined;
2182
+ } | {
2183
+ type: "tool-call";
2184
+ input: import("../schemas/common").JsonValue;
2185
+ toolCallId: string;
2186
+ toolName: string;
2187
+ state: "output-error";
2188
+ errorText: string;
2189
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2190
+ dynamic?: boolean | undefined;
2191
+ providerExecuted?: boolean | undefined;
2192
+ } | {
2193
+ type: "continuation";
2194
+ } | {
2195
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2196
+ type: "approval-outcome";
2197
+ call: {
2198
+ kind: "action";
2199
+ actionId: string;
2200
+ subject: {
2201
+ kind: "none";
2202
+ } | {
2203
+ kind: "object";
2204
+ objectTypeId: string;
2205
+ primaryId: string;
2206
+ };
2207
+ } | {
2208
+ kind: "workflow";
2209
+ workflowId: string;
2210
+ };
2211
+ approvalId: string;
2212
+ caller?: {
2213
+ runId: string;
2214
+ key: string;
2215
+ continues?: true | undefined;
2216
+ } | undefined;
2217
+ outcome?: {
2218
+ status: "succeeded" | "failed";
2219
+ kind: "action-run";
2220
+ runId: string;
2221
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2222
+ } | {
2223
+ kind: "workflow-run";
2224
+ runId: string;
2225
+ queuedAt: string;
2226
+ } | {
2227
+ error: {
2228
+ at: string;
2229
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
2230
+ message: string;
2231
+ retryable: boolean;
2232
+ details?: import("../schemas/common").JsonValue | undefined;
2233
+ httpStatus?: number | undefined;
2234
+ redacted?: true | undefined;
2235
+ truncated?: true | undefined;
2236
+ };
2237
+ kind: "error";
2238
+ } | undefined;
2239
+ } | {
2240
+ id: string;
2241
+ kind: "message" | "answer";
2242
+ type: "mail";
2243
+ text: string;
2244
+ from: "parent";
2245
+ inReplyTo?: string | undefined;
2246
+ afterAnswer?: true | undefined;
2247
+ })[];
2248
+ messageId: string;
2249
+ updatedAt: string;
2250
+ authorPrincipal: {
2251
+ id: string;
2252
+ type: "user" | "serviceAccount" | "system";
2253
+ };
2254
+ seq: number;
2255
+ locale?: string | undefined;
2256
+ timeZone?: string | undefined;
2257
+ spec?: {
2258
+ model?: {
2259
+ modelId: string;
2260
+ provider: string;
2261
+ } | undefined;
2262
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2263
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2264
+ budgetTokens: number;
2265
+ } | undefined;
2266
+ } | undefined;
2267
+ immediate?: boolean | undefined;
2268
+ }[];
2269
+ };
2270
+ 404: {
2271
+ error: string;
2272
+ };
2273
+ 400: {
2274
+ error: string;
2275
+ code?: string | undefined;
2276
+ };
2277
+ 501: {
2278
+ error: string;
2279
+ };
2280
+ 422: {
2281
+ type: "validation";
2282
+ on: string;
2283
+ summary?: string;
2284
+ message?: string;
2285
+ found?: unknown;
2286
+ property?: string;
2287
+ expected?: string;
2288
+ };
2289
+ };
2290
+ };
2291
+ };
2292
+ };
2293
+ };
2294
+ };
2295
+ } & {
2296
+ api: {
2297
+ "agent-threads": {
2298
+ ":threadId": {
2299
+ inbox: {
2300
+ ":itemId": {
2301
+ patch: {
2302
+ body: {
2303
+ model?: {
2304
+ modelId: string;
2305
+ provider: string;
2306
+ } | undefined;
2307
+ text?: string | undefined;
2308
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2309
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2310
+ budgetTokens: number;
2311
+ } | undefined;
2312
+ delivery?: "steer" | "queue" | undefined;
2313
+ immediate?: true | undefined;
2314
+ };
2315
+ params: {
2316
+ threadId: string;
2317
+ itemId: string;
2318
+ };
2319
+ query: unknown;
2320
+ headers: unknown;
2321
+ response: {
2322
+ 200: {
2323
+ item: {
2324
+ projectId: string;
2325
+ id: string;
2326
+ mode: "steer" | "queue";
2327
+ threadId: string;
2328
+ createdAt: string;
2329
+ parts: ({
2330
+ origin: "ambient" | "explicit";
2331
+ context: {
2332
+ kind: "object";
2333
+ ref: {
2334
+ objectTypeId: string;
2335
+ primaryId: string;
2336
+ };
2337
+ label?: string | undefined;
2338
+ } | {
2339
+ id: string;
2340
+ kind: "app-state";
2341
+ value: import("../schemas/common").JsonValue;
2342
+ description: string;
2343
+ label: string;
2344
+ };
2345
+ type: "context";
2346
+ } | {
2347
+ type: "text";
2348
+ text: string;
2349
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2350
+ } | {
2351
+ type: "reasoning";
2352
+ text: string;
2353
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2354
+ } | {
2355
+ type: "step-start";
2356
+ } | {
2357
+ type: "file";
2358
+ fileRef: {
2359
+ blobId: string;
2360
+ digest: string;
2361
+ sizeBytes: number;
2362
+ fileName?: string | undefined;
2363
+ mediaType?: string | undefined;
2364
+ logicalPath?: string | undefined;
2365
+ };
2366
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2367
+ } | {
2368
+ type: "provider-state";
2369
+ providerId: string;
2370
+ data: import("../schemas/common").JsonValue;
2371
+ } | {
2372
+ type: "tool-call";
2373
+ input: import("../schemas/common").JsonValue;
2374
+ output: import("../schemas/common").JsonValue;
2375
+ toolCallId: string;
2376
+ toolName: string;
2377
+ state: "output-available";
2378
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2379
+ dynamic?: boolean | undefined;
2380
+ providerExecuted?: boolean | undefined;
2381
+ outputFile?: {
2382
+ path: string;
2383
+ fileRef: {
2384
+ blobId: string;
2385
+ digest: string;
2386
+ sizeBytes: number;
2387
+ fileName?: string | undefined;
2388
+ mediaType?: string | undefined;
2389
+ logicalPath?: string | undefined;
2390
+ };
2391
+ } | undefined;
2392
+ } | {
2393
+ type: "tool-call";
2394
+ input: import("../schemas/common").JsonValue;
2395
+ toolCallId: string;
2396
+ toolName: string;
2397
+ state: "output-error";
2398
+ errorText: string;
2399
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2400
+ dynamic?: boolean | undefined;
2401
+ providerExecuted?: boolean | undefined;
2402
+ } | {
2403
+ type: "continuation";
2404
+ } | {
2405
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2406
+ type: "approval-outcome";
2407
+ call: {
2408
+ kind: "action";
2409
+ actionId: string;
2410
+ subject: {
2411
+ kind: "none";
2412
+ } | {
2413
+ kind: "object";
2414
+ objectTypeId: string;
2415
+ primaryId: string;
2416
+ };
2417
+ } | {
2418
+ kind: "workflow";
2419
+ workflowId: string;
2420
+ };
2421
+ approvalId: string;
2422
+ caller?: {
2423
+ runId: string;
2424
+ key: string;
2425
+ continues?: true | undefined;
2426
+ } | undefined;
2427
+ outcome?: {
2428
+ status: "succeeded" | "failed";
2429
+ kind: "action-run";
2430
+ runId: string;
2431
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2432
+ } | {
2433
+ kind: "workflow-run";
2434
+ runId: string;
2435
+ queuedAt: string;
2436
+ } | {
2437
+ error: {
2438
+ at: string;
2439
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
2440
+ message: string;
2441
+ retryable: boolean;
2442
+ details?: import("../schemas/common").JsonValue | undefined;
2443
+ httpStatus?: number | undefined;
2444
+ redacted?: true | undefined;
2445
+ truncated?: true | undefined;
2446
+ };
2447
+ kind: "error";
2448
+ } | undefined;
2449
+ } | {
2450
+ id: string;
2451
+ kind: "message" | "answer";
2452
+ type: "mail";
2453
+ text: string;
2454
+ from: "parent";
2455
+ inReplyTo?: string | undefined;
2456
+ afterAnswer?: true | undefined;
2457
+ })[];
2458
+ messageId: string;
2459
+ updatedAt: string;
2460
+ authorPrincipal: {
2461
+ id: string;
2462
+ type: "user" | "serviceAccount" | "system";
2463
+ };
2464
+ seq: number;
2465
+ locale?: string | undefined;
2466
+ timeZone?: string | undefined;
2467
+ spec?: {
2468
+ model?: {
2469
+ modelId: string;
2470
+ provider: string;
2471
+ } | undefined;
2472
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2473
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2474
+ budgetTokens: number;
2475
+ } | undefined;
2476
+ } | undefined;
2477
+ immediate?: boolean | undefined;
2478
+ };
2479
+ };
2480
+ 404: {
2481
+ error: string;
2482
+ };
2483
+ 403: {
2484
+ error: string;
2485
+ code?: string | undefined;
2486
+ };
2487
+ 409: {
2488
+ error: string;
2489
+ code?: string | undefined;
2490
+ };
2491
+ 400: {
2492
+ error: string;
2493
+ code?: string | undefined;
2494
+ };
2495
+ 501: {
2496
+ error: string;
2497
+ };
2498
+ 422: {
2499
+ type: "validation";
2500
+ on: string;
2501
+ summary?: string;
2502
+ message?: string;
2503
+ found?: unknown;
2504
+ property?: string;
2505
+ expected?: string;
2506
+ };
2507
+ };
2508
+ };
2509
+ };
2510
+ };
2511
+ };
2512
+ };
2513
+ };
2514
+ } & {
2515
+ api: {
2516
+ "agent-threads": {
2517
+ ":threadId": {
2518
+ inbox: {
2519
+ ":itemId": {
2520
+ delete: {
2521
+ body: unknown;
2522
+ params: {
2523
+ threadId: string;
2524
+ itemId: string;
2525
+ };
2526
+ query: unknown;
2527
+ headers: unknown;
2528
+ response: {
2529
+ 404: {
2530
+ error: string;
2531
+ };
2532
+ 403: {
2533
+ error: string;
2534
+ code?: string | undefined;
2535
+ };
2536
+ 409: {
2537
+ error: string;
2538
+ code?: string | undefined;
2539
+ };
2540
+ 400: {
2541
+ error: string;
2542
+ code?: string | undefined;
2543
+ };
2544
+ 501: {
2545
+ error: string;
2546
+ };
2547
+ 204: void;
2548
+ 422: {
2549
+ type: "validation";
2550
+ on: string;
2551
+ summary?: string;
2552
+ message?: string;
2553
+ found?: unknown;
2554
+ property?: string;
2555
+ expected?: string;
2556
+ };
2557
+ };
2558
+ };
2559
+ };
2560
+ };
2561
+ };
2562
+ };
2563
+ };
1672
2564
  } & {
1673
2565
  api: {
1674
2566
  "agent-threads": {