@inferencesh/sdk 0.6.47 → 0.6.49

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.
package/dist/types.d.ts CHANGED
@@ -9,6 +9,8 @@ export interface InternalToolsConfig {
9
9
  skills?: boolean;
10
10
  host_context?: boolean;
11
11
  meta?: boolean;
12
+ artifact?: boolean;
13
+ spawn?: boolean;
12
14
  }
13
15
  /**
14
16
  * AgentTool represents a unified tool that can be used by an agent
@@ -490,6 +492,12 @@ export interface SecretCreateRequest {
490
492
  value: string;
491
493
  description?: string;
492
494
  provider?: string;
495
+ /**
496
+ * ConnectionScope is who the credential this key activates belongs to —
497
+ * chosen once, here; scope is immutable after creation. Empty = the
498
+ * provider's default (team). Requires the matching admin role.
499
+ */
500
+ connection_scope?: CredentialScope;
493
501
  }
494
502
  export interface SecretUpdateRequest {
495
503
  value: string;
@@ -503,6 +511,13 @@ export interface IntegrationConnectRequest {
503
511
  metadata?: {
504
512
  [key: string]: any;
505
513
  };
514
+ /**
515
+ * ConnectionScope is who the resulting credential belongs to:
516
+ * "user" (just me) or "team" (shared with the team — requires team
517
+ * admin). Empty = the provider's default. Distinct from Scopes, which
518
+ * are OAuth permission scopes.
519
+ */
520
+ connection_scope?: CredentialScope;
506
521
  }
507
522
  export interface IntegrationCompleteOAuthRequest {
508
523
  provider: string;
@@ -808,6 +823,22 @@ export declare const ScopeKnowledgeRead: Scope;
808
823
  * Empty scopes = full access (for backwards compatibility with existing keys).
809
824
  */
810
825
  export declare const ScopeKnowledgeWrite: Scope;
826
+ /**
827
+ * Action-level scopes for Artifacts (published HTML/Markdown pages)
828
+ */
829
+ export declare const ScopeArtifacts: Scope;
830
+ /**
831
+ * API Key Scopes - hierarchical permission system.
832
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
833
+ * Empty scopes = full access (for backwards compatibility with existing keys).
834
+ */
835
+ export declare const ScopeArtifactsRead: Scope;
836
+ /**
837
+ * API Key Scopes - hierarchical permission system.
838
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
839
+ * Empty scopes = full access (for backwards compatibility with existing keys).
840
+ */
841
+ export declare const ScopeArtifactsWrite: Scope;
811
842
  /**
812
843
  * Action-level scopes for User profile
813
844
  */
@@ -846,6 +877,7 @@ export declare const ScopeGroupIntegrations: ScopeGroup;
846
877
  export declare const ScopeGroupEngines: ScopeGroup;
847
878
  export declare const ScopeGroupApiKeys: ScopeGroup;
848
879
  export declare const ScopeGroupKnowledge: ScopeGroup;
880
+ export declare const ScopeGroupArtifacts: ScopeGroup;
849
881
  export declare const ScopeGroupUser: ScopeGroup;
850
882
  export declare const ScopeGroupSettings: ScopeGroup;
851
883
  /**
@@ -933,6 +965,13 @@ export interface AppFunction {
933
965
  description?: string;
934
966
  input_schema: any;
935
967
  output_schema: any;
968
+ /**
969
+ * Capabilities implied by the function's declared types, derived by
970
+ * engine discovery at deploy (e.g. "llm" when the function takes an
971
+ * LLMInput and returns an LLMOutput). Promoted onto the version's
972
+ * metadata by AppVersion.DeriveCapabilities.
973
+ */
974
+ capabilities?: string[];
936
975
  }
937
976
  /**
938
977
  * AppImages holds developer-provided images for the app.
@@ -1097,6 +1136,313 @@ export interface PublicAppStoreDTO {
1097
1136
  page_id?: string;
1098
1137
  pricing_description?: string;
1099
1138
  }
1139
+ /**
1140
+ * ResourceImages is the display-image set every listable resource carries:
1141
+ * a card image for grids, a thumbnail for dense rows, a banner for headers.
1142
+ * AppImages and AgentImages predate this and hold the same three fields;
1143
+ * they should collapse onto this type, but aliasing them changes what
1144
+ * gotypegen emits for existing consumers, so that migration is separate.
1145
+ */
1146
+ export interface ResourceImages {
1147
+ card: string;
1148
+ thumbnail: string;
1149
+ banner: string;
1150
+ }
1151
+ /**
1152
+ * ArtifactDTO is the API shape of an artifact entry.
1153
+ */
1154
+ export interface ArtifactDTO extends BaseModelDTO, PermissionModelDTO {
1155
+ /**
1156
+ * Namespace is the owning team's username, copied at creation. Immutable.
1157
+ */
1158
+ namespace: string;
1159
+ /**
1160
+ * Name is the slug within the namespace. Immutable.
1161
+ */
1162
+ name: string;
1163
+ title: string;
1164
+ description?: string;
1165
+ favicon?: string;
1166
+ type: ArtifactType;
1167
+ /**
1168
+ * Images are the cover images shown in galleries and headers, same as
1169
+ * apps and agents. The favicon stays the rendered page's tab icon.
1170
+ */
1171
+ images: ResourceImages;
1172
+ /**
1173
+ * VersionID points at the latest published version.
1174
+ */
1175
+ version_id: string;
1176
+ version?: ArtifactVersionDTO;
1177
+ /**
1178
+ * SharedVersionID pins the version viewers see. Empty = always latest.
1179
+ */
1180
+ shared_version_id?: string;
1181
+ /**
1182
+ * Capabilities declared by the latest version (runtime features the page
1183
+ * may use). Reserved for the artifact runtime; opaque to the API.
1184
+ */
1185
+ capabilities?: {
1186
+ [key: string]: any;
1187
+ };
1188
+ views: number;
1189
+ /**
1190
+ * URL is the canonical viewer URL for this artifact.
1191
+ */
1192
+ url?: string;
1193
+ }
1194
+ /**
1195
+ * ArtifactVersionDTO is one immutable publish of an artifact.
1196
+ */
1197
+ export interface ArtifactVersionDTO extends BaseModelDTO {
1198
+ artifact_id: string;
1199
+ /**
1200
+ * Number is the 1-based publish sequence within the artifact.
1201
+ */
1202
+ number: number;
1203
+ /**
1204
+ * Content is the stored source file (uri/hash/size). The inline `content`
1205
+ * field is only populated on write requests, never on reads — use the
1206
+ * /content endpoint to fetch the body.
1207
+ */
1208
+ content: KnowledgeFile;
1209
+ content_hash: string;
1210
+ /**
1211
+ * MD5 is the lowercase hex MD5 of the UTF-8 source; SizeBytes its byte
1212
+ * length. Both let a DLP consumer dedupe without downloading.
1213
+ */
1214
+ md5: string;
1215
+ size_bytes: number;
1216
+ label?: string;
1217
+ notes?: string;
1218
+ /**
1219
+ * Provenance — same conventions as knowledge versions.
1220
+ */
1221
+ origin?: string;
1222
+ generated_by?: string;
1223
+ capabilities?: {
1224
+ [key: string]: any;
1225
+ };
1226
+ created_by_user_id?: string;
1227
+ }
1228
+ /**
1229
+ * ArtifactCreateRequest is the body for POST /artifacts. Creates the entry
1230
+ * and its first version. When an artifact with the same name already exists
1231
+ * in the caller's namespace a new version is published instead.
1232
+ */
1233
+ export interface ArtifactCreateRequest {
1234
+ /**
1235
+ * Name is optional; derived from Title when empty.
1236
+ */
1237
+ name?: string;
1238
+ title: string;
1239
+ description?: string;
1240
+ favicon?: string;
1241
+ type?: ArtifactType;
1242
+ images?: ResourceImages;
1243
+ /**
1244
+ * Content is the page source (HTML body/document or Markdown).
1245
+ */
1246
+ content: string;
1247
+ /**
1248
+ * ContentEncoding is "base64" when Content is base64-encoded UTF-8. Use it
1249
+ * from browsers and CLIs: edge firewalls reject raw <script> in JSON bodies.
1250
+ */
1251
+ content_encoding?: string;
1252
+ label?: string;
1253
+ notes?: string;
1254
+ origin?: string;
1255
+ generated_by?: string;
1256
+ capabilities?: {
1257
+ [key: string]: any;
1258
+ };
1259
+ /**
1260
+ * BaseVersionID is the version this content was built on. When the
1261
+ * artifact has moved past it, the publish is refused instead of
1262
+ * discarding whatever landed in between. Leave it empty to publish
1263
+ * unconditionally.
1264
+ */
1265
+ base_version_id?: string;
1266
+ /**
1267
+ * Force publishes over a newer version anyway, discarding it. Only ever
1268
+ * set this because a person said to discard that specific version.
1269
+ */
1270
+ force?: boolean;
1271
+ }
1272
+ /**
1273
+ * ArtifactUpdateRequest is the body for POST /artifacts/{id}. Metadata only;
1274
+ * content changes go through ArtifactPublishRequest.
1275
+ */
1276
+ export interface ArtifactUpdateRequest {
1277
+ title?: string;
1278
+ description?: string;
1279
+ favicon?: string;
1280
+ /**
1281
+ * Images replaces the whole cover-image set when present.
1282
+ */
1283
+ images?: ResourceImages;
1284
+ /**
1285
+ * SharedVersionID pins the version viewers see. Pass "" to share latest.
1286
+ */
1287
+ shared_version_id?: string;
1288
+ }
1289
+ /**
1290
+ * ArtifactPublishRequest is the body for POST /artifacts/{id}/versions.
1291
+ */
1292
+ export interface ArtifactPublishRequest {
1293
+ content: string;
1294
+ /**
1295
+ * ContentEncoding is "base64" when Content is base64-encoded UTF-8.
1296
+ */
1297
+ content_encoding?: string;
1298
+ label?: string;
1299
+ notes?: string;
1300
+ origin?: string;
1301
+ generated_by?: string;
1302
+ capabilities?: {
1303
+ [key: string]: any;
1304
+ };
1305
+ /**
1306
+ * Title/Favicon/Description may be refreshed alongside a publish.
1307
+ */
1308
+ title?: string;
1309
+ description?: string;
1310
+ favicon?: string;
1311
+ images?: ResourceImages;
1312
+ /**
1313
+ * BaseVersionID is the version this content was built on. When the
1314
+ * artifact has moved past it, the publish is refused instead of
1315
+ * discarding whatever landed in between. Leave it empty to publish
1316
+ * unconditionally.
1317
+ */
1318
+ base_version_id?: string;
1319
+ /**
1320
+ * Force publishes over a newer version anyway, discarding it. Only ever
1321
+ * set this because a person said to discard that specific version.
1322
+ */
1323
+ force?: boolean;
1324
+ }
1325
+ /**
1326
+ * ArtifactContentResponse is the JSON form of an artifact version body.
1327
+ */
1328
+ export interface ArtifactContentResponse {
1329
+ artifact_id: string;
1330
+ version_id: string;
1331
+ number: number;
1332
+ type: ArtifactType;
1333
+ title: string;
1334
+ content: string;
1335
+ content_hash: string;
1336
+ md5: string;
1337
+ size_bytes: number;
1338
+ }
1339
+ /**
1340
+ * ArtifactDataDTO is one document in an artifact's store.
1341
+ */
1342
+ export interface ArtifactDataDTO {
1343
+ collection: string;
1344
+ doc_id: string;
1345
+ data: {
1346
+ [key: string]: any;
1347
+ };
1348
+ updated_at: string;
1349
+ /**
1350
+ * OwnerUserID is set for documents private to one viewer.
1351
+ */
1352
+ owner_user_id?: string;
1353
+ }
1354
+ /**
1355
+ * ArtifactDataRequest addresses one document, or a collection when DocID is
1356
+ * empty (list).
1357
+ */
1358
+ export interface ArtifactDataRequest {
1359
+ collection: string;
1360
+ doc_id?: string;
1361
+ /**
1362
+ * Data is the document body for set and update.
1363
+ */
1364
+ data?: {
1365
+ [key: string]: any;
1366
+ };
1367
+ /**
1368
+ * Limit caps a list; the server clamps it.
1369
+ */
1370
+ limit?: number;
1371
+ }
1372
+ /**
1373
+ * ArtifactDataListResponse is a page of documents from one collection.
1374
+ */
1375
+ export interface ArtifactDataListResponse {
1376
+ collection: string;
1377
+ documents: ArtifactDataDTO[];
1378
+ count: number;
1379
+ }
1380
+ /**
1381
+ * ArtifactViewerDTO is what the user capability tells a page about whoever
1382
+ * has it open. It carries no credential and no email.
1383
+ */
1384
+ export interface ArtifactViewerDTO {
1385
+ /**
1386
+ * SignedIn is false for someone opening a public link without an account.
1387
+ */
1388
+ signed_in: boolean;
1389
+ user_id?: string;
1390
+ name?: string;
1391
+ avatar_url?: string;
1392
+ /**
1393
+ * CanEdit reports whether this viewer may publish new versions.
1394
+ */
1395
+ can_edit: boolean;
1396
+ }
1397
+ /**
1398
+ * ArtifactAssetDTO describes one file stored beside an artifact. URL is
1399
+ * absolute and is the only way a page may reference the bytes: the page has
1400
+ * no network of its own, and the CSP names this origin only when the
1401
+ * artifact declared the assets capability.
1402
+ */
1403
+ export interface ArtifactAssetDTO {
1404
+ asset_id: string;
1405
+ filename?: string;
1406
+ content_type?: string;
1407
+ size_bytes: number;
1408
+ url: string;
1409
+ created_at: string;
1410
+ uploaded_by_user_id?: string;
1411
+ }
1412
+ /**
1413
+ * ArtifactAssetListResponse is the body of the asset listing.
1414
+ */
1415
+ export interface ArtifactAssetListResponse {
1416
+ assets: ArtifactAssetDTO[];
1417
+ count: number;
1418
+ /**
1419
+ * TotalBytes is what this artifact's assets occupy, against the budget
1420
+ * an upload is refused for exceeding.
1421
+ */
1422
+ total_bytes: number;
1423
+ /**
1424
+ * BudgetBytes is the ceiling for one artifact.
1425
+ */
1426
+ budget_bytes: number;
1427
+ }
1428
+ /**
1429
+ * ArtifactFrameDTO is what the viewer embeds. EmbedURL is for an iframe on
1430
+ * the app; TopURL is the same page opened directly. Both point at the
1431
+ * user-content domain, never the API.
1432
+ * When Exchange is true the URL carries a short-lived signed token that the
1433
+ * content origin swaps for a cookie scoped to that origin and then redirects
1434
+ * to the document, so the token leaves the address bar. When false the page
1435
+ * is public and no credential is needed.
1436
+ */
1437
+ export interface ArtifactFrameDTO {
1438
+ artifact_id: string;
1439
+ version_id: string;
1440
+ version_short_id: string;
1441
+ embed_url: string;
1442
+ top_url: string;
1443
+ exchange: boolean;
1444
+ expires_at?: string;
1445
+ }
1100
1446
  /**
1101
1447
  * AuthSessionDTO is a safe representation of AuthSession for API responses.
1102
1448
  */
@@ -1135,6 +1481,7 @@ export interface PermissionModelDTO {
1135
1481
  user?: UserRelationDTO;
1136
1482
  team_id: string;
1137
1483
  team?: TeamRelationDTO;
1484
+ org_id?: string;
1138
1485
  visibility: Visibility;
1139
1486
  }
1140
1487
  /**
@@ -1179,6 +1526,12 @@ export interface BountyProgramDTO extends BaseModelDTO, PermissionModelDTO {
1179
1526
  max_per_day: number;
1180
1527
  proof_type: string;
1181
1528
  proof_min_length: number;
1529
+ /**
1530
+ * RequiresPaymentMethod withholds the reward until the claimant's team has
1531
+ * a saved payment method. The claim itself is refused with 402
1532
+ * payment_method_required (survey answers are still recorded).
1533
+ */
1534
+ requires_payment_method: boolean;
1182
1535
  status: string;
1183
1536
  notice_text: string;
1184
1537
  notice_cooldown_hours: number;
@@ -1290,6 +1643,11 @@ export interface CursorListRequest {
1290
1643
  fields: string[];
1291
1644
  permissions: string[];
1292
1645
  include_others: boolean;
1646
+ /**
1647
+ * IncludePrivate: an owner or admin of the selected team asks for every
1648
+ * row the team owns, private ones included. Audited; ignored for others.
1649
+ */
1650
+ include_private?: boolean;
1293
1651
  }
1294
1652
  /**
1295
1653
  * CursorListResponse represents a cursor-based paginated response
@@ -1440,7 +1798,10 @@ export interface WorkerRAM {
1440
1798
  * EntitlementDTO for API responses
1441
1799
  */
1442
1800
  export interface EntitlementDTO extends BaseModelDTO {
1801
+ scope: EntitlementScope;
1443
1802
  team_id: string;
1803
+ org_id?: string;
1804
+ user_id?: string;
1444
1805
  resource: EntitlementResource;
1445
1806
  type: EntitlementType;
1446
1807
  enabled: boolean;
@@ -2084,77 +2445,6 @@ export interface SkillStoreListingDTO {
2084
2445
  uses: number;
2085
2446
  tags?: string[];
2086
2447
  }
2087
- /**
2088
- * LifecycleHookConfig registers a handler for an agent lifecycle event.
2089
- * Stored on AgentVersion alongside Tools and Skills.
2090
- */
2091
- export interface LifecycleHookConfig {
2092
- event: HookEvent;
2093
- type: HookHandlerType;
2094
- handler?: string;
2095
- async?: boolean;
2096
- timeout?: number;
2097
- /**
2098
- * Gate-specific fields (type: "gate")
2099
- */
2100
- default_resolution?: InterruptResolution;
2101
- }
2102
- /**
2103
- * LifecycleHookPayload is sent to hook handlers on lifecycle events.
2104
- */
2105
- export interface LifecycleHookPayload {
2106
- event: HookEvent;
2107
- timestamp: string;
2108
- agent_id: string;
2109
- chat_id: string;
2110
- run_id?: string;
2111
- turn_count: number;
2112
- data?: any;
2113
- }
2114
- /**
2115
- * LifecycleHookResponse is returned by hook handlers.
2116
- * All fields are optional — an empty 200 response is equivalent to {decision: "allow"}.
2117
- */
2118
- export interface LifecycleHookResponse {
2119
- inject?: ContextInjection;
2120
- decision?: HookDecision;
2121
- reason?: string;
2122
- override?: any;
2123
- system?: string;
2124
- }
2125
- /**
2126
- * ContextInjection adds ephemeral content to the agent's context window.
2127
- * Injections are stored as ChatMessages and filtered at context-build time.
2128
- */
2129
- export interface ContextInjection {
2130
- content: string;
2131
- role?: string;
2132
- ttl_turns?: number;
2133
- dedup_key?: string;
2134
- }
2135
- /**
2136
- * ToolCallEventData is the typed payload for agent.tool_call events.
2137
- */
2138
- export interface ToolCallEventData {
2139
- tool: string;
2140
- arguments?: {
2141
- [key: string]: any;
2142
- };
2143
- }
2144
- /**
2145
- * ToolResultEventData is the typed payload for agent.tool_result events.
2146
- */
2147
- export interface ToolResultEventData {
2148
- tool: string;
2149
- status: string;
2150
- result?: string;
2151
- }
2152
- /**
2153
- * ErrorEventData is the typed payload for agent.error events.
2154
- */
2155
- export interface ErrorEventData {
2156
- error: string;
2157
- }
2158
2448
  /**
2159
2449
  * ElicitationCapability advertises which elicitation modes the client handles.
2160
2450
  * An empty struct is equivalent to form-only for backward compatibility.
@@ -2321,9 +2611,10 @@ export type StringSlice = string[];
2321
2611
  export interface MCPServerDTO {
2322
2612
  id: string;
2323
2613
  user_id: string;
2324
- user: UserRelationDTO;
2614
+ user?: UserRelationDTO;
2325
2615
  team_id: string;
2326
- team: TeamRelationDTO;
2616
+ team?: TeamRelationDTO;
2617
+ org_id?: string;
2327
2618
  visibility: Visibility;
2328
2619
  slug: string;
2329
2620
  name: string;
@@ -2445,9 +2736,59 @@ export interface PageDTO extends BaseModelDTO, PermissionModelDTO {
2445
2736
  publish_at?: string;
2446
2737
  }
2447
2738
  /**
2448
- * MenuDTO for API responses
2739
+ * CommentDTO for API responses
2449
2740
  */
2450
- export interface MenuDTO extends BaseModelDTO, PermissionModelDTO {
2741
+ export interface CommentDTO extends BaseModelDTO, PermissionModelDTO {
2742
+ /**
2743
+ * ResourceType and ResourceID address what is commented on ("artifacts",
2744
+ * "pages"). PageID stays for the page comment API that predates them.
2745
+ */
2746
+ resource_type: string;
2747
+ resource_id: string;
2748
+ page_id: string;
2749
+ content: string;
2750
+ parent_comment_id?: string;
2751
+ children: CommentDTO[];
2752
+ status: CommentStatus;
2753
+ resolved_at?: string;
2754
+ resolved_by_user_id?: string;
2755
+ /**
2756
+ * AgentActivated reports whether an agent may reply to or resolve this
2757
+ * thread. Reading is always allowed to anyone who can read the resource.
2758
+ */
2759
+ agent_activated: boolean;
2760
+ agent_activated_by_user_id?: string;
2761
+ /**
2762
+ * AuthorAgentID attributes a reply written by an agent on a person's
2763
+ * behalf; clients render it as "agent, via <user>".
2764
+ */
2765
+ author_agent_id?: string;
2766
+ }
2767
+ /**
2768
+ * ArtifactCommentCreateRequest posts a thread or a reply on an artifact.
2769
+ */
2770
+ export interface ArtifactCommentCreateRequest {
2771
+ content: string;
2772
+ /**
2773
+ * ParentCommentID replies into an existing thread; omit to start one.
2774
+ */
2775
+ parent_comment_id?: string;
2776
+ /**
2777
+ * SendToAgent activates the thread for agents in the same call, which is
2778
+ * what a "send to agent" affordance does.
2779
+ */
2780
+ send_to_agent?: boolean;
2781
+ }
2782
+ /**
2783
+ * ArtifactCommentThreadDTO is one thread: its root plus replies in order.
2784
+ */
2785
+ export interface ArtifactCommentThreadDTO extends CommentDTO {
2786
+ replies: CommentDTO[];
2787
+ }
2788
+ /**
2789
+ * MenuDTO for API responses
2790
+ */
2791
+ export interface MenuDTO extends BaseModelDTO, PermissionModelDTO {
2451
2792
  name: string;
2452
2793
  slug: string;
2453
2794
  description: string;
@@ -2802,6 +3143,37 @@ export interface SubscriptionDTO extends BaseModelDTO {
2802
3143
  cancel_at_period_end: boolean;
2803
3144
  credits_per_period: number;
2804
3145
  }
3146
+ /**
3147
+ * SurveyResponseDTO is the API representation of a survey response.
3148
+ */
3149
+ export interface SurveyResponseDTO extends BaseModelDTO, PermissionModelDTO {
3150
+ question_id: string;
3151
+ response: string;
3152
+ agent?: string;
3153
+ source?: string;
3154
+ context?: string;
3155
+ }
3156
+ /**
3157
+ * SubmitSurveyResponse is returned when submitting a survey answer.
3158
+ * GrantedAmount is the credit reward in microcents (0 if no reward was earned).
3159
+ * RewardBlockedReason is set when the answer was recorded but the reward was
3160
+ * withheld by policy (see RewardBlockedPaymentMethodRequired).
3161
+ */
3162
+ export interface SubmitSurveyResponse {
3163
+ response: SurveyResponseDTO;
3164
+ granted_amount?: number;
3165
+ reward_blocked_reason?: string;
3166
+ }
3167
+ /**
3168
+ * SubmitSurveyRequest is used to submit a single survey answer.
3169
+ */
3170
+ export interface SubmitSurveyRequest {
3171
+ question_id: string;
3172
+ response: string;
3173
+ agent?: string;
3174
+ source?: string;
3175
+ context?: string;
3176
+ }
2805
3177
  /**
2806
3178
  * Hardware/System related types
2807
3179
  */
@@ -3160,6 +3532,11 @@ export interface UsageEventDTO extends BaseModelDTO, PermissionModelDTO {
3160
3532
  export interface UserDTO extends BaseModelDTO {
3161
3533
  default_team_id: string;
3162
3534
  role: Role;
3535
+ /**
3536
+ * ManagedByOrgID: set for enterprise-managed accounts (no personal team,
3537
+ * cannot create teams/orgs).
3538
+ */
3539
+ managed_by_org_id?: string;
3163
3540
  email: string;
3164
3541
  name: string;
3165
3542
  full_name: string;
@@ -3221,6 +3598,11 @@ export declare const A2UIBadge: A2UIComponentType;
3221
3598
  export declare const A2UISpacer: A2UIComponentType;
3222
3599
  export declare const A2UIChart: A2UIComponentType;
3223
3600
  export declare const A2UIForm: A2UIComponentType;
3601
+ /**
3602
+ * Artifact embeds a published artifact (sandboxed page) with a link to
3603
+ * the viewer. Rendered from the artifact's /render endpoint.
3604
+ */
3605
+ export declare const A2UIArtifact: A2UIComponentType;
3224
3606
  /**
3225
3607
  * A2UIComponent is the universal component representation.
3226
3608
  * Children are string IDs (flat adjacency list), not nested objects.
@@ -3239,17 +3621,17 @@ export interface A2UIComponent {
3239
3621
  /**
3240
3622
  * Text
3241
3623
  */
3242
- text?: A2UIBoundValue;
3624
+ text?: A2UIBound;
3243
3625
  variant?: string;
3244
3626
  /**
3245
3627
  * Image
3246
3628
  */
3247
- url?: A2UIBoundValue;
3629
+ url?: A2UIBound;
3248
3630
  fit?: string;
3249
3631
  /**
3250
3632
  * Icon
3251
3633
  */
3252
- name?: A2UIBoundValue;
3634
+ name?: A2UIBound;
3253
3635
  /**
3254
3636
  * Divider
3255
3637
  */
@@ -3264,7 +3646,7 @@ export interface A2UIComponent {
3264
3646
  * TextField
3265
3647
  */
3266
3648
  label?: string;
3267
- value?: A2UIBoundValue;
3649
+ value?: A2UIBound;
3268
3650
  textFieldType?: string;
3269
3651
  validationRegexp?: string;
3270
3652
  placeholder?: string;
@@ -3283,7 +3665,7 @@ export interface A2UIComponent {
3283
3665
  * ChoicePicker
3284
3666
  */
3285
3667
  options?: A2UIChoiceOption[];
3286
- selections?: A2UIBoundValue;
3668
+ selections?: A2UIBound;
3287
3669
  maxAllowedSelections?: number;
3288
3670
  /**
3289
3671
  * Modal
@@ -3323,7 +3705,16 @@ export interface A2UIComponent {
3323
3705
  * Extension: Form
3324
3706
  */
3325
3707
  onSubmitAction?: A2UIAction;
3708
+ /**
3709
+ * Extension: Artifact
3710
+ */
3711
+ artifactId?: string;
3712
+ artifactVersionId?: string;
3713
+ artifactTitle?: string;
3714
+ artifactUrl?: string;
3715
+ artifactFavicon?: string;
3326
3716
  }
3717
+ export type A2UIBound = string | number | boolean | A2UIBoundValue;
3327
3718
  /**
3328
3719
  * A2UIBoundValue is either a literal or a data model path reference.
3329
3720
  */
@@ -3356,164 +3747,6 @@ export interface A2UISurface {
3356
3747
  components: A2UIComponent[];
3357
3748
  dataModel?: any;
3358
3749
  }
3359
- /**
3360
- * AgentEventType identifies what happened in an agent run.
3361
- * These are the backbone protocol events — every consumer (A2A, SDK, frontend)
3362
- * projects from this set.
3363
- */
3364
- export type AgentEventType = string;
3365
- /**
3366
- * Run lifecycle
3367
- */
3368
- export declare const AgentEventRunStarted: AgentEventType;
3369
- export declare const AgentEventRunStateChanged: AgentEventType;
3370
- /**
3371
- * Turn lifecycle
3372
- */
3373
- export declare const AgentEventTurnStarted: AgentEventType;
3374
- export declare const AgentEventTurnCompleted: AgentEventType;
3375
- /**
3376
- * Content streaming — structural wrapper; high-frequency token deltas
3377
- * still flow via the existing DeltaEvent channel for efficiency.
3378
- */
3379
- export declare const AgentEventContentDelta: AgentEventType;
3380
- /**
3381
- * Tool lifecycle
3382
- */
3383
- export declare const AgentEventToolStarted: AgentEventType;
3384
- export declare const AgentEventToolCompleted: AgentEventType;
3385
- /**
3386
- * Approval flow
3387
- */
3388
- export declare const AgentEventApprovalRequired: AgentEventType;
3389
- export declare const AgentEventApprovalResolved: AgentEventType;
3390
- /**
3391
- * Hook lifecycle
3392
- */
3393
- export declare const AgentEventHookExecuted: AgentEventType;
3394
- /**
3395
- * Usage
3396
- */
3397
- export declare const AgentEventUsageUpdated: AgentEventType;
3398
- /**
3399
- * Context management
3400
- */
3401
- export declare const AgentEventContextCompacted: AgentEventType;
3402
- /**
3403
- * Errors
3404
- */
3405
- export declare const AgentEventError: AgentEventType;
3406
- /**
3407
- * AgentEvent is the backbone protocol event for agent runs.
3408
- * Published to "runs:<runID>" and "chats:<chatID>" keys on the event bus.
3409
- */
3410
- export interface AgentEvent {
3411
- id: string;
3412
- type: AgentEventType;
3413
- run_id: string;
3414
- chat_id: string;
3415
- agent_id?: string;
3416
- timestamp: string;
3417
- payload?: any;
3418
- }
3419
- export interface RunStartedPayload {
3420
- agent_id: string;
3421
- agent_version_id?: string;
3422
- user_message_id?: string;
3423
- }
3424
- export interface RunStateChangedPayload {
3425
- from_state: AgentRunState;
3426
- to_state: AgentRunState;
3427
- error?: string;
3428
- }
3429
- export interface TurnStartedPayload {
3430
- turn_index: number;
3431
- model?: string;
3432
- }
3433
- export interface TurnCompletedPayload {
3434
- turn_index: number;
3435
- tool_count: number;
3436
- has_output: boolean;
3437
- stop_reason?: string;
3438
- }
3439
- export interface ContentDeltaPayload {
3440
- kind: ContentDeltaKind;
3441
- delta: string;
3442
- }
3443
- export type ContentDeltaKind = string;
3444
- export declare const ContentDeltaText: ContentDeltaKind;
3445
- export declare const ContentDeltaReasoning: ContentDeltaKind;
3446
- export interface ToolStartedPayload {
3447
- tool_invocation_id: string;
3448
- tool_name: string;
3449
- tool_type?: ToolType;
3450
- display_name?: string;
3451
- arguments?: StringEncodedMap;
3452
- }
3453
- export interface ToolCompletedPayload {
3454
- tool_invocation_id: string;
3455
- tool_name: string;
3456
- status: ToolInvocationStatus;
3457
- result?: string;
3458
- duration_ms?: number;
3459
- }
3460
- export interface ApprovalRequiredPayload {
3461
- tool_invocation_id: string;
3462
- tool_name: string;
3463
- arguments?: StringEncodedMap;
3464
- reason: InterruptReason;
3465
- }
3466
- export interface ApprovalResolvedPayload {
3467
- tool_invocation_id: string;
3468
- tool_name: string;
3469
- decision: string;
3470
- reason?: string;
3471
- }
3472
- export interface HookExecutedPayload {
3473
- hook_event: HookEvent;
3474
- decision: HookDecision;
3475
- reason?: string;
3476
- duration_ms?: number;
3477
- }
3478
- export interface UsageUpdatedPayload {
3479
- prompt_tokens: number;
3480
- completion_tokens: number;
3481
- total_tokens: number;
3482
- reasoning_tokens?: number;
3483
- cost_usd?: number;
3484
- }
3485
- export interface ContextCompactedPayload {
3486
- before_tokens: number;
3487
- after_tokens: number;
3488
- }
3489
- export interface ErrorPayload {
3490
- message: string;
3491
- code?: string;
3492
- }
3493
- /**
3494
- * AgentRunState tracks the lifecycle of an agent run (one user→agent turn).
3495
- * Maps to A2A TaskState and AG-UI Run outcome for protocol compliance.
3496
- */
3497
- export type AgentRunState = string;
3498
- export declare const AgentRunStateSubmitted: AgentRunState;
3499
- export declare const AgentRunStateWorking: AgentRunState;
3500
- export declare const AgentRunStateInputRequired: AgentRunState;
3501
- export declare const AgentRunStateAuthRequired: AgentRunState;
3502
- export declare const AgentRunStateCompleted: AgentRunState;
3503
- export declare const AgentRunStateFailed: AgentRunState;
3504
- export declare const AgentRunStateCanceled: AgentRunState;
3505
- export declare const AgentRunStateRejected: AgentRunState;
3506
- /**
3507
- * InterruptReason describes why an agent run is in an interrupted state.
3508
- * Aligns with AG-UI interrupt outcome reasons.
3509
- */
3510
- export type InterruptReason = string;
3511
- export declare const InterruptReasonToolApproval: InterruptReason;
3512
- export declare const InterruptReasonClientTool: InterruptReason;
3513
- export declare const InterruptReasonWidget: InterruptReason;
3514
- export declare const InterruptReasonAuth: InterruptReason;
3515
- export declare const InterruptReasonConfirmation: InterruptReason;
3516
- export declare const InterruptReasonHookGate: InterruptReason;
3517
3750
  export type AppCategory = string;
3518
3751
  export declare const AppCategoryImage: AppCategory;
3519
3752
  export declare const AppCategoryVideo: AppCategory;
@@ -3541,6 +3774,11 @@ export declare const GPUTypeApple: GPUType;
3541
3774
  export type Visibility = string;
3542
3775
  export declare const VisibilityPrivate: Visibility;
3543
3776
  export declare const VisibilityTeam: Visibility;
3777
+ /**
3778
+ * VisibilityOrg sits between team and public: visible to every member of
3779
+ * every team in the owning team's org (INF-795 Phase 2).
3780
+ */
3781
+ export declare const VisibilityOrg: Visibility;
3544
3782
  export declare const VisibilityPublic: Visibility;
3545
3783
  export declare const VisibilityUnlisted: Visibility;
3546
3784
  /**
@@ -3549,6 +3787,13 @@ export declare const VisibilityUnlisted: Visibility;
3549
3787
  export type Permission = string;
3550
3788
  export declare const PermRead: Permission;
3551
3789
  export declare const PermWrite: Permission;
3790
+ /**
3791
+ * PermUse is execute intent: run an app, load a skill/knowledge into an
3792
+ * agent context, invoke an MCP tool. Distinct from read — a public
3793
+ * resource is readable by everyone, but whether this caller may USE it is
3794
+ * governed by their team/org usage policy (reach, INF-808).
3795
+ */
3796
+ export declare const PermUse: Permission;
3552
3797
  export type SubscriptionStatus = string;
3553
3798
  export declare const SubscriptionStatusTrialing: SubscriptionStatus;
3554
3799
  export declare const SubscriptionStatusActive: SubscriptionStatus;
@@ -3570,6 +3815,16 @@ export declare const EntitlementSourceAddon: EntitlementSource;
3570
3815
  export type EntitlementType = string;
3571
3816
  export declare const EntitlementTypeBoolean: EntitlementType;
3572
3817
  export declare const EntitlementTypeLimit: EntitlementType;
3818
+ /**
3819
+ * EntitlementScope is who an entitlement row applies to (INF-799). The scope's
3820
+ * owner columns (team_id / org_id / user_id) identify the owner, mirroring the
3821
+ * ownership pattern used across the codebase; resolution matches all scopes
3822
+ * visible from an AuthContext in one query and mergeEntitlements arbitrates.
3823
+ */
3824
+ export type EntitlementScope = string;
3825
+ export declare const EntitlementScopeOrg: EntitlementScope;
3826
+ export declare const EntitlementScopeTeam: EntitlementScope;
3827
+ export declare const EntitlementScopeMember: EntitlementScope;
3573
3828
  export type EnforcementMode = string;
3574
3829
  export declare const EnforcementBlock: EnforcementMode;
3575
3830
  export declare const EnforcementWarn: EnforcementMode;
@@ -3650,9 +3905,6 @@ export interface IntegrationContext {
3650
3905
  integration_type?: IntegrationType;
3651
3906
  integration_metadata?: any;
3652
3907
  }
3653
- export type StringEncodedMap = {
3654
- [key: string]: any;
3655
- };
3656
3908
  /**
3657
3909
  * EngineStatus represents the status of an engine.
3658
3910
  */
@@ -3815,90 +4067,31 @@ export declare const GraphEdgeTypeSupersedes: GraphEdgeType;
3815
4067
  export declare const GraphEdgeTypeInput: GraphEdgeType;
3816
4068
  export declare const GraphEdgeTypeOutput: GraphEdgeType;
3817
4069
  /**
3818
- * InterruptStatus tracks the lifecycle of an interrupt gate.
4070
+ * MergeStrategy defines how a delta field should be merged by consumers.
3819
4071
  */
3820
- export type InterruptStatus = string;
3821
- export declare const InterruptStatusPending: InterruptStatus;
3822
- export declare const InterruptStatusResolved: InterruptStatus;
3823
- export declare const InterruptStatusExpired: InterruptStatus;
3824
- export declare const InterruptStatusCancelled: InterruptStatus;
4072
+ export type MergeStrategy = string;
4073
+ export declare const MergeStrategyConcat: MergeStrategy;
4074
+ export declare const MergeStrategyReplace: MergeStrategy;
4075
+ export declare const MergeStrategyIndexed: MergeStrategy;
4076
+ export declare const MergeStrategyNested: MergeStrategy;
3825
4077
  /**
3826
- * InterruptResolution records how a pending interrupt was resolved.
4078
+ * StreamDelta is the marker base for all streaming delta types.
4079
+ * Types embedding StreamDelta are routed through the delta channel.
3827
4080
  */
3828
- export type InterruptResolution = string;
3829
- export declare const InterruptResolutionAllow: InterruptResolution;
3830
- export declare const InterruptResolutionDeny: InterruptResolution;
4081
+ export interface StreamDelta {
4082
+ }
3831
4083
  /**
3832
- * InterruptResourceType identifies the kind of resource an interrupt gates.
4084
+ * LLMOutput is the output envelope from an LLM provider task.
4085
+ * This is the contract between chat apps (sdk-py) and the agent runtime (go/api).
3833
4086
  */
3834
- export type InterruptResourceType = string;
3835
- export declare const InterruptResourceToolInvocation: InterruptResourceType;
3836
- export declare const InterruptResourceHookEvent: InterruptResourceType;
4087
+ export interface LLMOutput {
4088
+ response: string;
4089
+ reasoning?: string;
4090
+ tool_calls?: ToolCall[];
4091
+ usage?: LLMUsage;
4092
+ }
3837
4093
  /**
3838
- * HookEvent is a lifecycle event in the agent conversation loop.
3839
- * Events fire at well-defined points in the turn cycle, giving external
3840
- * handlers the ability to observe, inject context, or halt execution.
3841
- */
3842
- export type HookEvent = string;
3843
- export declare const HookEventAgentStart: HookEvent;
3844
- export declare const HookEventTurnStart: HookEvent;
3845
- export declare const HookEventToolCall: HookEvent;
3846
- export declare const HookEventToolResult: HookEvent;
3847
- export declare const HookEventTurnComplete: HookEvent;
3848
- export declare const HookEventAgentError: HookEvent;
3849
- export declare const HookEventAgentComplete: HookEvent;
3850
- export declare const HookEventAgentIdle: HookEvent;
3851
- export declare const HookEventPreCompact: HookEvent;
3852
- export declare const HookEventPostCompact: HookEvent;
3853
- /**
3854
- * HookEventDefinition describes a lifecycle hook event and its capabilities.
3855
- */
3856
- export interface HookEventDefinition {
3857
- event: HookEvent;
3858
- description: string;
3859
- can_gate: boolean;
3860
- }
3861
- /**
3862
- * HookDecision is the handler's verdict on whether execution should continue.
3863
- */
3864
- export type HookDecision = string;
3865
- export declare const HookDecisionAllow: HookDecision;
3866
- export declare const HookDecisionDeny: HookDecision;
3867
- export declare const HookDecisionStop: HookDecision;
3868
- export declare const HookDecisionSuspend: HookDecision;
3869
- /**
3870
- * HookHandlerType distinguishes how a lifecycle hook is executed.
3871
- */
3872
- export type HookHandlerType = string;
3873
- export declare const HookHandlerWebhook: HookHandlerType;
3874
- export declare const HookHandlerTask: HookHandlerType;
3875
- export declare const HookHandlerGate: HookHandlerType;
3876
- /**
3877
- * MergeStrategy defines how a delta field should be merged by consumers.
3878
- */
3879
- export type MergeStrategy = string;
3880
- export declare const MergeStrategyConcat: MergeStrategy;
3881
- export declare const MergeStrategyReplace: MergeStrategy;
3882
- export declare const MergeStrategyIndexed: MergeStrategy;
3883
- export declare const MergeStrategyNested: MergeStrategy;
3884
- /**
3885
- * StreamDelta is the marker base for all streaming delta types.
3886
- * Types embedding StreamDelta are routed through the delta channel.
3887
- */
3888
- export interface StreamDelta {
3889
- }
3890
- /**
3891
- * LLMOutput is the output envelope from an LLM provider task.
3892
- * This is the contract between chat apps (sdk-py) and the agent runtime (go/api).
3893
- */
3894
- export interface LLMOutput {
3895
- response: string;
3896
- reasoning?: string;
3897
- tool_calls?: ToolCall[];
3898
- usage?: LLMUsage;
3899
- }
3900
- /**
3901
- * LLMDelta is a streaming delta for LLMOutput.
4094
+ * LLMDelta is a streaming delta for LLMOutput.
3902
4095
  */
3903
4096
  export interface LLMDelta extends StreamDelta {
3904
4097
  response: string;
@@ -4004,32 +4197,17 @@ export interface ResponseFormat {
4004
4197
  json_schema?: any;
4005
4198
  strict?: boolean;
4006
4199
  }
4007
- /**
4008
- * ModelSettings groups sampling and generation parameters as a passable unit.
4009
- */
4010
- export interface ModelSettings {
4011
- temperature?: number;
4012
- top_p?: number;
4013
- top_k?: number;
4014
- min_p?: number;
4015
- frequency_penalty?: number;
4016
- presence_penalty?: number;
4017
- repetition_penalty?: number;
4018
- seed?: number;
4019
- stop?: string[];
4020
- max_tokens?: number;
4021
- reasoning_effort?: string;
4022
- reasoning_max_tokens?: number;
4023
- }
4024
4200
  /**
4025
4201
  * LLMSettings is everything that configures a generation independent of the
4026
- * conversation: model, sampling, system prompt, tools and output constraints.
4027
- * Embedded by both BaseLLMInput (an agent's stored configuration) and
4028
- * LLMInput (a single call), so a field added here reaches both and the call
4029
- * is built from the configuration by one assignment.
4202
+ * conversation: context, sampling, system prompt, tools and output
4203
+ * constraints. Embedded (tstype extends) by BaseLLMInput — an agent's stored
4204
+ * configuration — and LLMInput — a single call — so a field added here
4205
+ * reaches both, and the call is built from the configuration by one
4206
+ * assignment.
4207
+ * Which model runs is not a setting: the app is the model. An app that
4208
+ * fronts several models (a router) declares its own `model` input.
4030
4209
  */
4031
4210
  export interface LLMSettings {
4032
- model?: string;
4033
4211
  context_size: number;
4034
4212
  temperature?: number;
4035
4213
  top_p?: number;
@@ -4052,25 +4230,7 @@ export interface LLMSettings {
4052
4230
  * LLMInput is the input envelope for an LLM provider task: the settings plus
4053
4231
  * the conversation, with the current turn split out of the context.
4054
4232
  */
4055
- export interface LLMInput {
4056
- model: string;
4057
- context_size: number;
4058
- temperature?: number;
4059
- top_p?: number;
4060
- top_k?: number;
4061
- min_p?: number;
4062
- frequency_penalty?: number;
4063
- presence_penalty?: number;
4064
- repetition_penalty?: number;
4065
- seed?: number;
4066
- stop?: string[];
4067
- max_tokens?: number;
4068
- reasoning_effort?: string;
4069
- reasoning_max_tokens?: number;
4070
- system_prompt: string;
4071
- tools?: Tool[];
4072
- tool_choice?: ToolChoice;
4073
- response_format?: ResponseFormat;
4233
+ export interface LLMInput extends LLMSettings {
4074
4234
  context: LLMContextMessage[];
4075
4235
  role?: ChatMessageRole;
4076
4236
  text?: string;
@@ -4123,29 +4283,11 @@ export declare const PageTypeDoc: PageType;
4123
4283
  export declare const PageTypeBlog: PageType;
4124
4284
  export declare const PageTypePage: PageType;
4125
4285
  export declare const PageTypeAnnouncement: PageType;
4126
- /**
4127
- * ToolInvocationStatus represents the execution status of a tool invocation
4128
- */
4129
- export type ToolInvocationStatus = string;
4130
- export declare const ToolInvocationStatusPending: ToolInvocationStatus;
4131
- export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
4132
- export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
4133
- export declare const ToolInvocationStatusAwaitingApproval: ToolInvocationStatus;
4134
- export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
4135
- export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
4136
- export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
4137
- /**
4138
- * ToolType represents the type of tool (used in both AgentTool definition and ToolInvocation)
4139
- */
4140
- export type ToolType = string;
4141
- export declare const ToolTypeApp: ToolType;
4142
- export declare const ToolTypeAgent: ToolType;
4143
- export declare const ToolTypeHook: ToolType;
4144
- export declare const ToolTypeHTTP: ToolType;
4145
- export declare const ToolTypeCall: ToolType;
4146
- export declare const ToolTypeMCP: ToolType;
4147
- export declare const ToolTypeClient: ToolType;
4148
- export declare const ToolTypeInternal: ToolType;
4286
+ export type CommentStatus = number;
4287
+ export declare const CommentStatusUnknown: CommentStatus;
4288
+ export declare const CommentStatusDraft: CommentStatus;
4289
+ export declare const CommentStatusPublished: CommentStatus;
4290
+ export declare const CommentStatusArchived: CommentStatus;
4149
4291
  export type InstanceCloudProvider = string;
4150
4292
  export declare const CloudAWS: InstanceCloudProvider;
4151
4293
  export declare const CloudAmaya: InstanceCloudProvider;
@@ -4256,6 +4398,12 @@ export declare const KnowledgeLifecyclePermanent: KnowledgeLifecycle;
4256
4398
  export declare const KnowledgeLifecycleDecay: KnowledgeLifecycle;
4257
4399
  export declare const KnowledgeLifecycleDraft: KnowledgeLifecycle;
4258
4400
  export declare const KnowledgeLifecycleDeprecated: KnowledgeLifecycle;
4401
+ /**
4402
+ * ArtifactType is the source format of an artifact page.
4403
+ */
4404
+ export type ArtifactType = string;
4405
+ export declare const ArtifactTypeHTML: ArtifactType;
4406
+ export declare const ArtifactTypeMarkdown: ArtifactType;
4259
4407
  export type FilterOperator = string;
4260
4408
  export declare const OpEqual: FilterOperator;
4261
4409
  export declare const OpNotEqual: FilterOperator;
@@ -4389,6 +4537,21 @@ export declare const IntegrationGrantCredentials: IntegrationGrant;
4389
4537
  * IntegrationGrantToken provides ready-to-use access (token, API key, etc.).
4390
4538
  */
4391
4539
  export declare const IntegrationGrantToken: IntegrationGrant;
4540
+ /**
4541
+ * CredentialScope controls resolution priority and ownership.
4542
+ */
4543
+ export type CredentialScope = string;
4544
+ export declare const CredentialScopePlatform: CredentialScope;
4545
+ /**
4546
+ * CredentialScopeOrg: shared across all teams of an org. In the enum for
4547
+ * end-to-end typing (connect-level pickers); connects with it are refused
4548
+ * until the org domain lands (INF-795 Phase 2). Resolution order once
4549
+ * live: agent > user > team > org > platform.
4550
+ */
4551
+ export declare const CredentialScopeOrg: CredentialScope;
4552
+ export declare const CredentialScopeTeam: CredentialScope;
4553
+ export declare const CredentialScopeUser: CredentialScope;
4554
+ export declare const CredentialScopeAgent: CredentialScope;
4392
4555
  /**
4393
4556
  * NotificationChannel represents a delivery channel
4394
4557
  */
@@ -4517,6 +4680,14 @@ export type TeamType = string;
4517
4680
  export declare const TeamTypePersonal: TeamType;
4518
4681
  export declare const TeamTypeTeam: TeamType;
4519
4682
  export declare const TeamTypeSystem: TeamType;
4683
+ /**
4684
+ * TeamTypeOrg is an organization's own workspace. Its id is the org's
4685
+ * id, its org_id points at itself, its members are the org's admins, and
4686
+ * it owns what the org owns: the payer row, billing settings, org-scope
4687
+ * credentials. Minted by org creation only; never archived while member
4688
+ * teams exist.
4689
+ */
4690
+ export declare const TeamTypeOrg: TeamType;
4520
4691
  export type TeamStatus = string;
4521
4692
  export declare const TeamStatusActive: TeamStatus;
4522
4693
  export declare const TeamStatusSuspended: TeamStatus;
@@ -4525,6 +4696,335 @@ export type TeamRole = string;
4525
4696
  export declare const TeamRoleOwner: TeamRole;
4526
4697
  export declare const TeamRoleAdmin: TeamRole;
4527
4698
  export declare const TeamRoleMember: TeamRole;
4699
+ export type Role = string;
4700
+ export declare const RoleGuest: Role;
4701
+ export declare const RoleUser: Role;
4702
+ export declare const RoleAdmin: Role;
4703
+ export declare const RoleSystem: Role;
4704
+ /**
4705
+ * UtilityConfig defines a flow utility node — gate, selector, merge, or custom CEL.
4706
+ */
4707
+ export interface UtilityConfig {
4708
+ preset: string;
4709
+ expression?: string;
4710
+ gate?: GateCondition;
4711
+ selector?: SelectorConfig;
4712
+ constant?: any;
4713
+ }
4714
+ /**
4715
+ * AgentEventType identifies what happened in an agent run.
4716
+ * These are the backbone protocol events — every consumer (A2A, SDK, frontend)
4717
+ * projects from this set.
4718
+ */
4719
+ export type AgentEventType = string;
4720
+ /**
4721
+ * Run lifecycle
4722
+ */
4723
+ export declare const AgentEventRunStarted: AgentEventType;
4724
+ export declare const AgentEventRunStateChanged: AgentEventType;
4725
+ /**
4726
+ * Turn lifecycle
4727
+ */
4728
+ export declare const AgentEventTurnStarted: AgentEventType;
4729
+ export declare const AgentEventTurnCompleted: AgentEventType;
4730
+ /**
4731
+ * Content streaming — structural wrapper; high-frequency token deltas
4732
+ * still flow via the existing DeltaEvent channel for efficiency.
4733
+ */
4734
+ export declare const AgentEventContentDelta: AgentEventType;
4735
+ /**
4736
+ * Tool lifecycle
4737
+ */
4738
+ export declare const AgentEventToolStarted: AgentEventType;
4739
+ export declare const AgentEventToolCompleted: AgentEventType;
4740
+ /**
4741
+ * Approval flow
4742
+ */
4743
+ export declare const AgentEventApprovalRequired: AgentEventType;
4744
+ export declare const AgentEventApprovalResolved: AgentEventType;
4745
+ /**
4746
+ * Hook lifecycle
4747
+ */
4748
+ export declare const AgentEventHookExecuted: AgentEventType;
4749
+ /**
4750
+ * Usage
4751
+ */
4752
+ export declare const AgentEventUsageUpdated: AgentEventType;
4753
+ /**
4754
+ * Context management
4755
+ */
4756
+ export declare const AgentEventContextCompacted: AgentEventType;
4757
+ /**
4758
+ * Errors
4759
+ */
4760
+ export declare const AgentEventError: AgentEventType;
4761
+ /**
4762
+ * AgentEvent is the backbone protocol event for agent runs.
4763
+ * Published to "runs:<runID>" and "chats:<chatID>" keys on the event bus.
4764
+ */
4765
+ export interface AgentEvent {
4766
+ id: string;
4767
+ type: AgentEventType;
4768
+ run_id: string;
4769
+ chat_id: string;
4770
+ agent_id?: string;
4771
+ timestamp: string;
4772
+ payload?: any;
4773
+ }
4774
+ export interface RunStartedPayload {
4775
+ agent_id: string;
4776
+ agent_version_id?: string;
4777
+ user_message_id?: string;
4778
+ }
4779
+ export interface RunStateChangedPayload {
4780
+ from_state: AgentRunState;
4781
+ to_state: AgentRunState;
4782
+ error?: string;
4783
+ }
4784
+ export interface TurnStartedPayload {
4785
+ turn_index: number;
4786
+ model?: string;
4787
+ }
4788
+ export interface TurnCompletedPayload {
4789
+ turn_index: number;
4790
+ tool_count: number;
4791
+ has_output: boolean;
4792
+ stop_reason?: string;
4793
+ }
4794
+ export interface ContentDeltaPayload {
4795
+ kind: ContentDeltaKind;
4796
+ delta: string;
4797
+ }
4798
+ export type ContentDeltaKind = string;
4799
+ export declare const ContentDeltaText: ContentDeltaKind;
4800
+ export declare const ContentDeltaReasoning: ContentDeltaKind;
4801
+ export interface ToolStartedPayload {
4802
+ tool_invocation_id: string;
4803
+ tool_name: string;
4804
+ tool_type?: ToolType;
4805
+ display_name?: string;
4806
+ arguments?: StringEncodedMap;
4807
+ }
4808
+ export interface ToolCompletedPayload {
4809
+ tool_invocation_id: string;
4810
+ tool_name: string;
4811
+ status: ToolInvocationStatus;
4812
+ result?: string;
4813
+ duration_ms?: number;
4814
+ }
4815
+ export interface ApprovalRequiredPayload {
4816
+ tool_invocation_id: string;
4817
+ tool_name: string;
4818
+ arguments?: StringEncodedMap;
4819
+ reason: InterruptReason;
4820
+ }
4821
+ export interface ApprovalResolvedPayload {
4822
+ tool_invocation_id: string;
4823
+ tool_name: string;
4824
+ decision: string;
4825
+ reason?: string;
4826
+ }
4827
+ export interface HookExecutedPayload {
4828
+ hook_event: HookEvent;
4829
+ decision: HookDecision;
4830
+ reason?: string;
4831
+ duration_ms?: number;
4832
+ }
4833
+ export interface UsageUpdatedPayload {
4834
+ prompt_tokens: number;
4835
+ completion_tokens: number;
4836
+ total_tokens: number;
4837
+ reasoning_tokens?: number;
4838
+ cost_usd?: number;
4839
+ }
4840
+ export interface ContextCompactedPayload {
4841
+ before_tokens: number;
4842
+ after_tokens: number;
4843
+ }
4844
+ export interface ErrorPayload {
4845
+ message: string;
4846
+ code?: string;
4847
+ }
4848
+ /**
4849
+ * AgentRunState tracks the lifecycle of an agent run (one user→agent turn).
4850
+ * Maps to A2A TaskState and AG-UI Run outcome for protocol compliance.
4851
+ */
4852
+ export type AgentRunState = string;
4853
+ export declare const AgentRunStateSubmitted: AgentRunState;
4854
+ export declare const AgentRunStateWorking: AgentRunState;
4855
+ export declare const AgentRunStateInputRequired: AgentRunState;
4856
+ export declare const AgentRunStateAuthRequired: AgentRunState;
4857
+ export declare const AgentRunStateCompleted: AgentRunState;
4858
+ export declare const AgentRunStateFailed: AgentRunState;
4859
+ export declare const AgentRunStateCanceled: AgentRunState;
4860
+ export declare const AgentRunStateRejected: AgentRunState;
4861
+ /**
4862
+ * InterruptReason describes why an agent run is in an interrupted state.
4863
+ * Aligns with AG-UI interrupt outcome reasons.
4864
+ */
4865
+ export type InterruptReason = string;
4866
+ export declare const InterruptReasonToolApproval: InterruptReason;
4867
+ export declare const InterruptReasonClientTool: InterruptReason;
4868
+ export declare const InterruptReasonWidget: InterruptReason;
4869
+ export declare const InterruptReasonAuth: InterruptReason;
4870
+ export declare const InterruptReasonConfirmation: InterruptReason;
4871
+ export declare const InterruptReasonHookGate: InterruptReason;
4872
+ export type StringEncodedMap = {
4873
+ [key: string]: any;
4874
+ };
4875
+ /**
4876
+ * InterruptStatus tracks the lifecycle of an interrupt gate.
4877
+ */
4878
+ export type InterruptStatus = string;
4879
+ export declare const InterruptStatusPending: InterruptStatus;
4880
+ export declare const InterruptStatusResolved: InterruptStatus;
4881
+ export declare const InterruptStatusExpired: InterruptStatus;
4882
+ export declare const InterruptStatusCancelled: InterruptStatus;
4883
+ /**
4884
+ * InterruptResolution records how a pending interrupt was resolved.
4885
+ */
4886
+ export type InterruptResolution = string;
4887
+ export declare const InterruptResolutionAllow: InterruptResolution;
4888
+ export declare const InterruptResolutionDeny: InterruptResolution;
4889
+ /**
4890
+ * InterruptResourceType identifies the kind of resource an interrupt gates.
4891
+ */
4892
+ export type InterruptResourceType = string;
4893
+ export declare const InterruptResourceToolInvocation: InterruptResourceType;
4894
+ export declare const InterruptResourceHookEvent: InterruptResourceType;
4895
+ /**
4896
+ * HookEvent is a lifecycle event in the agent conversation loop.
4897
+ * Events fire at well-defined points in the turn cycle, giving external
4898
+ * handlers the ability to observe, inject context, or halt execution.
4899
+ */
4900
+ export type HookEvent = string;
4901
+ export declare const HookEventAgentStart: HookEvent;
4902
+ export declare const HookEventTurnStart: HookEvent;
4903
+ export declare const HookEventToolCall: HookEvent;
4904
+ export declare const HookEventToolResult: HookEvent;
4905
+ export declare const HookEventTurnComplete: HookEvent;
4906
+ export declare const HookEventAgentError: HookEvent;
4907
+ export declare const HookEventAgentComplete: HookEvent;
4908
+ export declare const HookEventAgentIdle: HookEvent;
4909
+ export declare const HookEventPreCompact: HookEvent;
4910
+ export declare const HookEventPostCompact: HookEvent;
4911
+ /**
4912
+ * HookEventDefinition describes a lifecycle hook event and its capabilities.
4913
+ */
4914
+ export interface HookEventDefinition {
4915
+ event: HookEvent;
4916
+ description: string;
4917
+ can_gate: boolean;
4918
+ }
4919
+ /**
4920
+ * HookDecision is the handler's verdict on whether execution should continue.
4921
+ */
4922
+ export type HookDecision = string;
4923
+ export declare const HookDecisionAllow: HookDecision;
4924
+ export declare const HookDecisionDeny: HookDecision;
4925
+ export declare const HookDecisionStop: HookDecision;
4926
+ export declare const HookDecisionSuspend: HookDecision;
4927
+ /**
4928
+ * HookHandlerType distinguishes how a lifecycle hook is executed.
4929
+ */
4930
+ export type HookHandlerType = string;
4931
+ export declare const HookHandlerWebhook: HookHandlerType;
4932
+ export declare const HookHandlerTask: HookHandlerType;
4933
+ export declare const HookHandlerGate: HookHandlerType;
4934
+ /**
4935
+ * LifecycleHookConfig registers a handler for an agent lifecycle event.
4936
+ * Stored on AgentVersion alongside Tools and Skills.
4937
+ */
4938
+ export interface LifecycleHookConfig {
4939
+ event: HookEvent;
4940
+ type: HookHandlerType;
4941
+ handler?: string;
4942
+ async?: boolean;
4943
+ timeout?: number;
4944
+ /**
4945
+ * Gate-specific fields (type: "gate")
4946
+ */
4947
+ default_resolution?: InterruptResolution;
4948
+ }
4949
+ /**
4950
+ * LifecycleHookPayload is sent to hook handlers on lifecycle events.
4951
+ */
4952
+ export interface LifecycleHookPayload {
4953
+ event: HookEvent;
4954
+ timestamp: string;
4955
+ agent_id: string;
4956
+ chat_id: string;
4957
+ run_id?: string;
4958
+ turn_count: number;
4959
+ data?: any;
4960
+ }
4961
+ /**
4962
+ * LifecycleHookResponse is returned by hook handlers.
4963
+ * All fields are optional — an empty 200 response is equivalent to {decision: "allow"}.
4964
+ */
4965
+ export interface LifecycleHookResponse {
4966
+ inject?: ContextInjection;
4967
+ decision?: HookDecision;
4968
+ reason?: string;
4969
+ override?: any;
4970
+ system?: string;
4971
+ }
4972
+ /**
4973
+ * ContextInjection adds ephemeral content to the agent's context window.
4974
+ * Injections are stored as ChatMessages and filtered at context-build time.
4975
+ */
4976
+ export interface ContextInjection {
4977
+ content: string;
4978
+ role?: string;
4979
+ ttl_turns?: number;
4980
+ dedup_key?: string;
4981
+ }
4982
+ /**
4983
+ * ToolCallEventData is the typed payload for agent.tool_call events.
4984
+ */
4985
+ export interface ToolCallEventData {
4986
+ tool: string;
4987
+ arguments?: {
4988
+ [key: string]: any;
4989
+ };
4990
+ }
4991
+ /**
4992
+ * ToolResultEventData is the typed payload for agent.tool_result events.
4993
+ */
4994
+ export interface ToolResultEventData {
4995
+ tool: string;
4996
+ status: string;
4997
+ result?: string;
4998
+ }
4999
+ /**
5000
+ * ErrorEventData is the typed payload for agent.error events.
5001
+ */
5002
+ export interface ErrorEventData {
5003
+ error: string;
5004
+ }
5005
+ /**
5006
+ * ToolInvocationStatus represents the execution status of a tool invocation
5007
+ */
5008
+ export type ToolInvocationStatus = string;
5009
+ export declare const ToolInvocationStatusPending: ToolInvocationStatus;
5010
+ export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
5011
+ export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
5012
+ export declare const ToolInvocationStatusAwaitingApproval: ToolInvocationStatus;
5013
+ export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
5014
+ export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
5015
+ export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
5016
+ /**
5017
+ * ToolType represents the type of tool (used in both AgentTool definition and ToolInvocation)
5018
+ */
5019
+ export type ToolType = string;
5020
+ export declare const ToolTypeApp: ToolType;
5021
+ export declare const ToolTypeAgent: ToolType;
5022
+ export declare const ToolTypeHook: ToolType;
5023
+ export declare const ToolTypeHTTP: ToolType;
5024
+ export declare const ToolTypeCall: ToolType;
5025
+ export declare const ToolTypeMCP: ToolType;
5026
+ export declare const ToolTypeClient: ToolType;
5027
+ export declare const ToolTypeInternal: ToolType;
4528
5028
  /**
4529
5029
  * ToolCallType represents the type field on a tool call (wire format).
4530
5030
  */
@@ -4635,18 +5135,3 @@ export interface ToolParameterProperty {
4635
5135
  items?: ToolParameterProperty;
4636
5136
  required?: string[];
4637
5137
  }
4638
- export type Role = string;
4639
- export declare const RoleGuest: Role;
4640
- export declare const RoleUser: Role;
4641
- export declare const RoleAdmin: Role;
4642
- export declare const RoleSystem: Role;
4643
- /**
4644
- * UtilityConfig defines a flow utility node — gate, selector, merge, or custom CEL.
4645
- */
4646
- export interface UtilityConfig {
4647
- preset: string;
4648
- expression?: string;
4649
- gate?: GateCondition;
4650
- selector?: SelectorConfig;
4651
- constant?: any;
4652
- }