@sixb/server 0.2.1 → 0.2.3

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 (153) hide show
  1. package/README.md +3 -3
  2. package/dist/artifacts/frame.d.ts.map +1 -1
  3. package/dist/auth/scope.d.ts +3 -0
  4. package/dist/auth/scope.d.ts.map +1 -1
  5. package/dist/auth/shared-access.d.ts +23 -0
  6. package/dist/auth/shared-access.d.ts.map +1 -1
  7. package/dist/connectors/http.d.ts +6 -1
  8. package/dist/connectors/http.d.ts.map +1 -1
  9. package/dist/index.js +2876 -667
  10. package/dist/index.js.map +43 -36
  11. package/dist/live/awareness.d.ts +48 -0
  12. package/dist/live/awareness.d.ts.map +1 -0
  13. package/dist/live/room.d.ts +198 -0
  14. package/dist/live/room.d.ts.map +1 -0
  15. package/dist/live/rooms.d.ts +67 -0
  16. package/dist/live/rooms.d.ts.map +1 -0
  17. package/dist/registerRoutes.d.ts.map +1 -1
  18. package/dist/routes/actions.d.ts +3 -3
  19. package/dist/routes/agent-approvals.d.ts +21 -11
  20. package/dist/routes/agent-approvals.d.ts.map +1 -1
  21. package/dist/routes/agent-children.d.ts +4 -4
  22. package/dist/routes/agent-computers.d.ts +146 -1
  23. package/dist/routes/agent-computers.d.ts.map +1 -1
  24. package/dist/routes/agent-runners.d.ts.map +1 -1
  25. package/dist/routes/agents.d.ts +152 -60
  26. package/dist/routes/agents.d.ts.map +1 -1
  27. package/dist/routes/artifact-frames.d.ts +2 -1
  28. package/dist/routes/artifact-frames.d.ts.map +1 -1
  29. package/dist/routes/artifacts.d.ts +1713 -178
  30. package/dist/routes/artifacts.d.ts.map +1 -1
  31. package/dist/routes/auth.d.ts +21 -21
  32. package/dist/routes/connector-connection-runs.d.ts +124 -5
  33. package/dist/routes/connector-connection-runs.d.ts.map +1 -1
  34. package/dist/routes/connector-connections.d.ts +9 -1
  35. package/dist/routes/connector-connections.d.ts.map +1 -1
  36. package/dist/routes/datasets.d.ts +5 -5
  37. package/dist/routes/events.d.ts +4 -4
  38. package/dist/routes/lake.d.ts +91 -0
  39. package/dist/routes/lake.d.ts.map +1 -0
  40. package/dist/routes/links.d.ts +6 -6
  41. package/dist/routes/logs.d.ts +2 -2
  42. package/dist/routes/model-generations.d.ts +2 -2
  43. package/dist/routes/objects.d.ts +6 -6
  44. package/dist/routes/objects.d.ts.map +1 -1
  45. package/dist/routes/observed-agent-threads.d.ts +21 -11
  46. package/dist/routes/observed-agent-threads.d.ts.map +1 -1
  47. package/dist/routes/ontology.d.ts +6 -6
  48. package/dist/routes/pipelines.d.ts +13 -9
  49. package/dist/routes/pipelines.d.ts.map +1 -1
  50. package/dist/routes/projections.d.ts +27 -27
  51. package/dist/routes/share-grants.d.ts +9 -9
  52. package/dist/routes/shared-access.d.ts +57 -2
  53. package/dist/routes/shared-access.d.ts.map +1 -1
  54. package/dist/routes/status.d.ts +11 -15
  55. package/dist/routes/status.d.ts.map +1 -1
  56. package/dist/routes/syncs.d.ts +9 -6
  57. package/dist/routes/syncs.d.ts.map +1 -1
  58. package/dist/routes/telemetry.d.ts +7 -7
  59. package/dist/routes/webhooks.d.ts.map +1 -1
  60. package/dist/routes/workflows.d.ts +14 -14
  61. package/dist/routes/ws/artifacts.d.ts +57 -0
  62. package/dist/routes/ws/artifacts.d.ts.map +1 -0
  63. package/dist/routes/ws/events.d.ts +8 -7
  64. package/dist/routes/ws/events.d.ts.map +1 -1
  65. package/dist/routes/ws/index.d.ts +2 -1
  66. package/dist/routes/ws/index.d.ts.map +1 -1
  67. package/dist/routes/ws/logs.d.ts +10 -10
  68. package/dist/routes/ws/shared-sockets.d.ts +52 -0
  69. package/dist/routes/ws/shared-sockets.d.ts.map +1 -0
  70. package/dist/schemas/actions.d.ts +7 -7
  71. package/dist/schemas/activity.d.ts +16 -16
  72. package/dist/schemas/agent-approvals.d.ts +27 -27
  73. package/dist/schemas/agents.d.ts +642 -196
  74. package/dist/schemas/agents.d.ts.map +1 -1
  75. package/dist/schemas/ai-accounting.d.ts +41 -41
  76. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  77. package/dist/schemas/artifacts.d.ts +2106 -127
  78. package/dist/schemas/artifacts.d.ts.map +1 -1
  79. package/dist/schemas/auth.d.ts +63 -63
  80. package/dist/schemas/connectors.d.ts +180 -20
  81. package/dist/schemas/connectors.d.ts.map +1 -1
  82. package/dist/schemas/datasets.d.ts +44 -44
  83. package/dist/schemas/event-payloads.d.ts +2 -2
  84. package/dist/schemas/events.d.ts +26 -26
  85. package/dist/schemas/events.d.ts.map +1 -1
  86. package/dist/schemas/files.d.ts +12 -0
  87. package/dist/schemas/files.d.ts.map +1 -1
  88. package/dist/schemas/lake.d.ts +251 -0
  89. package/dist/schemas/lake.d.ts.map +1 -0
  90. package/dist/schemas/lineage.d.ts +56 -56
  91. package/dist/schemas/logs.d.ts +18 -18
  92. package/dist/schemas/models.d.ts +4 -4
  93. package/dist/schemas/objects.d.ts.map +1 -1
  94. package/dist/schemas/ontology.d.ts +14 -14
  95. package/dist/schemas/pipelines.d.ts +86 -64
  96. package/dist/schemas/pipelines.d.ts.map +1 -1
  97. package/dist/schemas/projections.d.ts +160 -160
  98. package/dist/schemas/projections.d.ts.map +1 -1
  99. package/dist/schemas/share-grants.d.ts +30 -30
  100. package/dist/schemas/shared-access.d.ts +17 -4
  101. package/dist/schemas/shared-access.d.ts.map +1 -1
  102. package/dist/schemas/status.d.ts +59 -79
  103. package/dist/schemas/status.d.ts.map +1 -1
  104. package/dist/schemas/syncs.d.ts +38 -22
  105. package/dist/schemas/syncs.d.ts.map +1 -1
  106. package/dist/schemas/telemetry.d.ts +26 -26
  107. package/dist/schemas/workflows.d.ts +71 -71
  108. package/dist/server.d.ts +13 -0
  109. package/dist/server.d.ts.map +1 -1
  110. package/dist/utils/ws.d.ts +3 -0
  111. package/dist/utils/ws.d.ts.map +1 -1
  112. package/package.json +11 -7
  113. package/src/artifacts/frame.ts +4 -13
  114. package/src/auth/scope.ts +10 -1
  115. package/src/auth/shared-access.ts +108 -12
  116. package/src/connectors/http.ts +35 -1
  117. package/src/live/README.md +136 -0
  118. package/src/live/awareness.ts +141 -0
  119. package/src/live/room.ts +933 -0
  120. package/src/live/rooms.ts +288 -0
  121. package/src/registerRoutes.ts +2 -0
  122. package/src/routes/agent-computers.ts +208 -14
  123. package/src/routes/agent-runners.ts +1 -0
  124. package/src/routes/agents.ts +52 -7
  125. package/src/routes/artifact-frames.ts +40 -12
  126. package/src/routes/artifacts.ts +713 -28
  127. package/src/routes/connector-connection-runs.ts +7 -12
  128. package/src/routes/connector-connections.ts +10 -7
  129. package/src/routes/lake.ts +73 -0
  130. package/src/routes/objects.ts +3 -9
  131. package/src/routes/pipelines.ts +1 -0
  132. package/src/routes/shared-access.ts +53 -1
  133. package/src/routes/status.ts +9 -4
  134. package/src/routes/syncs.ts +1 -0
  135. package/src/routes/webhooks.ts +44 -3
  136. package/src/routes/ws/artifacts.ts +138 -0
  137. package/src/routes/ws/events.ts +7 -2
  138. package/src/routes/ws/index.ts +13 -2
  139. package/src/routes/ws/shared-sockets.ts +152 -0
  140. package/src/schemas/agents.ts +71 -1
  141. package/src/schemas/ai-accounting.ts +1 -0
  142. package/src/schemas/artifacts.ts +255 -18
  143. package/src/schemas/connectors.ts +17 -2
  144. package/src/schemas/files.ts +12 -0
  145. package/src/schemas/lake.ts +53 -0
  146. package/src/schemas/objects.ts +1 -0
  147. package/src/schemas/pipelines.ts +2 -0
  148. package/src/schemas/projections.ts +2 -2
  149. package/src/schemas/shared-access.ts +16 -0
  150. package/src/schemas/status.ts +16 -22
  151. package/src/schemas/syncs.ts +2 -0
  152. package/src/server.ts +35 -4
  153. package/src/utils/ws.ts +7 -0
