@collective-intelligence/external-apps-client-sdk 0.3.5 → 0.3.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.
@@ -1,11 +1,10 @@
1
- import { $t as FederatedAuthState, At as JsonValue, Dt as CiError$2, Ft as ClientOperationInput, Gt as JsonObject, Ht as AgentInvokeTarget, It as ClientOperationMap, Jt as SearchQuery, Kt as KnowledgeQuery, Lt as ClientOperationOutput, Nt as ClientOperationDefinition, Pt as ClientOperationId, Rt as OperationExecutionOptions, Tt as ProxyTransportOptions, Ut as ConversationContinueTarget, Wt as ConversationHistory, Xt as ClientFetch, Yt as WorkflowInvokeTarget, en as FederatedSessionIdentity, fn as CiTransportError, kt as CiResult, qt as QueryFilter, un as CiError$1, zt as TypedOperationExecutor } from "./resources-CALtYMtN.js";
2
- import "effect/Clock";
3
- import * as Config from "effect/Config";
4
- import * as Context from "effect/Context";
5
- import * as Effect from "effect/Effect";
6
- import * as Layer from "effect/Layer";
1
+ import { B as ConversationHistory, D as CiError$1, F as JsonValue, G as SearchQuery, H as JsonObject, K as WorkflowInvokeTarget, M as CiError$2, R as AgentInvokeTarget, U as KnowledgeQuery, W as QueryFilter, c as FederatedSessionIdentity, i as ClientFetch, s as FederatedAuthState, v as ClientOperationDefinition, z as ConversationContinueTarget } from "./proxy-DRPEFvaV.js";
2
+ import { n as ClientSdkClient } from "./client-_rl-iXS8.js";
3
+ import "./resources-r2t8pcv2.js";
4
+ import "effect/Context";
5
+ import "effect/Effect";
6
+ import "effect/Layer";
7
7
  import "effect/Stream";
8
- import "effect/ManagedRuntime";
9
8
  /** One equality filter on a dotted data path of a topic's records. */
