@getsupervisor/agents-studio-sdk 1.24.0 → 1.26.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.
- package/CHANGELOG.md +37 -0
- package/README.md +87 -37
- package/dist/index.cjs +118 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -57
- package/dist/index.d.ts +55 -57
- package/dist/index.js +118 -75
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -882,10 +882,25 @@ type UpdateAgentBlueprintRequest = {
|
|
|
882
882
|
topicsAllowed?: string[];
|
|
883
883
|
topicsForbidden?: string[];
|
|
884
884
|
};
|
|
885
|
-
type
|
|
886
|
-
type
|
|
887
|
-
|
|
888
|
-
|
|
885
|
+
type BlueprintStageSchema = components['schemas']['BlueprintStage'];
|
|
886
|
+
type BlueprintStage = Omit<BlueprintStageSchema, 'prompt'> & {
|
|
887
|
+
goalPrompt: string;
|
|
888
|
+
promptInstructions: string[];
|
|
889
|
+
};
|
|
890
|
+
type BlueprintStageListResponseSchema = components['schemas']['BlueprintStageListResponse'];
|
|
891
|
+
type BlueprintStageListResponse = Omit<BlueprintStageListResponseSchema, 'data'> & {
|
|
892
|
+
data: BlueprintStage[];
|
|
893
|
+
};
|
|
894
|
+
type CreateBlueprintStageRequestSchema = components['schemas']['CreateBlueprintStageRequest'];
|
|
895
|
+
type CreateBlueprintStageRequest = Omit<CreateBlueprintStageRequestSchema, 'prompt'> & {
|
|
896
|
+
goalPrompt: string;
|
|
897
|
+
promptInstructions?: string[];
|
|
898
|
+
};
|
|
899
|
+
type UpdateBlueprintStageRequestSchema = components['schemas']['UpdateBlueprintStageRequest'];
|
|
900
|
+
type UpdateBlueprintStageRequest = Omit<UpdateBlueprintStageRequestSchema, 'prompt'> & {
|
|
901
|
+
goalPrompt?: string;
|
|
902
|
+
promptInstructions?: string[];
|
|
903
|
+
};
|
|
889
904
|
type BlueprintStageReorderRequest = components['schemas']['BlueprintStageReorderRequest'];
|
|
890
905
|
type BlueprintStageTrigger = components['schemas']['BlueprintStageTrigger'];
|
|
891
906
|
type BlueprintStageTriggerListResponse = components['schemas']['BlueprintStageTriggerListResponse'];
|
|
@@ -990,11 +1005,11 @@ declare function createAgentScheduleApi(cfg: ClientConfig & {
|
|
|
990
1005
|
|
|
991
1006
|
type ListAgentStageTriggersOptions = ListQueryOptions;
|
|
992
1007
|
type AgentStageTriggersApi$1 = {
|
|
993
|
-
list(agentId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
994
|
-
get(agentId: string, stageId: string, triggerId: string): Promise<BlueprintStageTrigger>;
|
|
995
|
-
create(agentId: string, stageId: string, payload: CreateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
996
|
-
update(agentId: string, stageId: string, triggerId: string, payload: UpdateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
997
|
-
delete(agentId: string, stageId: string, triggerId: string): Promise<void>;
|
|
1008
|
+
list(agentId: string, blueprintId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
1009
|
+
get(agentId: string, blueprintId: string, stageId: string, triggerId: string): Promise<BlueprintStageTrigger>;
|
|
1010
|
+
create(agentId: string, blueprintId: string, stageId: string, payload: CreateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
1011
|
+
update(agentId: string, blueprintId: string, stageId: string, triggerId: string, payload: UpdateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
1012
|
+
delete(agentId: string, blueprintId: string, stageId: string, triggerId: string): Promise<void>;
|
|
998
1013
|
};
|
|
999
1014
|
declare function createAgentStageTriggersApi(cfg: ClientConfig & {
|
|
1000
1015
|
retry?: RetryPolicy;
|
|
@@ -1002,12 +1017,12 @@ declare function createAgentStageTriggersApi(cfg: ClientConfig & {
|
|
|
1002
1017
|
|
|
1003
1018
|
type ListAgentStagesOptions = ListQueryOptions;
|
|
1004
1019
|
type AgentStagesApi$1 = {
|
|
1005
|
-
list(agentId: string, options?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, ListAgentStagesOptions>>;
|
|
1006
|
-
get(agentId: string, stageId: string): Promise<BlueprintStage>;
|
|
1007
|
-
create(agentId: string, payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1008
|
-
update(agentId: string, stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1009
|
-
delete(agentId: string, stageId: string): Promise<void>;
|
|
1010
|
-
reorder(agentId: string, payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1020
|
+
list(agentId: string, blueprintId: string, options?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, ListAgentStagesOptions>>;
|
|
1021
|
+
get(agentId: string, blueprintId: string, stageId: string): Promise<BlueprintStage>;
|
|
1022
|
+
create(agentId: string, blueprintId: string, payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1023
|
+
update(agentId: string, blueprintId: string, stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1024
|
+
delete(agentId: string, blueprintId: string, stageId: string): Promise<void>;
|
|
1025
|
+
reorder(agentId: string, blueprintId: string, payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1011
1026
|
};
|
|
1012
1027
|
declare function createAgentStagesApi(cfg: ClientConfig & {
|
|
1013
1028
|
retry?: RetryPolicy;
|
|
@@ -1103,7 +1118,7 @@ declare const bindAgentInstructions: (api: AgentInstructionsApi, agentId: string
|
|
|
1103
1118
|
}>;
|
|
1104
1119
|
delete(instructionId: string): Promise<void>;
|
|
1105
1120
|
};
|
|
1106
|
-
declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: string, stageId: string) => {
|
|
1121
|
+
declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: string, blueprintId: string, stageId: string) => {
|
|
1107
1122
|
list(opts?: ListAgentStageTriggersOptions): Promise<PaginatedResult<{
|
|
1108
1123
|
data: components["schemas"]["BlueprintStageTrigger"][];
|
|
1109
1124
|
meta: components["schemas"]["PaginationMeta"];
|
|
@@ -1138,11 +1153,8 @@ declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: stri
|
|
|
1138
1153
|
}>;
|
|
1139
1154
|
delete(triggerId: string): Promise<void>;
|
|
1140
1155
|
};
|
|
1141
|
-
declare const bindAgentStages: (stagesApi: AgentStagesApi, triggersApi: AgentStageTriggersApi, agentId: string) => {
|
|
1142
|
-
list(opts?: ListAgentStagesOptions): Promise<PaginatedResult<{
|
|
1143
|
-
data: components["schemas"]["BlueprintStage"][];
|
|
1144
|
-
meta: components["schemas"]["PaginationMeta"];
|
|
1145
|
-
}, Partial<{
|
|
1156
|
+
declare const bindAgentStages: (stagesApi: AgentStagesApi, triggersApi: AgentStageTriggersApi, agentId: string) => ((blueprintId: string) => {
|
|
1157
|
+
list(opts?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, Partial<{
|
|
1146
1158
|
page: number;
|
|
1147
1159
|
limit: number;
|
|
1148
1160
|
sort: string | string[];
|
|
@@ -1153,42 +1165,28 @@ declare const bindAgentStages: (stagesApi: AgentStagesApi, triggersApi: AgentSta
|
|
|
1153
1165
|
or: QueryOrGroups | QueryBuilderInput;
|
|
1154
1166
|
}>>>;
|
|
1155
1167
|
get(stageId: string): Promise<BlueprintStage>;
|
|
1156
|
-
create(payload: CreateBlueprintStageRequest): Promise<
|
|
1157
|
-
|
|
1158
|
-
agentId: string;
|
|
1159
|
-
blueprintId: string;
|
|
1160
|
-
name: string;
|
|
1161
|
-
title?: string | null;
|
|
1162
|
-
prompt: string;
|
|
1163
|
-
order: number;
|
|
1164
|
-
triggers: components["schemas"]["BlueprintStageTrigger"][];
|
|
1165
|
-
metadata?: {
|
|
1166
|
-
[key: string]: unknown;
|
|
1167
|
-
} | null;
|
|
1168
|
-
createdAt: string;
|
|
1169
|
-
updatedAt: string;
|
|
1170
|
-
}>;
|
|
1171
|
-
update(stageId: string, payload: UpdateBlueprintStageRequest): Promise<{
|
|
1172
|
-
id: string;
|
|
1173
|
-
agentId: string;
|
|
1174
|
-
blueprintId: string;
|
|
1175
|
-
name: string;
|
|
1176
|
-
title?: string | null;
|
|
1177
|
-
prompt: string;
|
|
1178
|
-
order: number;
|
|
1179
|
-
triggers: components["schemas"]["BlueprintStageTrigger"][];
|
|
1180
|
-
metadata?: {
|
|
1181
|
-
[key: string]: unknown;
|
|
1182
|
-
} | null;
|
|
1183
|
-
createdAt: string;
|
|
1184
|
-
updatedAt: string;
|
|
1185
|
-
}>;
|
|
1168
|
+
create(payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1169
|
+
update(stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1186
1170
|
delete(stageId: string): Promise<void>;
|
|
1187
|
-
reorder(payload: BlueprintStageReorderRequest): Promise<
|
|
1188
|
-
data: components["schemas"]["BlueprintStage"][];
|
|
1189
|
-
meta: components["schemas"]["PaginationMeta"];
|
|
1190
|
-
}>;
|
|
1171
|
+
reorder(payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1191
1172
|
triggers(stageId: string): AgentStageTriggersHelper;
|
|
1173
|
+
}) & {
|
|
1174
|
+
list(blueprintId: string, opts?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, Partial<{
|
|
1175
|
+
page: number;
|
|
1176
|
+
limit: number;
|
|
1177
|
+
sort: string | string[];
|
|
1178
|
+
fields: string | string[];
|
|
1179
|
+
include: string | string[];
|
|
1180
|
+
search: string;
|
|
1181
|
+
filter: QueryFilters | QueryBuilderInput;
|
|
1182
|
+
or: QueryOrGroups | QueryBuilderInput;
|
|
1183
|
+
}>>>;
|
|
1184
|
+
get(blueprintId: string, stageId: string): Promise<BlueprintStage>;
|
|
1185
|
+
create(blueprintId: string, payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1186
|
+
update(blueprintId: string, stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1187
|
+
delete(blueprintId: string, stageId: string): Promise<void>;
|
|
1188
|
+
reorder(blueprintId: string, payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1189
|
+
triggers(blueprintId: string, stageId: string): AgentStageTriggersHelper;
|
|
1192
1190
|
};
|
|
1193
1191
|
declare const bindAgentTags: (api: AgentTagsApi, agentId: string) => {
|
|
1194
1192
|
add(tagId: string): Promise<AgentTagsResponse>;
|
|
@@ -1636,7 +1634,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1636
1634
|
} & ((agentId: string) => ReturnType<typeof bindAgentVersions>);
|
|
1637
1635
|
blueprints: AgentBlueprintsApi$1 & ((agentId: string) => ReturnType<typeof bindAgentBlueprints>);
|
|
1638
1636
|
stages: AgentStagesApi$1 & ((agentId: string) => ReturnType<typeof bindAgentStages>) & {
|
|
1639
|
-
triggers: AgentStageTriggersApi$1 & ((agentId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1637
|
+
triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1640
1638
|
};
|
|
1641
1639
|
delete: (agent: string | AgentEntity) => Promise<void>;
|
|
1642
1640
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<{
|
|
@@ -1739,7 +1737,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1739
1737
|
} & ((agentId: string) => ReturnType<typeof bindAgentVersions>);
|
|
1740
1738
|
blueprints: AgentBlueprintsApi$1 & ((agentId: string) => ReturnType<typeof bindAgentBlueprints>);
|
|
1741
1739
|
stages: AgentStagesApi$1 & ((agentId: string) => ReturnType<typeof bindAgentStages>) & {
|
|
1742
|
-
triggers: AgentStageTriggersApi$1 & ((agentId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1740
|
+
triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1743
1741
|
};
|
|
1744
1742
|
delete: (agent: string | AgentEntity) => Promise<void>;
|
|
1745
1743
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<{
|
package/dist/index.d.ts
CHANGED
|
@@ -882,10 +882,25 @@ type UpdateAgentBlueprintRequest = {
|
|
|
882
882
|
topicsAllowed?: string[];
|
|
883
883
|
topicsForbidden?: string[];
|
|
884
884
|
};
|
|
885
|
-
type
|
|
886
|
-
type
|
|
887
|
-
|
|
888
|
-
|
|
885
|
+
type BlueprintStageSchema = components['schemas']['BlueprintStage'];
|
|
886
|
+
type BlueprintStage = Omit<BlueprintStageSchema, 'prompt'> & {
|
|
887
|
+
goalPrompt: string;
|
|
888
|
+
promptInstructions: string[];
|
|
889
|
+
};
|
|
890
|
+
type BlueprintStageListResponseSchema = components['schemas']['BlueprintStageListResponse'];
|
|
891
|
+
type BlueprintStageListResponse = Omit<BlueprintStageListResponseSchema, 'data'> & {
|
|
892
|
+
data: BlueprintStage[];
|
|
893
|
+
};
|
|
894
|
+
type CreateBlueprintStageRequestSchema = components['schemas']['CreateBlueprintStageRequest'];
|
|
895
|
+
type CreateBlueprintStageRequest = Omit<CreateBlueprintStageRequestSchema, 'prompt'> & {
|
|
896
|
+
goalPrompt: string;
|
|
897
|
+
promptInstructions?: string[];
|
|
898
|
+
};
|
|
899
|
+
type UpdateBlueprintStageRequestSchema = components['schemas']['UpdateBlueprintStageRequest'];
|
|
900
|
+
type UpdateBlueprintStageRequest = Omit<UpdateBlueprintStageRequestSchema, 'prompt'> & {
|
|
901
|
+
goalPrompt?: string;
|
|
902
|
+
promptInstructions?: string[];
|
|
903
|
+
};
|
|
889
904
|
type BlueprintStageReorderRequest = components['schemas']['BlueprintStageReorderRequest'];
|
|
890
905
|
type BlueprintStageTrigger = components['schemas']['BlueprintStageTrigger'];
|
|
891
906
|
type BlueprintStageTriggerListResponse = components['schemas']['BlueprintStageTriggerListResponse'];
|
|
@@ -990,11 +1005,11 @@ declare function createAgentScheduleApi(cfg: ClientConfig & {
|
|
|
990
1005
|
|
|
991
1006
|
type ListAgentStageTriggersOptions = ListQueryOptions;
|
|
992
1007
|
type AgentStageTriggersApi$1 = {
|
|
993
|
-
list(agentId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
994
|
-
get(agentId: string, stageId: string, triggerId: string): Promise<BlueprintStageTrigger>;
|
|
995
|
-
create(agentId: string, stageId: string, payload: CreateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
996
|
-
update(agentId: string, stageId: string, triggerId: string, payload: UpdateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
997
|
-
delete(agentId: string, stageId: string, triggerId: string): Promise<void>;
|
|
1008
|
+
list(agentId: string, blueprintId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
1009
|
+
get(agentId: string, blueprintId: string, stageId: string, triggerId: string): Promise<BlueprintStageTrigger>;
|
|
1010
|
+
create(agentId: string, blueprintId: string, stageId: string, payload: CreateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
1011
|
+
update(agentId: string, blueprintId: string, stageId: string, triggerId: string, payload: UpdateBlueprintStageTriggerRequest): Promise<BlueprintStageTrigger>;
|
|
1012
|
+
delete(agentId: string, blueprintId: string, stageId: string, triggerId: string): Promise<void>;
|
|
998
1013
|
};
|
|
999
1014
|
declare function createAgentStageTriggersApi(cfg: ClientConfig & {
|
|
1000
1015
|
retry?: RetryPolicy;
|
|
@@ -1002,12 +1017,12 @@ declare function createAgentStageTriggersApi(cfg: ClientConfig & {
|
|
|
1002
1017
|
|
|
1003
1018
|
type ListAgentStagesOptions = ListQueryOptions;
|
|
1004
1019
|
type AgentStagesApi$1 = {
|
|
1005
|
-
list(agentId: string, options?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, ListAgentStagesOptions>>;
|
|
1006
|
-
get(agentId: string, stageId: string): Promise<BlueprintStage>;
|
|
1007
|
-
create(agentId: string, payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1008
|
-
update(agentId: string, stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1009
|
-
delete(agentId: string, stageId: string): Promise<void>;
|
|
1010
|
-
reorder(agentId: string, payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1020
|
+
list(agentId: string, blueprintId: string, options?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, ListAgentStagesOptions>>;
|
|
1021
|
+
get(agentId: string, blueprintId: string, stageId: string): Promise<BlueprintStage>;
|
|
1022
|
+
create(agentId: string, blueprintId: string, payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1023
|
+
update(agentId: string, blueprintId: string, stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1024
|
+
delete(agentId: string, blueprintId: string, stageId: string): Promise<void>;
|
|
1025
|
+
reorder(agentId: string, blueprintId: string, payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1011
1026
|
};
|
|
1012
1027
|
declare function createAgentStagesApi(cfg: ClientConfig & {
|
|
1013
1028
|
retry?: RetryPolicy;
|
|
@@ -1103,7 +1118,7 @@ declare const bindAgentInstructions: (api: AgentInstructionsApi, agentId: string
|
|
|
1103
1118
|
}>;
|
|
1104
1119
|
delete(instructionId: string): Promise<void>;
|
|
1105
1120
|
};
|
|
1106
|
-
declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: string, stageId: string) => {
|
|
1121
|
+
declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: string, blueprintId: string, stageId: string) => {
|
|
1107
1122
|
list(opts?: ListAgentStageTriggersOptions): Promise<PaginatedResult<{
|
|
1108
1123
|
data: components["schemas"]["BlueprintStageTrigger"][];
|
|
1109
1124
|
meta: components["schemas"]["PaginationMeta"];
|
|
@@ -1138,11 +1153,8 @@ declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: stri
|
|
|
1138
1153
|
}>;
|
|
1139
1154
|
delete(triggerId: string): Promise<void>;
|
|
1140
1155
|
};
|
|
1141
|
-
declare const bindAgentStages: (stagesApi: AgentStagesApi, triggersApi: AgentStageTriggersApi, agentId: string) => {
|
|
1142
|
-
list(opts?: ListAgentStagesOptions): Promise<PaginatedResult<{
|
|
1143
|
-
data: components["schemas"]["BlueprintStage"][];
|
|
1144
|
-
meta: components["schemas"]["PaginationMeta"];
|
|
1145
|
-
}, Partial<{
|
|
1156
|
+
declare const bindAgentStages: (stagesApi: AgentStagesApi, triggersApi: AgentStageTriggersApi, agentId: string) => ((blueprintId: string) => {
|
|
1157
|
+
list(opts?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, Partial<{
|
|
1146
1158
|
page: number;
|
|
1147
1159
|
limit: number;
|
|
1148
1160
|
sort: string | string[];
|
|
@@ -1153,42 +1165,28 @@ declare const bindAgentStages: (stagesApi: AgentStagesApi, triggersApi: AgentSta
|
|
|
1153
1165
|
or: QueryOrGroups | QueryBuilderInput;
|
|
1154
1166
|
}>>>;
|
|
1155
1167
|
get(stageId: string): Promise<BlueprintStage>;
|
|
1156
|
-
create(payload: CreateBlueprintStageRequest): Promise<
|
|
1157
|
-
|
|
1158
|
-
agentId: string;
|
|
1159
|
-
blueprintId: string;
|
|
1160
|
-
name: string;
|
|
1161
|
-
title?: string | null;
|
|
1162
|
-
prompt: string;
|
|
1163
|
-
order: number;
|
|
1164
|
-
triggers: components["schemas"]["BlueprintStageTrigger"][];
|
|
1165
|
-
metadata?: {
|
|
1166
|
-
[key: string]: unknown;
|
|
1167
|
-
} | null;
|
|
1168
|
-
createdAt: string;
|
|
1169
|
-
updatedAt: string;
|
|
1170
|
-
}>;
|
|
1171
|
-
update(stageId: string, payload: UpdateBlueprintStageRequest): Promise<{
|
|
1172
|
-
id: string;
|
|
1173
|
-
agentId: string;
|
|
1174
|
-
blueprintId: string;
|
|
1175
|
-
name: string;
|
|
1176
|
-
title?: string | null;
|
|
1177
|
-
prompt: string;
|
|
1178
|
-
order: number;
|
|
1179
|
-
triggers: components["schemas"]["BlueprintStageTrigger"][];
|
|
1180
|
-
metadata?: {
|
|
1181
|
-
[key: string]: unknown;
|
|
1182
|
-
} | null;
|
|
1183
|
-
createdAt: string;
|
|
1184
|
-
updatedAt: string;
|
|
1185
|
-
}>;
|
|
1168
|
+
create(payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1169
|
+
update(stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1186
1170
|
delete(stageId: string): Promise<void>;
|
|
1187
|
-
reorder(payload: BlueprintStageReorderRequest): Promise<
|
|
1188
|
-
data: components["schemas"]["BlueprintStage"][];
|
|
1189
|
-
meta: components["schemas"]["PaginationMeta"];
|
|
1190
|
-
}>;
|
|
1171
|
+
reorder(payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1191
1172
|
triggers(stageId: string): AgentStageTriggersHelper;
|
|
1173
|
+
}) & {
|
|
1174
|
+
list(blueprintId: string, opts?: ListAgentStagesOptions): Promise<PaginatedResult<BlueprintStageListResponse, Partial<{
|
|
1175
|
+
page: number;
|
|
1176
|
+
limit: number;
|
|
1177
|
+
sort: string | string[];
|
|
1178
|
+
fields: string | string[];
|
|
1179
|
+
include: string | string[];
|
|
1180
|
+
search: string;
|
|
1181
|
+
filter: QueryFilters | QueryBuilderInput;
|
|
1182
|
+
or: QueryOrGroups | QueryBuilderInput;
|
|
1183
|
+
}>>>;
|
|
1184
|
+
get(blueprintId: string, stageId: string): Promise<BlueprintStage>;
|
|
1185
|
+
create(blueprintId: string, payload: CreateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1186
|
+
update(blueprintId: string, stageId: string, payload: UpdateBlueprintStageRequest): Promise<BlueprintStage>;
|
|
1187
|
+
delete(blueprintId: string, stageId: string): Promise<void>;
|
|
1188
|
+
reorder(blueprintId: string, payload: BlueprintStageReorderRequest): Promise<BlueprintStageListResponse>;
|
|
1189
|
+
triggers(blueprintId: string, stageId: string): AgentStageTriggersHelper;
|
|
1192
1190
|
};
|
|
1193
1191
|
declare const bindAgentTags: (api: AgentTagsApi, agentId: string) => {
|
|
1194
1192
|
add(tagId: string): Promise<AgentTagsResponse>;
|
|
@@ -1636,7 +1634,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1636
1634
|
} & ((agentId: string) => ReturnType<typeof bindAgentVersions>);
|
|
1637
1635
|
blueprints: AgentBlueprintsApi$1 & ((agentId: string) => ReturnType<typeof bindAgentBlueprints>);
|
|
1638
1636
|
stages: AgentStagesApi$1 & ((agentId: string) => ReturnType<typeof bindAgentStages>) & {
|
|
1639
|
-
triggers: AgentStageTriggersApi$1 & ((agentId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1637
|
+
triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1640
1638
|
};
|
|
1641
1639
|
delete: (agent: string | AgentEntity) => Promise<void>;
|
|
1642
1640
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<{
|
|
@@ -1739,7 +1737,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1739
1737
|
} & ((agentId: string) => ReturnType<typeof bindAgentVersions>);
|
|
1740
1738
|
blueprints: AgentBlueprintsApi$1 & ((agentId: string) => ReturnType<typeof bindAgentBlueprints>);
|
|
1741
1739
|
stages: AgentStagesApi$1 & ((agentId: string) => ReturnType<typeof bindAgentStages>) & {
|
|
1742
|
-
triggers: AgentStageTriggersApi$1 & ((agentId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1740
|
+
triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
|
|
1743
1741
|
};
|
|
1744
1742
|
delete: (agent: string | AgentEntity) => Promise<void>;
|
|
1745
1743
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<{
|
package/dist/index.js
CHANGED
|
@@ -606,7 +606,7 @@ function createAgentScheduleApi(cfg) {
|
|
|
606
606
|
function createAgentStageTriggersApi(cfg) {
|
|
607
607
|
const { base, doFetch } = createHttp(cfg);
|
|
608
608
|
const jsonHeaders = { "content-type": "application/json" };
|
|
609
|
-
const fetchTriggerPage = async (agentId, stageId, options = {}) => {
|
|
609
|
+
const fetchTriggerPage = async (agentId, blueprintId, stageId, options = {}) => {
|
|
610
610
|
const normalizedOptions = {
|
|
611
611
|
page: options.page,
|
|
612
612
|
limit: options.limit,
|
|
@@ -619,7 +619,7 @@ function createAgentStageTriggersApi(cfg) {
|
|
|
619
619
|
};
|
|
620
620
|
const query = serializeListOptions(normalizedOptions);
|
|
621
621
|
const res = await doFetch(
|
|
622
|
-
`${base}/agents/${agentId}/stages/${stageId}/triggers`,
|
|
622
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}/triggers`,
|
|
623
623
|
{
|
|
624
624
|
method: "GET",
|
|
625
625
|
query
|
|
@@ -628,26 +628,26 @@ function createAgentStageTriggersApi(cfg) {
|
|
|
628
628
|
return res.json();
|
|
629
629
|
};
|
|
630
630
|
return {
|
|
631
|
-
async list(agentId, stageId, options = {}) {
|
|
631
|
+
async list(agentId, blueprintId, stageId, options = {}) {
|
|
632
632
|
const normalized = {
|
|
633
633
|
...options ?? {}
|
|
634
634
|
};
|
|
635
|
-
const fetchPage = (opts) => fetchTriggerPage(agentId, stageId, opts);
|
|
635
|
+
const fetchPage = (opts) => fetchTriggerPage(agentId, blueprintId, stageId, opts);
|
|
636
636
|
const response = await fetchPage(normalized);
|
|
637
637
|
return attachPaginator(response, fetchPage, normalized);
|
|
638
638
|
},
|
|
639
|
-
async get(agentId, stageId, triggerId) {
|
|
639
|
+
async get(agentId, blueprintId, stageId, triggerId) {
|
|
640
640
|
const res = await doFetch(
|
|
641
|
-
`${base}/agents/${agentId}/stages/${stageId}/triggers/${triggerId}`,
|
|
641
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}/triggers/${triggerId}`,
|
|
642
642
|
{
|
|
643
643
|
method: "GET"
|
|
644
644
|
}
|
|
645
645
|
);
|
|
646
646
|
return res.json();
|
|
647
647
|
},
|
|
648
|
-
async create(agentId, stageId, payload) {
|
|
648
|
+
async create(agentId, blueprintId, stageId, payload) {
|
|
649
649
|
const res = await doFetch(
|
|
650
|
-
`${base}/agents/${agentId}/stages/${stageId}/triggers`,
|
|
650
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}/triggers`,
|
|
651
651
|
{
|
|
652
652
|
method: "POST",
|
|
653
653
|
headers: jsonHeaders,
|
|
@@ -656,9 +656,9 @@ function createAgentStageTriggersApi(cfg) {
|
|
|
656
656
|
);
|
|
657
657
|
return res.json();
|
|
658
658
|
},
|
|
659
|
-
async update(agentId, stageId, triggerId, payload) {
|
|
659
|
+
async update(agentId, blueprintId, stageId, triggerId, payload) {
|
|
660
660
|
const res = await doFetch(
|
|
661
|
-
`${base}/agents/${agentId}/stages/${stageId}/triggers/${triggerId}`,
|
|
661
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}/triggers/${triggerId}`,
|
|
662
662
|
{
|
|
663
663
|
method: "PATCH",
|
|
664
664
|
headers: jsonHeaders,
|
|
@@ -667,9 +667,9 @@ function createAgentStageTriggersApi(cfg) {
|
|
|
667
667
|
);
|
|
668
668
|
return res.json();
|
|
669
669
|
},
|
|
670
|
-
async delete(agentId, stageId, triggerId) {
|
|
670
|
+
async delete(agentId, blueprintId, stageId, triggerId) {
|
|
671
671
|
await doFetch(
|
|
672
|
-
`${base}/agents/${agentId}/stages/${stageId}/triggers/${triggerId}`,
|
|
672
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}/triggers/${triggerId}`,
|
|
673
673
|
{
|
|
674
674
|
method: "DELETE"
|
|
675
675
|
}
|
|
@@ -682,7 +682,7 @@ function createAgentStageTriggersApi(cfg) {
|
|
|
682
682
|
function createAgentStagesApi(cfg) {
|
|
683
683
|
const { base, doFetch } = createHttp(cfg);
|
|
684
684
|
const jsonHeaders = { "content-type": "application/json" };
|
|
685
|
-
const fetchStagePage = async (agentId, options = {}) => {
|
|
685
|
+
const fetchStagePage = async (agentId, blueprintId, options = {}) => {
|
|
686
686
|
const normalizedOptions = {
|
|
687
687
|
page: options.page,
|
|
688
688
|
limit: options.limit,
|
|
@@ -691,52 +691,70 @@ function createAgentStagesApi(cfg) {
|
|
|
691
691
|
search: options.search
|
|
692
692
|
};
|
|
693
693
|
const query = serializeListOptions(normalizedOptions);
|
|
694
|
-
const res = await doFetch(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
694
|
+
const res = await doFetch(
|
|
695
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages`,
|
|
696
|
+
{
|
|
697
|
+
method: "GET",
|
|
698
|
+
query
|
|
699
|
+
}
|
|
700
|
+
);
|
|
698
701
|
return res.json();
|
|
699
702
|
};
|
|
700
703
|
return {
|
|
701
|
-
async list(agentId, options = {}) {
|
|
704
|
+
async list(agentId, blueprintId, options = {}) {
|
|
702
705
|
const normalized = { ...options ?? {} };
|
|
703
|
-
const fetchPage = (opts) => fetchStagePage(agentId, opts);
|
|
706
|
+
const fetchPage = (opts) => fetchStagePage(agentId, blueprintId, opts);
|
|
704
707
|
const response = await fetchPage(normalized);
|
|
705
708
|
return attachPaginator(response, fetchPage, normalized);
|
|
706
709
|
},
|
|
707
|
-
async get(agentId, stageId) {
|
|
708
|
-
const res = await doFetch(
|
|
709
|
-
|
|
710
|
-
|
|
710
|
+
async get(agentId, blueprintId, stageId) {
|
|
711
|
+
const res = await doFetch(
|
|
712
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}`,
|
|
713
|
+
{
|
|
714
|
+
method: "GET"
|
|
715
|
+
}
|
|
716
|
+
);
|
|
711
717
|
return res.json();
|
|
712
718
|
},
|
|
713
|
-
async create(agentId, payload) {
|
|
714
|
-
const res = await doFetch(
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
+
async create(agentId, blueprintId, payload) {
|
|
720
|
+
const res = await doFetch(
|
|
721
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages`,
|
|
722
|
+
{
|
|
723
|
+
method: "POST",
|
|
724
|
+
headers: jsonHeaders,
|
|
725
|
+
body: JSON.stringify(payload)
|
|
726
|
+
}
|
|
727
|
+
);
|
|
719
728
|
return res.json();
|
|
720
729
|
},
|
|
721
|
-
async update(agentId, stageId, payload) {
|
|
722
|
-
const res = await doFetch(
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
730
|
+
async update(agentId, blueprintId, stageId, payload) {
|
|
731
|
+
const res = await doFetch(
|
|
732
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}`,
|
|
733
|
+
{
|
|
734
|
+
method: "PATCH",
|
|
735
|
+
headers: jsonHeaders,
|
|
736
|
+
body: JSON.stringify(payload)
|
|
737
|
+
}
|
|
738
|
+
);
|
|
727
739
|
return res.json();
|
|
728
740
|
},
|
|
729
|
-
async delete(agentId, stageId) {
|
|
730
|
-
await doFetch(
|
|
731
|
-
|
|
732
|
-
|
|
741
|
+
async delete(agentId, blueprintId, stageId) {
|
|
742
|
+
await doFetch(
|
|
743
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages/${stageId}`,
|
|
744
|
+
{
|
|
745
|
+
method: "DELETE"
|
|
746
|
+
}
|
|
747
|
+
);
|
|
733
748
|
},
|
|
734
|
-
async reorder(agentId, payload) {
|
|
735
|
-
const res = await doFetch(
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
749
|
+
async reorder(agentId, blueprintId, payload) {
|
|
750
|
+
const res = await doFetch(
|
|
751
|
+
`${base}/agents/${agentId}/blueprints/${blueprintId}/stages:reorder`,
|
|
752
|
+
{
|
|
753
|
+
method: "POST",
|
|
754
|
+
headers: jsonHeaders,
|
|
755
|
+
body: JSON.stringify(payload)
|
|
756
|
+
}
|
|
757
|
+
);
|
|
740
758
|
return res.json();
|
|
741
759
|
}
|
|
742
760
|
};
|
|
@@ -894,46 +912,71 @@ var bindAgentInstructions = (api, agentId) => ({
|
|
|
894
912
|
return api.delete(agentId, instructionId);
|
|
895
913
|
}
|
|
896
914
|
});
|
|
897
|
-
var bindAgentStageTriggers = (api, agentId, stageId) => ({
|
|
915
|
+
var bindAgentStageTriggers = (api, agentId, blueprintId, stageId) => ({
|
|
898
916
|
list(opts) {
|
|
899
|
-
return api.list(agentId, stageId, opts);
|
|
917
|
+
return api.list(agentId, blueprintId, stageId, opts);
|
|
900
918
|
},
|
|
901
919
|
get(triggerId) {
|
|
902
|
-
return api.get(agentId, stageId, triggerId);
|
|
920
|
+
return api.get(agentId, blueprintId, stageId, triggerId);
|
|
903
921
|
},
|
|
904
922
|
create(payload) {
|
|
905
|
-
return api.create(agentId, stageId, payload);
|
|
923
|
+
return api.create(agentId, blueprintId, stageId, payload);
|
|
906
924
|
},
|
|
907
925
|
update(triggerId, payload) {
|
|
908
|
-
return api.update(agentId, stageId, triggerId, payload);
|
|
926
|
+
return api.update(agentId, blueprintId, stageId, triggerId, payload);
|
|
909
927
|
},
|
|
910
928
|
delete(triggerId) {
|
|
911
|
-
return api.delete(agentId, stageId, triggerId);
|
|
912
|
-
}
|
|
913
|
-
});
|
|
914
|
-
var bindAgentStages = (stagesApi, triggersApi, agentId) => ({
|
|
915
|
-
list(opts) {
|
|
916
|
-
return stagesApi.list(agentId, opts);
|
|
917
|
-
},
|
|
918
|
-
get(stageId) {
|
|
919
|
-
return stagesApi.get(agentId, stageId);
|
|
920
|
-
},
|
|
921
|
-
create(payload) {
|
|
922
|
-
return stagesApi.create(agentId, payload);
|
|
923
|
-
},
|
|
924
|
-
update(stageId, payload) {
|
|
925
|
-
return stagesApi.update(agentId, stageId, payload);
|
|
926
|
-
},
|
|
927
|
-
delete(stageId) {
|
|
928
|
-
return stagesApi.delete(agentId, stageId);
|
|
929
|
-
},
|
|
930
|
-
reorder(payload) {
|
|
931
|
-
return stagesApi.reorder(agentId, payload);
|
|
932
|
-
},
|
|
933
|
-
triggers(stageId) {
|
|
934
|
-
return bindAgentStageTriggers(triggersApi, agentId, stageId);
|
|
929
|
+
return api.delete(agentId, blueprintId, stageId, triggerId);
|
|
935
930
|
}
|
|
936
931
|
});
|
|
932
|
+
var bindAgentStages = (stagesApi, triggersApi, agentId) => {
|
|
933
|
+
const forBlueprint = (blueprintId) => ({
|
|
934
|
+
list(opts) {
|
|
935
|
+
return stagesApi.list(agentId, blueprintId, opts);
|
|
936
|
+
},
|
|
937
|
+
get(stageId) {
|
|
938
|
+
return stagesApi.get(agentId, blueprintId, stageId);
|
|
939
|
+
},
|
|
940
|
+
create(payload) {
|
|
941
|
+
return stagesApi.create(agentId, blueprintId, payload);
|
|
942
|
+
},
|
|
943
|
+
update(stageId, payload) {
|
|
944
|
+
return stagesApi.update(agentId, blueprintId, stageId, payload);
|
|
945
|
+
},
|
|
946
|
+
delete(stageId) {
|
|
947
|
+
return stagesApi.delete(agentId, blueprintId, stageId);
|
|
948
|
+
},
|
|
949
|
+
reorder(payload) {
|
|
950
|
+
return stagesApi.reorder(agentId, blueprintId, payload);
|
|
951
|
+
},
|
|
952
|
+
triggers(stageId) {
|
|
953
|
+
return bindAgentStageTriggers(triggersApi, agentId, blueprintId, stageId);
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
return Object.assign(forBlueprint, {
|
|
957
|
+
list(blueprintId, opts) {
|
|
958
|
+
return stagesApi.list(agentId, blueprintId, opts);
|
|
959
|
+
},
|
|
960
|
+
get(blueprintId, stageId) {
|
|
961
|
+
return stagesApi.get(agentId, blueprintId, stageId);
|
|
962
|
+
},
|
|
963
|
+
create(blueprintId, payload) {
|
|
964
|
+
return stagesApi.create(agentId, blueprintId, payload);
|
|
965
|
+
},
|
|
966
|
+
update(blueprintId, stageId, payload) {
|
|
967
|
+
return stagesApi.update(agentId, blueprintId, stageId, payload);
|
|
968
|
+
},
|
|
969
|
+
delete(blueprintId, stageId) {
|
|
970
|
+
return stagesApi.delete(agentId, blueprintId, stageId);
|
|
971
|
+
},
|
|
972
|
+
reorder(blueprintId, payload) {
|
|
973
|
+
return stagesApi.reorder(agentId, blueprintId, payload);
|
|
974
|
+
},
|
|
975
|
+
triggers(blueprintId, stageId) {
|
|
976
|
+
return bindAgentStageTriggers(triggersApi, agentId, blueprintId, stageId);
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
};
|
|
937
980
|
var bindAgentTags = (api, agentId) => ({
|
|
938
981
|
add(tagId) {
|
|
939
982
|
return api.add(agentId, { tagId });
|
|
@@ -1829,7 +1872,7 @@ function createClient(initialCfg) {
|
|
|
1829
1872
|
blueprintsApi
|
|
1830
1873
|
);
|
|
1831
1874
|
const stageTriggersNamespace = Object.assign(
|
|
1832
|
-
(agentId, stageId) => bindAgentStageTriggers(stageTriggersApi, agentId, stageId),
|
|
1875
|
+
(agentId, blueprintId, stageId) => bindAgentStageTriggers(stageTriggersApi, agentId, blueprintId, stageId),
|
|
1833
1876
|
stageTriggersApi
|
|
1834
1877
|
);
|
|
1835
1878
|
const stagesNamespace = Object.assign(
|