@stack-spot/portal-network 0.146.2-beta.0 → 0.146.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/dist/api/agent-tools.d.ts +4 -178
- package/dist/api/agent-tools.d.ts.map +1 -1
- package/dist/api/agent-tools.js +2 -98
- package/dist/api/agent-tools.js.map +1 -1
- package/dist/client/agent-tools.d.ts +0 -77
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +1 -134
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/agent.d.ts +49 -2
- package/dist/client/agent.d.ts.map +1 -1
- package/dist/client/agent.js +63 -0
- package/dist/client/agent.js.map +1 -1
- package/dist/client/ai.d.ts +0 -7
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +1 -10
- package/dist/client/ai.js.map +1 -1
- package/dist/client/types.d.ts +3 -5
- package/dist/client/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/agent-tools.ts +4 -306
- package/src/client/agent-tools.ts +1 -103
- package/src/client/agent.ts +67 -1
- package/src/client/ai.ts +0 -5
- package/src/client/types.ts +4 -7
|
@@ -40,9 +40,7 @@ export type FunctionParameter = {
|
|
|
40
40
|
/** A list of possible values for the parameter (optional) */
|
|
41
41
|
"enum"?: string[] | null;
|
|
42
42
|
/** A dictionary of properties for the parameter (optional) */
|
|
43
|
-
properties?:
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
} | null;
|
|
43
|
+
properties?: object | null;
|
|
46
44
|
/** A list of required parameters (optional) */
|
|
47
45
|
required?: string[] | null;
|
|
48
46
|
/** Allow arbitrary data of specific typed */
|
|
@@ -70,123 +68,14 @@ export type ExecuteAgentToolRequest = {
|
|
|
70
68
|
export type AgentToolExecutionResponse = {
|
|
71
69
|
result: string;
|
|
72
70
|
};
|
|
73
|
-
export type AgentVisibilityLevelEnum = "built_in";
|
|
74
|
-
export type VisibilityLevelEnum = "account" | "personal" | "shared" | "workspace" | "favorite";
|
|
75
|
-
export type ListAgentResponse = {
|
|
76
|
-
id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
slug: string;
|
|
79
|
-
created_by: string | null;
|
|
80
|
-
visibility_level: string;
|
|
81
|
-
avatar: string | null;
|
|
82
|
-
conversation_starter: string[] | null;
|
|
83
|
-
};
|
|
84
|
-
export type AgentType = "CONVERSATIONAL" | "SINGLE_ANSWER";
|
|
85
|
-
export type SimilarityFunctionEnum = "cosine" | "euclidean" | "dot_product";
|
|
86
|
-
export type KnowledgeSourcesConfigRequest = {
|
|
87
|
-
similarity_function?: SimilarityFunctionEnum | null;
|
|
88
|
-
post_processing?: boolean | null;
|
|
89
|
-
max_number_of_kos?: number | null;
|
|
90
|
-
relevancy_threshold?: number | null;
|
|
91
|
-
knowledge_sources?: string[] | null;
|
|
92
|
-
sealed?: boolean | null;
|
|
93
|
-
};
|
|
94
|
-
export type NewAgentRequest = {
|
|
95
|
-
/** LLM model name */
|
|
96
|
-
model_name?: string | null;
|
|
97
|
-
/** LLM model id */
|
|
98
|
-
model_id?: string | null;
|
|
99
|
-
/** Agent name */
|
|
100
|
-
name: string;
|
|
101
|
-
/** Agent unique slug */
|
|
102
|
-
slug: string;
|
|
103
|
-
/** Agent description */
|
|
104
|
-
description?: string | null;
|
|
105
|
-
/** Agent avatar image */
|
|
106
|
-
avatar?: string | null;
|
|
107
|
-
/** Agent suggested prompt */
|
|
108
|
-
suggested_prompts?: string[];
|
|
109
|
-
/** System prompt */
|
|
110
|
-
system_prompt?: string | null;
|
|
111
|
-
/** Agent type */
|
|
112
|
-
"type": AgentType;
|
|
113
|
-
knowledge_sources_config?: KnowledgeSourcesConfigRequest | null;
|
|
114
|
-
builtin_tools_ids?: string[];
|
|
115
|
-
detail_mode?: boolean;
|
|
116
|
-
structured_output?: string | null;
|
|
117
|
-
llm_settings?: {
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
} | null;
|
|
120
|
-
};
|
|
121
|
-
export type NewAgentResponse = {
|
|
122
|
-
id: string;
|
|
123
|
-
};
|
|
124
|
-
export type SearchAgentsRequest = {
|
|
125
|
-
/** Agent ids to filter for */
|
|
126
|
-
ids: string[];
|
|
127
|
-
};
|
|
128
|
-
export type KnowledgeSourceConfigModel = {
|
|
129
|
-
similarity_function: SimilarityFunctionEnum;
|
|
130
|
-
max_number_of_kos: number;
|
|
131
|
-
relevancy_threshold: number;
|
|
132
|
-
post_processing: boolean;
|
|
133
|
-
knowledge_sources: string[];
|
|
134
|
-
sealed: boolean;
|
|
135
|
-
created_by?: string | null;
|
|
136
|
-
created_at?: string | null;
|
|
137
|
-
updated_by?: string | null;
|
|
138
|
-
updated_at?: string | null;
|
|
139
|
-
};
|
|
140
|
-
export type AgentToolModel = {
|
|
141
|
-
agent_id: string;
|
|
142
|
-
builtin_tool_id: string;
|
|
143
|
-
builtin_toolkit_id?: string | null;
|
|
144
|
-
created_by?: string | null;
|
|
145
|
-
created_at?: string | null;
|
|
146
|
-
updated_by?: string | null;
|
|
147
|
-
updated_at?: string | null;
|
|
148
|
-
};
|
|
149
|
-
export type LlmSettingsModel = {
|
|
150
|
-
property_key?: string | null;
|
|
151
|
-
property_value?: string | null;
|
|
152
|
-
property_type?: string | null;
|
|
153
|
-
agent_id: string;
|
|
154
|
-
created_by?: string | null;
|
|
155
|
-
created_at?: string | null;
|
|
156
|
-
updated_by?: string | null;
|
|
157
|
-
updated_at?: string | null;
|
|
158
|
-
};
|
|
159
|
-
export type AgentModel = {
|
|
160
|
-
id: string;
|
|
161
|
-
name: string;
|
|
162
|
-
slug: string;
|
|
163
|
-
description?: string | null;
|
|
164
|
-
system_prompt: string;
|
|
165
|
-
visibility_level: string;
|
|
166
|
-
avatar?: string | null;
|
|
167
|
-
"type": string;
|
|
168
|
-
conversation_starter?: string[] | null;
|
|
169
|
-
use_only: boolean;
|
|
170
|
-
detail_mode: boolean;
|
|
171
|
-
structured_output?: string | null;
|
|
172
|
-
model_id?: string | null;
|
|
173
|
-
model_name?: string | null;
|
|
174
|
-
knowledge_source_config?: KnowledgeSourceConfigModel | null;
|
|
175
|
-
tools?: AgentToolModel[];
|
|
176
|
-
settings?: LlmSettingsModel[];
|
|
177
|
-
created_by?: string | null;
|
|
178
|
-
created_at?: string | null;
|
|
179
|
-
updated_by?: string | null;
|
|
180
|
-
updated_at?: string | null;
|
|
181
|
-
};
|
|
182
71
|
/**
|
|
183
72
|
* Health Check
|
|
184
73
|
*/
|
|
185
74
|
export declare function healthCheckHealthzGet(opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
186
75
|
/**
|
|
187
|
-
*
|
|
76
|
+
* Health Check
|
|
188
77
|
*/
|
|
189
|
-
export declare function
|
|
78
|
+
export declare function healthCheckReadyzGet(opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
190
79
|
/**
|
|
191
80
|
* Get Public Tool Kits
|
|
192
81
|
*/
|
|
@@ -228,9 +117,7 @@ export declare function listToolsByAgentForSchemaV1AgentsAgentIdToolsSchemaSchem
|
|
|
228
117
|
isPublic?: boolean;
|
|
229
118
|
xAccountId?: string | null;
|
|
230
119
|
authorization: string;
|
|
231
|
-
}, opts?: Oazapfts.RequestOpts): Promise<(
|
|
232
|
-
[key: string]: any;
|
|
233
|
-
})[]>;
|
|
120
|
+
}, opts?: Oazapfts.RequestOpts): Promise<(object | OpenAiTool)[]>;
|
|
234
121
|
/**
|
|
235
122
|
* Execute Tool
|
|
236
123
|
*/
|
|
@@ -241,65 +128,4 @@ export declare function executeToolV1AgentsToolsAgentToolIdExecutePost({ agentTo
|
|
|
241
128
|
authorization: string;
|
|
242
129
|
executeAgentToolRequest: ExecuteAgentToolRequest;
|
|
243
130
|
}, opts?: Oazapfts.RequestOpts): Promise<AgentToolExecutionResponse>;
|
|
244
|
-
/**
|
|
245
|
-
* List Agents
|
|
246
|
-
*/
|
|
247
|
-
export declare function listAgentsV1AgentsGet({ name, slug, visibility, size, page, xAccountId, authorization }: {
|
|
248
|
-
name?: string | null;
|
|
249
|
-
slug?: string | null;
|
|
250
|
-
visibility?: AgentVisibilityLevelEnum | VisibilityLevelEnum;
|
|
251
|
-
size?: number;
|
|
252
|
-
page?: number;
|
|
253
|
-
xAccountId?: string | null;
|
|
254
|
-
authorization: string;
|
|
255
|
-
}, opts?: Oazapfts.RequestOpts): Promise<ListAgentResponse[]>;
|
|
256
|
-
/**
|
|
257
|
-
* Create Agent
|
|
258
|
-
*/
|
|
259
|
-
export declare function createAgentV1AgentsPost({ isPublic, xAccountId, authorization, newAgentRequest }: {
|
|
260
|
-
isPublic?: boolean;
|
|
261
|
-
xAccountId?: string | null;
|
|
262
|
-
authorization: string;
|
|
263
|
-
newAgentRequest: NewAgentRequest;
|
|
264
|
-
}, opts?: Oazapfts.RequestOpts): Promise<NewAgentResponse>;
|
|
265
|
-
/**
|
|
266
|
-
* Search Agents
|
|
267
|
-
*/
|
|
268
|
-
export declare function searchAgentsV1AgentsSearchPost({ xAccountId, authorization, searchAgentsRequest }: {
|
|
269
|
-
xAccountId?: string | null;
|
|
270
|
-
authorization: string;
|
|
271
|
-
searchAgentsRequest: SearchAgentsRequest;
|
|
272
|
-
}, opts?: Oazapfts.RequestOpts): Promise<ListAgentResponse[]>;
|
|
273
|
-
/**
|
|
274
|
-
* Get Agent
|
|
275
|
-
*/
|
|
276
|
-
export declare function getAgentV1AgentsAgentIdGet({ agentId, xAccountId, authorization }: {
|
|
277
|
-
agentId: string;
|
|
278
|
-
xAccountId?: string | null;
|
|
279
|
-
authorization: string;
|
|
280
|
-
}, opts?: Oazapfts.RequestOpts): Promise<AgentModel>;
|
|
281
|
-
/**
|
|
282
|
-
* Update Agent
|
|
283
|
-
*/
|
|
284
|
-
export declare function updateAgentV1AgentsAgentIdPut({ agentId }: {
|
|
285
|
-
agentId: string;
|
|
286
|
-
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
287
|
-
/**
|
|
288
|
-
* Delete Agent
|
|
289
|
-
*/
|
|
290
|
-
export declare function deleteAgentV1AgentsAgentIdDelete({ agentId }: {
|
|
291
|
-
agentId: string;
|
|
292
|
-
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
293
|
-
/**
|
|
294
|
-
* Add Favorite
|
|
295
|
-
*/
|
|
296
|
-
export declare function addFavoriteV1AgentsAgentIdFavoritePost({ agentId }: {
|
|
297
|
-
agentId: string;
|
|
298
|
-
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
299
|
-
/**
|
|
300
|
-
* Publish Agent
|
|
301
|
-
*/
|
|
302
|
-
export declare function publishAgentV1AgentsAgentIdPublishPost({ agentId }: {
|
|
303
|
-
agentId: string;
|
|
304
|
-
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
305
131
|
//# sourceMappingURL=agent-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/api/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CAAC;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC;AAC1B,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IACpC,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC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,CAAC;CACzB,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oBAkB7B;AACD;;GAEG;AACH,wBAAgB,4DAA4D,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE;IACnI,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACzB,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oCAkB7B;AACD;;GAEG;AACH,wBAAgB,8CAA8C,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE;IAC1I,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,uBAAuB,CAAC;CACpD,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,uCAoB7B"}
|
package/dist/api/agent-tools.js
CHANGED
|
@@ -21,9 +21,9 @@ export function healthCheckHealthzGet(opts) {
|
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Health Check
|
|
25
25
|
*/
|
|
26
|
-
export function
|
|
26
|
+
export function healthCheckReadyzGet(opts) {
|
|
27
27
|
return oazapfts.ok(oazapfts.fetchJson("/readyz", {
|
|
28
28
|
...opts
|
|
29
29
|
}));
|
|
@@ -111,100 +111,4 @@ export function executeToolV1AgentsToolsAgentToolIdExecutePost({ agentToolId, is
|
|
|
111
111
|
})
|
|
112
112
|
})));
|
|
113
113
|
}
|
|
114
|
-
/**
|
|
115
|
-
* List Agents
|
|
116
|
-
*/
|
|
117
|
-
export function listAgentsV1AgentsGet({ name, slug, visibility, size, page, xAccountId, authorization }, opts) {
|
|
118
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents${QS.query(QS.explode({
|
|
119
|
-
name,
|
|
120
|
-
slug,
|
|
121
|
-
visibility,
|
|
122
|
-
size,
|
|
123
|
-
page
|
|
124
|
-
}))}`, {
|
|
125
|
-
...opts,
|
|
126
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
127
|
-
"x-account-id": xAccountId,
|
|
128
|
-
authorization
|
|
129
|
-
})
|
|
130
|
-
}));
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Create Agent
|
|
134
|
-
*/
|
|
135
|
-
export function createAgentV1AgentsPost({ isPublic, xAccountId, authorization, newAgentRequest }, opts) {
|
|
136
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents${QS.query(QS.explode({
|
|
137
|
-
is_public: isPublic
|
|
138
|
-
}))}`, oazapfts.json({
|
|
139
|
-
...opts,
|
|
140
|
-
method: "POST",
|
|
141
|
-
body: newAgentRequest,
|
|
142
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
143
|
-
"x-account-id": xAccountId,
|
|
144
|
-
authorization
|
|
145
|
-
})
|
|
146
|
-
})));
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Search Agents
|
|
150
|
-
*/
|
|
151
|
-
export function searchAgentsV1AgentsSearchPost({ xAccountId, authorization, searchAgentsRequest }, opts) {
|
|
152
|
-
return oazapfts.ok(oazapfts.fetchJson("/v1/agents/search", oazapfts.json({
|
|
153
|
-
...opts,
|
|
154
|
-
method: "POST",
|
|
155
|
-
body: searchAgentsRequest,
|
|
156
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
157
|
-
"x-account-id": xAccountId,
|
|
158
|
-
authorization
|
|
159
|
-
})
|
|
160
|
-
})));
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Get Agent
|
|
164
|
-
*/
|
|
165
|
-
export function getAgentV1AgentsAgentIdGet({ agentId, xAccountId, authorization }, opts) {
|
|
166
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents/${encodeURIComponent(agentId)}`, {
|
|
167
|
-
...opts,
|
|
168
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
169
|
-
"x-account-id": xAccountId,
|
|
170
|
-
authorization
|
|
171
|
-
})
|
|
172
|
-
}));
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Update Agent
|
|
176
|
-
*/
|
|
177
|
-
export function updateAgentV1AgentsAgentIdPut({ agentId }, opts) {
|
|
178
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents/${encodeURIComponent(agentId)}`, {
|
|
179
|
-
...opts,
|
|
180
|
-
method: "PUT"
|
|
181
|
-
}));
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Delete Agent
|
|
185
|
-
*/
|
|
186
|
-
export function deleteAgentV1AgentsAgentIdDelete({ agentId }, opts) {
|
|
187
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents/${encodeURIComponent(agentId)}`, {
|
|
188
|
-
...opts,
|
|
189
|
-
method: "DELETE"
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Add Favorite
|
|
194
|
-
*/
|
|
195
|
-
export function addFavoriteV1AgentsAgentIdFavoritePost({ agentId }, opts) {
|
|
196
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents/${encodeURIComponent(agentId)}/favorite`, {
|
|
197
|
-
...opts,
|
|
198
|
-
method: "POST"
|
|
199
|
-
}));
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Publish Agent
|
|
203
|
-
*/
|
|
204
|
-
export function publishAgentV1AgentsAgentIdPublishPost({ agentId }, opts) {
|
|
205
|
-
return oazapfts.ok(oazapfts.fetchJson(`/v1/agents/${encodeURIComponent(agentId)}/publish`, {
|
|
206
|
-
...opts,
|
|
207
|
-
method: "POST"
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
114
|
//# sourceMappingURL=agent-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/api/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,GAAG;CACf,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/api/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,GAAG;CACf,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;AA8D1B;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAA2B;IAC7D,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAKlC,UAAU,EAAE;QACX,GAAG,IAAI;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAA2B;IAC5D,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAK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E,uBAAuB,EAMzI,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAQlC,oBAAoB,kBAAkB,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC;QACjF,SAAS,EAAE,QAAQ;KACtB,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;QACjB,GAAG,IAAI;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE;YAC1C,cAAc,EAAE,UAAU;YAC1B,aAAa;SAChB,CAAC;KACL,CAAC,CAAC,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -1,87 +1,10 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
-
import { VisibilityLevelEnum } from '../api/agent-tools.js';
|
|
3
2
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
3
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
-
import { AgentResponseWithBuiltIn, AgentVisibilityLevel } from './types.js';
|
|
6
4
|
declare class AgentToolsClient extends ReactQueryNetworkClient {
|
|
7
5
|
constructor();
|
|
8
6
|
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
9
7
|
tools: import("../network/types.js").QueryObject<void, import("../api/agent-tools.js").BuiltinToolkitResponse[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Create agent
|
|
12
|
-
*/
|
|
13
|
-
createAgent: import("../network/types.js").MutationObject<Omit<{
|
|
14
|
-
isPublic?: boolean | undefined;
|
|
15
|
-
xAccountId?: string | null | undefined;
|
|
16
|
-
authorization: string;
|
|
17
|
-
newAgentRequest: import("../api/agent-tools.js").NewAgentRequest;
|
|
18
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").NewAgentResponse>;
|
|
19
|
-
/**
|
|
20
|
-
* Delete agent
|
|
21
|
-
*/
|
|
22
|
-
deleteAgent: import("../network/types.js").MutationObject<{
|
|
23
|
-
agentId: string;
|
|
24
|
-
}, any>;
|
|
25
|
-
/**
|
|
26
|
-
* Updates an agent
|
|
27
|
-
*/
|
|
28
|
-
updateAgent: import("../network/types.js").MutationObject<{
|
|
29
|
-
agentId: string;
|
|
30
|
-
}, any>;
|
|
31
|
-
/**
|
|
32
|
-
* Favorite an agent
|
|
33
|
-
*/
|
|
34
|
-
favoriteAgent: import("../network/types.js").MutationObject<{
|
|
35
|
-
agentId: string;
|
|
36
|
-
}, any>;
|
|
37
|
-
/**
|
|
38
|
-
* Publish an agent
|
|
39
|
-
*/
|
|
40
|
-
publishAgent: import("../network/types.js").MutationObject<{
|
|
41
|
-
agentId: string;
|
|
42
|
-
}, any>;
|
|
43
|
-
/**
|
|
44
|
-
* List agents
|
|
45
|
-
*/
|
|
46
|
-
agents: import("../network/types.js").InfiniteQueryObject<Omit<{
|
|
47
|
-
name?: string | null | undefined;
|
|
48
|
-
slug?: string | null | undefined;
|
|
49
|
-
visibility?: VisibilityLevelEnum | "built_in" | undefined;
|
|
50
|
-
size?: number | undefined;
|
|
51
|
-
page?: number | undefined;
|
|
52
|
-
xAccountId?: string | null | undefined;
|
|
53
|
-
authorization: string;
|
|
54
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").ListAgentResponse[], "">;
|
|
55
|
-
/**
|
|
56
|
-
* Gets agent by id
|
|
57
|
-
*/
|
|
58
|
-
agent: import("../network/types.js").QueryObject<Omit<{
|
|
59
|
-
agentId: string;
|
|
60
|
-
xAccountId?: string | null | undefined;
|
|
61
|
-
authorization: string;
|
|
62
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").AgentModel>;
|
|
63
|
-
/**
|
|
64
|
-
* Gets agents by ids
|
|
65
|
-
*/
|
|
66
|
-
agentsByIds: import("../network/types.js").QueryObject<Omit<{
|
|
67
|
-
xAccountId?: string | null | undefined;
|
|
68
|
-
authorization: string;
|
|
69
|
-
searchAgentsRequest: import("../api/agent-tools.js").SearchAgentsRequest;
|
|
70
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").ListAgentResponse[]>;
|
|
71
|
-
/**
|
|
72
|
-
* Gets the default agent slug
|
|
73
|
-
*/
|
|
74
|
-
agentDefaultSlug: string;
|
|
75
|
-
/**
|
|
76
|
-
* Gets the default agent
|
|
77
|
-
*/
|
|
78
|
-
agentDefault: Omit<import("../network/types.js").QueryObject<void, import("../api/agent-tools.js").AgentModel | undefined>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
79
|
-
/**
|
|
80
|
-
* List agents filtered by visibility.
|
|
81
|
-
*/
|
|
82
|
-
allAgents: Omit<import("../network/types.js").QueryObject<{
|
|
83
|
-
visibilities: (AgentVisibilityLevel | 'all')[];
|
|
84
|
-
}, AgentResponseWithBuiltIn[]>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
85
8
|
}
|
|
86
9
|
export declare const agentToolsClient: AgentToolsClient;
|
|
87
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,gBAAiB,SAAQ,uBAAuB;;IAKpD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IASlE,KAAK,sGAAmD;CACzD;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAA"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaults, getPublicToolKitsV1BuiltinToolkitGet } from '../api/agent-tools.js';
|
|
2
2
|
import apis from '../apis.json';
|
|
3
3
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
4
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
-
import { removeAuthorizationParam } from '../utils/remove-authorization-param.js';
|
|
6
|
-
import { workspaceAiClient } from './workspace-ai.js';
|
|
7
|
-
const AGENT_DEFAULT_SLUG = 'stk_code_buddy';
|
|
8
5
|
class AgentToolsClient extends ReactQueryNetworkClient {
|
|
9
6
|
constructor() {
|
|
10
7
|
super(apis['agent-tools'].url, defaults);
|
|
@@ -14,136 +11,6 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
14
11
|
writable: true,
|
|
15
12
|
value: this.query(getPublicToolKitsV1BuiltinToolkitGet)
|
|
16
13
|
});
|
|
17
|
-
/**
|
|
18
|
-
* Create agent
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(this, "createAgent", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: this.mutation(removeAuthorizationParam(createAgentV1AgentsPost))
|
|
25
|
-
});
|
|
26
|
-
/**
|
|
27
|
-
* Delete agent
|
|
28
|
-
*/
|
|
29
|
-
Object.defineProperty(this, "deleteAgent", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: this.mutation(deleteAgentV1AgentsAgentIdDelete)
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Updates an agent
|
|
37
|
-
*/
|
|
38
|
-
Object.defineProperty(this, "updateAgent", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true,
|
|
42
|
-
value: this.mutation(updateAgentV1AgentsAgentIdPut)
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* Favorite an agent
|
|
46
|
-
*/
|
|
47
|
-
Object.defineProperty(this, "favoriteAgent", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
configurable: true,
|
|
50
|
-
writable: true,
|
|
51
|
-
value: this.mutation(addFavoriteV1AgentsAgentIdFavoritePost)
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* Publish an agent
|
|
55
|
-
*/
|
|
56
|
-
Object.defineProperty(this, "publishAgent", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true,
|
|
60
|
-
value: this.mutation(publishAgentV1AgentsAgentIdPublishPost)
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* List agents
|
|
64
|
-
*/
|
|
65
|
-
Object.defineProperty(this, "agents", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true,
|
|
69
|
-
value: this.infiniteQuery(removeAuthorizationParam(listAgentsV1AgentsGet))
|
|
70
|
-
});
|
|
71
|
-
/**
|
|
72
|
-
* Gets agent by id
|
|
73
|
-
*/
|
|
74
|
-
Object.defineProperty(this, "agent", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true,
|
|
77
|
-
writable: true,
|
|
78
|
-
value: this.query(removeAuthorizationParam(getAgentV1AgentsAgentIdGet))
|
|
79
|
-
});
|
|
80
|
-
/**
|
|
81
|
-
* Gets agents by ids
|
|
82
|
-
*/
|
|
83
|
-
Object.defineProperty(this, "agentsByIds", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
configurable: true,
|
|
86
|
-
writable: true,
|
|
87
|
-
value: this.query(removeAuthorizationParam(searchAgentsV1AgentsSearchPost))
|
|
88
|
-
});
|
|
89
|
-
/**
|
|
90
|
-
* Gets the default agent slug
|
|
91
|
-
*/
|
|
92
|
-
Object.defineProperty(this, "agentDefaultSlug", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
configurable: true,
|
|
95
|
-
writable: true,
|
|
96
|
-
value: AGENT_DEFAULT_SLUG
|
|
97
|
-
});
|
|
98
|
-
/**
|
|
99
|
-
* Gets the default agent
|
|
100
|
-
*/
|
|
101
|
-
Object.defineProperty(this, "agentDefault", {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
configurable: true,
|
|
104
|
-
writable: true,
|
|
105
|
-
value: this.query({
|
|
106
|
-
name: 'agentDefault',
|
|
107
|
-
request: async (signal) => {
|
|
108
|
-
const agentDefault = await listAgentsV1AgentsGet({ visibility: 'built_in', slug: this.agentDefaultSlug, authorization: '' }, { signal });
|
|
109
|
-
const agentId = agentDefault.at(0)?.id;
|
|
110
|
-
const agent = agentId ? await this.agent.query({ agentId }) : undefined;
|
|
111
|
-
return agent;
|
|
112
|
-
},
|
|
113
|
-
})
|
|
114
|
-
});
|
|
115
|
-
/**
|
|
116
|
-
* List agents filtered by visibility.
|
|
117
|
-
*/
|
|
118
|
-
Object.defineProperty(this, "allAgents", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
configurable: true,
|
|
121
|
-
writable: true,
|
|
122
|
-
value: this.query({
|
|
123
|
-
name: 'allAgents',
|
|
124
|
-
request: async (signal, variables) => {
|
|
125
|
-
const allVisibilities = ['account', 'built_in', 'favorite', 'personal', 'shared', 'workspace'];
|
|
126
|
-
const visibilities = variables.visibilities.includes('all')
|
|
127
|
-
? allVisibilities
|
|
128
|
-
: variables.visibilities;
|
|
129
|
-
const shouldFetchWorkspaceAgents = visibilities.includes('workspace');
|
|
130
|
-
const workspaceAgentsPromise = shouldFetchWorkspaceAgents
|
|
131
|
-
? workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' })
|
|
132
|
-
: Promise.resolve([]);
|
|
133
|
-
const [workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
134
|
-
workspaceAgentsPromise,
|
|
135
|
-
...visibilities.map((visibility) => listAgentsV1AgentsGet({ visibility, authorization: '' }, { signal })),
|
|
136
|
-
]);
|
|
137
|
-
const workspaceAgentsWithSpaceName = workspaceAgents.flatMap(({ agents, space_name }) => agents?.map((agent) => ({ ...agent, spaceName: space_name, builtIn: false })));
|
|
138
|
-
const allAgents = workspaceAgentsWithSpaceName ?? [];
|
|
139
|
-
agentsByVisibility.forEach(agents => allAgents.push(...agents.map(agent => ({
|
|
140
|
-
...agent,
|
|
141
|
-
builtIn: agent?.visibility_level === 'built_in',
|
|
142
|
-
}))));
|
|
143
|
-
return allAgents;
|
|
144
|
-
},
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
14
|
}
|
|
148
15
|
buildStackSpotError(error) {
|
|
149
16
|
return new StackspotAPIError({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,oCAAoC,EAAuB,MAAM,oBAAoB,CAAA;AACxG,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,MAAM,gBAAiB,SAAQ,uBAAuB;IACpD;QACE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAY1C;;;;mBAAQ,IAAI,CAAC,KAAK,CAAC,oCAAoC,CAAC;WAAA;IAXxD,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,iBAAiB,CAAC;YAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAG,KAAK,CAAC,IAAwC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;SAC9F,CAAC,CAAA;IACJ,CAAC;CAGF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAA"}
|