@macro-inc/sdk 0.0.1 → 0.2.2
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/README.md +628 -21
- package/dist/{chunk-5HAKQN23.js → chunk-7LVVPVNT.js} +70 -57
- package/dist/{chunk-JXIQT5TH.js → chunk-7YJ6Y7HJ.js} +234 -16
- package/dist/chunk-LMJW65ML.js +836 -0
- package/dist/{chunk-SGAHIERJ.js → chunk-OGE7WXJE.js} +16 -0
- package/dist/chunk-PRUFPW3B.js +943 -0
- package/dist/{chunk-CTKR64MY.js → chunk-QVBNNMQS.js} +242 -367
- package/dist/{chunk-QNUS5BC5.js → chunk-SUINKDXF.js} +30 -84
- package/dist/{chunk-77EI4LSQ.js → chunk-ZQXOHNDB.js} +1518 -386
- package/dist/generated/agent-harness/index.d.ts +1 -1
- package/dist/generated/agent-harness/index.js +1 -1
- package/dist/generated/agent-harness/sdk.gen.d.ts +174 -4
- package/dist/generated/agent-harness/types.gen.d.ts +2511 -189
- package/dist/generated/auth/index.d.ts +1 -1
- package/dist/generated/auth/index.js +1 -1
- package/dist/generated/auth/sdk.gen.d.ts +106 -8
- package/dist/generated/auth/types.gen.d.ts +1473 -116
- package/dist/generated/calendar/client/client.gen.d.ts +2 -0
- package/dist/generated/calendar/client/index.d.ts +10 -0
- package/dist/generated/calendar/client/types.gen.d.ts +120 -0
- package/dist/generated/calendar/client/utils.gen.d.ts +37 -0
- package/dist/generated/calendar/client.gen.d.ts +12 -0
- package/dist/generated/calendar/core/auth.gen.d.ts +25 -0
- package/dist/generated/calendar/core/bodySerializer.gen.d.ts +25 -0
- package/dist/generated/calendar/core/params.gen.d.ts +43 -0
- package/dist/generated/calendar/core/pathSerializer.gen.d.ts +33 -0
- package/dist/generated/calendar/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/generated/calendar/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/generated/calendar/core/types.gen.d.ts +83 -0
- package/dist/generated/calendar/core/utils.gen.d.ts +19 -0
- package/dist/generated/calendar/index.d.ts +2 -0
- package/dist/generated/calendar/index.js +6 -0
- package/dist/generated/calendar/sdk.gen.d.ts +95 -0
- package/dist/generated/calendar/types.gen.d.ts +1091 -0
- package/dist/generated/cognition/index.d.ts +1 -1
- package/dist/generated/cognition/index.js +1 -1
- package/dist/generated/cognition/sdk.gen.d.ts +6 -1
- package/dist/generated/cognition/types.gen.d.ts +304 -36
- package/dist/generated/connection/types.gen.d.ts +1 -1
- package/dist/generated/email/index.d.ts +1 -1
- package/dist/generated/email/index.js +1 -1
- package/dist/generated/email/sdk.gen.d.ts +32 -27
- package/dist/generated/email/types.gen.d.ts +586 -409
- package/dist/generated/notification/index.d.ts +1 -1
- package/dist/generated/notification/types.gen.d.ts +384 -19
- package/dist/generated/properties/types.gen.d.ts +8 -5
- package/dist/generated/scheduled-action/index.d.ts +1 -1
- package/dist/generated/scheduled-action/index.js +3 -842
- package/dist/generated/scheduled-action/sdk.gen.d.ts +3 -1
- package/dist/generated/scheduled-action/types.gen.d.ts +277 -41
- package/dist/generated/search/index.d.ts +1 -1
- package/dist/generated/search/types.gen.d.ts +262 -43
- package/dist/generated/storage/index.d.ts +1 -1
- package/dist/generated/storage/index.js +1 -1
- package/dist/generated/storage/sdk.gen.d.ts +678 -107
- package/dist/generated/storage/types.gen.d.ts +14827 -5995
- package/dist/generated/unfurl/index.d.ts +1 -1
- package/dist/generated/unfurl/index.js +3 -832
- package/dist/generated/unfurl/types.gen.d.ts +20 -0
- package/dist/src/config.d.ts +33 -13
- package/dist/src/entities/agent-sessions/agent-session.d.ts +150 -6
- package/dist/src/entities/agent-sessions/code-execution.d.ts +43 -0
- package/dist/src/entities/agent-sessions/conversation.d.ts +54 -0
- package/dist/src/entities/agent-sessions/namespace.d.ts +23 -5
- package/dist/src/entities/agent-sessions/queued-action.d.ts +46 -0
- package/dist/src/entities/agent-sessions/review.d.ts +107 -0
- package/dist/src/entities/agent-sessions/tool-approval.d.ts +21 -0
- package/dist/src/entities/agents/agent.d.ts +47 -0
- package/dist/src/entities/agents/namespace.d.ts +13 -0
- package/dist/src/entities/ai/namespace.d.ts +24 -0
- package/dist/src/entities/api-keys/api-key.d.ts +17 -0
- package/dist/src/entities/api-keys/namespace.d.ts +18 -0
- package/dist/src/entities/calendar/calendar.d.ts +35 -0
- package/dist/src/entities/calendar/event.d.ts +123 -0
- package/dist/src/entities/calendar/event.test.d.ts +1 -0
- package/dist/src/entities/calendar/namespace.d.ts +111 -0
- package/dist/src/entities/calendar/replacement.d.ts +15 -0
- package/dist/src/entities/calls/call-record.d.ts +62 -6
- package/dist/src/entities/calls/message.d.ts +33 -0
- package/dist/src/entities/channels/activity.d.ts +24 -0
- package/dist/src/entities/channels/channel.d.ts +44 -3
- package/dist/src/entities/channels/labels.d.ts +39 -0
- package/dist/src/entities/channels/message.d.ts +9 -17
- package/dist/src/entities/channels/namespace.d.ts +6 -0
- package/dist/src/entities/channels/picture.d.ts +11 -0
- package/dist/src/entities/channels/post.d.ts +1 -1
- package/dist/src/entities/channels/thread.d.ts +5 -0
- package/dist/src/entities/chats/chat.d.ts +11 -1
- package/dist/src/entities/chats/generation.d.ts +46 -0
- package/dist/src/entities/crm/comment.d.ts +55 -34
- package/dist/src/entities/crm/company.d.ts +42 -10
- package/dist/src/entities/crm/contact.d.ts +42 -10
- package/dist/src/entities/crm/namespace.d.ts +18 -1
- package/dist/src/entities/crm/pipeline.d.ts +122 -0
- package/dist/src/entities/crm/pipelines.d.ts +14 -0
- package/dist/src/entities/databases/column.d.ts +75 -0
- package/dist/src/entities/databases/database.d.ts +272 -0
- package/dist/src/entities/databases/namespace.d.ts +21 -0
- package/dist/src/entities/databases/query.d.ts +86 -0
- package/dist/src/entities/databases/row.d.ts +27 -0
- package/dist/src/entities/databases/table.d.ts +61 -0
- package/dist/src/entities/databases/view.d.ts +40 -0
- package/dist/src/entities/databases/webhook.d.ts +32 -0
- package/dist/src/entities/documents/anchor.d.ts +29 -0
- package/dist/src/entities/documents/comment.d.ts +25 -22
- package/dist/src/entities/documents/document.d.ts +60 -12
- package/dist/src/entities/documents/namespace.d.ts +30 -0
- package/dist/src/entities/documents/version.d.ts +22 -0
- package/dist/src/entities/email/draft.d.ts +79 -0
- package/dist/src/entities/email/filter.d.ts +34 -0
- package/dist/src/entities/email/link.d.ts +6 -4
- package/dist/src/entities/email/message.d.ts +12 -1
- package/dist/src/entities/email/namespace.d.ts +34 -1
- package/dist/src/entities/email/thread.d.ts +23 -1
- package/dist/src/entities/entity-mentions/mention.d.ts +16 -0
- package/dist/src/entities/entity-mentions/namespace.d.ts +12 -0
- package/dist/src/entities/entity.d.ts +7 -0
- package/dist/src/entities/favorites/namespace.d.ts +14 -2
- package/dist/src/entities/foreign/foreign-entity.d.ts +2 -0
- package/dist/src/entities/foreign/namespace.d.ts +40 -0
- package/dist/src/entities/forms/form.d.ts +227 -0
- package/dist/src/entities/forms/namespace.d.ts +18 -0
- package/dist/src/entities/forms/question.d.ts +37 -0
- package/dist/src/entities/forms/response.d.ts +32 -0
- package/dist/src/entities/forms/section.d.ts +19 -0
- package/dist/src/entities/github-pull-requests/namespace.d.ts +12 -0
- package/dist/src/entities/github-pull-requests/pull-request.d.ts +52 -0
- package/dist/src/entities/harnesses/harness.d.ts +19 -0
- package/dist/src/entities/harnesses/namespace.d.ts +33 -0
- package/dist/src/entities/harnesses/pairing.d.ts +39 -0
- package/dist/src/entities/initiatives/initiative.d.ts +50 -0
- package/dist/src/entities/initiatives/namespace.d.ts +13 -0
- package/dist/src/entities/meetings/meeting.d.ts +38 -0
- package/dist/src/entities/meetings/namespace.d.ts +18 -0
- package/dist/src/entities/messages/thread.d.ts +101 -0
- package/dist/src/entities/notifications/notification.d.ts +6 -3
- package/dist/src/entities/notifications/notification.test.d.ts +1 -0
- package/dist/src/entities/projects/project.d.ts +7 -0
- package/dist/src/entities/reference.d.ts +82 -0
- package/dist/src/entities/routines/namespace.d.ts +15 -0
- package/dist/src/entities/routines/routine.d.ts +115 -0
- package/dist/src/entities/sharing/access.d.ts +65 -0
- package/dist/src/entities/sharing/permissions.d.ts +13 -0
- package/dist/src/entities/tasks/namespace.d.ts +4 -0
- package/dist/src/entities/tasks/task.d.ts +6 -0
- package/dist/src/entities/unfurls/namespace.d.ts +10 -0
- package/dist/src/entities/webhooks/webhook.d.ts +3 -1
- package/dist/src/entities/workspace/items.d.ts +7 -0
- package/dist/src/entities/workspace/namespace.d.ts +83 -0
- package/dist/src/entities/workspace/query.d.ts +12 -0
- package/dist/src/entities/workspace/types.d.ts +96 -0
- package/dist/src/events/hydrate/agentSession.d.ts +192 -0
- package/dist/src/events/hydrate/channel.d.ts +2 -39
- package/dist/src/events/hydrate/message.d.ts +70 -0
- package/dist/src/events/receiver.d.ts +57 -19
- package/dist/src/events/types.d.ts +3 -1
- package/dist/src/macro.d.ts +80 -3
- package/dist/src/macro.js +8832 -2784
- package/dist/src/utils/activity.d.ts +11 -0
- package/dist/src/utils/activity.test.d.ts +1 -0
- package/dist/src/utils/client.d.ts +10 -1
- package/dist/src/utils/concurrency.d.ts +5 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/pagination.d.ts +9 -4
- package/package.json +11 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
|
|
2
|
-
import type { CreateScheduledActionData, CreateScheduledActionErrors, CreateScheduledActionResponses, DeleteScheduledActionData, DeleteScheduledActionErrors, DeleteScheduledActionResponses, ExecuteScheduledActionNowData, ExecuteScheduledActionNowErrors, ExecuteScheduledActionNowResponses, ListScheduledActionHistoryData, ListScheduledActionHistoryErrors, ListScheduledActionHistoryResponses, ListScheduledActionsData, ListScheduledActionsErrors, ListScheduledActionsResponses, ScheduledActionHealthData, ScheduledActionHealthResponses, UpdateScheduledActionData, UpdateScheduledActionErrors, UpdateScheduledActionResponses } from './types.gen';
|
|
2
|
+
import type { CreateScheduledActionData, CreateScheduledActionErrors, CreateScheduledActionResponses, DeleteScheduledActionData, DeleteScheduledActionErrors, DeleteScheduledActionResponses, ExecuteScheduledActionNowData, ExecuteScheduledActionNowErrors, ExecuteScheduledActionNowResponses, GetScheduledActionData, GetScheduledActionErrors, GetScheduledActionResponses, ListScheduledActionHistoryData, ListScheduledActionHistoryErrors, ListScheduledActionHistoryResponses, ListScheduledActionsData, ListScheduledActionsErrors, ListScheduledActionsResponses, ScheduledActionHealthData, ScheduledActionHealthResponses, SetScheduledActionEnabledData, SetScheduledActionEnabledErrors, SetScheduledActionEnabledResponses, UpdateScheduledActionData, UpdateScheduledActionErrors, UpdateScheduledActionResponses } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -35,7 +35,9 @@ export declare class Sdk extends HeyApiClient {
|
|
|
35
35
|
listScheduledActions<ThrowOnError extends boolean = false>(options?: Options<ListScheduledActionsData, ThrowOnError>): RequestResult<ListScheduledActionsResponses, ListScheduledActionsErrors, ThrowOnError>;
|
|
36
36
|
createScheduledAction<ThrowOnError extends boolean = false>(options: Options<CreateScheduledActionData, ThrowOnError>): RequestResult<CreateScheduledActionResponses, CreateScheduledActionErrors, ThrowOnError>;
|
|
37
37
|
deleteScheduledAction<ThrowOnError extends boolean = false>(options: Options<DeleteScheduledActionData, ThrowOnError>): RequestResult<DeleteScheduledActionResponses, DeleteScheduledActionErrors, ThrowOnError>;
|
|
38
|
+
getScheduledAction<ThrowOnError extends boolean = false>(options: Options<GetScheduledActionData, ThrowOnError>): RequestResult<GetScheduledActionResponses, GetScheduledActionErrors, ThrowOnError>;
|
|
38
39
|
updateScheduledAction<ThrowOnError extends boolean = false>(options: Options<UpdateScheduledActionData, ThrowOnError>): RequestResult<UpdateScheduledActionResponses, UpdateScheduledActionErrors, ThrowOnError>;
|
|
40
|
+
setScheduledActionEnabled<ThrowOnError extends boolean = false>(options: Options<SetScheduledActionEnabledData, ThrowOnError>): RequestResult<SetScheduledActionEnabledResponses, SetScheduledActionEnabledErrors, ThrowOnError>;
|
|
39
41
|
executeScheduledActionNow<ThrowOnError extends boolean = false>(options: Options<ExecuteScheduledActionNowData, ThrowOnError>): RequestResult<ExecuteScheduledActionNowResponses, ExecuteScheduledActionNowErrors, ThrowOnError>;
|
|
40
42
|
listScheduledActionHistory<ThrowOnError extends boolean = false>(options: Options<ListScheduledActionHistoryData, ThrowOnError>): RequestResult<ListScheduledActionHistoryResponses, ListScheduledActionHistoryErrors, ThrowOnError>;
|
|
41
43
|
}
|
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
export type ClientOptions = {
|
|
2
2
|
baseUrl: `${string}://${string}` | (string & {});
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* Canonical client configuration. Ownership and execution state are server-owned.
|
|
6
|
+
*/
|
|
7
|
+
export type ActionConfiguration = {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
kind: ActionKind;
|
|
10
|
+
name: string;
|
|
11
|
+
task: {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
trigger: ActionTrigger;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Canonical configuration replacement. Activation has its own endpoint, so
|
|
18
|
+
* omitting `enabled` keeps the stored value.
|
|
19
|
+
*/
|
|
20
|
+
export type ActionConfigurationUpdate = {
|
|
21
|
+
/**
|
|
22
|
+
* Still sent by clients deployed before the activation endpoint.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
enabled?: boolean | null;
|
|
27
|
+
kind: ActionKind;
|
|
28
|
+
name: string;
|
|
29
|
+
task: {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
trigger: ActionTrigger;
|
|
33
|
+
};
|
|
4
34
|
export type ActionExecutionRecord = {
|
|
5
35
|
action_id: string;
|
|
6
36
|
created_at: string;
|
|
@@ -8,8 +38,8 @@ export type ActionExecutionRecord = {
|
|
|
8
38
|
id?: string | null;
|
|
9
39
|
is_success: boolean;
|
|
10
40
|
/**
|
|
11
|
-
* ID of the primary resource produced by this run
|
|
12
|
-
*
|
|
41
|
+
* ID of the primary resource produced by this run. Its type is recorded in
|
|
42
|
+
* `result`, independently of the routine's current configuration.
|
|
13
43
|
*/
|
|
14
44
|
resource_id?: string | null;
|
|
15
45
|
result: {
|
|
@@ -18,17 +48,120 @@ export type ActionExecutionRecord = {
|
|
|
18
48
|
start_time: string;
|
|
19
49
|
};
|
|
20
50
|
export type ActionKind = 'Agent';
|
|
51
|
+
/**
|
|
52
|
+
* A routine may run on one trigger or any of several schedules and Macro events.
|
|
53
|
+
*/
|
|
54
|
+
export type ActionTrigger = {
|
|
55
|
+
schedule: Schedule;
|
|
56
|
+
timezone: string;
|
|
57
|
+
type: 'cron';
|
|
58
|
+
} | {
|
|
59
|
+
filters: EventFilters;
|
|
60
|
+
type: 'events';
|
|
61
|
+
} | {
|
|
62
|
+
triggers: RoutineTriggers;
|
|
63
|
+
type: 'multiple';
|
|
64
|
+
};
|
|
21
65
|
export type AgentTask = {
|
|
22
|
-
|
|
66
|
+
agent?: null | AgentTaskAgent;
|
|
67
|
+
model?: null | RoutineModelId;
|
|
23
68
|
prompt: string;
|
|
24
69
|
user_prompt: string;
|
|
25
70
|
};
|
|
26
71
|
/**
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
72
|
+
* A persona selection, independent of its runtime and current default model.
|
|
73
|
+
*/
|
|
74
|
+
export type AgentTaskAgent = {
|
|
75
|
+
bot_id: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Public admission error payload. Handlers with additional fields can reuse the
|
|
79
|
+
* domain error's code and message and [`admission_status`].
|
|
80
|
+
*/
|
|
81
|
+
export type AiAdmissionErrorBody = {
|
|
82
|
+
/**
|
|
83
|
+
* Stable denial or unavailability code.
|
|
84
|
+
*/
|
|
85
|
+
code: string;
|
|
86
|
+
/**
|
|
87
|
+
* Human-readable explanation, without internal billing diagnostics.
|
|
88
|
+
*/
|
|
89
|
+
error: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Why an event-triggered run was skipped before it started.
|
|
93
|
+
*/
|
|
94
|
+
export type ConditionResult = {
|
|
95
|
+
/**
|
|
96
|
+
* The classifier's probability, from 0 to 1, that the answer was yes.
|
|
97
|
+
*/
|
|
98
|
+
probability: number;
|
|
99
|
+
status: 'not_met';
|
|
100
|
+
} | {
|
|
101
|
+
status: 'unavailable';
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Exactly one representation is accepted, even if mixed fields agree or are null.
|
|
105
|
+
*/
|
|
106
|
+
export type CreateScheduledAction = ActionConfiguration | LegacyActionConfiguration;
|
|
107
|
+
/**
|
|
108
|
+
* Empty response is required due to custom fetch forcing `response.json()`
|
|
109
|
+
*/
|
|
110
|
+
export type EmptyResponse = {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* An event name AND an entity ID must match within the same filter. A
|
|
115
|
+
* condition further requires the event's content to answer it with yes.
|
|
116
|
+
*/
|
|
117
|
+
export type EventFilter = {
|
|
118
|
+
/**
|
|
119
|
+
* Yes/no question about the triggering content, e.g. "Is this email an
|
|
120
|
+
* invoice?". The routine runs only when the answer is yes.
|
|
121
|
+
*/
|
|
122
|
+
condition?: string | null;
|
|
123
|
+
events: Array<EventName>;
|
|
124
|
+
ids?: Array<string> | null;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Bounded nonempty OR of filters, canonicalized to remove duplicates.
|
|
128
|
+
*/
|
|
129
|
+
export type EventFilters = Array<EventFilter>;
|
|
130
|
+
/**
|
|
131
|
+
* Closed allowlist: unknown names, deletions and ambiguous attribution are not
|
|
132
|
+
* selectors. Adding a broker variant does not automatically enable routines.
|
|
133
|
+
*/
|
|
134
|
+
export type EventName = 'document.created' | 'document.updated' | 'document.deleted' | 'task.created' | 'task.status_changed' | 'task.priority_changed' | 'task.property_changed' | 'email.message_received' | 'channel.created' | 'channel.message_posted' | 'channel.mentioned' | 'channel.message_patched' | 'channel.message_attachment_created' | 'call.started' | 'call.ended';
|
|
135
|
+
/**
|
|
136
|
+
* Transcript resource created by a run. Never infer this from current task configuration.
|
|
30
137
|
*/
|
|
31
|
-
export type
|
|
138
|
+
export type ExecutionResource = {
|
|
139
|
+
id: string;
|
|
140
|
+
type: ExecutionResourceType;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Closed set of transcript destinations understood by routine clients.
|
|
144
|
+
*/
|
|
145
|
+
export type ExecutionResourceType = 'chat' | 'agent';
|
|
146
|
+
/**
|
|
147
|
+
* Version 1 execution metadata stored in the existing JSON result column.
|
|
148
|
+
* Null/string column values predate this envelope and refer to legacy chats.
|
|
149
|
+
*/
|
|
150
|
+
export type ExecutionResult = {
|
|
151
|
+
condition?: null | ConditionResult;
|
|
152
|
+
error?: string | null;
|
|
153
|
+
resource?: null | ExecutionResource;
|
|
154
|
+
version: number;
|
|
155
|
+
};
|
|
156
|
+
export type InProgressExecution = {
|
|
157
|
+
action_id: string;
|
|
158
|
+
chat_id?: string | null;
|
|
159
|
+
resource?: null | ExecutionResource;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Deprecated cron-only input, accepted during the compatibility rollout.
|
|
163
|
+
*/
|
|
164
|
+
export type LegacyActionConfiguration = {
|
|
32
165
|
enabled: boolean;
|
|
33
166
|
kind: ActionKind;
|
|
34
167
|
name: string;
|
|
@@ -39,75 +172,109 @@ export type CreateScheduledAction = {
|
|
|
39
172
|
timezone: string;
|
|
40
173
|
};
|
|
41
174
|
/**
|
|
42
|
-
*
|
|
175
|
+
* A nonblank model identifier. Runtime catalogs, not the scheduler, own availability.
|
|
43
176
|
*/
|
|
44
|
-
export type
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
177
|
+
export type RoutineModelId = string;
|
|
178
|
+
/**
|
|
179
|
+
* An individual trigger in a routine's trigger list.
|
|
180
|
+
*/
|
|
181
|
+
export type RoutineTrigger = {
|
|
182
|
+
schedule: Schedule;
|
|
183
|
+
timezone: string;
|
|
184
|
+
type: 'cron';
|
|
185
|
+
} | {
|
|
186
|
+
filters: EventFilters;
|
|
187
|
+
type: 'events';
|
|
50
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Bounded schedules and one combined set of event filters.
|
|
191
|
+
*/
|
|
192
|
+
export type RoutineTriggers = Array<RoutineTrigger>;
|
|
51
193
|
export type Schedule = string;
|
|
52
194
|
export type ScheduledAction = {
|
|
53
195
|
claimed?: string | null;
|
|
196
|
+
/**
|
|
197
|
+
* Independent of execution bookkeeping in `updated_at`.
|
|
198
|
+
*/
|
|
199
|
+
configuration_revision: number;
|
|
54
200
|
created_at: string;
|
|
55
201
|
/**
|
|
56
|
-
* When false,
|
|
202
|
+
* When false, automatic dispatch skips this action. `run_now` remains
|
|
57
203
|
* available regardless.
|
|
58
204
|
*/
|
|
59
205
|
enabled: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Event publication boundary; absent for cron actions.
|
|
208
|
+
*/
|
|
209
|
+
event_activated_at?: string | null;
|
|
60
210
|
id?: string | null;
|
|
61
211
|
kind: ActionKind;
|
|
62
212
|
name: string;
|
|
63
213
|
/**
|
|
64
|
-
*
|
|
65
|
-
|
|
214
|
+
* Next cron firing, absent for event-triggered actions.
|
|
215
|
+
*/
|
|
216
|
+
next_run_at?: string | null;
|
|
217
|
+
/**
|
|
218
|
+
* Who the action belongs to. Every action is user-owned today, but the
|
|
219
|
+
* type no longer says so: the principal string on the wire and in the
|
|
220
|
+
* `owner` column is the same, and a bot- or team-owned row decodes
|
|
221
|
+
* rather than failing to parse.
|
|
66
222
|
*/
|
|
67
|
-
next_run_at: string;
|
|
68
223
|
owner: string;
|
|
69
|
-
schedule: Schedule;
|
|
70
224
|
task: {
|
|
71
225
|
[key: string]: unknown;
|
|
72
226
|
};
|
|
73
|
-
|
|
227
|
+
trigger: ActionTrigger;
|
|
74
228
|
updated_at: string;
|
|
75
229
|
};
|
|
230
|
+
/**
|
|
231
|
+
* Canonical trigger plus deprecated cron fields for existing clients. Event
|
|
232
|
+
* responses omit legacy fields rather than inventing a schedule or timezone.
|
|
233
|
+
*/
|
|
234
|
+
export type ScheduledActionResponse = ScheduledAction & {
|
|
235
|
+
/**
|
|
236
|
+
* Deprecated: use `trigger.schedule`. Present only for cron actions.
|
|
237
|
+
*
|
|
238
|
+
* @deprecated
|
|
239
|
+
*/
|
|
240
|
+
schedule?: string | null;
|
|
241
|
+
/**
|
|
242
|
+
* Deprecated: use `trigger.timezone`. Present only for cron actions.
|
|
243
|
+
*
|
|
244
|
+
* @deprecated
|
|
245
|
+
*/
|
|
246
|
+
timezone?: string | null;
|
|
247
|
+
};
|
|
76
248
|
/**
|
|
77
249
|
* Live status update for a scheduled-action run, broadcast via the connection
|
|
78
|
-
* gateway to the owner. Clients use the
|
|
79
|
-
* transcript and the variant tag to toggle the running indicator.
|
|
250
|
+
* gateway to the owner. Clients use the typed resource to navigate to the run
|
|
251
|
+
* transcript and the variant tag to toggle the running indicator. `chat_id`
|
|
252
|
+
* remains populated only for chat runs, for older clients.
|
|
80
253
|
*
|
|
81
254
|
* Serialized with a `type` tag (`started`/`stopped`) and delivered over the
|
|
82
255
|
* single `scheduled_action_update` message type on the gateway.
|
|
83
256
|
*/
|
|
84
257
|
export type ScheduledActionUpdate = {
|
|
85
258
|
action_id: string;
|
|
86
|
-
chat_id
|
|
259
|
+
chat_id?: string | null;
|
|
87
260
|
owner: string;
|
|
261
|
+
resource?: null | ExecutionResource;
|
|
88
262
|
type: 'started';
|
|
89
263
|
} | {
|
|
90
264
|
action_id: string;
|
|
91
|
-
chat_id
|
|
265
|
+
chat_id?: string | null;
|
|
92
266
|
is_success: boolean;
|
|
93
267
|
owner: string;
|
|
268
|
+
resource?: null | ExecutionResource;
|
|
94
269
|
type: 'stopped';
|
|
95
270
|
};
|
|
96
|
-
|
|
97
|
-
* Client-supplied payload for updating a scheduled action. Mirrors the fields
|
|
98
|
-
* the repository actually writes — `id`/`owner`/timestamps/`claimed`/
|
|
99
|
-
* `next_run_at` are not client-mutable.
|
|
100
|
-
*/
|
|
101
|
-
export type UpdateScheduledAction = {
|
|
271
|
+
export type SetScheduledActionEnabled = {
|
|
102
272
|
enabled: boolean;
|
|
103
|
-
kind: ActionKind;
|
|
104
|
-
name: string;
|
|
105
|
-
schedule: Schedule;
|
|
106
|
-
task: {
|
|
107
|
-
[key: string]: unknown;
|
|
108
|
-
};
|
|
109
|
-
timezone: string;
|
|
110
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* Full replacement of client configuration, not of server-owned action state.
|
|
276
|
+
*/
|
|
277
|
+
export type UpdateScheduledAction = ActionConfigurationUpdate | LegacyActionConfiguration;
|
|
111
278
|
export type ScheduledActionHealthData = {
|
|
112
279
|
body?: never;
|
|
113
280
|
path?: never;
|
|
@@ -124,16 +291,22 @@ export type ScheduledActionHealthResponse = ScheduledActionHealthResponses[keyof
|
|
|
124
291
|
export type ListScheduledActionsData = {
|
|
125
292
|
body?: never;
|
|
126
293
|
path?: never;
|
|
127
|
-
query?:
|
|
294
|
+
query?: {
|
|
295
|
+
/**
|
|
296
|
+
* Backend clients must opt in to event actions; defaults to false (cron-only).
|
|
297
|
+
*/
|
|
298
|
+
include_events?: boolean | null;
|
|
299
|
+
};
|
|
128
300
|
url: '/scheduled-actions';
|
|
129
301
|
};
|
|
130
302
|
export type ListScheduledActionsErrors = {
|
|
303
|
+
400: string;
|
|
131
304
|
401: string;
|
|
132
305
|
500: string;
|
|
133
306
|
};
|
|
134
307
|
export type ListScheduledActionsError = ListScheduledActionsErrors[keyof ListScheduledActionsErrors];
|
|
135
308
|
export type ListScheduledActionsResponses = {
|
|
136
|
-
200: Array<
|
|
309
|
+
200: Array<ScheduledActionResponse>;
|
|
137
310
|
};
|
|
138
311
|
export type ListScheduledActionsResponse = ListScheduledActionsResponses[keyof ListScheduledActionsResponses];
|
|
139
312
|
export type CreateScheduledActionData = {
|
|
@@ -143,12 +316,14 @@ export type CreateScheduledActionData = {
|
|
|
143
316
|
url: '/scheduled-actions';
|
|
144
317
|
};
|
|
145
318
|
export type CreateScheduledActionErrors = {
|
|
319
|
+
400: string;
|
|
146
320
|
401: string;
|
|
321
|
+
403: string;
|
|
147
322
|
500: string;
|
|
148
323
|
};
|
|
149
324
|
export type CreateScheduledActionError = CreateScheduledActionErrors[keyof CreateScheduledActionErrors];
|
|
150
325
|
export type CreateScheduledActionResponses = {
|
|
151
|
-
201:
|
|
326
|
+
201: ScheduledActionResponse;
|
|
152
327
|
};
|
|
153
328
|
export type CreateScheduledActionResponse = CreateScheduledActionResponses[keyof CreateScheduledActionResponses];
|
|
154
329
|
export type DeleteScheduledActionData = {
|
|
@@ -172,6 +347,27 @@ export type DeleteScheduledActionResponses = {
|
|
|
172
347
|
204: void;
|
|
173
348
|
};
|
|
174
349
|
export type DeleteScheduledActionResponse = DeleteScheduledActionResponses[keyof DeleteScheduledActionResponses];
|
|
350
|
+
export type GetScheduledActionData = {
|
|
351
|
+
body?: never;
|
|
352
|
+
path: {
|
|
353
|
+
/**
|
|
354
|
+
* ID of the scheduled action
|
|
355
|
+
*/
|
|
356
|
+
id: string;
|
|
357
|
+
};
|
|
358
|
+
query?: never;
|
|
359
|
+
url: '/scheduled-actions/{id}';
|
|
360
|
+
};
|
|
361
|
+
export type GetScheduledActionErrors = {
|
|
362
|
+
401: string;
|
|
363
|
+
404: string;
|
|
364
|
+
500: string;
|
|
365
|
+
};
|
|
366
|
+
export type GetScheduledActionError = GetScheduledActionErrors[keyof GetScheduledActionErrors];
|
|
367
|
+
export type GetScheduledActionResponses = {
|
|
368
|
+
200: ScheduledActionResponse;
|
|
369
|
+
};
|
|
370
|
+
export type GetScheduledActionResponse = GetScheduledActionResponses[keyof GetScheduledActionResponses];
|
|
175
371
|
export type UpdateScheduledActionData = {
|
|
176
372
|
body: UpdateScheduledAction;
|
|
177
373
|
path: {
|
|
@@ -184,15 +380,46 @@ export type UpdateScheduledActionData = {
|
|
|
184
380
|
url: '/scheduled-actions/{id}';
|
|
185
381
|
};
|
|
186
382
|
export type UpdateScheduledActionErrors = {
|
|
383
|
+
400: string;
|
|
187
384
|
401: string;
|
|
188
385
|
404: string;
|
|
386
|
+
/**
|
|
387
|
+
* Configuration changed or execution is active
|
|
388
|
+
*/
|
|
389
|
+
409: string;
|
|
189
390
|
500: string;
|
|
190
391
|
};
|
|
191
392
|
export type UpdateScheduledActionError = UpdateScheduledActionErrors[keyof UpdateScheduledActionErrors];
|
|
192
393
|
export type UpdateScheduledActionResponses = {
|
|
193
|
-
200:
|
|
394
|
+
200: ScheduledActionResponse;
|
|
194
395
|
};
|
|
195
396
|
export type UpdateScheduledActionResponse = UpdateScheduledActionResponses[keyof UpdateScheduledActionResponses];
|
|
397
|
+
export type SetScheduledActionEnabledData = {
|
|
398
|
+
body: SetScheduledActionEnabled;
|
|
399
|
+
path: {
|
|
400
|
+
/**
|
|
401
|
+
* ID of the scheduled action
|
|
402
|
+
*/
|
|
403
|
+
id: string;
|
|
404
|
+
};
|
|
405
|
+
query?: never;
|
|
406
|
+
url: '/scheduled-actions/{id}/enabled';
|
|
407
|
+
};
|
|
408
|
+
export type SetScheduledActionEnabledErrors = {
|
|
409
|
+
400: string;
|
|
410
|
+
401: string;
|
|
411
|
+
404: string;
|
|
412
|
+
/**
|
|
413
|
+
* Configuration changed or execution is active
|
|
414
|
+
*/
|
|
415
|
+
409: string;
|
|
416
|
+
500: string;
|
|
417
|
+
};
|
|
418
|
+
export type SetScheduledActionEnabledError = SetScheduledActionEnabledErrors[keyof SetScheduledActionEnabledErrors];
|
|
419
|
+
export type SetScheduledActionEnabledResponses = {
|
|
420
|
+
200: ScheduledActionResponse;
|
|
421
|
+
};
|
|
422
|
+
export type SetScheduledActionEnabledResponse = SetScheduledActionEnabledResponses[keyof SetScheduledActionEnabledResponses];
|
|
196
423
|
export type ExecuteScheduledActionNowData = {
|
|
197
424
|
body?: never;
|
|
198
425
|
path: {
|
|
@@ -205,13 +432,22 @@ export type ExecuteScheduledActionNowData = {
|
|
|
205
432
|
url: '/scheduled-actions/{id}/execute';
|
|
206
433
|
};
|
|
207
434
|
export type ExecuteScheduledActionNowErrors = {
|
|
435
|
+
400: string;
|
|
208
436
|
401: string;
|
|
437
|
+
/**
|
|
438
|
+
* AI allowance exhausted
|
|
439
|
+
*/
|
|
440
|
+
402: AiAdmissionErrorBody;
|
|
209
441
|
404: string;
|
|
210
442
|
/**
|
|
211
443
|
* Action is already running
|
|
212
444
|
*/
|
|
213
445
|
409: string;
|
|
214
446
|
500: string;
|
|
447
|
+
/**
|
|
448
|
+
* AI usage validation unavailable; retry later
|
|
449
|
+
*/
|
|
450
|
+
503: AiAdmissionErrorBody;
|
|
215
451
|
};
|
|
216
452
|
export type ExecuteScheduledActionNowError = ExecuteScheduledActionNowErrors[keyof ExecuteScheduledActionNowErrors];
|
|
217
453
|
export type ExecuteScheduledActionNowResponses = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { type Options, Sdk } from './sdk.gen';
|
|
2
|
-
export type { CalendarEventFilters, CalendarEventMetadata, CalendarEventSearchOccurrence, CalendarEventSearchResponseItem, CalendarEventSearchResponseItemWithMetadata, CalendarEventSearchResult, CalendarEventSearchTime, CallFilters, CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata, CallRecordSearchResult, CallStatus, ChannelFilters, ChannelMessageSearchResponseItem, ChannelMetadata, ChannelNameSearchResponseItem, ChannelSearchRequest, ChannelSearchResponse, ChannelSearchResponseItem, ChannelSearchResponseItemWithMetadata, ChannelSearchResult, ChannelSortTimestamp, ChannelThreadFilters, ChatFilters, ChatMessageSearchResult, ChatMetadata, ChatSearchRequest, ChatSearchResponse, ChatSearchResponseItem, ChatSearchResponseItemWithMetadata, ClientOptions, CrmCompanyFilters, CrmCompanySearchDomain, CrmCompanySearchResponseItem, DataType, DocumentFilters, DocumentMetadata, DocumentSearchRequest, DocumentSearchResponse, DocumentSearchResponseItem, DocumentSearchResponseItemWithMetadata, DocumentSearchResult, DocumentSubType, EmailFilters, EmailSearchParticipant, EmailSearchRequest, EmailSearchResponse, EmailSearchResponseItem, EmailSearchResponseItemWithMetadata, EmailSearchResult, EmptyResponse, EntityFilters, EntityReference, EntityType, ErrorResponse, FileType, ForeignEntityFilters, MatchType, NotificationFilters, ProjectFilters, ProjectMetadata, ProjectSearchMetadata, ProjectSearchRequest, ProjectSearchResponseItem, ProjectSearchResponseItemWithMetadata, ProjectSearchResult, PropertyDefinition, PropertyFilter, PropertyOwner, PropertyValue,
|
|
2
|
+
export type { AgentSessionAuthor, AgentSessionFilters, AgentSessionSearchResponseItem, AgentSessionSearchResult, CalendarEventFilters, CalendarEventMetadata, CalendarEventOrganizer, CalendarEventSearchOccurrence, CalendarEventSearchResponseItem, CalendarEventSearchResponseItemWithMetadata, CalendarEventSearchResult, CalendarEventSearchTime, CallFilters, CallRecordMetadata, CallRecordSearchResponseItem, CallRecordSearchResponseItemWithMetadata, CallRecordSearchResult, CallStatus, ChannelFilters, ChannelMessageSearchResponseItem, ChannelMetadata, ChannelNameSearchResponseItem, ChannelSearchRequest, ChannelSearchResponse, ChannelSearchResponseItem, ChannelSearchResponseItemWithMetadata, ChannelSearchResult, ChannelSortTimestamp, ChannelThreadFilters, ChatFilters, ChatMessageSearchResult, ChatMetadata, ChatSearchRequest, ChatSearchResponse, ChatSearchResponseItem, ChatSearchResponseItemWithMetadata, ClientOptions, CrmCompanyFilters, CrmCompanySearchDomain, CrmCompanySearchResponseItem, DataType, DocumentFilters, DocumentMetadata, DocumentSearchRequest, DocumentSearchResponse, DocumentSearchResponseItem, DocumentSearchResponseItemWithMetadata, DocumentSearchResult, DocumentSubType, EmailFilters, EmailSearchParticipant, EmailSearchRequest, EmailSearchResponse, EmailSearchResponseItem, EmailSearchResponseItemWithMetadata, EmailSearchResult, EmptyResponse, EntityFilters, EntityReference, EntityType, ErrorResponse, FileType, ForeignEntityFilters, Highlight, InitiativeFilters, MatchType, NotificationFilters, NotificationState, ProjectFilters, ProjectMetadata, ProjectSearchMetadata, ProjectSearchRequest, ProjectSearchResponseItem, ProjectSearchResponseItemWithMetadata, ProjectSearchResult, PropertyDefinition, PropertyFilter, PropertyOwner, PropertyValue, SearchGotoAgentSession, SearchGotoCallRecord, SearchGotoChannel, SearchGotoChat, SearchGotoContent, SearchGotoDocument, SearchGotoEmail, SearchHighlight, SearchOn, SearchResponse, SharedEmailFilter, SimpleCalendarEventSearchResponseBaseItemHumanReadableTimestamp, SimpleCallRecordSearchResponseBaseItemHumanReadableTimestamp, SimpleChannelSearchReponseBaseItem, SimpleChannelSearchReponseBaseItemHumanReadableTimestamp, SimpleChannelSearchResponse, SimpleChatSearchResponse, SimpleChatSearchResponseBaseItem, SimpleChatSearchResponseBaseItemHumanReadableTimestamp, SimpleDocumentSearchResponse, SimpleDocumentSearchResponseBaseItem, SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp, SimpleEmailSearchResponse, SimpleEmailSearchResponseBaseItem, SimpleEmailSearchResponseBaseItemHumanReadableTimestamp, SimpleProjectSearchResponse, SimpleProjectSearchResponseBaseItem, SimpleProjectSearchResponseBaseItemHumanReadableTimestamp, SimpleSearchResponse, SimpleSearchResponseItem, SimpleUnifiedSearchBaseResponse, SimpleUnifiedSearchData, SimpleUnifiedSearchError, SimpleUnifiedSearchErrors, SimpleUnifiedSearchResponse, SimpleUnifiedSearchResponseBaseItem, SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp, SimpleUnifiedSearchResponses, SoupProperty, TagFilterMode, TaskFilters, UnifiedSearchData, UnifiedSearchError, UnifiedSearchErrors, UnifiedSearchRequest, UnifiedSearchResponse, UnifiedSearchResponse2, UnifiedSearchResponseItem, UnifiedSearchResponses } from './types.gen';
|