@macro-inc/sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +45 -0
  2. package/dist/{chunk-Y4HQV7EL.js → chunk-AZJUIUIV.js} +26 -0
  3. package/dist/{chunk-KPR5JIGY.js → chunk-G43PLP2U.js} +95 -0
  4. package/dist/{chunk-IIICUUWY.js → chunk-PPR7IWZ7.js} +51 -51
  5. package/dist/{chunk-PTMBRVEK.js → chunk-PTX2RV2N.js} +84 -0
  6. package/dist/{chunk-OEHZOKGE.js → chunk-PZPTJI6F.js} +16 -0
  7. package/dist/{chunk-HR32RQGP.js → chunk-ZLBDES7U.js} +307 -1
  8. package/dist/generated/agent-fold/index.d.ts +6 -1
  9. package/dist/generated/agent-harness/index.d.ts +1 -1
  10. package/dist/generated/agent-harness/index.js +1 -1
  11. package/dist/generated/agent-harness/sdk.gen.d.ts +44 -1
  12. package/dist/generated/agent-harness/types.gen.d.ts +699 -0
  13. package/dist/generated/calendar/index.d.ts +1 -1
  14. package/dist/generated/calendar/index.js +1 -1
  15. package/dist/generated/calendar/sdk.gen.d.ts +41 -1
  16. package/dist/generated/calendar/types.gen.d.ts +904 -2
  17. package/dist/generated/cognition/index.d.ts +1 -1
  18. package/dist/generated/cognition/index.js +1 -1
  19. package/dist/generated/cognition/sdk.gen.d.ts +9 -1
  20. package/dist/generated/cognition/types.gen.d.ts +79 -0
  21. package/dist/generated/email/types.gen.d.ts +11 -1
  22. package/dist/generated/notification/index.js +1 -1
  23. package/dist/generated/notification/sdk.gen.d.ts +20 -20
  24. package/dist/generated/notification/types.gen.d.ts +77 -72
  25. package/dist/generated/scheduled-action/index.d.ts +1 -1
  26. package/dist/generated/scheduled-action/index.js +1 -1
  27. package/dist/generated/scheduled-action/sdk.gen.d.ts +4 -1
  28. package/dist/generated/scheduled-action/types.gen.d.ts +388 -7
  29. package/dist/generated/storage/index.d.ts +1 -1
  30. package/dist/generated/storage/index.js +1 -1
  31. package/dist/generated/storage/sdk.gen.d.ts +151 -1
  32. package/dist/generated/storage/types.gen.d.ts +3888 -139
  33. package/dist/src/entities/account-managers/grant.d.ts +39 -0
  34. package/dist/src/entities/account-managers/namespace.d.ts +17 -0
  35. package/dist/src/entities/agent-sessions/activity.d.ts +39 -0
  36. package/dist/src/entities/agent-sessions/agent-session.d.ts +42 -0
  37. package/dist/src/entities/agent-sessions/namespace.d.ts +7 -1
  38. package/dist/src/entities/agent-sessions/origin.d.ts +94 -0
  39. package/dist/src/entities/ai/namespace.d.ts +1 -1
  40. package/dist/src/entities/bots/bot.d.ts +108 -0
  41. package/dist/src/entities/bots/namespace.d.ts +15 -4
  42. package/dist/src/entities/bots/token.d.ts +34 -0
  43. package/dist/src/entities/calendar/booking-link.d.ts +49 -0
  44. package/dist/src/entities/calendar/booking-namespace.d.ts +130 -0
  45. package/dist/src/entities/calendar/booking-namespace.test.d.ts +1 -0
  46. package/dist/src/entities/calendar/booking.d.ts +77 -0
  47. package/dist/src/entities/calendar/create-confirmed.test.d.ts +1 -0
  48. package/dist/src/entities/calendar/namespace.d.ts +63 -15
  49. package/dist/src/entities/calls/call-record.d.ts +25 -3
  50. package/dist/src/entities/calls/connection.d.ts +53 -0
  51. package/dist/src/entities/calls/errors.d.ts +15 -0
  52. package/dist/src/entities/calls/namespace.d.ts +19 -2
  53. package/dist/src/entities/calls/participant.d.ts +22 -0
  54. package/dist/src/entities/channels/channel.d.ts +21 -3
  55. package/dist/src/entities/channels/namespace.d.ts +3 -3
  56. package/dist/src/entities/channels/post.d.ts +10 -2
  57. package/dist/src/entities/channels/thread.d.ts +4 -0
  58. package/dist/src/entities/chats/chat.d.ts +1 -1
  59. package/dist/src/entities/chats/namespace.d.ts +14 -1
  60. package/dist/src/entities/connected-apps/connected-app.d.ts +107 -0
  61. package/dist/src/entities/connected-apps/connector.d.ts +56 -0
  62. package/dist/src/entities/connected-apps/namespace.d.ts +74 -0
  63. package/dist/src/entities/crm/company.d.ts +1 -1
  64. package/dist/src/entities/crm/pipeline.d.ts +1 -1
  65. package/dist/src/entities/documents/document.d.ts +156 -7
  66. package/dist/src/entities/documents/namespace.d.ts +41 -2
  67. package/dist/src/entities/documents/office-files.d.ts +47 -0
  68. package/dist/src/entities/email/draft.d.ts +26 -4
  69. package/dist/src/entities/email/message.d.ts +91 -1
  70. package/dist/src/entities/email/namespace.d.ts +26 -3
  71. package/dist/src/entities/email/namespace.test.d.ts +1 -0
  72. package/dist/src/entities/email/thread.d.ts +7 -2
  73. package/dist/src/entities/external-chat/namespace.d.ts +2 -0
  74. package/dist/src/entities/favorites/namespace.d.ts +1 -1
  75. package/dist/src/entities/harnesses/namespace.d.ts +5 -1
  76. package/dist/src/entities/images/namespace.d.ts +5 -1
  77. package/dist/src/entities/me/namespace.d.ts +5 -1
  78. package/dist/src/entities/meetings/meeting.d.ts +5 -0
  79. package/dist/src/entities/messages/thread.d.ts +1 -1
  80. package/dist/src/entities/pins/namespace.d.ts +1 -1
  81. package/dist/src/entities/projects/namespace.d.ts +1 -1
  82. package/dist/src/entities/projects/project.d.ts +1 -1
  83. package/dist/src/entities/search/namespace.d.ts +65 -0
  84. package/dist/src/entities/search/options.d.ts +29 -0
  85. package/dist/src/entities/search/types.d.ts +90 -0
  86. package/dist/src/entities/tasks/namespace.d.ts +1 -1
  87. package/dist/src/entities/tasks/task.d.ts +4 -3
  88. package/dist/src/entities/users/namespace.d.ts +1 -1
  89. package/dist/src/entities/whatsapp/namespace.d.ts +2 -0
  90. package/dist/src/entities/workspace/items.d.ts +7 -0
  91. package/dist/src/entities/workspace/namespace.d.ts +14 -9
  92. package/dist/src/entities/workspace/query.d.ts +23 -0
  93. package/dist/src/entities/workspace/types.d.ts +6 -3
  94. package/dist/src/events/hydrate/call.d.ts +101 -0
  95. package/dist/src/events/types.d.ts +2 -1
  96. package/dist/src/macro.d.ts +33 -1
  97. package/dist/src/macro.js +6423 -4265
  98. package/dist/src/utils/activity.d.ts +23 -2
  99. package/package.json +1 -1
  100. package/dist/src/entities/search.d.ts +0 -53
