@stack-spot/portal-network 0.154.0 → 0.155.0-beta.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/CHANGELOG.md +66 -0
- package/dist/api/ai.d.ts +252 -76
- package/dist/api/ai.d.ts.map +1 -1
- package/dist/api/ai.js +245 -138
- package/dist/api/ai.js.map +1 -1
- package/dist/api/codeShift.d.ts +101 -196
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +37 -94
- package/dist/api/codeShift.js.map +1 -1
- package/dist/client/account.d.ts +2 -2
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +2 -2
- package/dist/client/account.js.map +1 -1
- package/dist/client/agent-tools.d.ts +89 -3
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +133 -2
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/agent.d.ts +5 -50
- package/dist/client/agent.d.ts.map +1 -1
- package/dist/client/agent.js +0 -64
- package/dist/client/agent.js.map +1 -1
- package/dist/client/ai.d.ts +45 -1
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +19 -1
- package/dist/client/ai.js.map +1 -1
- package/dist/client/code-shift.d.ts +25 -67
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +30 -73
- package/dist/client/code-shift.js.map +1 -1
- package/dist/client/types.d.ts +5 -4
- package/dist/client/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/src/api/account.ts +1 -0
- package/src/api/agent-tools.ts +3 -0
- package/src/api/agent.ts +2 -0
- package/src/api/ai.ts +436 -145
- package/src/api/codeShift.ts +248 -481
- package/src/api/notification.ts +2 -0
- package/src/client/account.ts +3 -3
- package/src/client/agent-tools.ts +102 -3
- package/src/client/agent.ts +0 -68
- package/src/client/ai.ts +11 -0
- package/src/client/code-shift.ts +19 -57
- package/src/client/types.ts +7 -5
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { createToolkitToolsV1ToolkitsToolkitIdToolsPost, createToolkitV1ToolkitsPost, defaults, deleteToolkitToolsV1ToolkitsToolkitIdToolsDelete, deleteToolkitV1ToolkitsToolkitIdDelete, editToolkitToolV1ToolkitsToolkitIdToolsToolIdPut, forkToolkitV1ToolkitsToolkitIdForkPost, getPublicToolKitsV1BuiltinToolkitGet, getToolkitToolV1ToolkitsToolkitIdToolsToolIdGet, getToolkitV1ToolkitsToolkitIdGet, listAgentsUsingToolsV1ToolkitsToolkitIdToolsAgentsPost, listToolkitsV1ToolkitsGet, updateToolkitV1ToolkitsToolkitIdPatch } from '../api/agent-tools.js';
|
|
1
|
+
import { addFavoriteV1AgentsAgentIdFavoritePost, createAgentV1AgentsPost, createToolkitToolsV1ToolkitsToolkitIdToolsPost, createToolkitV1ToolkitsPost, defaults, deleteAgentV1AgentsAgentIdDelete, deleteToolkitToolsV1ToolkitsToolkitIdToolsDelete, deleteToolkitV1ToolkitsToolkitIdDelete, editToolkitToolV1ToolkitsToolkitIdToolsToolIdPut, forkToolkitV1ToolkitsToolkitIdForkPost, getAgentV1AgentsAgentIdGet, getPublicToolKitsV1BuiltinToolkitGet, getToolkitToolV1ToolkitsToolkitIdToolsToolIdGet, getToolkitV1ToolkitsToolkitIdGet, listAgentsUsingToolsV1ToolkitsToolkitIdToolsAgentsPost, listAgentsV1AgentsGet, listToolkitsV1ToolkitsGet, publishAgentV1AgentsAgentIdPublishPost, searchAgentsV1AgentsSearchPost, updateAgentV1AgentsAgentIdPut, updateToolkitV1ToolkitsToolkitIdPatch } 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
5
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param.js';
|
|
6
6
|
import { StreamedArray } from '../utils/StreamedArray.js';
|
|
7
|
+
import { workspaceAiClient } from './workspace-ai.js';
|
|
8
|
+
const AGENT_DEFAULT_SLUG = 'stk_code_buddy';
|
|
7
9
|
class AgentToolsClient extends ReactQueryNetworkClient {
|
|
8
10
|
constructor() {
|
|
9
11
|
super(apis['agent-tools'].url, defaults);
|
|
@@ -14,8 +16,137 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
14
16
|
value: this.query(removeAuthorizationParam(getPublicToolKitsV1BuiltinToolkitGet))
|
|
15
17
|
});
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Create agent
|
|
18
20
|
*/
|
|
21
|
+
Object.defineProperty(this, "createAgent", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: this.mutation(removeAuthorizationParam(createAgentV1AgentsPost))
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Delete agent
|
|
29
|
+
*/
|
|
30
|
+
Object.defineProperty(this, "deleteAgent", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: this.mutation(deleteAgentV1AgentsAgentIdDelete)
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Updates an agent
|
|
38
|
+
*/
|
|
39
|
+
Object.defineProperty(this, "updateAgent", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: this.mutation(updateAgentV1AgentsAgentIdPut)
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Favorite an agent
|
|
47
|
+
*/
|
|
48
|
+
Object.defineProperty(this, "favoriteAgent", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: this.mutation(addFavoriteV1AgentsAgentIdFavoritePost)
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Publish an agent
|
|
56
|
+
*/
|
|
57
|
+
Object.defineProperty(this, "publishAgent", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true,
|
|
61
|
+
value: this.mutation(publishAgentV1AgentsAgentIdPublishPost)
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* List agents
|
|
65
|
+
*/
|
|
66
|
+
Object.defineProperty(this, "agents", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: this.infiniteQuery(removeAuthorizationParam(listAgentsV1AgentsGet))
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Gets agent by id
|
|
74
|
+
*/
|
|
75
|
+
Object.defineProperty(this, "agent", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
configurable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
value: this.query(removeAuthorizationParam(getAgentV1AgentsAgentIdGet))
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Gets agents by ids
|
|
83
|
+
*/
|
|
84
|
+
Object.defineProperty(this, "agentsByIds", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: this.query(removeAuthorizationParam(searchAgentsV1AgentsSearchPost))
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Gets the default agent slug
|
|
92
|
+
*/
|
|
93
|
+
Object.defineProperty(this, "agentDefaultSlug", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
configurable: true,
|
|
96
|
+
writable: true,
|
|
97
|
+
value: AGENT_DEFAULT_SLUG
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* Gets the default agent
|
|
101
|
+
*/
|
|
102
|
+
Object.defineProperty(this, "agentDefault", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
value: this.query({
|
|
107
|
+
name: 'agentDefault',
|
|
108
|
+
request: async (signal) => {
|
|
109
|
+
const agentDefault = await listAgentsV1AgentsGet({ visibility: 'built_in', slug: this.agentDefaultSlug, authorization: '' }, { signal });
|
|
110
|
+
const agentId = agentDefault.at(0)?.id;
|
|
111
|
+
const agent = agentId ? await this.agent.query({ agentId }) : undefined;
|
|
112
|
+
return agent;
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* List agents filtered by visibility.
|
|
118
|
+
*/
|
|
119
|
+
Object.defineProperty(this, "allAgents", {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
configurable: true,
|
|
122
|
+
writable: true,
|
|
123
|
+
value: this.query({
|
|
124
|
+
name: 'allAgents',
|
|
125
|
+
request: async (signal, variables) => {
|
|
126
|
+
const allVisibilities = ['account', 'built_in', 'favorite', 'personal', 'shared', 'workspace'];
|
|
127
|
+
const visibilities = variables.visibilities.includes('all')
|
|
128
|
+
? allVisibilities
|
|
129
|
+
: variables.visibilities;
|
|
130
|
+
const shouldFetchWorkspaceAgents = visibilities.includes('workspace');
|
|
131
|
+
const workspaceAgentsPromise = shouldFetchWorkspaceAgents
|
|
132
|
+
? workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' })
|
|
133
|
+
: Promise.resolve([]);
|
|
134
|
+
const [workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
135
|
+
workspaceAgentsPromise,
|
|
136
|
+
...visibilities.map((visibility) => listAgentsV1AgentsGet({ visibility, authorization: '' }, { signal })),
|
|
137
|
+
]);
|
|
138
|
+
const workspaceAgentsWithSpaceName = workspaceAgents.flatMap(({ agents, space_name }) => agents?.map((agent) => ({ ...agent, spaceName: space_name, builtIn: false })));
|
|
139
|
+
const allAgents = workspaceAgentsWithSpaceName ?? [];
|
|
140
|
+
agentsByVisibility.forEach(agents => allAgents.push(...agents.map(agent => ({
|
|
141
|
+
...agent,
|
|
142
|
+
builtIn: agent?.visibility_level === 'built_in',
|
|
143
|
+
}))));
|
|
144
|
+
return allAgents;
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
/* Get list of Toolkits
|
|
149
|
+
*/
|
|
19
150
|
Object.defineProperty(this, "toolkits", {
|
|
20
151
|
enumerable: true,
|
|
21
152
|
configurable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8CAA8C,EAAE,2BAA2B,EAAE,QAAQ,EAAE,gDAAgD,EAAE,sCAAsC,EAAE,gDAAgD,EAAE,sCAAsC,EAAE,oCAAoC,EAAE,+CAA+C,EAAE,gCAAgC,EAAuB,sDAAsD,EAAE,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sCAAsC,EAA4B,uBAAuB,EAAE,8CAA8C,EAAE,2BAA2B,EAAE,QAAQ,EAAE,gCAAgC,EAAE,gDAAgD,EAAE,sCAAsC,EAAE,gDAAgD,EAAE,sCAAsC,EAAE,0BAA0B,EAAE,oCAAoC,EAAE,+CAA+C,EAAE,gCAAgC,EAAuB,sDAAsD,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,qCAAqC,EAAuB,MAAM,oBAAoB,CAAA;AACl2B,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,kBAAkB,GAAG,gBAAgB,CAA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C/F,CAAC,CAAA;IACJ,CAAC;CA0JF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAA"}
|
package/dist/client/agent.d.ts
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
-
import { VisibilityLevel } from '../api/agent.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
|
-
export declare const isAgentDefault: (agentSlug?: string) => boolean;
|
|
7
4
|
declare class AgentClient extends ReactQueryNetworkClient {
|
|
8
5
|
constructor();
|
|
9
6
|
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
10
|
-
/**
|
|
11
|
-
* List agents filtered by visibility.
|
|
12
|
-
*/
|
|
13
|
-
allAgents: Omit<import("../network/types.js").QueryObject<{
|
|
14
|
-
visibilities: AgentVisibilityLevel[];
|
|
15
|
-
}, AgentResponseWithBuiltIn[]>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
16
7
|
/**
|
|
17
8
|
* Gets an agent by id
|
|
18
9
|
*/
|
|
@@ -30,7 +21,7 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
30
21
|
llm_config?: import("../api/agent.js").LlmConfigResponse | undefined;
|
|
31
22
|
suggested_prompts?: string[] | undefined;
|
|
32
23
|
knowledge_sources_config?: import("../api/agent.js").KnowledgeSourceResponse | undefined;
|
|
33
|
-
visibility_level: VisibilityLevel;
|
|
24
|
+
visibility_level: import("../api/agent.js").VisibilityLevel;
|
|
34
25
|
use_only: boolean;
|
|
35
26
|
creator_name: string;
|
|
36
27
|
created_by: string;
|
|
@@ -48,47 +39,11 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
48
39
|
[key: string]: any;
|
|
49
40
|
} | null | undefined;
|
|
50
41
|
}>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
51
|
-
/**
|
|
52
|
-
* Gets the default agent
|
|
53
|
-
*/
|
|
54
|
-
agentDefault: Omit<import("../network/types.js").QueryObject<void, {
|
|
55
|
-
builtIn: boolean;
|
|
56
|
-
id: string;
|
|
57
|
-
name: string;
|
|
58
|
-
slug: string;
|
|
59
|
-
/**
|
|
60
|
-
* Adds the resource of type Agent to the list of favorites.
|
|
61
|
-
*/
|
|
62
|
-
description?: string | undefined;
|
|
63
|
-
avatar?: string | undefined;
|
|
64
|
-
system_prompt: string;
|
|
65
|
-
type: string;
|
|
66
|
-
llm_config?: import("../api/agent.js").LlmConfigResponse | undefined;
|
|
67
|
-
suggested_prompts?: string[] | undefined;
|
|
68
|
-
knowledge_sources_config?: import("../api/agent.js").KnowledgeSourceResponse | undefined;
|
|
69
|
-
visibility_level: VisibilityLevel;
|
|
70
|
-
use_only: boolean;
|
|
71
|
-
creator_name: string;
|
|
72
|
-
created_by: string;
|
|
73
|
-
created_at: string;
|
|
74
|
-
updated_by?: string | undefined;
|
|
75
|
-
updated_at?: string | undefined;
|
|
76
|
-
toolkits?: import("../api/agent.js").ToolkitsInAgentResponse | undefined;
|
|
77
|
-
detail_mode?: boolean | undefined;
|
|
78
|
-
model_id?: string | undefined;
|
|
79
|
-
model_name?: string | undefined;
|
|
80
|
-
structured_output?: {
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
} | null | undefined;
|
|
83
|
-
llm_settings?: {
|
|
84
|
-
[key: string]: any;
|
|
85
|
-
} | null | undefined;
|
|
86
|
-
} | undefined>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
87
42
|
/**
|
|
88
43
|
* List commons agents
|
|
89
44
|
*/
|
|
90
45
|
agents: import("../network/types.js").QueryObject<{
|
|
91
|
-
visibility?: VisibilityLevel | undefined;
|
|
46
|
+
visibility?: import("../api/agent.js").VisibilityLevel | undefined;
|
|
92
47
|
}, import("../api/agent.js").AgentResponse[]>;
|
|
93
48
|
/**
|
|
94
49
|
* Gets a common agent by id
|
|
@@ -106,7 +61,7 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
106
61
|
llm_config?: import("../api/agent.js").LlmConfigResponse | undefined;
|
|
107
62
|
suggested_prompts?: string[] | undefined;
|
|
108
63
|
knowledge_sources_config?: import("../api/agent.js").KnowledgeSourceResponse | undefined;
|
|
109
|
-
visibility_level: VisibilityLevel;
|
|
64
|
+
visibility_level: import("../api/agent.js").VisibilityLevel;
|
|
110
65
|
use_only: boolean;
|
|
111
66
|
creator_name: string;
|
|
112
67
|
created_by: string;
|
|
@@ -128,7 +83,7 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
128
83
|
* List all public agents (built-in)
|
|
129
84
|
*/
|
|
130
85
|
publicAgents: import("../network/types.js").QueryObject<{
|
|
131
|
-
visibility?: VisibilityLevel | undefined;
|
|
86
|
+
visibility?: import("../api/agent.js").VisibilityLevel | undefined;
|
|
132
87
|
}, import("../api/agent.js").AgentResponse[]>;
|
|
133
88
|
/**
|
|
134
89
|
* Gets a public agent by id (built-in)
|
|
@@ -146,7 +101,7 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
146
101
|
llm_config?: import("../api/agent.js").LlmConfigResponse | undefined;
|
|
147
102
|
suggested_prompts?: string[] | undefined;
|
|
148
103
|
knowledge_sources_config?: import("../api/agent.js").KnowledgeSourceResponse | undefined;
|
|
149
|
-
visibility_level: VisibilityLevel;
|
|
104
|
+
visibility_level: import("../api/agent.js").VisibilityLevel;
|
|
150
105
|
use_only: boolean;
|
|
151
106
|
creator_name: string;
|
|
152
107
|
created_by: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/client/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/client/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAM7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAQ5E,cAAM,WAAY,SAAQ,uBAAuB;;IAK/C,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAalE;;OAEG;IACH,SAAS;iBAEiC,MAAM;iBAAW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAGhE;IAEF;;OAEG;IACH,MAAM;;+CAA0B;IAEhC;;OAEG;IACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAkC;IAEvC;;OAEG;IACH,YAAY;;+CAAgC;IAE5C;;OAEG;IACH,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAwC;IAEnD;;OAEG;IACH,gBAAgB;;aAA8C;IAE9D;;OAEG;IACH,mBAAmB;;aAAgD;IACnE;;OAEG;IACH,WAAW;;;gBAAqC;CACjD;AAED,eAAO,MAAM,WAAW,aAAoB,CAAA"}
|
package/dist/client/agent.js
CHANGED
|
@@ -2,57 +2,9 @@ import { defaults, deleteV1AgentByAgentIdFavorite, getV1AgentByAgentId, getV1Age
|
|
|
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 { workspaceAiClient } from './workspace-ai.js';
|
|
6
|
-
export const isAgentDefault = (agentSlug) => agentSlug === 'stk_code_buddy';
|
|
7
5
|
class AgentClient extends ReactQueryNetworkClient {
|
|
8
6
|
constructor() {
|
|
9
7
|
super(apis.agent.url, defaults);
|
|
10
|
-
/**
|
|
11
|
-
* List agents filtered by visibility.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(this, "allAgents", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
configurable: true,
|
|
16
|
-
writable: true,
|
|
17
|
-
value: this.query({
|
|
18
|
-
name: 'allAgents',
|
|
19
|
-
request: async (signal, variables) => {
|
|
20
|
-
const visibilities = variables.visibilities.includes('ALL')
|
|
21
|
-
? ['PERSONAL', 'SHARED', 'WORKSPACE', 'ACCOUNT', 'FAVORITE']
|
|
22
|
-
: variables.visibilities.filter((visibility) => visibility !== 'BUILT-IN' && visibility !== 'ALL');
|
|
23
|
-
const shouldIncludeBuiltInAgent = variables.visibilities.includes('ALL') || variables.visibilities.includes('BUILT-IN');
|
|
24
|
-
const shouldFetchBuiltInAgent = shouldIncludeBuiltInAgent || variables.visibilities.includes('FAVORITE');
|
|
25
|
-
const shouldFetchWorkspaceAgents = variables.visibilities.includes('ALL') || variables.visibilities.includes('WORKSPACE');
|
|
26
|
-
const publicAgentsPromise = shouldFetchBuiltInAgent ? getV1PublicAgents({}, { signal }) : Promise.resolve([]);
|
|
27
|
-
const workspaceAgentsPromise = shouldFetchWorkspaceAgents
|
|
28
|
-
? workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' })
|
|
29
|
-
: Promise.resolve([]);
|
|
30
|
-
const [publicAgents, workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
31
|
-
publicAgentsPromise,
|
|
32
|
-
workspaceAgentsPromise,
|
|
33
|
-
...visibilities.map((visibility) => getV1Agents({ visibility }, { signal })),
|
|
34
|
-
]);
|
|
35
|
-
const workspaceAgentsWithSpaceName = workspaceAgents?.flatMap(({ agents, space_name }) => agents?.map((agent) => ({
|
|
36
|
-
...agent,
|
|
37
|
-
spaceName: space_name,
|
|
38
|
-
builtIn: publicAgents?.some(publicAgent => publicAgent.id === agent.id),
|
|
39
|
-
})));
|
|
40
|
-
const allAgents = workspaceAgentsWithSpaceName || [];
|
|
41
|
-
if (shouldIncludeBuiltInAgent) {
|
|
42
|
-
const builtInsAgents = publicAgents?.map((agent) => ({ ...agent, builtIn: true, visibility_level: 'BUILT-IN' }));
|
|
43
|
-
// @ts-ignore fixme: above, BUILT-IN is not a valid value for the enum VisibilityLevel.
|
|
44
|
-
allAgents.push(...builtInsAgents);
|
|
45
|
-
}
|
|
46
|
-
agentsByVisibility.forEach(agents => {
|
|
47
|
-
allAgents.push(...agents.map(agent => ({
|
|
48
|
-
...agent,
|
|
49
|
-
builtIn: publicAgents?.some(publicAgent => publicAgent.id === agent.id),
|
|
50
|
-
})));
|
|
51
|
-
});
|
|
52
|
-
return allAgents;
|
|
53
|
-
},
|
|
54
|
-
})
|
|
55
|
-
});
|
|
56
8
|
/**
|
|
57
9
|
* Gets an agent by id
|
|
58
10
|
*/
|
|
@@ -67,22 +19,6 @@ class AgentClient extends ReactQueryNetworkClient {
|
|
|
67
19
|
: getV1AgentByAgentId({ ...variables }, { signal }),
|
|
68
20
|
})
|
|
69
21
|
});
|
|
70
|
-
/**
|
|
71
|
-
* Gets the default agent
|
|
72
|
-
*/
|
|
73
|
-
Object.defineProperty(this, "agentDefault", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true,
|
|
76
|
-
writable: true,
|
|
77
|
-
value: this.query({
|
|
78
|
-
name: 'agentDefault',
|
|
79
|
-
request: async (signal) => {
|
|
80
|
-
const publicAgents = await getV1PublicAgents({}, { signal });
|
|
81
|
-
const agentDefault = publicAgents.find((agent) => isAgentDefault(agent.slug));
|
|
82
|
-
return agentDefault ? { ...agentDefault, builtIn: true } : undefined;
|
|
83
|
-
},
|
|
84
|
-
})
|
|
85
|
-
});
|
|
86
22
|
/**
|
|
87
23
|
* List commons agents
|
|
88
24
|
*/
|
package/dist/client/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/client/agent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,WAAW,EAAE,yBAAyB,EAAE,iBAAiB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;WAAA;QAE9D;;WAEG;QACH;;;;mBAAsB,IAAI,CAAC,QAAQ,CAAC,8BAA8B,CAAC;WAAA;QACnE;;WAEG;QACH;;;;mBAAc,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;WAAA;IAzDhD,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,IAA8B,CAAA;QACtD,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QACpC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,qBAAqB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACpI,OAAO,IAAI,iBAAiB,CAAC;YAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI;YACtB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5B,CAAC,CAAA;IACJ,CAAC;CA6CF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA"}
|
package/dist/client/ai.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
13
13
|
runQuickAction: import("../network/types.js").MutationObject<Omit<{
|
|
14
14
|
authorization: string;
|
|
15
15
|
xAccountId?: string | null | undefined;
|
|
16
|
+
xMemberId?: string | null | undefined;
|
|
16
17
|
quickActionsRequest: import("../api/ai.js").QuickActionsRequest;
|
|
17
18
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").SimpleResponse>;
|
|
18
19
|
/**
|
|
@@ -45,6 +46,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
45
46
|
slug: string;
|
|
46
47
|
authorization: string;
|
|
47
48
|
xAccountId?: string | null | undefined;
|
|
49
|
+
xMemberId?: string | null | undefined;
|
|
48
50
|
customKnowledgeSourceRequest: import("../api/ai.js").CustomKnowledgeSourceRequest;
|
|
49
51
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
50
52
|
/**
|
|
@@ -54,6 +56,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
54
56
|
visibility?: import("../api/ai.js").VisibilityLevelEnum | undefined;
|
|
55
57
|
authorization: string;
|
|
56
58
|
xAccountId?: string | null | undefined;
|
|
59
|
+
xMemberId?: string | null | undefined;
|
|
57
60
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").GetAiStackResponse[]>;
|
|
58
61
|
/**
|
|
59
62
|
* Gets total tokens usage
|
|
@@ -61,6 +64,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
61
64
|
totalTokensUsage: import("../network/types.js").QueryObject<Omit<{
|
|
62
65
|
authorization: string;
|
|
63
66
|
xAccountId?: string | null | undefined;
|
|
67
|
+
xMemberId?: string | null | undefined;
|
|
64
68
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").TokensCurrentUsageResponse>;
|
|
65
69
|
/**
|
|
66
70
|
* Gets current tokens usage
|
|
@@ -70,6 +74,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
70
74
|
month: number;
|
|
71
75
|
authorization: string;
|
|
72
76
|
xAccountId?: string | null | undefined;
|
|
77
|
+
xMemberId?: string | null | undefined;
|
|
73
78
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").TokensCurrentUsageResponse>;
|
|
74
79
|
/**
|
|
75
80
|
* Gets a workspace by its id.
|
|
@@ -78,6 +83,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
78
83
|
workspaceId: string;
|
|
79
84
|
authorization: string;
|
|
80
85
|
xAccountId?: string | null | undefined;
|
|
86
|
+
xMemberId?: string | null | undefined;
|
|
81
87
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").KnowledgeSourceResponse[]>;
|
|
82
88
|
/**
|
|
83
89
|
* @deprecated
|
|
@@ -89,6 +95,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
89
95
|
types?: import("../api/ai.js").QuickCommandTypeRequest[] | null | undefined;
|
|
90
96
|
authorization: string;
|
|
91
97
|
xAccountId?: string | null | undefined;
|
|
98
|
+
xMemberId?: string | null | undefined;
|
|
92
99
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").QuickCommandListResponse[]>;
|
|
93
100
|
/**
|
|
94
101
|
* Lists all the quick commands according to filters passed as parameter (including QC with secrets).
|
|
@@ -99,6 +106,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
99
106
|
types?: import("../api/ai.js").QuickCommandTypeRequest[] | null | undefined;
|
|
100
107
|
authorization: string;
|
|
101
108
|
xAccountId?: string | null | undefined;
|
|
109
|
+
xMemberId?: string | null | undefined;
|
|
102
110
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").QuickCommandListResponse[]>;
|
|
103
111
|
/**
|
|
104
112
|
* Gets a quick command by its slug.
|
|
@@ -108,6 +116,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
108
116
|
findAgents?: boolean | undefined;
|
|
109
117
|
authorization: string;
|
|
110
118
|
xAccountId?: string | null | undefined;
|
|
119
|
+
xMemberId?: string | null | undefined;
|
|
111
120
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").QuickCommandResponse>;
|
|
112
121
|
/**
|
|
113
122
|
* Lists the knowledge sources according to filters passed as parameter.
|
|
@@ -119,6 +128,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
119
128
|
types?: import("../api/ai.js").KnowledgeSourceTypeEnum[] | null | undefined;
|
|
120
129
|
authorization: string;
|
|
121
130
|
xAccountId?: string | null | undefined;
|
|
131
|
+
xMemberId?: string | null | undefined;
|
|
122
132
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").KnowledgeSourceItemResponse[]>;
|
|
123
133
|
/**
|
|
124
134
|
* Gets a knowledge source by its slug.
|
|
@@ -135,6 +145,13 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
135
145
|
customId: string;
|
|
136
146
|
authorization: string;
|
|
137
147
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").DocumentResponse>;
|
|
148
|
+
/**
|
|
149
|
+
* Lists knowledge sources matching the provided IDs.
|
|
150
|
+
*/
|
|
151
|
+
searchKnowledgeSources: import("../network/types.js").QueryObject<Omit<{
|
|
152
|
+
authorization: string;
|
|
153
|
+
searchKnowledgeSourcesRequest: import("../api/ai.js").SearchKnowledgeSourcesRequest;
|
|
154
|
+
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, any>;
|
|
138
155
|
/**
|
|
139
156
|
* Gets the chat history. This is a paginated resource.
|
|
140
157
|
*/
|
|
@@ -143,6 +160,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
143
160
|
page?: number | undefined;
|
|
144
161
|
authorization: string;
|
|
145
162
|
xAccountId?: string | null | undefined;
|
|
163
|
+
xMemberId?: string | null | undefined;
|
|
146
164
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").ConversationResponse[], "">;
|
|
147
165
|
/**
|
|
148
166
|
* Gets a specific chat from the history according to its id.
|
|
@@ -151,6 +169,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
151
169
|
conversationId: string;
|
|
152
170
|
authorization: string;
|
|
153
171
|
xAccountId?: string | null | undefined;
|
|
172
|
+
xMemberId?: string | null | undefined;
|
|
154
173
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, FixedConversationResponse>;
|
|
155
174
|
/**
|
|
156
175
|
* Deletes a chat from the chat history.
|
|
@@ -159,6 +178,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
159
178
|
conversationId: string;
|
|
160
179
|
authorization: string;
|
|
161
180
|
xAccountId?: string | null | undefined;
|
|
181
|
+
xMemberId?: string | null | undefined;
|
|
162
182
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
163
183
|
/**
|
|
164
184
|
* Gets a plain text version of the chat with id passed as parameter.
|
|
@@ -167,6 +187,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
167
187
|
conversationId: string;
|
|
168
188
|
authorization: string;
|
|
169
189
|
xAccountId?: string | null | undefined;
|
|
190
|
+
xMemberId?: string | null | undefined;
|
|
170
191
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, any>;
|
|
171
192
|
/**
|
|
172
193
|
* Renames a chat.
|
|
@@ -175,6 +196,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
175
196
|
conversationId: string;
|
|
176
197
|
authorization: string;
|
|
177
198
|
xAccountId?: string | null | undefined;
|
|
199
|
+
xMemberId?: string | null | undefined;
|
|
178
200
|
conversationUpdateTitleRequest: import("../api/ai.js").ConversationUpdateTitleRequest;
|
|
179
201
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").ConversationResponse>;
|
|
180
202
|
/**
|
|
@@ -183,6 +205,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
183
205
|
createEvent: import("../network/types.js").MutationObject<Omit<{
|
|
184
206
|
authorization: string;
|
|
185
207
|
xAccountId?: string | null | undefined;
|
|
208
|
+
xMemberId?: string | null | undefined;
|
|
186
209
|
body: import("../api/ai.js").GenericEventRequest[];
|
|
187
210
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
188
211
|
/**
|
|
@@ -193,6 +216,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
193
216
|
stepSlug: string;
|
|
194
217
|
authorization: string;
|
|
195
218
|
xAccountId?: string | null | undefined;
|
|
219
|
+
xMemberId?: string | null | undefined;
|
|
196
220
|
quickCommandsExecutionRequest: QuickCommandsExecutionRequest;
|
|
197
221
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").QuickCommandStepFetchResponse>;
|
|
198
222
|
/**
|
|
@@ -203,10 +227,11 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
203
227
|
stepSlug: string;
|
|
204
228
|
authorization: string;
|
|
205
229
|
xAccountId?: string | null | undefined;
|
|
230
|
+
xMemberId?: string | null | undefined;
|
|
206
231
|
quickCommandsExecutionRequest: QuickCommandsExecutionRequest;
|
|
207
232
|
}, "authorization"> & {
|
|
208
233
|
headers?: Record<string, any> | undefined;
|
|
209
|
-
},
|
|
234
|
+
}, import("../api/ai.js").QuickCommandStepFetchResponse>;
|
|
210
235
|
/**
|
|
211
236
|
* @deprecated This method does not use stream, only json. The json support has been removed
|
|
212
237
|
* So this method might not work as expected.
|
|
@@ -217,8 +242,20 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
217
242
|
stepSlug: string;
|
|
218
243
|
authorization: string;
|
|
219
244
|
xAccountId?: string | null | undefined;
|
|
245
|
+
xMemberId?: string | null | undefined;
|
|
220
246
|
quickCommandsExecutionRequest: QuickCommandsExecutionRequest;
|
|
221
247
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, string | QuickCommandPromptResponse2>;
|
|
248
|
+
/**
|
|
249
|
+
* Calculates QC router next step.
|
|
250
|
+
*/
|
|
251
|
+
calculateNextStep: import("../network/types.js").MutationObject<Omit<{
|
|
252
|
+
slug: string;
|
|
253
|
+
stepSlug: string;
|
|
254
|
+
authorization: string;
|
|
255
|
+
xAccountId?: string | null | undefined;
|
|
256
|
+
xMemberId?: string | null | undefined;
|
|
257
|
+
quickCommandEvaluateStepRouterRequest: import("../api/ai.js").QuickCommandEvaluateStepRouterRequest;
|
|
258
|
+
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").QuickCommandEvaluateStepRouterResponse>;
|
|
222
259
|
/**
|
|
223
260
|
* Runs a stream of a step of type "llm" of a quick command.
|
|
224
261
|
*/
|
|
@@ -230,6 +267,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
230
267
|
slug: string;
|
|
231
268
|
authorization: string;
|
|
232
269
|
xAccountId?: string | null | undefined;
|
|
270
|
+
xMemberId?: string | null | undefined;
|
|
233
271
|
quickCommandsExecutionRequest: QuickCommandsExecutionRequest;
|
|
234
272
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, import("../api/ai.js").QuickCommandFinalResultResponse>;
|
|
235
273
|
/**
|
|
@@ -239,6 +277,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
239
277
|
stackId: string;
|
|
240
278
|
authorization: string;
|
|
241
279
|
xAccountId?: string | null | undefined;
|
|
280
|
+
xMemberId?: string | null | undefined;
|
|
242
281
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
243
282
|
/**
|
|
244
283
|
* Removes the resource of type Stack AI from the list of favorites.
|
|
@@ -247,6 +286,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
247
286
|
stackId: string;
|
|
248
287
|
authorization: string;
|
|
249
288
|
xAccountId?: string | null | undefined;
|
|
289
|
+
xMemberId?: string | null | undefined;
|
|
250
290
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
251
291
|
/**
|
|
252
292
|
* Updates a Quick Command
|
|
@@ -255,6 +295,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
255
295
|
slug: string;
|
|
256
296
|
authorization: string;
|
|
257
297
|
xAccountId?: string | null | undefined;
|
|
298
|
+
xMemberId?: string | null | undefined;
|
|
258
299
|
quickCommandsUpdateRequest: import("../api/ai.js").QuickCommandsUpdateRequest;
|
|
259
300
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
260
301
|
/**
|
|
@@ -264,6 +305,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
264
305
|
slug: string;
|
|
265
306
|
authorization: string;
|
|
266
307
|
xAccountId?: string | null | undefined;
|
|
308
|
+
xMemberId?: string | null | undefined;
|
|
267
309
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
268
310
|
/**
|
|
269
311
|
* Removes the resource of type Quick Command from the list of favorites.
|
|
@@ -272,6 +314,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
272
314
|
slug: string;
|
|
273
315
|
authorization: string;
|
|
274
316
|
xAccountId?: string | null | undefined;
|
|
317
|
+
xMemberId?: string | null | undefined;
|
|
275
318
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, unknown>;
|
|
276
319
|
private static toolsOfAgent;
|
|
277
320
|
sendChatMessage(request: FixedChatRequest, minChangeIntervalMS?: number): StreamedJson<ChatResponseWithSteps>;
|
|
@@ -280,6 +323,7 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
280
323
|
contentId: string;
|
|
281
324
|
authorization: string;
|
|
282
325
|
xAccountId?: string | null | undefined;
|
|
326
|
+
xMemberId?: string | null | undefined;
|
|
283
327
|
}, "authorization" | "authorizationHeader" | "jwtToken"> & {}, FixedDependencyResponse>;
|
|
284
328
|
}
|
|
285
329
|
export declare const aiClient: AIClient;
|
package/dist/client/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/client/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/client/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EA6BL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