@@ -0,0 +1,48 @@
1
+ import { type ArtifactLiveUser } from "@sixb/core/artifacts/live";
2
+ import type { Storage } from "@sixb/core/storage";
3
+ /** The most awareness clients one connection may speak for: a browser tab holds one. */
4
+ export declare const MAX_AWARENESS_CLIENTS = 4;
5
+ /** The most a client's awareness state may weigh, as JSON. */
6
+ export declare const MAX_AWARENESS_STATE_BYTES: number;
7
+ /** What the project's own code, and everyone where nobody signs in, is called. */
8
+ export declare const PROJECT_NAME = "Project";
9
+ /**
10
+ * The name others see for someone: a member's profile name, else their email, and the project's
11
+ * for its own code. Null for anyone else, or a member the project no longer knows. Without
12
+ * `email`, for a reader outside the project such as a shared link's guest, a member who gave no
13
+ * name stays unnamed.
14
+ */
15
+ export declare function principalName(storage: Pick<Storage, "auth">, projectId: string, principal: {
16
+ readonly type: string;
17
+ readonly id: string;
18
+ }, options?: {
19
+ readonly email?: boolean;
20
+ }): Promise<string | null>;
21
+ /**
22
+ * Who a connection is: the member it signed in as, by their profile's name, or the service
23
+ * account or project code it runs as.
24
+ *
25
+ * Everyone in the room sees it, a shared link's guest included, and the server shares one state
26
+ * with all: so it is never an email, nor an id. Someone without a profile name has none, which the
27
+ * app names in the reader's language.
28
+ */
29
+ export declare function liveUserOf(storage: Pick<Storage, "auth">, projectId: string, principal: {
30
+ readonly type: string;
31
+ readonly id: string;
32
+ } | undefined): Promise<ArtifactLiveUser>;
33
+ /**
34
+ * Who a shared link's guest is: one per session, by the name they gave, or none yet, marked as a
35
+ * guest so nobody takes them for a member of the same name.
36
+ */
37
+ export declare function guestLiveUser(sessionId: string, name: string | undefined): ArtifactLiveUser;
38
+ /**
39
+ * An awareness update from a connection, as the server takes it: only the clients it may speak
40
+ * for, each state naming `user`, without the Agent's field, and within its size. Null when none is
41
+ * left, or the update does not read.
42
+ */
43
+ export declare function vouchedAwareness(update: Uint8Array, input: {
44
+ readonly user: ArtifactLiveUser;
45
+ /** Whether the connection may speak for this awareness client. */
46
+ readonly mayUse: (clientID: number) => boolean;
47
+ }): Uint8Array | null;
48
+ //# sourceMappingURL=awareness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"awareness.d.ts","sourceRoot":"","sources":["../../src/live/awareness.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EAEtB,M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}
@@ -0,0 +1,198 @@
1
+ import { type BlobStorage, type Storage } from "@sixb/core";
2
+ import { type ArtifactLiveAccess, type ArtifactLiveServerMessage, type ArtifactLiveUser } from "@sixb/core/artifacts/live";
3
+ import type { Broker } from "@sixb/core/broker";
4
+ import type { Sixb } from "@sixb/core/internal/request-execution";
5
+ import * as awarenessProtocol from "y-protocols/awareness";
6
+ import * as Y from "yjs";
7
+ /** After the last change, how long the document waits before it writes itself back. */
8
+ export declare const SAVE_IDLE_MS = 1500;
9
+ /** How long changes made without pause wait, at most, to be written back. */
10
+ export declare const SAVE_MAX_MS = 10000;
11
+ /** How long an editor's right to change the artifact holds before it is read again. */
12
+ export declare const ACCESS_RECHECK_MS = 2000;
13
+ /**
14
+ * How long an edit heard from another server waits before this one writes it back too, in case
15
+ * the server that heard it never does: long enough that it normally has.
16
+ */
17
+ export declare const HEARD_SAVE_MS: number;
18
+ /** How often every member's right to read and change the artifact is read again. */
19
+ export declare const MEMBERS_RECHECK_MS = 60000;
20
+ /** How often, at most, this server shares its people's awareness with the others. */
21
+ export declare const AWARENESS_SHARE_MS = 100;
22
+ /** A connection, as a room sees it: who it is, through its SDK, and how to reach it. */
23
+ export interface LiveConnection {
24
+ readonly id: string;
25
+ /** The connection's SDK, as the person who opened it: every write goes through it. */
26
+ readonly sixb: Sixb;
27
+ /** Who the connection is when its SDK names nobody: a shared link's guest. */
28
+ readonly user?: () => Promise<ArtifactLiveUser>;
29
+ send(message: ArtifactLiveServerMessage): void;
30
+ }
31
+ export interface LiveRoomHost {
32
+ readonly projectId: string;
33
+ readonly storage: Pick<Storage, "artifacts" | "auth">;
34
+ readonly blobStorage: Pick<BlobStorage, "open" | "put">;
35
+ readonly broker: Broker;
36
+ /** This server, among those that hold the artifact live. */
37
+ readonly instance: string;
38
+ /** What reports to the project's `onError`: changes that could never be stored. */
39
+ readonly errorReporterHost: object;
40
+ }
41
+ export declare class LiveRoom {
42
+ private readonly host;
43
+ readonly artifactId: string;
44
+ private readonly onClose;
45
+ readonly doc: Y.Doc;
46
+ readonly awareness: awarenessProtocol.Awareness;
47
+ private readonly members;
48
+ private synced;
49
+ /**
50
+ * What the document held when it was last written back, as a Yjs snapshot, its insertions and
51
+ * its deletions: a client forgets the changes it covers.
52
+ */
53
+ private savedSnapshot;
54
+ private dirty;
55
+ /** What another server heard is not known to be written yet. */
56
+ private unwritten;
57
+ private author;
58
+ /** The last connection that joined to edit: who writes back what another server heard. */
59
+ private lastEditor;
60
+ /**
61
+ * The document as it is, again: a client's update is tried on it first, so one that would leave
62
+ * the document unreadable is refused before anyone gets it.
63
+ */
64
+ private shadow;
65
+ private state;
66
+ private error;
67
+ /** The last write-back's failure, which a loss of the changes reports. */
68
+ private failure;
69
+ private attempts;
70
+ private idle;
71
+ private deadline;
72
+ private retry;
73
+ private heardSave;
74
+ private recheck;
75
+ /** The awareness clients whose state waits to be shared with the other servers. */
76
+ private readonly unshared;
77
+ private sharing;
78
+ private queue;
79
+ private readonly agents;
80
+ /** The awareness clients other servers speak for. */
81
+ private readonly remoteClients;
82
+ private unsubscribe;
83
+ private closed;
84
+ private constructor();
85
+ /**
86
+ * The room of an artifact, its document loaded as storage keeps it; a reason instead for an
87
+ * artifact that is gone or is not edited live. Whoever opens it must already have been allowed
88
+ * to read it.
89
+ */
90
+ static open(host: LiveRoomHost, artifactId: string, onClose: (room: LiveRoom) => void): Promise<LiveRoom | "not_found" | "not_live">;
91
+ get isClosed(): boolean;
92
+ get revision(): number;
93
+ /** Adds a connection, which gets the document and who is here; sync is the client's to start. */
94
+ join(connection: LiveConnection, access: ArtifactLiveAccess, user: ArtifactLiveUser): void;
95
+ /**
96
+ * Removes a connection and what it said of itself. The last editor to leave writes the document
97
+ * back at once, and the last connection closes the room once nothing waits to be written: a
98
+ * client that comes back loads the same history from storage.
99
+ */
100
+ leave(connectionId: string): void;
101
+ /**
102
+ * A y-protocols sync message from a connection. One that watches may ask for the document, never
103
+ * change it; one that edits is read again at most every {@link ACCESS_RECHECK_MS}.
104
+ */
105
+ sync(connectionId: string, bytes: Uint8Array): Promise<void>;
106
+ /**
107
+ * An awareness update from a connection: what it points at, under the name the server knows it
108
+ * by, for the clients it may speak for.
109
+ */
110
+ presence(connectionId: string, data: string): void;
111
+ /**
112
+ * The connection is someone else now, as the server read it: each awareness state it set takes
113
+ * the new `user`, shared as its own updates are.
114
+ */
115
+ rename(connectionId: string, user: ArtifactLiveUser): void;
116
+ /**
117
+ * The artifact was written at `revision`, by this room or anyone else. Every write is made into
118
+ * the stored document, which the room takes in: what its editors changed meanwhile stays.
119
+ */
120
+ written(revision: number): void;
121
+ /** Closes the room if nobody holds it and nothing waits to be written: a join gave up. */
122
+ closeIfUnheld(): void;
123
+ /** Writes the document back now, if it changed. */
124
+ save(): void;
125
+ /** Settles once what the room has queued, a write-back or a merge, is done. */
126
+ settled(): Promise<void>;
127
+ /**
128
+ * Stops the room. What it still holds unwritten is the caller's to save first: changes it could
129
+ * not write are reported lost.
130
+ */
131
+ close(): void;
132
+ private updated;
133
+ private heard;
134
+ private changed;
135
+ /**
136
+ * Writes the document back into the open version, as the last editor: a normal write, which
137
+ * bumps the revision and tells every reader. The write carries the document itself, which
138
+ * storage merges into its own, so whatever was written meanwhile stays, there and back. A
139
+ * failure leaves the changes waiting, says so, and tries again.
140
+ */
141
+ private flush;
142
+ private saved;
143
+ /**
144
+ * Keeps the changes and says why they were not written. A refusal of what the document holds
145
+ * waits for the next change; one of who wrote it is tried as another editor. Either is lost once
146
+ * nobody is left to write it. Anything else is tried again later, for as long as the server
147
+ * runs: the changes are lost only if it stops first.
148
+ */
149
+ private failed;
150
+ /** The changes will never be stored: the project's `onError` hears of it, and they are dropped. */
151
+ private lose;
152
+ private scheduleRetry;
153
+ /**
154
+ * Takes in what someone else wrote: the stored document, which shares this one's history. One
155
+ * a write left behind is brought up to the content first, as every server that loads it does. An
156
+ * artifact that keeps none takes the change from the files the room last took in.
157
+ */
158
+ private reconcile;
159
+ private enqueue;
160
+ /** Closes the room once nobody holds it and nothing waits to be written. */
161
+ private closeWhenDone;
162
+ private clearTimers;
163
+ /**
164
+ * Whether the document stays readable with a client's sync message: tried on the shadow, which
165
+ * is made again from the document when it does not.
166
+ */
167
+ private readable;
168
+ private mayEdit;
169
+ private demote;
170
+ /**
171
+ * Reads every member's right to the artifact again, editors and watchers alike: who may no
172
+ * longer read it leaves, who may no longer change it watches, and who may now change it edits.
173
+ */
174
+ private recheckAccess;
175
+ private isMember;
176
+ /**
177
+ * Whether a connection may speak for an awareness client: one it already speaks for, or a new
178
+ * one nobody else does, the server's own included, up to {@link MAX_AWARENESS_CLIENTS}.
179
+ */
180
+ private mayUse;
181
+ private presenceChanged;
182
+ /** Tells the other servers holding the artifact what an editor here changed or pointed at. */
183
+ private share;
184
+ /**
185
+ * Reads the artifact's live stream: other servers' editors' updates and awareness, and the
186
+ * Agent's presence. From its start, so the room takes in what was changed elsewhere since the
187
+ * last write-back; an update it already holds changes nothing.
188
+ */
189
+ private follow;
190
+ private heardRecord;
191
+ private agentEnded;
192
+ /** The server's awareness entry: each Agent turn at work on the canvas, and its boards. */
193
+ private showAgents;
194
+ private sendSync;
195
+ private status;
196
+ private setState;
197
+ }
198
+ //# sourceMappingURL=room.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/live/room.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AACjF,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAKtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,mBAAmB,CAAA;AAe7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAA;AAIjE,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAA;AAE1D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAOxB,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O,CAAC,eAAe;IAiCvB,8FAA8F;IAC9F,OAAO,CAAC,KAAK;IAiBb;;;;OAIG;YACW,MAAM;IAmBpB,OAAO,CAAC,WAAW;IA+CnB,OAAO,CAAC,UAAU;IAQlB,2FAA2F;IAC3F,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,QAAQ;CAMjB"}
@@ -0,0 +1,67 @@
1
+ import type { SixbHostView } from "@sixb/core";
2
+ import { type ArtifactLiveClientMessage } from "@sixb/core/artifacts/live";
3
+ import { type LiveConnection, type LiveRoomHost } from "./room";
4
+ /** How many artifacts one connection may hold live at once. */
5
+ export declare const MAX_LIVE_ARTIFACTS_PER_CONNECTION = 16;
6
+ /** The largest sync message a connection may send in parts: four boards' worth of HTML. */
7
+ export declare const MAX_LIVE_SYNC_BYTES: number;
8
+ /**
9
+ * The artifacts this server holds live, one room each, opened by the first connection that joins
10
+ * and closed once the last leaves and its changes are written back. Every room learns of the
11
+ * artifact's writes from the project's events, wherever they were made.
12
+ */
13
+ export declare class LiveRooms {
14
+ private readonly host;
15
+ private readonly rooms;
16
+ /**
17
+ * The artifacts each connection joined, or is joining: the slot is taken before the join reads
18
+ * anything, so joins at once count against the cap, and each is its own ticket, so a join that
19
+ * resumes once the connection left, or joined again, knows it is stale.
20
+ */
21
+ private readonly joined;
22
+ /** Who each connection is, read once. */
23
+ private readonly users;
24
+ /** The parts of a sync message a connection is sending, by connection and artifact. */
25
+ private readonly parts;
26
+ private events;
27
+ private closed;
28
+ constructor(host: LiveRoomHost & {
29
+ readonly events: SixbHostView["events"];
30
+ });
31
+ /** Handles a message from a connection. */
32
+ receive(connection: LiveConnection, message: ArtifactLiveClientMessage): Promise<void>;
33
+ /** Leaves every artifact a connection holds: it closed. */
34
+ disconnect(connection: LiveConnection): Promise<void>;
35
+ /**
36
+ * Writes back what every room holds unwritten, then stops them and the events feed: the server
37
+ * stops.
38
+ */
39
+ close(): Promise<void>;
40
+ /** Settles once every room's queued work is done. */
41
+ settled(): Promise<void>;
42
+ /**
43
+ * Joins a connection to an artifact it may read: to edit it when it may change it, to watch it
44
+ * otherwise. One it may not read, or that is not edited live, is refused with why.
45
+ */
46
+ private join;
47
+ private userOf;
48
+ /**
49
+ * Reads again who a connection is, and shows it so in every artifact it holds: a shared link's
50
+ * guest gave their name, which the server reads from their session, never from the client.
51
+ */
52
+ refreshUser(connection: LiveConnection): Promise<void>;
53
+ /** Leaves an artifact, as asked: the connection is told it left, once it did. */
54
+ private leave;
55
+ /**
56
+ * The bytes of a whole sync message: this one's, or, on its last part, every part's. Null while
57
+ * parts are still to come, and for a message that is not base64 or grew too large.
58
+ */
59
+ private assemble;
60
+ /** The room of an artifact the connection joined. */
61
+ private held;
62
+ /** The artifact's room, opened once however many join at once; a refusal is not kept. */
63
+ private open;
64
+ /** Every write to an artifact a room holds reaches it, whichever server or worker made it. */
65
+ private followEvents;
66
+ }
67
+ //# sourceMappingURL=rooms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/live/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EACL,KAAK,yBAAyB,EAI/B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,KAAK,cAAc,EAAY,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAEzE,+DAA+D;AAC/D,eAAO,MAAM,iCAAiC,KAAK,CAAA;AACnD,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,QAAkB,CAAA;AAElD;;;;GAIG;AACH,qBAAa,SAAS;IAeR,OAAO,CAAC,QAAQ,CAAC,IAAI;IAdjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkE;IACxF;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,yCAAyC;IACzC,OAAO,CAAC,QAAQ,C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A;AA4B3C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,+BAA+B,CAAA;IAC9D,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAA;IAC3C,wEAAwE;IACxE,QAAQ,CAAC,aAAa,EAAE,4BAA4B,CAAA;CACrD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0C5F"}
1
+ {"version":3,"file":"registerRoutes.d.ts","sourceRoot":"","sources":["../src/registerRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAahE,OAAO,EACL,KAAK,+BAA+B,EAErC,MAAM,oCAAoC,CAAA;AA6B3C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,+BAA+B,CAAA;IAC9D,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAA;IAC3C,wEAAwE;IACxE,QAAQ,CAAC,aAAa,EAAE,4BAA4B,CAAA;CACrD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2C5F"}
@@ -26,6 +26,7 @@ export declare function registerActionRoutes(app: Elysia, host: SixbHostView): E
26
26
  response: {
27
27
  200: {
28
28
  id: string;
29
+ name: string;
29
30
  params: {
30
31
  id: string;
31
32
  name: string;
@@ -35,7 +36,6 @@ export declare function registerActionRoutes(app: Elysia, host: SixbHostView): E
35
36
  semanticType?: string | undefined;
36
37
  schema?: unknown;
37
38
  }[];
38
- name: string;
39
39
  phases: {
40
40
  validate: boolean;
41
41
  writeback: boolean;
@@ -72,6 +72,7 @@ export declare function registerActionRoutes(app: Elysia, host: SixbHostView): E
72
72
  response: {
73
73
  200: {
74
74
  id: string;
75
+ name: string;
75
76
  params: {
76
77
  id: string;
77
78
  name: string;
@@ -81,7 +82,6 @@ export declare function registerActionRoutes(app: Elysia, host: SixbHostView): E
81
82
  semanticType?: string | undefined;
82
83
  schema?: unknown;
83
84
  }[];
84
- name: string;
85
85
  phases: {
86
86
  validate: boolean;
87
87
  writeback: boolean;
@@ -185,7 +185,7 @@ export declare function registerActionRoutes(app: Elysia, host: SixbHostView): E
185
185
  };
186
186
  500: {
187
187
  error: string;
188
- 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.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";
188
+ 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";
189
189
  };
190
190
  422: {
191
191
  type: "validation";
@@ -158,6 +158,16 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
158
158
  spawnedBy: string;
159
159
  } | undefined;
160
160
  sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
161
+ backgroundCommands?: {
162
+ status: "running" | "exited" | "stopped";
163
+ id: string;
164
+ startedAt: string;
165
+ threadId: string;
166
+ command: string;
167
+ exitCode?: number | undefined;
168
+ endedAt?: string | undefined;
169
+ stopping?: boolean | undefined;
170
+ }[] | undefined;
161
171
  movedAt?: string | undefined;
162
172
  lastMessageAt?: string | undefined;
163
173
  };
@@ -215,6 +225,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
215
225
  approvals: {
216
226
  status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
217
227
  id: string;
228
+ expiresAt: string;
218
229
  requestedBy: {
219
230
  id: string;
220
231
  type: "user" | "serviceAccount" | "system";
@@ -243,7 +254,6 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
243
254
  workflowRunId: string;
244
255
  };
245
256
  createdAt: string;
246
- expiresAt: string;
247
257
  reported: boolean;
248
258
  caller?: {
249
259
  runId: string;
@@ -266,7 +276,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
266
276
  } | {
267
277
  error: {
268
278
  at: string;
269
- 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.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";
279
+ 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";
270
280
  message: string;
271
281
  retryable: boolean;
272
282
  details?: import("../schemas/common").JsonValue | undefined;
@@ -325,6 +335,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
325
335
  approval: {
326
336
  status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
327
337
  id: string;
338
+ expiresAt: string;
328
339
  requestedBy: {
329
340
  id: string;
330
341
  type: "user" | "serviceAccount" | "system";
@@ -353,7 +364,6 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
353
364
  workflowRunId: string;
354
365
  };
355
366
  createdAt: string;
356
- expiresAt: string;
357
367
  reported: boolean;
358
368
  caller?: {
359
369
  runId: string;
@@ -376,7 +386,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
376
386
  } | {
377
387
  error: {
378
388
  at: string;
379
- 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.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";
389
+ 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";
380
390
  message: string;
381
391
  retryable: boolean;
382
392
  details?: import("../schemas/common").JsonValue | undefined;
@@ -388,7 +398,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
388
398
  } | undefined;
389
399
  };
390
400
  run?: {
391
- status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
401
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
392
402
  projectId: string;
393
403
  id: string;
394
404
  kind: "conversation" | "subagent";
@@ -398,14 +408,14 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
398
408
  triggerMessageId: string;
399
409
  streamId: string;
400
410
  error?: import("@sixb/core").SixbFailure<"agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
401
- requestedBy?: {
402
- id: string;
403
- type: "user" | "serviceAccount";
404
- } | undefined;
405
411
  model?: {
406
412
  modelId: string;
407
413
  provider: string;
408
414
  } | undefined;
415
+ requestedBy?: {
416
+ id: string;
417
+ type: "user" | "serviceAccount";
418
+ } | undefined;
409
419
  modelId?: string | undefined;
410
420
  startedAt?: string | undefined;
411
421
  completedAt?: string | undefined;
@@ -510,6 +520,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
510
520
  approvals: {
511
521
  status: "pending" | "approved" | "denied" | "cancelled" | "superseded" | "expired";
512
522
  id: string;
523
+ expiresAt: string;
513
524
  requestedBy: {
514
525
  id: string;
515
526
  type: "user" | "serviceAccount" | "system";
@@ -538,7 +549,6 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
538
549
  workflowRunId: string;
539
550
  };
540
551
  createdAt: string;
541
- expiresAt: string;
542
552
  reported: boolean;
543
553
  caller?: {
544
554
  runId: string;
@@ -561,7 +571,7 @@ export declare function registerAgentApprovalRoutes(app: Elysia, host: SixbHostV
561
571
  } | {
562
572
  error: {
563
573
  at: string;
564
- 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.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";
574
+ 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";
565
575
  message: string;
566
576
  retryable: boolean;
567
577
  details?: import("../schemas/common").JsonValue | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-approvals.d.ts","sourceRoot":"","sources":["../../src/routes/agent-approvals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,YAAY,CAAA;AAGnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA+DpC,wFAAwF;AACxF,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuO1E"}
1
+ {"version":3,"file":"agent-approvals.d.ts","sourceRoot":"","sources":["../../src/routes/agent-approvals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,YAAY,CAAA;AAGnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA+DpC,wFAAwF;AACxF,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuO1E"}
@@ -76,15 +76,15 @@ export declare function registerAgentChildRoutes(app: Elysia, host: SixbHostView
76
76
  response: {
77
77
  200: {
78
78
  children: {
79
- status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
80
- projectId: string;
81
- id: string;
79
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
82
80
  model: {
83
81
  modelId: string;
84
82
  provider: string;
85
83
  };
84
+ projectId: string;
85
+ id: string;
86
86
  runs: {
87
- status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
87
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
88
88
  id: string;
89
89
  createdAt: string;
90
90
  attempt: number;