@@ -5,6 +5,48 @@ export type ClientOptions = {
5
5
  * Ordered from least to most access top -> bottom
6
6
  */
7
7
  export type AccessLevel = 'view' | 'comment' | 'edit' | 'owner';
8
+ /**
9
+ * One activity row on the wire — the realtime projection of an inserted
10
+ * `activity_events` row.
11
+ */
12
+ export type ActivityWireRow = {
13
+ /**
14
+ * The stored action tag.
15
+ */
16
+ action: string;
17
+ /**
18
+ * The stored action payload, if any.
19
+ */
20
+ action_payload?: unknown;
21
+ /**
22
+ * Who mechanically acted, as a principal string (`macro|…` / `bot|…`).
23
+ */
24
+ actor_id: string;
25
+ /**
26
+ * Originating code-mode invocation, absent on older events.
27
+ */
28
+ agent_correlation_id?: string | null;
29
+ /**
30
+ * The entity acted on.
31
+ */
32
+ entity_id: string;
33
+ /**
34
+ * The kind of entity acted on.
35
+ */
36
+ entity_type: EntityType;
37
+ /**
38
+ * The stored activity id.
39
+ */
40
+ id: string;
41
+ /**
42
+ * When it happened.
43
+ */
44
+ occurred_at: string;
45
+ /**
46
+ * Whose activity this is (a principal string).
47
+ */
48
+ subject_id: string;
49
+ };
8
50
  /**
9
51
  * One thing a caller wants an agent to do.
10
52
  */
@@ -37,6 +79,46 @@ export type AgentAction = (AgentPromptAction & {
37
79
  * not uuids and stay `None`.
38
80
  */
39
81
  export type AgentActionId = string;
82
+ /**
83
+ * Stable chronological resume position.
84
+ */
85
+ export type AgentActivityCursor = {
86
+ /**
87
+ * Tie-breaking activity identity.
88
+ */
89
+ id: string;
90
+ /**
91
+ * Last stored event time.
92
+ */
93
+ occurredAt: string;
94
+ };
95
+ /**
96
+ * One page of the activity caused by this session.
97
+ */
98
+ export type AgentActivityPage = {
99
+ /**
100
+ * Original activity rows, also retained in the affected entities' histories.
101
+ */
102
+ activities: Array<ActivityWireRow>;
103
+ nextCursor?: null | AgentActivityCursor;
104
+ };
105
+ /**
106
+ * An agent acting for a person.
107
+ */
108
+ export type AgentActor = {
109
+ /**
110
+ * The agent.
111
+ */
112
+ bot: BotId;
113
+ /**
114
+ * Where the agent's own work came from.
115
+ */
116
+ lineage: Lineage;
117
+ /**
118
+ * The person it acts for.
119
+ */
120
+ on_behalf_of: MacroUserIdStr;
121
+ };
40
122
  /**
41
123
  * Type-specific state for one agent session setting.
42
124
  */
@@ -551,6 +633,11 @@ export type AgentSessionResponse = {
551
633
  * User-facing session name.
552
634
  */
553
635
  name: string;
636
+ /**
637
+ * What opened the session: who or what started it, and what it is about.
638
+ * `unknown` when nothing recorded it.
639
+ */
640
+ origin?: TriggerOrigin;
554
641
  /**
555
642
  * The exact message that invoked the bot, if any.
556
643
  */
@@ -730,6 +817,21 @@ export type CalendarSuggestions = {
730
817
  */
731
818
  title?: string | null;
732
819
  };
820
+ /**
821
+ * Call one tool of a connected app.
822
+ */
823
+ export type CallConnectedTool = {
824
+ /**
825
+ * The tool's arguments, matching its input schema.
826
+ */
827
+ arguments?: {
828
+ [key: string]: unknown;
829
+ };
830
+ /**
831
+ * The tool's name on its server.
832
+ */
833
+ tool: string;
834
+ };
733
835
  /**
734
836
  * Call search supports speakers, channels and attendance status.
735
837
  */
@@ -751,6 +853,18 @@ export type CallSearchSuggestions = {
751
853
  */
752
854
  status?: string | null;
753
855
  };
856
+ /**
857
+ * Who did something that opened a session.
858
+ */
859
+ export type Caller = {
860
+ type: 'person';
861
+ /**
862
+ * Who.
863
+ */
864
+ user: MacroUserIdStr;
865
+ } | (AgentActor & {
866
+ type: 'agent';
867
+ });
754
868
  /**
755
869
  * Harness names accepted by the capability-discovery endpoint.
756
870
  */
@@ -939,6 +1053,149 @@ export type CodingPreferencesBody = {
939
1053
  */
940
1054
  openPullRequests: boolean;
941
1055
  };
1056
+ /**
1057
+ * Add a custom MCP server to the user's connections.
1058
+ */
1059
+ export type ConnectMcpServer = {
1060
+ /**
1061
+ * Display name for the server.
1062
+ */
1063
+ serverName: string;
1064
+ /**
1065
+ * The server's URL.
1066
+ */
1067
+ url: string;
1068
+ };
1069
+ /**
1070
+ * Response from [`ConnectMcpServer`].
1071
+ */
1072
+ export type ConnectMcpServerResponse = {
1073
+ /**
1074
+ * Whether the user already had this server before the call.
1075
+ */
1076
+ alreadyConnected: boolean;
1077
+ /**
1078
+ * Whether the server holds the user's sign-in.
1079
+ */
1080
+ authenticated: boolean;
1081
+ /**
1082
+ * Whether the server's tools are turned on.
1083
+ */
1084
+ enabled: boolean;
1085
+ /**
1086
+ * The server's display name.
1087
+ */
1088
+ serverName: string;
1089
+ /**
1090
+ * What happened and what the user still has to do.
1091
+ */
1092
+ summary: string;
1093
+ /**
1094
+ * The server's URL.
1095
+ */
1096
+ url: string;
1097
+ };
1098
+ /**
1099
+ * A connected app the session's agent may use.
1100
+ */
1101
+ export type ConnectedApp = {
1102
+ /**
1103
+ * The app's slug, or its custom server key.
1104
+ */
1105
+ key: string;
1106
+ /**
1107
+ * Which store the app comes from.
1108
+ */
1109
+ kind: ConnectedAppKind;
1110
+ /**
1111
+ * Display name, e.g. `Slack` or the owner's name for a custom server.
1112
+ */
1113
+ name: string;
1114
+ };
1115
+ /**
1116
+ * Which store a connected app comes from.
1117
+ */
1118
+ export type ConnectedAppKind = 'app' | 'custom';
1119
+ /**
1120
+ * One tool a connected app serves.
1121
+ */
1122
+ export type ConnectedTool = {
1123
+ /**
1124
+ * What the server says the tool does.
1125
+ */
1126
+ description?: string | null;
1127
+ /**
1128
+ * JSON Schema for the tool's arguments.
1129
+ */
1130
+ inputSchema: {
1131
+ [key: string]: unknown;
1132
+ };
1133
+ /**
1134
+ * The tool's name on its server.
1135
+ */
1136
+ name: string;
1137
+ };
1138
+ /**
1139
+ * One tool found by a search across the agent's connected apps.
1140
+ */
1141
+ export type ConnectedToolMatch = {
1142
+ /**
1143
+ * The app serving the tool.
1144
+ */
1145
+ app: ConnectedApp;
1146
+ /**
1147
+ * The tool.
1148
+ */
1149
+ tool: ConnectedTool;
1150
+ };
1151
+ /**
1152
+ * A connected tool's answer: MCP's `CallToolResult`.
1153
+ */
1154
+ export type ConnectedToolResult = {
1155
+ /**
1156
+ * MCP content blocks, e.g. `{type: "text", text}`.
1157
+ */
1158
+ content: Array<{
1159
+ [key: string]: unknown;
1160
+ }>;
1161
+ /**
1162
+ * The tool failed, or could not run; `content` says why.
1163
+ */
1164
+ isError: boolean;
1165
+ /**
1166
+ * Structured output, for tools that declare an output schema.
1167
+ */
1168
+ structuredContent?: {
1169
+ [key: string]: unknown;
1170
+ } | null;
1171
+ };
1172
+ /**
1173
+ * The best matches across the agent's connected apps, and the apps whose
1174
+ * tools could not be listed, which the search did not cover.
1175
+ */
1176
+ export type ConnectedToolSearch = {
1177
+ /**
1178
+ * At most [`MAX_TOOL_MATCHES`] tools, best first.
1179
+ */
1180
+ matches: Array<ConnectedToolMatch>;
1181
+ /**
1182
+ * Apps whose tools could not be listed.
1183
+ */
1184
+ unsearched: Array<ConnectedApp>;
1185
+ };
1186
+ /**
1187
+ * An advertised action, not a tool loaded into the current turn.
1188
+ */
1189
+ export type ConnectorTool = {
1190
+ /**
1191
+ * What the action supports.
1192
+ */
1193
+ description: string;
1194
+ /**
1195
+ * Upstream tool name.
1196
+ */
1197
+ name: string;
1198
+ };
942
1199
  /**
943
1200
  * Request body for a control operation on a live session.
944
1201
  *
@@ -1165,6 +1422,86 @@ export type DiscoverAgentCapabilitiesResponse = {
1165
1422
  */
1166
1423
  configOptions: Array<AgentConfigOptionDto>;
1167
1424
  };
1425
+ /**
1426
+ * Discovery metadata and optional markup for a user-controlled auth flow.
1427
+ */
1428
+ export type DiscoverConnectorsResponse = {
1429
+ /**
1430
+ * Include verbatim only if an advertised tool supports the requested task.
1431
+ */
1432
+ connect_markup?: string | null;
1433
+ /**
1434
+ * Catalog or capability results.
1435
+ */
1436
+ result: DiscoveryResult;
1437
+ };
1438
+ /**
1439
+ * A verified app identity from the directory.
1440
+ */
1441
+ export type DiscoveredApp = {
1442
+ /**
1443
+ * Exact identity to inspect or connect.
1444
+ */
1445
+ app_slug: string;
1446
+ /**
1447
+ * Directory description; inspect tools to verify specific capabilities.
1448
+ */
1449
+ description?: string | null;
1450
+ /**
1451
+ * Human-readable app name.
1452
+ */
1453
+ name: string;
1454
+ };
1455
+ /**
1456
+ * Search by app name, then inspect a returned slug before recommending auth.
1457
+ */
1458
+ export type DiscoveryRequest = {
1459
+ operation: 'search';
1460
+ /**
1461
+ * App name, e.g. "Notion" or "Linear", not a task description.
1462
+ */
1463
+ query: string;
1464
+ } | {
1465
+ /**
1466
+ * Exact app slug from search results.
1467
+ */
1468
+ app_slug: string;
1469
+ operation: 'inspect';
1470
+ };
1471
+ /**
1472
+ * Discovery results never execute tools or change connections.
1473
+ */
1474
+ export type DiscoveryResult = {
1475
+ /**
1476
+ * Matching apps.
1477
+ */
1478
+ apps: Array<DiscoveredApp>;
1479
+ /**
1480
+ * Narrow the app name if this is true.
1481
+ */
1482
+ more_results: boolean;
1483
+ operation: 'search';
1484
+ } | {
1485
+ /**
1486
+ * App from the directory.
1487
+ */
1488
+ app: DiscoveredApp;
1489
+ /**
1490
+ * Whether this caller has an enabled connection. For an app that
1491
+ * connects through its own MCP server, that connection is checked
1492
+ * there, not in Pipedream.
1493
+ */
1494
+ connected: boolean;
1495
+ operation: 'inspect';
1496
+ /**
1497
+ * Advertised tools. Use SearchTools after connecting to load them.
1498
+ */
1499
+ tools: Array<ConnectorTool>;
1500
+ /**
1501
+ * True when some advertised tools were omitted.
1502
+ */
1503
+ tools_truncated: boolean;
1504
+ };
1168
1505
  /**
1169
1506
  * A validated document identifier. Historical document ids need not be UUIDs.
1170
1507
  */
@@ -1259,6 +1596,10 @@ export type EmailSuggestions = {
1259
1596
  */
1260
1597
  subject?: string | null;
1261
1598
  };
1599
+ /**
1600
+ * The type of an entity in Macro
1601
+ */
1602
+ export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'crm_pipeline' | 'reminder' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative' | 'database' | 'database_row' | 'form' | 'external_chat';
1262
1603
  /**
1263
1604
  * A bounded SDK operation observed during execution; not an authorization or write receipt.
1264
1605
  */
@@ -1489,6 +1830,22 @@ export type IntentScore = {
1489
1830
  */
1490
1831
  score: number;
1491
1832
  };
1833
+ /**
1834
+ * Where an acting agent's work came from.
1835
+ */
1836
+ export type Lineage = {
1837
+ /**
1838
+ * The first non-agent cause of its work.
1839
+ */
1840
+ root: Root;
1841
+ /**
1842
+ * The acting session.
1843
+ */
1844
+ session: string;
1845
+ type: 'session';
1846
+ } | {
1847
+ type: 'unattributed';
1848
+ };
1492
1849
  /**
1493
1850
  * Defines who can access an item through its share link.
1494
1851
  */
@@ -1549,6 +1906,7 @@ export type LogFrameDto = {
1549
1906
  */
1550
1907
  direction: LogDirectionDto;
1551
1908
  };
1909
+ export type MacroUserIdStr = string;
1552
1910
  /**
1553
1911
  * The entity whose permissions and lifecycle govern a message.
1554
1912
  */
@@ -2030,6 +2388,37 @@ export type ReviewRecord = {
2030
2388
  */
2031
2389
  updatedAt: number;
2032
2390
  };
2391
+ /**
2392
+ * The first non-agent cause. An agent cannot be one, so a chain always ends
2393
+ * at a person or a routine.
2394
+ */
2395
+ export type Root = {
2396
+ type: 'person';
2397
+ /**
2398
+ * Who.
2399
+ */
2400
+ user: MacroUserIdStr;
2401
+ } | {
2402
+ /**
2403
+ * The routine.
2404
+ */
2405
+ routine: string;
2406
+ type: 'routine';
2407
+ };
2408
+ /**
2409
+ * What made a routine fire.
2410
+ */
2411
+ export type RoutineCause = {
2412
+ type: 'scheduled';
2413
+ } | {
2414
+ type: 'manual';
2415
+ } | {
2416
+ /**
2417
+ * The event.
2418
+ */
2419
+ event_id: string;
2420
+ type: 'event';
2421
+ };
2033
2422
  /**
2034
2423
  * Named compute tier for a managed sandbox.
2035
2424
  *
@@ -2253,6 +2642,78 @@ export type ToolApprovalAnswerDto = 'approve' | 'approve_and_remember' | 'deny'
2253
2642
  * Where a held tool call stands once answered.
2254
2643
  */
2255
2644
  export type ToolApprovalStatusDto = 'pending' | 'approved' | 'denied' | 'cancelled' | 'expired';
2645
+ /**
2646
+ * What opened a session.
2647
+ */
2648
+ export type TriggerOrigin = {
2649
+ /**
2650
+ * Who posted it.
2651
+ */
2652
+ by: Caller;
2653
+ /**
2654
+ * The message.
2655
+ */
2656
+ message_id: string;
2657
+ origin: 'mentioned';
2658
+ } | {
2659
+ /**
2660
+ * Who wrote.
2661
+ */
2662
+ by: MacroUserIdStr;
2663
+ /**
2664
+ * The message.
2665
+ */
2666
+ message_id: string;
2667
+ origin: 'conversation';
2668
+ } | {
2669
+ /**
2670
+ * Who assigned it.
2671
+ */
2672
+ by: Caller;
2673
+ origin: 'task_assigned';
2674
+ /**
2675
+ * The task.
2676
+ */
2677
+ task: string;
2678
+ } | {
2679
+ /**
2680
+ * Who added the task to the project.
2681
+ */
2682
+ by: Caller;
2683
+ origin: 'project_inherited';
2684
+ /**
2685
+ * The project.
2686
+ */
2687
+ project: string;
2688
+ /**
2689
+ * The task.
2690
+ */
2691
+ task: string;
2692
+ } | {
2693
+ /**
2694
+ * Who opened it.
2695
+ */
2696
+ by: MacroUserIdStr;
2697
+ origin: 'requested';
2698
+ } | {
2699
+ /**
2700
+ * The user whose authority the work runs under.
2701
+ */
2702
+ on_behalf_of: MacroUserIdStr;
2703
+ origin: 'dispatched';
2704
+ } | {
2705
+ /**
2706
+ * What made it fire.
2707
+ */
2708
+ firing: RoutineCause;
2709
+ origin: 'routine';
2710
+ /**
2711
+ * The routine.
2712
+ */
2713
+ routine: string;
2714
+ } | {
2715
+ origin: 'unknown';
2716
+ };
2256
2717
  export type UpdateChannelSharePermission = {
2257
2718
  accessLevel?: null | AccessLevel;
2258
2719
  /**
@@ -2305,6 +2766,27 @@ export type WithAgentSessionId = {
2305
2766
  */
2306
2767
  id: string;
2307
2768
  };
2769
+ /**
2770
+ * One account's active registration of one session as its work.
2771
+ */
2772
+ export type WorkRegistrationResponse = {
2773
+ /**
2774
+ * The account whose work this is.
2775
+ */
2776
+ accountId: string;
2777
+ /**
2778
+ * The session registered.
2779
+ */
2780
+ agentSessionId: string;
2781
+ /**
2782
+ * The registration.
2783
+ */
2784
+ id: string;
2785
+ /**
2786
+ * When the account registered it.
2787
+ */
2788
+ registeredAt: string;
2789
+ };
2308
2790
  export type GetAgentAutoArchivePreferencesData = {
2309
2791
  body?: never;
2310
2792
  path?: never;
@@ -2793,6 +3275,40 @@ export type GetAgentSessionResponses = {
2793
3275
  200: AgentSessionResponse;
2794
3276
  };
2795
3277
  export type GetAgentSessionResponse = GetAgentSessionResponses[keyof GetAgentSessionResponses];
3278
+ export type GetAgentSessionActivityData = {
3279
+ body?: never;
3280
+ path: {
3281
+ session_id: string;
3282
+ };
3283
+ query?: {
3284
+ /**
3285
+ * Restrict activity to one code-mode invocation within this session.
3286
+ */
3287
+ agentCorrelationId?: string | null;
3288
+ /**
3289
+ * Cursor timestamp from the previous page.
3290
+ */
3291
+ beforeAt?: string | null;
3292
+ /**
3293
+ * Cursor activity ID from the previous page.
3294
+ */
3295
+ beforeId?: string | null;
3296
+ /**
3297
+ * Page size, from 1 to 100; defaults to 50.
3298
+ */
3299
+ limit?: number | null;
3300
+ };
3301
+ url: '/agent-sessions/{session_id}/activity';
3302
+ };
3303
+ export type GetAgentSessionActivityErrors = {
3304
+ 400: unknown;
3305
+ 401: unknown;
3306
+ 403: unknown;
3307
+ };
3308
+ export type GetAgentSessionActivityResponses = {
3309
+ 200: AgentActivityPage;
3310
+ };
3311
+ export type GetAgentSessionActivityResponse = GetAgentSessionActivityResponses[keyof GetAgentSessionActivityResponses];
2796
3312
  export type ReportAgentSessionAppConnectedData = {
2797
3313
  body: AppConnectedRequest;
2798
3314
  path: {
@@ -2983,6 +3499,129 @@ export type GetCodeExecutionResponses = {
2983
3499
  200: ExecutionRecord;
2984
3500
  };
2985
3501
  export type GetCodeExecutionResponse = GetCodeExecutionResponses[keyof GetCodeExecutionResponses];
3502
+ export type ListExecutionConnectedAppsData = {
3503
+ body?: never;
3504
+ path: {
3505
+ session_id: string;
3506
+ /**
3507
+ * A running execution of the session's current turn
3508
+ */
3509
+ execution_id: string;
3510
+ };
3511
+ query?: never;
3512
+ url: '/agent-sessions/{session_id}/code-executions/{execution_id}/connected-apps';
3513
+ };
3514
+ export type ListExecutionConnectedAppsErrors = {
3515
+ 403: unknown;
3516
+ 404: unknown;
3517
+ };
3518
+ export type ListExecutionConnectedAppsResponses = {
3519
+ 200: Array<ConnectedApp>;
3520
+ };
3521
+ export type ListExecutionConnectedAppsResponse = ListExecutionConnectedAppsResponses[keyof ListExecutionConnectedAppsResponses];
3522
+ export type DiscoverConnectedAppsData = {
3523
+ body: DiscoveryRequest;
3524
+ path: {
3525
+ session_id: string;
3526
+ execution_id: string;
3527
+ };
3528
+ query?: never;
3529
+ url: '/agent-sessions/{session_id}/code-executions/{execution_id}/connected-apps/discover';
3530
+ };
3531
+ export type DiscoverConnectedAppsErrors = {
3532
+ 400: unknown;
3533
+ 403: unknown;
3534
+ 404: unknown;
3535
+ };
3536
+ export type DiscoverConnectedAppsResponses = {
3537
+ 200: DiscoverConnectorsResponse;
3538
+ };
3539
+ export type DiscoverConnectedAppsResponse = DiscoverConnectedAppsResponses[keyof DiscoverConnectedAppsResponses];
3540
+ export type AddConnectedMcpServerData = {
3541
+ body: ConnectMcpServer;
3542
+ path: {
3543
+ session_id: string;
3544
+ execution_id: string;
3545
+ };
3546
+ query?: never;
3547
+ url: '/agent-sessions/{session_id}/code-executions/{execution_id}/connected-apps/servers';
3548
+ };
3549
+ export type AddConnectedMcpServerErrors = {
3550
+ 400: unknown;
3551
+ 403: unknown;
3552
+ 404: unknown;
3553
+ };
3554
+ export type AddConnectedMcpServerResponses = {
3555
+ 200: ConnectMcpServerResponse;
3556
+ };
3557
+ export type AddConnectedMcpServerResponse = AddConnectedMcpServerResponses[keyof AddConnectedMcpServerResponses];
3558
+ export type SearchConnectedAppToolsData = {
3559
+ body?: never;
3560
+ path: {
3561
+ session_id: string;
3562
+ execution_id: string;
3563
+ };
3564
+ query: {
3565
+ /**
3566
+ * Keywords matched against tool names and descriptions, e.g. `linear issue`.
3567
+ */
3568
+ query: string;
3569
+ };
3570
+ url: '/agent-sessions/{session_id}/code-executions/{execution_id}/connected-apps/tools';
3571
+ };
3572
+ export type SearchConnectedAppToolsErrors = {
3573
+ 403: unknown;
3574
+ 404: unknown;
3575
+ };
3576
+ export type SearchConnectedAppToolsResponses = {
3577
+ 200: ConnectedToolSearch;
3578
+ };
3579
+ export type SearchConnectedAppToolsResponse = SearchConnectedAppToolsResponses[keyof SearchConnectedAppToolsResponses];
3580
+ export type CallConnectedAppToolData = {
3581
+ body: CallConnectedTool;
3582
+ path: {
3583
+ session_id: string;
3584
+ execution_id: string;
3585
+ kind: ConnectedAppKind;
3586
+ /**
3587
+ * The app's slug or custom server key
3588
+ */
3589
+ key: string;
3590
+ };
3591
+ query?: never;
3592
+ url: '/agent-sessions/{session_id}/code-executions/{execution_id}/connected-apps/{kind}/{key}/calls';
3593
+ };
3594
+ export type CallConnectedAppToolErrors = {
3595
+ 400: unknown;
3596
+ 403: unknown;
3597
+ 404: unknown;
3598
+ };
3599
+ export type CallConnectedAppToolResponses = {
3600
+ 200: ConnectedToolResult;
3601
+ };
3602
+ export type CallConnectedAppToolResponse = CallConnectedAppToolResponses[keyof CallConnectedAppToolResponses];
3603
+ export type ListConnectedAppToolsData = {
3604
+ body?: never;
3605
+ path: {
3606
+ session_id: string;
3607
+ execution_id: string;
3608
+ kind: ConnectedAppKind;
3609
+ /**
3610
+ * The app's slug or custom server key
3611
+ */
3612
+ key: string;
3613
+ };
3614
+ query?: never;
3615
+ url: '/agent-sessions/{session_id}/code-executions/{execution_id}/connected-apps/{kind}/{key}/tools';
3616
+ };
3617
+ export type ListConnectedAppToolsErrors = {
3618
+ 403: unknown;
3619
+ 404: unknown;
3620
+ };
3621
+ export type ListConnectedAppToolsResponses = {
3622
+ 200: Array<ConnectedTool>;
3623
+ };
3624
+ export type ListConnectedAppToolsResponse = ListConnectedAppToolsResponses[keyof ListConnectedAppToolsResponses];
2986
3625
  export type ListExecutionReviewsData = {
2987
3626
  body?: never;
2988
3627
  path: {
@@ -3448,6 +4087,66 @@ export type PresentSessionViewResponses = {
3448
4087
  204: void;
3449
4088
  };
3450
4089
  export type PresentSessionViewResponse = PresentSessionViewResponses[keyof PresentSessionViewResponses];
4090
+ export type UnregisterAgentSessionWorkData = {
4091
+ body?: never;
4092
+ path: {
4093
+ /**
4094
+ * ID of the agent session
4095
+ */
4096
+ session_id: string;
4097
+ };
4098
+ query?: never;
4099
+ url: '/agent-sessions/{session_id}/work-registration';
4100
+ };
4101
+ export type UnregisterAgentSessionWorkErrors = {
4102
+ 401: string;
4103
+ 500: string;
4104
+ };
4105
+ export type UnregisterAgentSessionWorkError = UnregisterAgentSessionWorkErrors[keyof UnregisterAgentSessionWorkErrors];
4106
+ export type UnregisterAgentSessionWorkResponses = {
4107
+ /**
4108
+ * The caller has no active registration of the session
4109
+ */
4110
+ 204: void;
4111
+ };
4112
+ export type UnregisterAgentSessionWorkResponse = UnregisterAgentSessionWorkResponses[keyof UnregisterAgentSessionWorkResponses];
4113
+ export type RegisterAgentSessionWorkData = {
4114
+ body?: never;
4115
+ path: {
4116
+ /**
4117
+ * ID of the agent session
4118
+ */
4119
+ session_id: string;
4120
+ };
4121
+ query?: never;
4122
+ url: '/agent-sessions/{session_id}/work-registration';
4123
+ };
4124
+ export type RegisterAgentSessionWorkErrors = {
4125
+ 401: string;
4126
+ 403: string;
4127
+ 409: string;
4128
+ 500: string;
4129
+ };
4130
+ export type RegisterAgentSessionWorkError = RegisterAgentSessionWorkErrors[keyof RegisterAgentSessionWorkErrors];
4131
+ export type RegisterAgentSessionWorkResponses = {
4132
+ 200: WorkRegistrationResponse;
4133
+ };
4134
+ export type RegisterAgentSessionWorkResponse = RegisterAgentSessionWorkResponses[keyof RegisterAgentSessionWorkResponses];
4135
+ export type ListAgentWorkRegistrationsData = {
4136
+ body?: never;
4137
+ path?: never;
4138
+ query?: never;
4139
+ url: '/agent-work-registrations';
4140
+ };
4141
+ export type ListAgentWorkRegistrationsErrors = {
4142
+ 401: string;
4143
+ 500: string;
4144
+ };
4145
+ export type ListAgentWorkRegistrationsError = ListAgentWorkRegistrationsErrors[keyof ListAgentWorkRegistrationsErrors];
4146
+ export type ListAgentWorkRegistrationsResponses = {
4147
+ 200: Array<WorkRegistrationResponse>;
4148
+ };
4149
+ export type ListAgentWorkRegistrationsResponse = ListAgentWorkRegistrationsResponses[keyof ListAgentWorkRegistrationsResponses];
3451
4150
  export type ClassifyData = {
3452
4151
  body: ClassifyInputRequest;
3453
4152
  path?: never;