10
9
  type RealtimeTopicFilter = Readonly<{
11
10
  field: string;
@@ -63,209 +62,6 @@ type RealtimeEventSource = Readonly<{
63
62
  type RealtimeEventSourceFactory = (url: string, handlers: RealtimeStreamHandlers) => RealtimeEventSource;
64
63
  /** Reads `text/event-stream` with `fetch`, so pings and refusals are visible. */
65
64
  declare const createFetchEventSourceFactory: (fetch: ClientFetch) => RealtimeEventSourceFactory;
66
- type DirectTransportOptions = Readonly<{
67
- auth: Readonly<{
68
- getAccessToken: () => Promise<string> | string;
69
- }>;
70
- fetch?: ClientFetch;
71
- tenantUrl: string;
72
- }>;
73
- /**
74
- * The Vanilla Facade of `CiClient.layerDirect`, in a runtime of its own;
75
- * `close` disposes it. A bad `tenantUrl` throws `TypeError`.
76
- */
77
- declare const createDirectTransport: <Operations extends ClientOperationMap>(options: DirectTransportOptions) => TypedOperationExecutor<Operations> & Readonly<{
78
- close: () => Promise<void>;
79
- }>;
80
- type Input<Id extends ClientOperationId> = ClientOperationMap[Id]["input"];
81
- type Output<Id extends ClientOperationId> = ClientOperationMap[Id]["output"];
82
- /** One CI operation as its `CiResult` envelope; only a transport failure fails. */
83
- type ExecuteResult<R = never> = <Id extends ClientOperationId>(operationId: Id, input: Input<Id>, options: OperationExecutionOptions) => Effect.Effect<CiResult<Output<Id>>, CiTransportError, R>;
84
- type CiClientValue = Readonly<{
85
- /**
86
- * The result of one operation. An Expected Error of CI fails with
87
- * `CiError`; a request that does not reach CI fails with
88
- * `CiTransportError`. Interruption cancels the request.
89
- */
90
- execute: <Id extends ClientOperationId>(operationId: Id, input: Input<Id>, options: OperationExecutionOptions) => Effect.Effect<Output<Id>, CiError$1 | CiTransportError>;
91
- /** The same call as its envelope, which keeps the correlation id of CI. */
92
- executeResult: ExecuteResult;
93
- }>;
94
- declare const CiClient_base: Context.ServiceClass<CiClient, "@collective-intelligence/external-apps-client-sdk/CiClient", Readonly<{
95
- /**
96
- * The result of one operation. An Expected Error of CI fails with
97
- * `CiError`; a request that does not reach CI fails with
98
- * `CiTransportError`. Interruption cancels the request.
99
- */
100
- execute: <Id extends ClientOperationId>(operationId: Id, input: Input<Id>, options: OperationExecutionOptions) => Effect.Effect<Output<Id>, CiError$1 | CiTransportError>;
101
- /** The same call as its envelope, which keeps the correlation id of CI. */
102
- executeResult: ExecuteResult;
103
- }>>;
104
- declare class CiClient extends CiClient_base {}
105
- /** `CiClient` over the tenant Application HTTP API; a bad `tenantUrl` dies with `TypeError`. */
106
- declare const layerDirect: (options: DirectTransportOptions) => Layer.Layer<CiClient, never, never>;
107
- /** `CiClient` over the app's protocol proxy; a bad `serverUrl` or `path` dies with `TypeError`. */
108
- declare const layerProxy: (options: ProxyTransportOptions) => Layer.Layer<CiClient, never, never>;
109
- /** `CiClient` over a `TypedOperationExecutor`, such as the transport of `createClient`. */
110
- declare const layerFromExecutor: <Operations extends ClientOperationMap>(executor: TypedOperationExecutor<Operations>) => Layer.Layer<CiClient, never, never>;
111
- /** `layerDirect` with options that Effect `Config` reads. */
112
- declare const layerDirectConfig: (config: Config.Wrap<DirectTransportOptions>) => Layer.Layer<CiClient, Config.ConfigError, never>;
113
- /** `layerProxy` with options that Effect `Config` reads. */
114
- declare const layerProxyConfig: (config: Config.Wrap<ProxyTransportOptions>) => Layer.Layer<CiClient, Config.ConfigError, never>;
115
- type CiStreamPage = ClientOperationOutput<ClientOperationMap, "runs_stream">;
116
- type CiStreamEvent = CiStreamPage["events"][number];
117
- type CiRunCancellation = ClientOperationOutput<ClientOperationMap, "runs_cancel">;
118
- declare const nextStreamCursor: (page: CiStreamPage) => string | null;
119
- type RunFollowOptions = Readonly<{
120
- /** Total wait before the follow fails with `CiError` `unavailable`. */
121
- deadlineMs?: number;
122
- /**
123
- * First wait between polls in milliseconds (default 50). It doubles while
124
- * no new event arrives, up to one second or `idleMs` if larger.
125
- */
126
- idleMs?: number;
127
- runId: string;
128
- }>;
129
- /**
130
- * Ten minutes: a skill run's five-minute AI deadline plus queueing and
131
- * delivery slack. Long runs return a `runId` immediately; follow is how
132
- * callers wait for their outcome.
133
- */
134
- declare const DEFAULT_FOLLOW_RUN_DEADLINE_MS = 600000;
135
- type RunsValue = Readonly<{
136
- /**
137
- * Follows a run of `organizationId` until it finishes, and succeeds with
138
- * its last event page. A failed read fails with its `CiError`; a run that
139
- * does not finish before the deadline fails with `CiError` `unavailable`.
140
- */
141
- follow: (options: RunFollowOptions & Readonly<{
142
- organizationId: string;
143
- }>) => Effect.Effect<CiStreamPage, CiError$1 | CiTransportError>;
144
- }>;
145
- declare const Runs_base: Context.ServiceClass<Runs, "@collective-intelligence/external-apps-client-sdk/Runs", Readonly<{
146
- /**
147
- * Follows a run of `organizationId` until it finishes, and succeeds with
148
- * its last event page. A failed read fails with its `CiError`; a run that
149
- * does not finish before the deadline fails with `CiError` `unavailable`.
150
- */
151
- follow: (options: RunFollowOptions & Readonly<{
152
- organizationId: string;
153
- }>) => Effect.Effect<CiStreamPage, CiError$1 | CiTransportError>;
154
- }>>;
155
- declare class Runs extends Runs_base {}
156
- /** `Runs` over the `CiClient` of the context. */
157
- declare const layer: Layer.Layer<Runs, never, CiClient>;
158
- type FollowRunSource = Readonly<{
159
- get: (input: Readonly<{
160
- runId: string;
161
- }>) => Promise<CiResult<unknown>>;
162
- stream: (input: Readonly<{
163
- afterCursor?: string;
164
- runId: string;
165
- }>) => Promise<CiResult<CiStreamPage>>;
166
- }>;
167
- type FollowRunOptions = Readonly<{
168
- /**
169
- * Total wait before `followRun` rejects with `CiError` `unavailable`
170
- * ("Run did not finish"). Defaults to
171
- * {@link DEFAULT_FOLLOW_RUN_DEADLINE_MS}.
172
- */
173
- deadlineMs?: number;
174
- /**
175
- * First wait between polls in milliseconds (default 50). It doubles while
176
- * no new event arrives, up to one second or `idleMs` if larger.
177
- */
178
- idleMs?: number;
179
- now?: () => number;
180
- runId: string;
181
- /** Stops following and cancels in-flight requests made by `runs.follow`. */
182
- signal?: AbortSignal;
183
- sleep?: (ms: number) => Promise<void>;
184
- }>;
185
- /**
186
- * Follows dedicated run events until a terminal event or snapshot status.
187
- * Resolves with the last event page read. A failed read rejects with its
188
- * `CiError`; a source that rejects gives `CiTransportError`; an abort
189
- * rejects with `signal.reason`.
190
- */
191
- declare const followRun: (runs: FollowRunSource, options: FollowRunOptions) => Promise<CiStreamPage>;
192
- declare const clientSdkProtocolVersion: "v1";
193
- type SignalOptions = Readonly<{
194
- signal?: AbortSignal;
195
- }>;
196
- type FollowRunCall<Scoped extends boolean> = Scoped extends true ? (options: FollowRunOptions) => Promise<CiStreamPage> : (options: FollowRunOptions & Readonly<{
197
- organizationId: string;
198
- }>) => Promise<CiStreamPage>;
199
- type ScopedOperation<Operations extends ClientOperationMap, Id extends ClientOperationId> = (input: ClientOperationInput<Operations, Id>, options?: SignalOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
200
- type RootOperation<Operations extends ClientOperationMap, Id extends ClientOperationId> = (input: ClientOperationInput<Operations, Id> & Readonly<{
201
- organizationId: string;
202
- }>, options?: SignalOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
203
- type DomainOperation<Operations extends ClientOperationMap, Id extends ClientOperationId, Scoped extends boolean> = Scoped extends true ? ScopedOperation<Operations, Id> : RootOperation<Operations, Id>;
204
- type ClientDomains<Operations extends ClientOperationMap, Scoped extends boolean> = Readonly<{
205
- agents: Readonly<{
206
- invoke: DomainOperation<Operations, "agents_invoke", Scoped>;
207
- list: DomainOperation<Operations, "agents_list", Scoped>;
208
- }>;
209
- attachments: Readonly<{
210
- downloadUrl: DomainOperation<Operations, "attachments_download_url", Scoped>;
211
- upload: DomainOperation<Operations, "attachments_upload", Scoped>;
212
- }>;
213
- context: Readonly<{
214
- get: DomainOperation<Operations, "context_get", Scoped>;
215
- }>;
216
- knowledge: Readonly<{
217
- autocomplete: DomainOperation<Operations, "knowledge_autocomplete", Scoped>;
218
- createEntity: DomainOperation<Operations, "knowledge_create_entity", Scoped>;
219
- deleteEntity: DomainOperation<Operations, "knowledge_delete_entity", Scoped>;
220
- facets: DomainOperation<Operations, "knowledge_facets", Scoped>;
221
- getEntity: DomainOperation<Operations, "knowledge_get_entity", Scoped>;
222
- getEntitySchemaSnapshot: DomainOperation<Operations, "knowledge_get_entity_schema_snapshot", Scoped>;
223
- getSchemaQueryContext: DomainOperation<Operations, "knowledge_get_schema_query_context", Scoped>;
224
- query: DomainOperation<Operations, "knowledge_query", Scoped>;
225
- searchEntities: DomainOperation<Operations, "knowledge_search_entities", Scoped>;
226
- updateEntity: DomainOperation<Operations, "knowledge_update_entity", Scoped>;
227
- upsertEntity: DomainOperation<Operations, "knowledge_upsert_entity", Scoped>;
228
- }>;
229
- runs: Readonly<{
230
- cancel: DomainOperation<Operations, "runs_cancel", Scoped>;
231
- follow: FollowRunCall<Scoped>;
232
- get: DomainOperation<Operations, "runs_get", Scoped>;
233
- stream: DomainOperation<Operations, "runs_stream", Scoped>;
234
- }>;
235
- skills: Readonly<{
236
- invoke: DomainOperation<Operations, "skills_invoke", Scoped>;
237
- list: DomainOperation<Operations, "skills_list", Scoped>;
238
- }>;
239
- workflows: Readonly<{
240
- invoke: DomainOperation<Operations, "workflows_invoke", Scoped>;
241
- list: DomainOperation<Operations, "workflows_list", Scoped>;
242
- }>;
243
- }>;
244
- type OrganizationClient<Operations extends ClientOperationMap> = ClientDomains<Operations, true> & Readonly<{
245
- organizationId: string;
246
- }>;
247
- type ClientSdkClient<Operations extends ClientOperationMap> = Omit<ClientDomains<Operations, false>, "context"> & TypedOperationExecutor<Operations> & Readonly<{
248
- context: ClientDomains<Operations, false>["context"] & Readonly<{
249
- forOrganization: (organizationId: string) => OrganizationClient<Operations>;
250
- }>;
251
- forOrganization: (organizationId: string) => OrganizationClient<Operations>;
252
- protocolVersion: typeof clientSdkProtocolVersion;
253
- }>;
254
- type ClientSdkEntrypoint = Readonly<{
255
- protocolVersion: typeof clientSdkProtocolVersion;
256
- }>;
257
- /**
258
- * The Vanilla Facade of `CiClient` and `Runs` over `transport`, in one
259
- * runtime; `close` disposes it. A CI error answer resolves
260
- * `{ ok: false, error }` with a `CiError`; `runs.follow` rejects with it. A
261
- * transport failure rejects with `CiTransportError`, an abort with
262
- * `signal.reason`.
263
- */
264
- declare const createClient: <Operations extends ClientOperationMap>(options: {
265
- readonly transport: TypedOperationExecutor<Operations>;
266
- }) => ClientSdkClient<Operations> & Readonly<{
267
- close: () => Promise<void>;
268
- }>;
269
65
  type DelegatedRuntimeState = Readonly<{
270
66
  status: "checking" | "anonymous" | "expired";
271
67
  }> | Readonly<{
@@ -308,7 +104,7 @@ declare const createDelegatedApplicationRuntime: (options: DelegatedApplicationR
308
104
  subscribe: (listener: (state: FederatedAuthState) => void) => () => void;
309
105
  }>;
310
106
  client: ClientSdkClient<Readonly<{
311
- context_get: ClientOperationDefinition<unknown[] | Readonly<Record<string, string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly<{
107
+ context_get: ClientOperationDefinition<Readonly<Record<string, string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly<{
312
108
  readonly [key: string]: string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null;
313
109
  }> | null)[] | Readonly<{
314
110
  readonly [key: string]: string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null;
@@ -332,7 +128,7 @@ declare const createDelegatedApplicationRuntime: (options: DelegatedApplicationR
332
128
  readonly [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null;
333
129
  }> | null)[] | Readonly<{
334
130
  readonly [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null;
335
- }> | null>>, Readonly<Record<string, string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly<{
131
+ }> | null>> | unknown[], Readonly<Record<string, string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly<{
336
132
  readonly [key: string]: string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null;
337
133
  }> | null)[] | Readonly<{
338
134
  readonly [key: string]: string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null)[] | Readonly< /*elided*/ any> | null;
@@ -866,6 +662,1533 @@ declare const createDelegatedApplicationRuntime: (options: DelegatedApplicationR
866
662
  conversations_history: ClientOperationDefinition<{
867
663
  conversationId: string;
868
664
  }, ConversationHistory>;
665
+ } & {
666
+ chat_conversations_list: ClientOperationDefinition<{
667
+ query?: {
668
+ historyScope?: Array<string>;
669
+ };
670
+ path?: never;
671
+ body?: never;
672
+ }, {
673
+ data: Array<{
674
+ agentId: string | null;
675
+ createdAt: string | null;
676
+ id: string;
677
+ lastActivityAt: string | null;
678
+ lastActivityInvocationId: string | null;
679
+ memoryEnabled: boolean;
680
+ organizationId: string;
681
+ projectId: string | null;
682
+ title: string;
683
+ updatedAt: string | null;
684
+ userId: string;
685
+ origin: {
686
+ id: string;
687
+ kind: "studio_app" | "external_app";
688
+ };
689
+ }>;
690
+ }>;
691
+ chat_conversations_create: ClientOperationDefinition<{
692
+ query?: never;
693
+ path?: never;
694
+ body: {
695
+ agentId?: string;
696
+ projectId?: string;
697
+ title?: string;
698
+ };
699
+ }, {
700
+ agentId: string | null;
701
+ createdAt: string | null;
702
+ id: string;
703
+ lastActivityAt: string | null;
704
+ lastActivityInvocationId: string | null;
705
+ memoryEnabled: boolean;
706
+ organizationId: string;
707
+ projectId: string | null;
708
+ title: string;
709
+ updatedAt: string | null;
710
+ userId: string;
711
+ origin: {
712
+ id: string;
713
+ kind: "studio_app" | "external_app";
714
+ };
715
+ }>;
716
+ chat_conversations_get: ClientOperationDefinition<{
717
+ query?: never;
718
+ path: {
719
+ conversationId: string;
720
+ };
721
+ body?: never;
722
+ }, {
723
+ agentId: string | null;
724
+ createdAt: string | null;
725
+ id: string;
726
+ lastActivityAt: string | null;
727
+ lastActivityInvocationId: string | null;
728
+ memoryEnabled: boolean;
729
+ organizationId: string;
730
+ projectId: string | null;
731
+ title: string;
732
+ updatedAt: string | null;
733
+ userId: string;
734
+ origin: {
735
+ id: string;
736
+ kind: "studio_app" | "external_app";
737
+ };
738
+ }>;
739
+ chat_conversations_update: ClientOperationDefinition<{
740
+ query?: never;
741
+ path: {
742
+ conversationId: string;
743
+ };
744
+ body: {
745
+ memoryEnabled?: boolean;
746
+ projectId?: string | null;
747
+ title?: string;
748
+ };
749
+ }, {
750
+ agentId: string | null;
751
+ createdAt: string | null;
752
+ id: string;
753
+ lastActivityAt: string | null;
754
+ lastActivityInvocationId: string | null;
755
+ memoryEnabled: boolean;
756
+ organizationId: string;
757
+ projectId: string | null;
758
+ title: string;
759
+ updatedAt: string | null;
760
+ userId: string;
761
+ origin: {
762
+ id: string;
763
+ kind: "studio_app" | "external_app";
764
+ };
765
+ }>;
766
+ chat_conversations_delete: ClientOperationDefinition<{
767
+ query?: never;
768
+ path: {
769
+ conversationId: string;
770
+ };
771
+ body?: never;
772
+ }, void>;
773
+ chat_conversations_transcript: ClientOperationDefinition<{
774
+ query?: never;
775
+ path: {
776
+ conversationId: string;
777
+ };
778
+ body?: never;
779
+ }, {
780
+ agentTurns: Array<{
781
+ completedAt: string | null;
782
+ createdAt: string;
783
+ input: string;
784
+ message: string | null;
785
+ sequence: number;
786
+ status: "pending" | "completed" | "failed" | "cancelled";
787
+ turnId: string;
788
+ }>;
789
+ conversation: {
790
+ agent: {
791
+ displayName: string;
792
+ id: string;
793
+ } | null;
794
+ compaction: {
795
+ active: boolean;
796
+ activeSummary: {
797
+ id: string;
798
+ status: string;
799
+ summary: string;
800
+ trigger: string;
801
+ } | null;
802
+ boundary: {
803
+ compactedThroughInvocationId: string | null;
804
+ coveredInvocationCount: number;
805
+ coveredMessageCount: number;
806
+ } | null;
807
+ };
808
+ contextUsage: {
809
+ estimatedCharacters: number;
810
+ fillRatio: number;
811
+ thresholdCharacters: number;
812
+ };
813
+ id: string;
814
+ title: string;
815
+ };
816
+ messages: Array<{
817
+ approvalRequestId: string | null;
818
+ attachments: Array<{
819
+ characterCount: number;
820
+ contentType: string | null;
821
+ extension: string | null;
822
+ extractionStatus: string;
823
+ filename: string;
824
+ id: string;
825
+ mediaUrl: string | null;
826
+ sizeBytes: number;
827
+ truncated: boolean;
828
+ unavailableReason: string | null;
829
+ }>;
830
+ content: string;
831
+ conversationId: string;
832
+ currentUserFeedback?: {
833
+ sentiment: "positive" | "negative" | null;
834
+ submitterNote: string | null;
835
+ };
836
+ feedbackTargetId?: string;
837
+ invocationId: string;
838
+ processingEvents: Array<{
839
+ data: {
840
+ [key: string]: unknown;
841
+ };
842
+ event: string;
843
+ }>;
844
+ role: "assistant" | "user";
845
+ run?: {
846
+ approvalRequestId: string | null;
847
+ conversationId: string;
848
+ durationMs: number;
849
+ inputTokens: number;
850
+ invocationId: string;
851
+ memoryEvidence: {
852
+ events: Array<{
853
+ category: string | null;
854
+ conversationId: string | null;
855
+ invocationId: string | null;
856
+ kind: string;
857
+ lifecycleStatus: string | null;
858
+ memoryId: string | null;
859
+ reason: string | null;
860
+ scope: string | null;
861
+ }>;
862
+ } | null;
863
+ model: string | null;
864
+ output: string;
865
+ outputTokens: number;
866
+ permissionWait: {
867
+ capabilityKind: "skill" | "tool";
868
+ invocationId: string;
869
+ subjectId: string;
870
+ } | null;
871
+ processingEvents: Array<{
872
+ data: {
873
+ [key: string]: unknown;
874
+ };
875
+ event: string;
876
+ }>;
877
+ skillOutcome: string | null;
878
+ status: string;
879
+ toolTrace: Array<{
880
+ displayName: string | null;
881
+ displayParts: Array<{
882
+ data: unknown;
883
+ description: string | null;
884
+ metadata: {
885
+ [key: string]: unknown;
886
+ };
887
+ title: string | null;
888
+ type: string;
889
+ }>;
890
+ durationMs: number | null;
891
+ error: string | null;
892
+ fqn: string | null;
893
+ toolId: string | null;
894
+ }>;
895
+ userInteraction: {
896
+ allowFreeText: boolean;
897
+ id: string;
898
+ kind: "approval" | "question";
899
+ mode: "open" | "single_choice" | null;
900
+ operation: {
901
+ displayName: string;
902
+ kind: "tool";
903
+ toolFqn: string;
904
+ toolId: string;
905
+ } | null;
906
+ options: Array<{
907
+ description: string | null;
908
+ id: string;
909
+ label: string;
910
+ }>;
911
+ preview: string | null;
912
+ prompt: string;
913
+ safePreview: string | null;
914
+ status: "pending" | "responding" | "completed" | "cancelled" | "failed";
915
+ summary: string | null;
916
+ } | null;
917
+ };
918
+ status: string;
919
+ toolDisplay: {
920
+ kind: "text";
921
+ text: string;
922
+ } | {
923
+ kind: "unavailable";
924
+ };
925
+ }>;
926
+ steeringMessages: Array<{
927
+ attachments: Array<{
928
+ characterCount: number;
929
+ contentType: string | null;
930
+ extension: string | null;
931
+ extractionStatus: string;
932
+ filename: string;
933
+ id: string;
934
+ mediaUrl: string | null;
935
+ sizeBytes: number;
936
+ truncated: boolean;
937
+ unavailableReason: string | null;
938
+ }>;
939
+ claimedAt: string | null;
940
+ content: string;
941
+ id: string;
942
+ invocationId: string;
943
+ }>;
944
+ }>;
945
+ chat_turns_submit: ClientOperationDefinition<{
946
+ query?: never;
947
+ path?: never;
948
+ body: {
949
+ attachmentIds?: Array<string>;
950
+ clientTurnId?: string;
951
+ conversationId?: string;
952
+ directTool?: {
953
+ handle: string;
954
+ input: {
955
+ [key: string]: unknown;
956
+ };
957
+ };
958
+ message: string;
959
+ selectedCapabilities?: Array<{
960
+ id: string;
961
+ kind: "skill" | "tool";
962
+ }>;
963
+ selectedReportRunId?: string;
964
+ };
965
+ }, {
966
+ conversationId: string;
967
+ invocationId: string;
968
+ output: string;
969
+ status: "cancelled" | "completed" | "error" | "running" | "waiting_for_approval";
970
+ } | {
971
+ conversationId: string;
972
+ outcome: "queued";
973
+ queuedMessageId: string;
974
+ revision: number;
975
+ }>;
976
+ chat_turns_stream: ClientOperationDefinition<{
977
+ query?: never;
978
+ path?: never;
979
+ body: {
980
+ attachmentIds?: Array<string>;
981
+ clientTurnId?: string;
982
+ conversationId?: string;
983
+ directTool?: {
984
+ handle: string;
985
+ input: {
986
+ [key: string]: unknown;
987
+ };
988
+ };
989
+ message: string;
990
+ selectedCapabilities?: Array<{
991
+ id: string;
992
+ kind: "skill" | "tool";
993
+ }>;
994
+ selectedReportRunId?: string;
995
+ };
996
+ }, AsyncIterable<{
997
+ data: string;
998
+ event: "turn_result";
999
+ id?: string;
1000
+ } | {
1001
+ data: string;
1002
+ event: "approval_result";
1003
+ id?: string;
1004
+ } | {
1005
+ data: string;
1006
+ event: "error";
1007
+ id?: string;
1008
+ }>>;
1009
+ chat_turns_cancel: ClientOperationDefinition<{
1010
+ query?: never;
1011
+ path: {
1012
+ invocationId: string;
1013
+ };
1014
+ body?: never;
1015
+ }, {
1016
+ invocationId: string;
1017
+ status: "cancelled" | "completed" | "error" | "running" | "waiting_for_approval";
1018
+ }>;
1019
+ chat_steering_messages_send: ClientOperationDefinition<{
1020
+ query?: never;
1021
+ path: {
1022
+ conversationId: string;
1023
+ };
1024
+ body: {
1025
+ clientMessageId: string;
1026
+ content: string;
1027
+ invocationId: string;
1028
+ };
1029
+ }, {
1030
+ conversationId: string;
1031
+ invocationId: string;
1032
+ outcome: "started";
1033
+ status: "cancelled" | "completed" | "error" | "running" | "waiting_for_approval";
1034
+ } | {
1035
+ conversationId: string;
1036
+ invocationId: string;
1037
+ outcome: "steered";
1038
+ status: "cancelled" | "completed" | "error" | "running" | "waiting_for_approval";
1039
+ steeringMessageId: string;
1040
+ } | {
1041
+ conversationId: string;
1042
+ outcome: "queued";
1043
+ queuedMessageId: string;
1044
+ revision: number;
1045
+ }>;
1046
+ chat_queued_messages_create: ClientOperationDefinition<{
1047
+ query?: never;
1048
+ path: {
1049
+ conversationId: string;
1050
+ };
1051
+ body: {
1052
+ clientMessageId: string;
1053
+ content: string;
1054
+ };
1055
+ }, {
1056
+ conversationId: string;
1057
+ outcome: "queued";
1058
+ queuedMessage: {
1059
+ content: string;
1060
+ createdAt: string;
1061
+ id: string;
1062
+ invocationId: string | null;
1063
+ position: number;
1064
+ revision: number;
1065
+ status: "waiting" | "claimed" | "removed";
1066
+ };
1067
+ } | {
1068
+ conversationId: string;
1069
+ invocationId?: string;
1070
+ outcome: "started";
1071
+ queuedMessageId?: string;
1072
+ } | {
1073
+ conversationId: string;
1074
+ invocationId: string;
1075
+ outcome: "steered";
1076
+ steeringMessageId: string;
1077
+ }>;
1078
+ chat_queued_messages_list: ClientOperationDefinition<{
1079
+ query?: never;
1080
+ path: {
1081
+ conversationId: string;
1082
+ };
1083
+ body?: never;
1084
+ }, {
1085
+ data: Array<{
1086
+ content: string;
1087
+ createdAt: string;
1088
+ id: string;
1089
+ invocationId: string | null;
1090
+ position: number;
1091
+ revision: number;
1092
+ status: "waiting" | "claimed" | "removed";
1093
+ }>;
1094
+ }>;
1095
+ chat_queued_messages_update: ClientOperationDefinition<{
1096
+ query?: never;
1097
+ path: {
1098
+ conversationId: string;
1099
+ queuedMessageId: string;
1100
+ };
1101
+ body: {
1102
+ content: string;
1103
+ revision: number;
1104
+ };
1105
+ }, {
1106
+ content: string;
1107
+ createdAt: string;
1108
+ id: string;
1109
+ invocationId: string | null;
1110
+ position: number;
1111
+ revision: number;
1112
+ status: "waiting" | "claimed" | "removed";
1113
+ }>;
1114
+ chat_queued_messages_delete: ClientOperationDefinition<{
1115
+ query: {
1116
+ revision: string;
1117
+ };
1118
+ path: {
1119
+ conversationId: string;
1120
+ queuedMessageId: string;
1121
+ };
1122
+ body?: never;
1123
+ }, void>;
1124
+ chat_place_context_get: ClientOperationDefinition<{
1125
+ query?: never;
1126
+ path?: never;
1127
+ body?: never;
1128
+ }, {
1129
+ places: Array<{
1130
+ id: string;
1131
+ kind: "studio_app" | "external_app";
1132
+ name: string | null;
1133
+ }>;
1134
+ readAloud: boolean;
1135
+ voiceInputMode?: "local" | "remote";
1136
+ }>;
1137
+ chat_presentation_get: ClientOperationDefinition<{
1138
+ query?: {
1139
+ afterSequence?: string;
1140
+ };
1141
+ path: {
1142
+ invocationId: string;
1143
+ };
1144
+ body?: never;
1145
+ }, {
1146
+ changed: boolean;
1147
+ latestSequence: number;
1148
+ presentation: {
1149
+ finalOutputIdentity: string | null;
1150
+ sequence: number;
1151
+ state: "closed";
1152
+ } | {
1153
+ additionalWaitingCount: number;
1154
+ attempt: number;
1155
+ invocationId: string;
1156
+ requestId: string | null;
1157
+ sequence: number;
1158
+ state: "actionable";
1159
+ waitKind: "approval" | "input" | "permission";
1160
+ workGroupId: string | null;
1161
+ workItemId: string | null;
1162
+ } | {
1163
+ completedCount: number | null;
1164
+ expectedCount: number | null;
1165
+ failedCount: number | null;
1166
+ messageKey: string | null;
1167
+ phase: string | null;
1168
+ safeParameters: {
1169
+ [key: string]: string | number | boolean | null;
1170
+ };
1171
+ sequence: number;
1172
+ state: "progress";
1173
+ succeededCount: number | null;
1174
+ waitingCount: number | null;
1175
+ } | {
1176
+ outcome: string;
1177
+ sequence: number;
1178
+ state: "output_pending";
1179
+ };
1180
+ rootInvocationId: string;
1181
+ }>;
1182
+ chat_presentation_stream: ClientOperationDefinition<{
1183
+ query?: {
1184
+ afterSequence?: string;
1185
+ };
1186
+ path: {
1187
+ invocationId: string;
1188
+ };
1189
+ body?: never;
1190
+ }, AsyncIterable<{
1191
+ data: string;
1192
+ event: "presentation";
1193
+ id?: string;
1194
+ }>>;
1195
+ chat_agents_list: ClientOperationDefinition<{
1196
+ query?: never;
1197
+ path?: never;
1198
+ body?: never;
1199
+ }, {
1200
+ data: Array<{
1201
+ agentType: "organization" | "personal";
1202
+ degraded: boolean;
1203
+ displayName: string;
1204
+ id: string;
1205
+ paused: boolean;
1206
+ responsibility: string;
1207
+ }>;
1208
+ }>;
1209
+ chat_skills_list: ClientOperationDefinition<{
1210
+ query?: never;
1211
+ path?: never;
1212
+ body?: never;
1213
+ }, {
1214
+ data: Array<{
1215
+ dataAccess: {
1216
+ datasets?: "user" | "skill";
1217
+ documents?: "user" | "skill";
1218
+ knowledge?: "user" | "skill";
1219
+ } | null;
1220
+ description: string | null;
1221
+ fqn: string;
1222
+ id: string;
1223
+ name: string;
1224
+ slug: string;
1225
+ }>;
1226
+ }>;
1227
+ chat_tools_list: ClientOperationDefinition<{
1228
+ query?: {
1229
+ conversationId?: string;
1230
+ usageScope?: "chat" | "skill" | "automation";
1231
+ };
1232
+ path?: never;
1233
+ body?: never;
1234
+ }, {
1235
+ data: Array<{
1236
+ collectionId: string | null;
1237
+ description: string;
1238
+ displayName: string;
1239
+ fqn: string;
1240
+ id: string;
1241
+ inputSchema: {
1242
+ [key: string]: unknown;
1243
+ };
1244
+ }>;
1245
+ }>;
1246
+ chat_agent_conversations_submit_turn: ClientOperationDefinition<{
1247
+ query?: never;
1248
+ path: {
1249
+ conversationId: string;
1250
+ };
1251
+ body: {
1252
+ idempotencyKey: string;
1253
+ message: string;
1254
+ };
1255
+ }, {
1256
+ activationId: string;
1257
+ activationState: string;
1258
+ activityId: string;
1259
+ queuedWhilePaused: boolean;
1260
+ reason: string | null;
1261
+ runId: string;
1262
+ runState: string;
1263
+ turnId: string;
1264
+ }>;
1265
+ chat_agent_conversations_cancel_turn: ClientOperationDefinition<{
1266
+ query?: never;
1267
+ path: {
1268
+ conversationId: string;
1269
+ turnId: string;
1270
+ };
1271
+ body: {
1272
+ idempotencyKey: string;
1273
+ };
1274
+ }, {
1275
+ conversationId: string;
1276
+ outcome: "accepted";
1277
+ receiptId: string;
1278
+ }>;
1279
+ chat_agent_conversations_close: ClientOperationDefinition<{
1280
+ query?: never;
1281
+ path: {
1282
+ conversationId: string;
1283
+ };
1284
+ body: {
1285
+ idempotencyKey: string;
1286
+ };
1287
+ }, {
1288
+ conversationId: string;
1289
+ outcome: "accepted";
1290
+ receiptId: string;
1291
+ }>;
1292
+ chat_attachments_upload: ClientOperationDefinition<{
1293
+ query?: never;
1294
+ path: {
1295
+ conversationId: string;
1296
+ };
1297
+ readonly body: Readonly<{
1298
+ files: readonly File[];
1299
+ }>;
1300
+ }, {
1301
+ attachments: Array<{
1302
+ characterCount: number;
1303
+ contentType: string | null;
1304
+ extension: string | null;
1305
+ extractionStatus: string;
1306
+ filename: string;
1307
+ id: string;
1308
+ sizeBytes: number;
1309
+ truncated: boolean;
1310
+ unavailableReason: string | null;
1311
+ }>;
1312
+ }>;
1313
+ chat_attachments_download_url: ClientOperationDefinition<{
1314
+ query?: never;
1315
+ path: {
1316
+ attachmentId: string;
1317
+ conversationId: string;
1318
+ };
1319
+ body?: never;
1320
+ }, {
1321
+ expiresIn: number;
1322
+ url: string;
1323
+ }>;
1324
+ chat_attachments_capabilities: ClientOperationDefinition<{
1325
+ query?: never;
1326
+ path?: never;
1327
+ body?: never;
1328
+ }, {
1329
+ fileTypes: Array<{
1330
+ extension: string;
1331
+ mediaTypes: Array<string>;
1332
+ }>;
1333
+ projectFileTypes: Array<{
1334
+ extension: string;
1335
+ mediaTypes: Array<string>;
1336
+ }>;
1337
+ }>;
1338
+ chat_feedback_upsert: ClientOperationDefinition<{
1339
+ query?: never;
1340
+ path: {
1341
+ invocationId: string;
1342
+ };
1343
+ body: {
1344
+ sentiment: "positive" | "negative";
1345
+ submitterNote?: string;
1346
+ };
1347
+ }, {
1348
+ currentUserFeedback: {
1349
+ sentiment: "positive" | "negative" | null;
1350
+ submitterNote: string | null;
1351
+ };
1352
+ feedbackTargetId: string;
1353
+ }>;
1354
+ chat_feedback_clear: ClientOperationDefinition<{
1355
+ query?: never;
1356
+ path: {
1357
+ invocationId: string;
1358
+ };
1359
+ body?: never;
1360
+ }, {
1361
+ currentUserFeedback: {
1362
+ sentiment: "positive" | "negative" | null;
1363
+ submitterNote: string | null;
1364
+ };
1365
+ feedbackTargetId: string;
1366
+ }>;
1367
+ chat_approvals_search_requests: ClientOperationDefinition<{
1368
+ query?: never;
1369
+ path?: never;
1370
+ body: {
1371
+ involvement?: "mine" | "requester" | "reviewer";
1372
+ limit?: number;
1373
+ page?: number;
1374
+ status?: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1375
+ };
1376
+ }, {
1377
+ data: Array<{
1378
+ approvalRuleId: string | null;
1379
+ approvalRuleName: string | null;
1380
+ createdAt: string | null;
1381
+ decisions: Array<{
1382
+ approverName: string | null;
1383
+ approverUserId: string;
1384
+ comment: string | null;
1385
+ decidedAt: string | null;
1386
+ id: string;
1387
+ status: string;
1388
+ stepIndex: number | null;
1389
+ stepSubjectId: string | null;
1390
+ stepSubjectKind: string | null;
1391
+ }>;
1392
+ description: string | null;
1393
+ expiresAt: string | null;
1394
+ id: string;
1395
+ invocationId: string;
1396
+ myApprovalRequired: boolean;
1397
+ resolvedAt: string | null;
1398
+ ruleSnapshot: {
1399
+ allowInvokerApproval: boolean;
1400
+ expiresInSeconds: number | null;
1401
+ requireAllSteps: boolean;
1402
+ steps: Array<{
1403
+ grantee: {
1404
+ kind: "organization";
1405
+ } | {
1406
+ kind: "user";
1407
+ userId: string;
1408
+ } | {
1409
+ coverage: "direct" | "inherited";
1410
+ groupId: string;
1411
+ kind: "group";
1412
+ };
1413
+ requiredApprovals: number;
1414
+ }>;
1415
+ };
1416
+ skillId: string | null;
1417
+ status: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1418
+ subjectId: string | null;
1419
+ subjectType: string;
1420
+ title: string;
1421
+ updatedAt: string | null;
1422
+ userId: string | null;
1423
+ userName: string | null;
1424
+ participation: "requester" | "reviewer" | "both";
1425
+ }>;
1426
+ paging: {
1427
+ page: number;
1428
+ pageSize: number;
1429
+ totalItems: number;
1430
+ totalPages: number;
1431
+ };
1432
+ }>;
1433
+ chat_approvals_search: ClientOperationDefinition<{
1434
+ query?: never;
1435
+ path?: never;
1436
+ body?: never;
1437
+ }, {
1438
+ canViewAll: boolean;
1439
+ data: Array<{
1440
+ approvalRuleId: string | null;
1441
+ approvalRuleName: string | null;
1442
+ createdAt: string | null;
1443
+ decisions: Array<{
1444
+ approverName: string | null;
1445
+ approverUserId: string;
1446
+ comment: string | null;
1447
+ decidedAt: string | null;
1448
+ id: string;
1449
+ status: string;
1450
+ stepIndex: number | null;
1451
+ stepSubjectId: string | null;
1452
+ stepSubjectKind: string | null;
1453
+ }>;
1454
+ description: string | null;
1455
+ expiresAt: string | null;
1456
+ id: string;
1457
+ invocationId: string;
1458
+ myApprovalRequired: boolean;
1459
+ resolvedAt: string | null;
1460
+ ruleSnapshot: {
1461
+ allowInvokerApproval: boolean;
1462
+ expiresInSeconds: number | null;
1463
+ requireAllSteps: boolean;
1464
+ steps: Array<{
1465
+ grantee: {
1466
+ kind: "organization";
1467
+ } | {
1468
+ kind: "user";
1469
+ userId: string;
1470
+ } | {
1471
+ coverage: "direct" | "inherited";
1472
+ groupId: string;
1473
+ kind: "group";
1474
+ };
1475
+ requiredApprovals: number;
1476
+ }>;
1477
+ };
1478
+ skillId: string | null;
1479
+ status: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1480
+ subjectId: string | null;
1481
+ subjectType: string;
1482
+ title: string;
1483
+ updatedAt: string | null;
1484
+ userId: string | null;
1485
+ userName: string | null;
1486
+ }>;
1487
+ paging: {
1488
+ page: number;
1489
+ pageSize: number;
1490
+ totalItems: number;
1491
+ totalPages: number;
1492
+ };
1493
+ }>;
1494
+ chat_approvals_get: ClientOperationDefinition<{
1495
+ query?: never;
1496
+ path: {
1497
+ approvalId: string;
1498
+ };
1499
+ body?: never;
1500
+ }, {
1501
+ actionContext: {
1502
+ action: {
1503
+ disclosure?: "author";
1504
+ value: string;
1505
+ visibility: "visible";
1506
+ } | {
1507
+ reason: "secret" | "privacy" | "unavailable";
1508
+ visibility: "omitted";
1509
+ };
1510
+ consequences: {
1511
+ approve: {
1512
+ disclosure?: "author";
1513
+ value: string;
1514
+ visibility: "visible";
1515
+ } | {
1516
+ reason: "secret" | "privacy" | "unavailable";
1517
+ visibility: "omitted";
1518
+ };
1519
+ reject: {
1520
+ disclosure?: "author";
1521
+ value: string;
1522
+ visibility: "visible";
1523
+ } | {
1524
+ reason: "secret" | "privacy" | "unavailable";
1525
+ visibility: "omitted";
1526
+ };
1527
+ };
1528
+ kind: "notification" | "tool" | "workflow";
1529
+ limitations: Array<string>;
1530
+ notification: {
1531
+ body: {
1532
+ disclosure?: "author";
1533
+ value: string;
1534
+ visibility: "visible";
1535
+ } | {
1536
+ reason: "secret" | "privacy" | "unavailable";
1537
+ visibility: "omitted";
1538
+ };
1539
+ destinations: Array<{
1540
+ disclosure?: "author";
1541
+ value: string;
1542
+ visibility: "visible";
1543
+ } | {
1544
+ reason: "secret" | "privacy" | "unavailable";
1545
+ visibility: "omitted";
1546
+ }>;
1547
+ recipients: Array<{
1548
+ disclosure?: "author";
1549
+ value: string;
1550
+ visibility: "visible";
1551
+ } | {
1552
+ reason: "secret" | "privacy" | "unavailable";
1553
+ visibility: "omitted";
1554
+ }>;
1555
+ title: {
1556
+ disclosure?: "author";
1557
+ value: string;
1558
+ visibility: "visible";
1559
+ } | {
1560
+ reason: "secret" | "privacy" | "unavailable";
1561
+ visibility: "omitted";
1562
+ };
1563
+ } | null;
1564
+ purpose: {
1565
+ disclosure?: "author";
1566
+ value: string;
1567
+ visibility: "visible";
1568
+ } | {
1569
+ reason: "secret" | "privacy" | "unavailable";
1570
+ visibility: "omitted";
1571
+ };
1572
+ requester: {
1573
+ disclosure?: "author";
1574
+ value: string;
1575
+ visibility: "visible";
1576
+ } | {
1577
+ reason: "secret" | "privacy" | "unavailable";
1578
+ visibility: "omitted";
1579
+ } | null;
1580
+ source: {
1581
+ kind: "skill" | "workflow";
1582
+ label: {
1583
+ disclosure?: "author";
1584
+ value: string;
1585
+ visibility: "visible";
1586
+ } | {
1587
+ reason: "secret" | "privacy" | "unavailable";
1588
+ visibility: "omitted";
1589
+ };
1590
+ } | null;
1591
+ tool: {
1592
+ name: {
1593
+ disclosure?: "author";
1594
+ value: string;
1595
+ visibility: "visible";
1596
+ } | {
1597
+ reason: "secret" | "privacy" | "unavailable";
1598
+ visibility: "omitted";
1599
+ };
1600
+ } | null;
1601
+ version: 1;
1602
+ workflow: {
1603
+ boundary: {
1604
+ disclosure?: "author";
1605
+ value: string;
1606
+ visibility: "visible";
1607
+ } | {
1608
+ reason: "secret" | "privacy" | "unavailable";
1609
+ visibility: "omitted";
1610
+ } | null;
1611
+ steps: Array<{
1612
+ label: {
1613
+ disclosure?: "author";
1614
+ value: string;
1615
+ visibility: "visible";
1616
+ } | {
1617
+ reason: "secret" | "privacy" | "unavailable";
1618
+ visibility: "omitted";
1619
+ };
1620
+ outcome: {
1621
+ disclosure?: "author";
1622
+ value: string;
1623
+ visibility: "visible";
1624
+ } | {
1625
+ reason: "secret" | "privacy" | "unavailable";
1626
+ visibility: "omitted";
1627
+ };
1628
+ }>;
1629
+ } | null;
1630
+ } | null;
1631
+ actions: {
1632
+ canApprove: boolean;
1633
+ canReject: boolean;
1634
+ };
1635
+ decisions: Array<{
1636
+ actorLabel: string;
1637
+ decidedAt: string;
1638
+ decision: "approved" | "rejected";
1639
+ }>;
1640
+ eligibilityBasis: "direct_user" | "group_member" | null;
1641
+ executionDisposition: "not_executed_destination_changed" | null;
1642
+ expiresAt: string | null;
1643
+ id: string;
1644
+ replacementForRequestId: string | null;
1645
+ replacementRequestId: string | null;
1646
+ rule: {
1647
+ mode: "all" | "any";
1648
+ satisfied: boolean;
1649
+ steps: Array<{
1650
+ approved: number;
1651
+ label: string;
1652
+ required: number;
1653
+ satisfied: boolean;
1654
+ }>;
1655
+ };
1656
+ status: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1657
+ terminalReason: string | null;
1658
+ viewerBasis: "eligible_approver" | "previous_approver" | "invoker" | "chat_viewer" | "execution_viewer";
1659
+ }>;
1660
+ chat_approvals_decide: ClientOperationDefinition<{
1661
+ query?: never;
1662
+ path: {
1663
+ approvalId: string;
1664
+ };
1665
+ body: {
1666
+ comment?: string | null;
1667
+ decision: "approved" | "rejected";
1668
+ };
1669
+ }, {
1670
+ approval: {
1671
+ approvalRuleId: string | null;
1672
+ approvalRuleName: string | null;
1673
+ createdAt: string | null;
1674
+ decisions: Array<{
1675
+ approverName: string | null;
1676
+ approverUserId: string;
1677
+ comment: string | null;
1678
+ decidedAt: string | null;
1679
+ id: string;
1680
+ status: string;
1681
+ stepIndex: number | null;
1682
+ stepSubjectId: string | null;
1683
+ stepSubjectKind: string | null;
1684
+ }>;
1685
+ description: string | null;
1686
+ expiresAt: string | null;
1687
+ id: string;
1688
+ invocationId: string;
1689
+ myApprovalRequired: boolean;
1690
+ resolvedAt: string | null;
1691
+ ruleSnapshot: {
1692
+ allowInvokerApproval: boolean;
1693
+ expiresInSeconds: number | null;
1694
+ requireAllSteps: boolean;
1695
+ steps: Array<{
1696
+ grantee: {
1697
+ kind: "organization";
1698
+ } | {
1699
+ kind: "user";
1700
+ userId: string;
1701
+ } | {
1702
+ coverage: "direct" | "inherited";
1703
+ groupId: string;
1704
+ kind: "group";
1705
+ };
1706
+ requiredApprovals: number;
1707
+ }>;
1708
+ };
1709
+ skillId: string | null;
1710
+ status: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1711
+ subjectId: string | null;
1712
+ subjectType: string;
1713
+ title: string;
1714
+ updatedAt: string | null;
1715
+ userId: string | null;
1716
+ userName: string | null;
1717
+ };
1718
+ approvalResult: {
1719
+ conversationId: string | null;
1720
+ kind: "approval_recorded" | "continued" | "continuation_in_progress" | "reconciliation_required" | "already_approved" | "already_decided";
1721
+ } | null;
1722
+ messages: Array<unknown>;
1723
+ run: unknown | null;
1724
+ }>;
1725
+ chat_approvals_reject: ClientOperationDefinition<{
1726
+ query?: never;
1727
+ path: {
1728
+ approvalId: string;
1729
+ };
1730
+ body: {
1731
+ reason: string;
1732
+ };
1733
+ }, {
1734
+ cause: "invoker_withdrawal" | "rejected";
1735
+ reason: string;
1736
+ requestId: string;
1737
+ resolvedAt: string;
1738
+ status: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1739
+ }>;
1740
+ chat_approvals_withdraw: ClientOperationDefinition<{
1741
+ query?: never;
1742
+ path: {
1743
+ approvalId: string;
1744
+ };
1745
+ body: {
1746
+ reason: string;
1747
+ };
1748
+ }, {
1749
+ cause: "invoker_withdrawal" | "rejected";
1750
+ reason: string;
1751
+ requestId: string;
1752
+ resolvedAt: string;
1753
+ status: "pending" | "approved" | "rejected" | "cancelled" | "expired";
1754
+ }>;
1755
+ chat_permissions_decide_wait: ClientOperationDefinition<{
1756
+ query?: never;
1757
+ path: {
1758
+ invocationId: string;
1759
+ };
1760
+ body: {
1761
+ decision: "allow_always" | "allow_this_conversation" | "deny";
1762
+ };
1763
+ }, {
1764
+ capabilityKind: string;
1765
+ conversationId: string | null;
1766
+ decision: "allow" | "deny";
1767
+ id: string;
1768
+ scope: "always" | "conversation";
1769
+ subjectId: string;
1770
+ }>;
1771
+ chat_permissions_list: ClientOperationDefinition<{
1772
+ query?: never;
1773
+ path?: never;
1774
+ body?: never;
1775
+ }, {
1776
+ data: Array<{
1777
+ capabilityKind: string;
1778
+ conversationId: string | null;
1779
+ decision: "allow" | "deny";
1780
+ id: string;
1781
+ scope: "always" | "conversation";
1782
+ subjectId: string;
1783
+ }>;
1784
+ }>;
1785
+ chat_permissions_update: ClientOperationDefinition<{
1786
+ query?: never;
1787
+ path: {
1788
+ permissionId: string;
1789
+ };
1790
+ body: {
1791
+ decision: "allow" | "deny";
1792
+ };
1793
+ }, {
1794
+ capabilityKind: string;
1795
+ conversationId: string | null;
1796
+ decision: "allow" | "deny";
1797
+ id: string;
1798
+ scope: "always" | "conversation";
1799
+ subjectId: string;
1800
+ }>;
1801
+ chat_permissions_revoke: ClientOperationDefinition<{
1802
+ query?: never;
1803
+ path: {
1804
+ permissionId: string;
1805
+ };
1806
+ body?: never;
1807
+ }, void>;
1808
+ chat_artifacts_progress: ClientOperationDefinition<{
1809
+ query?: never;
1810
+ path: {
1811
+ conversationId: string;
1812
+ };
1813
+ body?: never;
1814
+ }, {
1815
+ currentArtifact: {
1816
+ artifactId: string;
1817
+ contentType: string | null;
1818
+ filename: string;
1819
+ role: string;
1820
+ sourceKind: string;
1821
+ } | null;
1822
+ failed: number;
1823
+ leased: number;
1824
+ pending: number;
1825
+ processed: number;
1826
+ skipped: number;
1827
+ }>;
1828
+ chat_compaction_get: ClientOperationDefinition<{
1829
+ query?: never;
1830
+ path: {
1831
+ conversationId: string;
1832
+ };
1833
+ body?: never;
1834
+ }, {
1835
+ compaction: {
1836
+ active: boolean;
1837
+ activeSummary: {
1838
+ id: string;
1839
+ status: string;
1840
+ summary: string;
1841
+ trigger: string;
1842
+ } | null;
1843
+ boundary: {
1844
+ compactedThroughInvocationId: string | null;
1845
+ coveredInvocationCount: number;
1846
+ coveredMessageCount: number;
1847
+ } | null;
1848
+ };
1849
+ conversation: {
1850
+ agentId: string | null;
1851
+ createdAt: string | null;
1852
+ id: string;
1853
+ lastActivityAt: string | null;
1854
+ lastActivityInvocationId: string | null;
1855
+ memoryEnabled: boolean;
1856
+ organizationId: string;
1857
+ projectId: string | null;
1858
+ title: string;
1859
+ updatedAt: string | null;
1860
+ userId: string;
1861
+ origin: {
1862
+ id: string;
1863
+ kind: "studio_app" | "external_app";
1864
+ };
1865
+ };
1866
+ }>;
1867
+ chat_compaction_compact: ClientOperationDefinition<{
1868
+ query?: never;
1869
+ path: {
1870
+ conversationId: string;
1871
+ };
1872
+ body?: never;
1873
+ }, {
1874
+ compaction: {
1875
+ active: boolean;
1876
+ activeSummary: {
1877
+ id: string;
1878
+ status: string;
1879
+ summary: string;
1880
+ trigger: string;
1881
+ } | null;
1882
+ boundary: {
1883
+ compactedThroughInvocationId: string | null;
1884
+ coveredInvocationCount: number;
1885
+ coveredMessageCount: number;
1886
+ } | null;
1887
+ };
1888
+ conversation: {
1889
+ agentId: string | null;
1890
+ createdAt: string | null;
1891
+ id: string;
1892
+ lastActivityAt: string | null;
1893
+ lastActivityInvocationId: string | null;
1894
+ memoryEnabled: boolean;
1895
+ organizationId: string;
1896
+ projectId: string | null;
1897
+ title: string;
1898
+ updatedAt: string | null;
1899
+ userId: string;
1900
+ origin: {
1901
+ id: string;
1902
+ kind: "studio_app" | "external_app";
1903
+ };
1904
+ };
1905
+ }>;
1906
+ chat_compaction_regenerate: ClientOperationDefinition<{
1907
+ query?: never;
1908
+ path: {
1909
+ conversationId: string;
1910
+ };
1911
+ body?: never;
1912
+ }, {
1913
+ compaction: {
1914
+ active: boolean;
1915
+ activeSummary: {
1916
+ id: string;
1917
+ status: string;
1918
+ summary: string;
1919
+ trigger: string;
1920
+ } | null;
1921
+ boundary: {
1922
+ compactedThroughInvocationId: string | null;
1923
+ coveredInvocationCount: number;
1924
+ coveredMessageCount: number;
1925
+ } | null;
1926
+ };
1927
+ conversation: {
1928
+ agentId: string | null;
1929
+ createdAt: string | null;
1930
+ id: string;
1931
+ lastActivityAt: string | null;
1932
+ lastActivityInvocationId: string | null;
1933
+ memoryEnabled: boolean;
1934
+ organizationId: string;
1935
+ projectId: string | null;
1936
+ title: string;
1937
+ updatedAt: string | null;
1938
+ userId: string;
1939
+ origin: {
1940
+ id: string;
1941
+ kind: "studio_app" | "external_app";
1942
+ };
1943
+ };
1944
+ }>;
1945
+ chat_compaction_reset: ClientOperationDefinition<{
1946
+ query?: never;
1947
+ path: {
1948
+ conversationId: string;
1949
+ };
1950
+ body?: never;
1951
+ }, {
1952
+ compaction: {
1953
+ active: boolean;
1954
+ activeSummary: {
1955
+ id: string;
1956
+ status: string;
1957
+ summary: string;
1958
+ trigger: string;
1959
+ } | null;
1960
+ boundary: {
1961
+ compactedThroughInvocationId: string | null;
1962
+ coveredInvocationCount: number;
1963
+ coveredMessageCount: number;
1964
+ } | null;
1965
+ };
1966
+ conversation: {
1967
+ agentId: string | null;
1968
+ createdAt: string | null;
1969
+ id: string;
1970
+ lastActivityAt: string | null;
1971
+ lastActivityInvocationId: string | null;
1972
+ memoryEnabled: boolean;
1973
+ organizationId: string;
1974
+ projectId: string | null;
1975
+ title: string;
1976
+ updatedAt: string | null;
1977
+ userId: string;
1978
+ origin: {
1979
+ id: string;
1980
+ kind: "studio_app" | "external_app";
1981
+ };
1982
+ };
1983
+ }>;
1984
+ chat_evidence_resolve: ClientOperationDefinition<{
1985
+ query?: never;
1986
+ path: {
1987
+ invocationId: string;
1988
+ };
1989
+ body: {
1990
+ evidenceId: string;
1991
+ navigation: {
1992
+ entityId: string;
1993
+ kind: "entity";
1994
+ } | {
1995
+ fileId: string;
1996
+ kind: "file";
1997
+ } | {
1998
+ kind: "external_url";
1999
+ url: string;
2000
+ };
2001
+ };
2002
+ }, {
2003
+ target: {
2004
+ entityId: string;
2005
+ kind: "entity";
2006
+ } | {
2007
+ fileId: string;
2008
+ kind: "file";
2009
+ mediaUrl?: string;
2010
+ } | {
2011
+ kind: "external_url";
2012
+ url: string;
2013
+ } | null;
2014
+ }>;
2015
+ chat_interactions_respond: ClientOperationDefinition<{
2016
+ query?: never;
2017
+ path: {
2018
+ interactionId: string;
2019
+ };
2020
+ body: {
2021
+ action?: "answer" | "approve" | "revise" | null;
2022
+ optionId?: string | null;
2023
+ text?: string | null;
2024
+ };
2025
+ }, {
2026
+ id: string;
2027
+ invocationId: string;
2028
+ status: "completed" | "pending" | "responding";
2029
+ }>;
2030
+ chat_interactions_stream: ClientOperationDefinition<{
2031
+ query?: never;
2032
+ path: {
2033
+ interactionId: string;
2034
+ };
2035
+ body: {
2036
+ action?: "answer" | "approve" | "revise" | null;
2037
+ optionId?: string | null;
2038
+ text?: string | null;
2039
+ };
2040
+ }, AsyncIterable<{
2041
+ data: string;
2042
+ event: "interaction_result";
2043
+ id?: string;
2044
+ }>>;
2045
+ chat_projects_list: ClientOperationDefinition<{
2046
+ query?: never;
2047
+ path?: never;
2048
+ body?: never;
2049
+ }, {
2050
+ data: Array<{
2051
+ createdAt: string;
2052
+ id: string;
2053
+ instructions: string | null;
2054
+ name: string;
2055
+ updatedAt: string;
2056
+ }>;
2057
+ }>;
2058
+ chat_projects_create: ClientOperationDefinition<{
2059
+ query?: never;
2060
+ path?: never;
2061
+ body: {
2062
+ name: string;
2063
+ };
2064
+ }, {
2065
+ createdAt: string;
2066
+ id: string;
2067
+ instructions: string | null;
2068
+ name: string;
2069
+ updatedAt: string;
2070
+ }>;
2071
+ chat_projects_update: ClientOperationDefinition<{
2072
+ query?: never;
2073
+ path: {
2074
+ projectId: string;
2075
+ };
2076
+ body: {
2077
+ instructions?: string | null;
2078
+ name?: string;
2079
+ };
2080
+ }, {
2081
+ createdAt: string;
2082
+ id: string;
2083
+ instructions: string | null;
2084
+ name: string;
2085
+ updatedAt: string;
2086
+ }>;
2087
+ chat_projects_delete: ClientOperationDefinition<{
2088
+ query?: never;
2089
+ path: {
2090
+ projectId: string;
2091
+ };
2092
+ body?: never;
2093
+ }, void>;
2094
+ chat_projects_list_files: ClientOperationDefinition<{
2095
+ query?: never;
2096
+ path: {
2097
+ projectId: string;
2098
+ };
2099
+ body?: never;
2100
+ }, {
2101
+ files: Array<{
2102
+ contentType: string | null;
2103
+ createdAt: string;
2104
+ extractionState: "available" | "truncated" | "failed";
2105
+ filename: string;
2106
+ id: string;
2107
+ inContext: boolean;
2108
+ sizeBytes: number;
2109
+ }>;
2110
+ maxCharacters: number;
2111
+ usedCharacters: number;
2112
+ }>;
2113
+ chat_projects_upload_file: ClientOperationDefinition<{
2114
+ query?: never;
2115
+ path: {
2116
+ projectId: string;
2117
+ };
2118
+ readonly body: Readonly<{
2119
+ file: File;
2120
+ }>;
2121
+ }, {
2122
+ contentType: string | null;
2123
+ createdAt: string;
2124
+ extractionState: "available" | "truncated" | "failed";
2125
+ filename: string;
2126
+ id: string;
2127
+ inContext: boolean;
2128
+ sizeBytes: number;
2129
+ }>;
2130
+ chat_projects_delete_file: ClientOperationDefinition<{
2131
+ query?: never;
2132
+ path: {
2133
+ fileId: string;
2134
+ projectId: string;
2135
+ };
2136
+ body?: never;
2137
+ }, void>;
2138
+ chat_projects_file_download_url: ClientOperationDefinition<{
2139
+ query?: never;
2140
+ path: {
2141
+ fileId: string;
2142
+ projectId: string;
2143
+ };
2144
+ body?: never;
2145
+ }, {
2146
+ expiresIn: number;
2147
+ url: string;
2148
+ }>;
2149
+ chat_speech_create_clip: ClientOperationDefinition<{
2150
+ query?: never;
2151
+ path?: never;
2152
+ body: {
2153
+ contentType: string;
2154
+ size: number;
2155
+ };
2156
+ }, {
2157
+ clipId: string;
2158
+ headers: {
2159
+ [key: string]: string;
2160
+ };
2161
+ method: "PUT";
2162
+ url: string;
2163
+ }>;
2164
+ chat_speech_transcribe: ClientOperationDefinition<{
2165
+ query?: never;
2166
+ path?: never;
2167
+ body: {
2168
+ clipId: string;
2169
+ };
2170
+ }, {
2171
+ text: string;
2172
+ }>;
2173
+ chat_speech_availability: ClientOperationDefinition<{
2174
+ query?: never;
2175
+ path?: never;
2176
+ body?: never;
2177
+ }, {
2178
+ readAloud: boolean;
2179
+ remoteTranscription: boolean;
2180
+ }>;
2181
+ chat_speech_read_aloud_part: ClientOperationDefinition<{
2182
+ query?: never;
2183
+ path: {
2184
+ invocationId: string;
2185
+ partIndex: string;
2186
+ };
2187
+ body?: never;
2188
+ }, {
2189
+ partCount: number;
2190
+ url: string;
2191
+ }>;
869
2192
  }>>;
870
2193
  close: () => Promise<void>;
871
2194
  followRun: (runId: string) => Promise<{
@@ -990,4 +2313,4 @@ declare const CiError: typeof CiError$1;
990
2313
  * keeps the envelope shape; each instance of the `CiError` class has it.
991
2314
  */
992
2315
  type CiError = CiError$2;
993
- export { RealtimeTopicFilter as $, CiStreamEvent as A, layerProxyConfig as B, followRun as C, RunsValue as D, Runs as E, ExecuteResult as F, RealtimeStreamEnd as G, createDirectTransport as H, layerDirect as I, createFetchEventSourceFactory as J, RealtimeStreamEvent as K, layerDirectConfig as L, nextStreamCursor as M, CiClient as N, layer as O, CiClientValue as P, RealtimeTopic as Q, layerFromExecutor as R, FollowRunSource as S, RunFollowOptions as T, RealtimeEventSource as U, DirectTransportOptions as V, RealtimeEventSourceFactory as W, RealtimeWindow as X, RealtimeDocument as Y, RealtimeChange as Z, ClientSdkEntrypoint as _, RealtimeClientStatus as a, createClient as b, FixedWorkflowClient as c, DelegatedApplicationRuntime as d, realtimeTopicKey as et, DelegatedApplicationRuntimeOptions as f, ClientSdkClient as g, ClientDomains as h, RealtimeClientState as i, CiStreamPage as j, CiRunCancellation as k, FixedWorkflowClientOptions as l, createDelegatedApplicationRuntime as m, RealtimeClient as n, RealtimeTimers as o, DelegatedRuntimeState as p, RealtimeStreamHandlers as q, RealtimeClientOptions as r, createRealtimeClient as s, CiError as t, createFixedWorkflowClient as u, OrganizationClient as v, DEFAULT_FOLLOW_RUN_DEADLINE_MS as w, FollowRunOptions as x, clientSdkProtocolVersion as y, layerProxy as z };
2316
+ export { RealtimeChange as C, realtimeTopicKey as E, RealtimeWindow as S, RealtimeTopicFilter as T, RealtimeStreamEnd as _, RealtimeClientStatus as a, createFetchEventSourceFactory as b, FixedWorkflowClient as c, DelegatedApplicationRuntime as d, DelegatedApplicationRuntimeOptions as f, RealtimeEventSourceFactory as g, RealtimeEventSource as h, RealtimeClientState as i, FixedWorkflowClientOptions as l, createDelegatedApplicationRuntime as m, RealtimeClient as n, RealtimeTimers as o, DelegatedRuntimeState as p, RealtimeClientOptions as r, createRealtimeClient as s, CiError as t, createFixedWorkflowClient as u, RealtimeStreamEvent as v, RealtimeTopic as w, RealtimeDocument as x, RealtimeStreamHandlers as y };