@stack-spot/portal-network 0.192.1 → 0.193.0-beta.1
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 +170 -0
- package/dist/api/account.d.ts +4 -116
- package/dist/api/account.d.ts.map +1 -1
- package/dist/api/account.js +9 -95
- package/dist/api/account.js.map +1 -1
- package/dist/api/ai.d.ts +189 -86
- package/dist/api/ai.d.ts.map +1 -1
- package/dist/api/ai.js +238 -142
- package/dist/api/ai.js.map +1 -1
- package/dist/api/cloudPlatform.d.ts +73 -126
- package/dist/api/cloudPlatform.d.ts.map +1 -1
- package/dist/api/cloudPlatform.js +82 -66
- package/dist/api/cloudPlatform.js.map +1 -1
- package/dist/api/codeShift.d.ts +171 -40
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +80 -10
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api/discover.d.ts +23 -12
- package/dist/api/discover.d.ts.map +1 -1
- package/dist/api/discover.js +10 -0
- package/dist/api/discover.js.map +1 -1
- package/dist/client/account.d.ts +4 -0
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +10 -1
- package/dist/client/account.js.map +1 -1
- package/dist/client/ai.d.ts +46 -0
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +140 -15
- package/dist/client/ai.js.map +1 -1
- package/dist/client/cloud-platform.d.ts +155 -51
- package/dist/client/cloud-platform.d.ts.map +1 -1
- package/dist/client/cloud-platform.js +146 -47
- package/dist/client/cloud-platform.js.map +1 -1
- package/dist/client/code-shift.d.ts +53 -3
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +55 -1
- package/dist/client/code-shift.js.map +1 -1
- package/dist/client/discover.d.ts +7 -1
- package/dist/client/discover.d.ts.map +1 -1
- package/dist/client/discover.js +208 -0
- package/dist/client/discover.js.map +1 -1
- package/dist/client/types.d.ts +39 -5
- package/dist/client/types.d.ts.map +1 -1
- package/dist/error/dictionary/cloud-platform.d.ts +6 -0
- package/dist/error/dictionary/cloud-platform.d.ts.map +1 -1
- package/dist/error/dictionary/cloud-platform.js +6 -0
- package/dist/error/dictionary/cloud-platform.js.map +1 -1
- package/dist/utils/StreamedJson.d.ts.map +1 -1
- package/dist/utils/StreamedJson.js +9 -1
- package/dist/utils/StreamedJson.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +2 -1
- package/src/api/account.ts +21 -192
- package/src/api/agent-tools.ts +3 -0
- package/src/api/agent.ts +2 -0
- package/src/api/ai.ts +364 -157
- package/src/api/cloudPlatform.ts +147 -204
- package/src/api/codeShift.ts +284 -45
- package/src/api/discover.ts +35 -12
- package/src/api/notification.ts +2 -0
- package/src/client/account.ts +5 -0
- package/src/client/ai.ts +136 -13
- package/src/client/cloud-platform.ts +84 -29
- package/src/client/code-shift.ts +30 -1
- package/src/client/discover.ts +220 -3
- package/src/client/types.ts +43 -7
- package/src/error/dictionary/cloud-platform.ts +6 -0
- package/src/utils/StreamedJson.tsx +9 -2
package/src/client/types.ts
CHANGED
|
@@ -246,6 +246,7 @@ export interface ChatAgentTool {
|
|
|
246
246
|
image?: string,
|
|
247
247
|
input?: string,
|
|
248
248
|
output?: string,
|
|
249
|
+
goal?: string,
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
export interface ChatStepAttempt {
|
|
@@ -257,8 +258,8 @@ export interface ChatStepAttempt {
|
|
|
257
258
|
|
|
258
259
|
export interface BaseChatStep {
|
|
259
260
|
id: string,
|
|
260
|
-
type: 'planning' | 'step' | 'answer',
|
|
261
|
-
status: 'pending' | 'running' | 'success' | 'error',
|
|
261
|
+
type: 'planning' | 'step' | 'answer' | 'tool',
|
|
262
|
+
status: 'pending' | 'running' | 'success' | 'error' | 'awaiting_approval',
|
|
262
263
|
/**
|
|
263
264
|
* Duration in seconds.
|
|
264
265
|
*/
|
|
@@ -267,9 +268,24 @@ export interface BaseChatStep {
|
|
|
267
268
|
|
|
268
269
|
export interface PlanningChatStep extends BaseChatStep {
|
|
269
270
|
type: 'planning',
|
|
270
|
-
status: 'success',
|
|
271
|
+
status: 'success' | 'awaiting_approval',
|
|
271
272
|
steps: string[],
|
|
272
273
|
goal: string,
|
|
274
|
+
user_question?: string,
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface ToolChatStep extends BaseChatStep {
|
|
278
|
+
type: 'tool',
|
|
279
|
+
status: 'running' | 'success' | 'error' | 'awaiting_approval',
|
|
280
|
+
/**
|
|
281
|
+
* Each step might attempt to run for multiple times, with different inputs and outputs. If first attempt succeeds, this array will have
|
|
282
|
+
* only one element.
|
|
283
|
+
*
|
|
284
|
+
* This array never has less than one element, despite the step's status.
|
|
285
|
+
*/
|
|
286
|
+
attempts: ChatStepAttempt[],
|
|
287
|
+
input?: Record<string, any>,
|
|
288
|
+
user_question?: string,
|
|
273
289
|
}
|
|
274
290
|
|
|
275
291
|
export interface StepChatStep extends BaseChatStep {
|
|
@@ -289,17 +305,19 @@ export interface AnswerChatStep extends BaseChatStep {
|
|
|
289
305
|
type: 'answer',
|
|
290
306
|
}
|
|
291
307
|
|
|
292
|
-
export type ChatStep = PlanningChatStep | StepChatStep | AnswerChatStep
|
|
308
|
+
export type ChatStep = PlanningChatStep | StepChatStep | AnswerChatStep | ToolChatStep
|
|
293
309
|
|
|
294
310
|
export interface BaseAgentInfo {
|
|
295
311
|
type: 'chat' | 'planning' | 'step' | 'tool' | 'final_answer',
|
|
296
|
-
action: 'start' | 'end',
|
|
312
|
+
action: 'start' | 'end' | 'awaiting_approval',
|
|
297
313
|
duration?: number,
|
|
314
|
+
id: string,
|
|
298
315
|
}
|
|
299
316
|
|
|
300
317
|
export interface AgentTool {
|
|
301
318
|
tool_id: string,
|
|
302
319
|
tool_execution_id: string,
|
|
320
|
+
goal: string,
|
|
303
321
|
}
|
|
304
322
|
|
|
305
323
|
export interface PlanningAgentInfo extends BaseAgentInfo {
|
|
@@ -312,6 +330,7 @@ export interface PlanningAgentInfo extends BaseAgentInfo {
|
|
|
312
330
|
goal: string,
|
|
313
331
|
tools?: AgentTool[],
|
|
314
332
|
}[],
|
|
333
|
+
user_question?: string,
|
|
315
334
|
},
|
|
316
335
|
}
|
|
317
336
|
|
|
@@ -327,6 +346,8 @@ export interface ToolAgentInfo extends BaseAgentInfo {
|
|
|
327
346
|
input?: any,
|
|
328
347
|
attempt: number,
|
|
329
348
|
output?: string,
|
|
349
|
+
user_question?: string,
|
|
350
|
+
tool_id: string,
|
|
330
351
|
},
|
|
331
352
|
}
|
|
332
353
|
|
|
@@ -340,10 +361,25 @@ export interface FixedChatResponse extends ChatResponse3 {
|
|
|
340
361
|
agent_info: AgentInfo,
|
|
341
362
|
tools?: string[],
|
|
342
363
|
}
|
|
364
|
+
export interface OpportunitiesPMAgent {
|
|
365
|
+
title: string,
|
|
366
|
+
description: string,
|
|
367
|
+
}
|
|
343
368
|
|
|
369
|
+
export type HypothesisPMAgent = OpportunitiesPMAgent
|
|
370
|
+
|
|
371
|
+
export type PrfaqPMAgent = {
|
|
372
|
+
title: string,
|
|
373
|
+
content: string,
|
|
374
|
+
}
|
|
344
375
|
export interface ChatResponseWithSteps extends FixedChatResponse {
|
|
345
376
|
steps: ChatStep[],
|
|
346
377
|
}
|
|
378
|
+
export interface ChatResponseWithPMResources {
|
|
379
|
+
opportunities?: OpportunitiesPMAgent[],
|
|
380
|
+
hypothesis?: HypothesisPMAgent[],
|
|
381
|
+
prfaq?: PrfaqPMAgent,
|
|
382
|
+
}
|
|
347
383
|
|
|
348
384
|
export type OazapftsFunction<Variables = any, Result = any> = (variables: Variables, opts?: RequestOpts) => Promise<Result>
|
|
349
385
|
|
|
@@ -359,12 +395,12 @@ export type FixVariables<
|
|
|
359
395
|
|
|
360
396
|
export type ReplaceResult<T extends (...args: any[]) => Promise<any>, Fix> = (...args: Parameters<T>) => Promise<Fix>
|
|
361
397
|
|
|
362
|
-
export interface AgentResponseWithBuiltIn extends Omit<ListAgentResponse, 'conversation_starter' | 'avatar'>
|
|
398
|
+
export interface AgentResponseWithBuiltIn extends Omit<ListAgentResponse, 'conversation_starter' | 'avatar'> {
|
|
363
399
|
builtIn?: boolean,
|
|
364
400
|
spaceName?: string,
|
|
365
401
|
conversation_starter?: string[] | null,
|
|
366
402
|
avatar?: string | null | undefined,
|
|
367
|
-
}
|
|
403
|
+
}
|
|
368
404
|
|
|
369
405
|
export type AgentVisibilityLevel = AgentVisibilityLevelEnum | VisibilityLevelEnum
|
|
370
406
|
|
|
@@ -39,6 +39,9 @@ export const scfDictionary = {
|
|
|
39
39
|
SCF_VPN_ERROR: 'VPN operation failed.',
|
|
40
40
|
SCF_VPN_NOT_FOUND_ERROR: 'VPN with ID {1} not found.',
|
|
41
41
|
SCF_VPN_NOT_READY_ERROR: 'VPN with ID {1} not ready.',
|
|
42
|
+
SCF_DNS_ZONE_NOT_EMPTY_ERROR: 'DNS Zone with ID {1} is not empty.',
|
|
43
|
+
SCF_FOLDER_NOT_EMPTY_ERROR: 'Folder with ID {1} is not empty.',
|
|
44
|
+
SCF_PROJECT_NOT_EMPTY_ERROR: 'Project with ID {1} is not empty.',
|
|
42
45
|
},
|
|
43
46
|
pt: {
|
|
44
47
|
SCF_CERTIFICATE_ERROR: 'Falha na operação de Certificado.',
|
|
@@ -78,5 +81,8 @@ export const scfDictionary = {
|
|
|
78
81
|
SCF_VPN_ERROR: 'Falha na operação de VPN.',
|
|
79
82
|
SCF_VPN_NOT_FOUND_ERROR: 'VPN com ID {1} não encontrada.',
|
|
80
83
|
SCF_VPN_NOT_READY_ERROR: 'VPN com ID {1} não está pronta.',
|
|
84
|
+
SCF_DNS_ZONE_NOT_EMPTY_ERROR: 'DNS Zone com ID {1} não está vazia.',
|
|
85
|
+
SCF_FOLDER_NOT_EMPTY_ERROR: 'Folder com ID {1} não está vazia.',
|
|
86
|
+
SCF_PROJECT_NOT_EMPTY_ERROR: 'Project com ID {1} não está vazia.',
|
|
81
87
|
},
|
|
82
88
|
} satisfies Dictionary
|
|
@@ -64,7 +64,14 @@ export class StreamedJson<T> {
|
|
|
64
64
|
for await (const event of events) {
|
|
65
65
|
if (this.error) return
|
|
66
66
|
if (event.data) {
|
|
67
|
-
|
|
67
|
+
let json
|
|
68
|
+
try {
|
|
69
|
+
json = JSON.parse(event.data)
|
|
70
|
+
} catch (e) {
|
|
71
|
+
// eslint-disable-next-line no-console
|
|
72
|
+
console.warn('Mal formed JSON in streaming:', event.data)
|
|
73
|
+
continue
|
|
74
|
+
}
|
|
68
75
|
await this.transform?.(json, this.data)
|
|
69
76
|
this.merge(json, this.data)
|
|
70
77
|
if (new Date().getTime() - lastChangeCall >= minChangeIntervalMS) {
|
|
@@ -138,7 +145,7 @@ export class StreamedJson<T> {
|
|
|
138
145
|
onChange(listener: (value: Partial<T>) => void) {
|
|
139
146
|
if (this.fullPromise.resolved) {
|
|
140
147
|
listener(this.data)
|
|
141
|
-
return () => {}
|
|
148
|
+
return () => { }
|
|
142
149
|
}
|
|
143
150
|
this.onChangeListeners.push(listener)
|
|
144
151
|
return () => {
|