@anvia/studio 0.1.2 → 0.2.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/dist/index.d.ts +150 -6
- package/dist/index.js +1996 -341
- package/dist/index.js.map +1 -1
- package/dist/ui/assets/index-BY0kc1ar.js +91 -0
- package/dist/ui/assets/index-BY0kc1ar.js.map +1 -0
- package/dist/ui/assets/index-DcPwH55d.css +1 -0
- package/dist/ui/index.html +6 -2
- package/package.json +6 -5
- package/dist/ui/assets/index-Dy72BB4f.js +0 -85
- package/dist/ui/assets/index-Dy72BB4f.js.map +0 -1
- package/dist/ui/assets/index-VMCHaVgC.css +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Message, JsonObject, AgentTraceOptions, PromptResponse, AgentStreamEvent, JsonValue, Usage, AgentTraceInfo, Agent, MemoryStore, AgentObserver, AgentRunStartArgs, AgentRunObserver } from '@anvia/core';
|
|
2
1
|
import { Hono } from 'hono';
|
|
2
|
+
import { Message, JsonObject, AgentTraceOptions, PromptResponse, AgentStreamEvent, JsonValue, Agent, Pipeline, Usage, AgentTraceInfo, PipelineGraph, MemoryStore, AgentObserver, AgentRunStartArgs, AgentRunObserver } from '@anvia/core';
|
|
3
3
|
|
|
4
|
-
type StudioCapability = "agents" | "approvals" | "knowledge" | "observability" | "sessions" | "traces";
|
|
4
|
+
type StudioCapability = "agents" | "approvals" | "knowledge" | "mcps" | "observability" | "pipelines" | "sessions" | "tools" | "traces";
|
|
5
5
|
type StudioAgent = {
|
|
6
6
|
id: string;
|
|
7
7
|
agent: Agent;
|
|
@@ -10,6 +10,7 @@ type StudioAgent = {
|
|
|
10
10
|
quickPrompts?: string[];
|
|
11
11
|
metadata?: JsonObject;
|
|
12
12
|
};
|
|
13
|
+
type StudioTarget = Agent | Pipeline<unknown, unknown>;
|
|
13
14
|
type StudioAgentConfig = {
|
|
14
15
|
id: string;
|
|
15
16
|
name?: string;
|
|
@@ -17,6 +18,27 @@ type StudioAgentConfig = {
|
|
|
17
18
|
quickPrompts: string[];
|
|
18
19
|
metadata?: JsonObject;
|
|
19
20
|
};
|
|
21
|
+
type StudioPipeline = {
|
|
22
|
+
id: string;
|
|
23
|
+
pipeline: Pipeline<unknown, unknown>;
|
|
24
|
+
name?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
metadata?: JsonObject;
|
|
27
|
+
};
|
|
28
|
+
type StudioPipelineConfig = {
|
|
29
|
+
id: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
metadata?: JsonObject;
|
|
33
|
+
stageCount: number;
|
|
34
|
+
edgeCount: number;
|
|
35
|
+
hasParallelStages: boolean;
|
|
36
|
+
agentCount: number;
|
|
37
|
+
extractorCount: number;
|
|
38
|
+
};
|
|
39
|
+
type StudioPipelineDetail = StudioPipelineConfig & {
|
|
40
|
+
graph: PipelineGraph;
|
|
41
|
+
};
|
|
20
42
|
type StudioCapabilityConfig = {
|
|
21
43
|
enabled: boolean;
|
|
22
44
|
reason?: string;
|
|
@@ -27,12 +49,47 @@ type StudioConfig = {
|
|
|
27
49
|
description?: string;
|
|
28
50
|
version?: string;
|
|
29
51
|
agents: StudioAgentConfig[];
|
|
52
|
+
pipelines: StudioPipelineConfig[];
|
|
30
53
|
chat: {
|
|
31
54
|
quickPrompts: Record<string, string[]>;
|
|
32
55
|
};
|
|
33
56
|
capabilities: Partial<Record<StudioCapability, StudioCapabilityConfig>>;
|
|
34
57
|
unsupportedCapabilities: StudioCapability[];
|
|
35
58
|
};
|
|
59
|
+
type StudioAgentToolSource = "static" | "dynamic";
|
|
60
|
+
type StudioAgentToolApprovalMetadata = {
|
|
61
|
+
required: boolean;
|
|
62
|
+
reason?: string;
|
|
63
|
+
rejectMessage?: string;
|
|
64
|
+
};
|
|
65
|
+
type StudioAgentToolMetadata = {
|
|
66
|
+
agentId: string;
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
parameters: JsonObject;
|
|
70
|
+
source: StudioAgentToolSource;
|
|
71
|
+
approval: StudioAgentToolApprovalMetadata;
|
|
72
|
+
};
|
|
73
|
+
type StudioAgentToolsSummary = {
|
|
74
|
+
agentId: string;
|
|
75
|
+
tools: StudioAgentToolMetadata[];
|
|
76
|
+
};
|
|
77
|
+
type StudioAgentMcpToolMetadata = {
|
|
78
|
+
name: string;
|
|
79
|
+
description: string;
|
|
80
|
+
parameters: JsonObject;
|
|
81
|
+
source: StudioAgentToolSource;
|
|
82
|
+
};
|
|
83
|
+
type StudioAgentMcpServerMetadata = {
|
|
84
|
+
agentId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
toolCount: number;
|
|
87
|
+
tools: StudioAgentMcpToolMetadata[];
|
|
88
|
+
};
|
|
89
|
+
type StudioAgentMcpsSummary = {
|
|
90
|
+
agentId: string;
|
|
91
|
+
servers: StudioAgentMcpServerMetadata[];
|
|
92
|
+
};
|
|
36
93
|
type StudioTranscriptChatEntry = {
|
|
37
94
|
entryId: number;
|
|
38
95
|
kind: "message";
|
|
@@ -110,12 +167,42 @@ type StudioSessionRunTranscriptInput = {
|
|
|
110
167
|
status: StudioSessionRunStatus;
|
|
111
168
|
error?: JsonValue;
|
|
112
169
|
};
|
|
170
|
+
type StudioSessionLogLevel = "debug" | "info" | "warn" | "error";
|
|
171
|
+
type StudioSessionLogCategory = "session" | "run" | "memory" | "prompt" | "model" | "tool" | "approval" | "question" | "api";
|
|
172
|
+
type StudioSessionLogEntry = {
|
|
173
|
+
id: string;
|
|
174
|
+
sessionId: string;
|
|
175
|
+
runId?: string;
|
|
176
|
+
sequence: number;
|
|
177
|
+
timestamp: string;
|
|
178
|
+
level: StudioSessionLogLevel;
|
|
179
|
+
category: StudioSessionLogCategory;
|
|
180
|
+
event: string;
|
|
181
|
+
message: string;
|
|
182
|
+
metadata?: JsonObject;
|
|
183
|
+
};
|
|
184
|
+
type StudioSessionLogAppendInput = {
|
|
185
|
+
sessionId: string;
|
|
186
|
+
runId?: string;
|
|
187
|
+
level: StudioSessionLogLevel;
|
|
188
|
+
category: StudioSessionLogCategory;
|
|
189
|
+
event: string;
|
|
190
|
+
message: string;
|
|
191
|
+
metadata?: JsonObject;
|
|
192
|
+
};
|
|
193
|
+
type StudioSessionLogListOptions = {
|
|
194
|
+
sessionId: string;
|
|
195
|
+
limit: number;
|
|
196
|
+
after?: number;
|
|
197
|
+
};
|
|
113
198
|
type StudioSessionStore = MemoryStore & {
|
|
114
199
|
readonly kind?: string;
|
|
115
200
|
listSessions(options: StudioSessionListOptions): StudioSessionSummary[] | Promise<StudioSessionSummary[]>;
|
|
116
201
|
createSession(input: StudioSessionCreateInput): StudioSessionSummary | Promise<StudioSessionSummary>;
|
|
117
202
|
getSession(id: string): StudioSession | undefined | Promise<StudioSession | undefined>;
|
|
118
203
|
saveSessionRunTranscript(input: StudioSessionRunTranscriptInput): StudioSession | undefined | Promise<StudioSession | undefined>;
|
|
204
|
+
appendSessionLog?(input: StudioSessionLogAppendInput): StudioSessionLogEntry | Promise<StudioSessionLogEntry>;
|
|
205
|
+
listSessionLogs?(options: StudioSessionLogListOptions): StudioSessionLogEntry[] | Promise<StudioSessionLogEntry[]>;
|
|
119
206
|
deleteSession?(id: string): boolean | Promise<boolean>;
|
|
120
207
|
};
|
|
121
208
|
type StudioTraceStatus = "running" | "success" | "error";
|
|
@@ -212,6 +299,7 @@ type StudioKnowledgeSummary = {
|
|
|
212
299
|
type StudioStores = {
|
|
213
300
|
sessions?: StudioSessionStore | false;
|
|
214
301
|
traces?: StudioTraceStore;
|
|
302
|
+
pipelineLogs?: StudioPipelineLogStore | false;
|
|
215
303
|
};
|
|
216
304
|
type StudioUiOptions = {
|
|
217
305
|
path?: string;
|
|
@@ -310,6 +398,62 @@ type StudioToolQuestionResultEvent = {
|
|
|
310
398
|
type: "tool_question_result";
|
|
311
399
|
question: StudioToolQuestion;
|
|
312
400
|
};
|
|
401
|
+
type StudioSessionLogEvent = {
|
|
402
|
+
type: "session_log";
|
|
403
|
+
log: StudioSessionLogEntry;
|
|
404
|
+
};
|
|
405
|
+
type StudioPipelineLogLevel = "debug" | "info" | "warn" | "error";
|
|
406
|
+
type StudioPipelineLogCategory = "pipeline" | "run" | "stage" | "parallel" | "agent" | "extractor" | "api";
|
|
407
|
+
type StudioPipelineLogEntry = {
|
|
408
|
+
id: string;
|
|
409
|
+
pipelineId: string;
|
|
410
|
+
runId?: string;
|
|
411
|
+
sequence: number;
|
|
412
|
+
timestamp: string;
|
|
413
|
+
level: StudioPipelineLogLevel;
|
|
414
|
+
category: StudioPipelineLogCategory;
|
|
415
|
+
event: string;
|
|
416
|
+
message: string;
|
|
417
|
+
metadata?: JsonObject;
|
|
418
|
+
};
|
|
419
|
+
type StudioPipelineLogAppendInput = {
|
|
420
|
+
pipelineId: string;
|
|
421
|
+
runId?: string;
|
|
422
|
+
level: StudioPipelineLogLevel;
|
|
423
|
+
category: StudioPipelineLogCategory;
|
|
424
|
+
event: string;
|
|
425
|
+
message: string;
|
|
426
|
+
metadata?: JsonObject;
|
|
427
|
+
};
|
|
428
|
+
type StudioPipelineLogListOptions = {
|
|
429
|
+
pipelineId: string;
|
|
430
|
+
limit: number;
|
|
431
|
+
after?: number;
|
|
432
|
+
};
|
|
433
|
+
type StudioPipelineLogStore = {
|
|
434
|
+
appendPipelineLog(input: StudioPipelineLogAppendInput): StudioPipelineLogEntry | Promise<StudioPipelineLogEntry>;
|
|
435
|
+
listPipelineLogs(options: StudioPipelineLogListOptions): StudioPipelineLogEntry[] | Promise<StudioPipelineLogEntry[]>;
|
|
436
|
+
};
|
|
437
|
+
type StudioPipelineLogEvent = {
|
|
438
|
+
type: "pipeline_log";
|
|
439
|
+
log: StudioPipelineLogEntry;
|
|
440
|
+
};
|
|
441
|
+
type StudioPipelineFinalEvent = {
|
|
442
|
+
type: "pipeline_final";
|
|
443
|
+
runId: string;
|
|
444
|
+
pipelineId: string;
|
|
445
|
+
output: JsonValue;
|
|
446
|
+
};
|
|
447
|
+
type StudioPipelineRunRequest = {
|
|
448
|
+
input: JsonValue;
|
|
449
|
+
stream?: boolean;
|
|
450
|
+
metadata?: JsonObject;
|
|
451
|
+
};
|
|
452
|
+
type StudioPipelineRunResponse = {
|
|
453
|
+
runId: string;
|
|
454
|
+
pipelineId: string;
|
|
455
|
+
output: JsonValue;
|
|
456
|
+
};
|
|
313
457
|
type AgentRunRequest = {
|
|
314
458
|
message: string | Message;
|
|
315
459
|
history?: Message[];
|
|
@@ -321,7 +465,7 @@ type AgentRunRequest = {
|
|
|
321
465
|
trace?: AgentTraceOptions;
|
|
322
466
|
};
|
|
323
467
|
type AgentRunResponse = PromptResponse;
|
|
324
|
-
type AgentRunStreamEvent = AgentStreamEvent | StudioToolApprovalRequestEvent | StudioToolApprovalResultEvent | StudioToolQuestionRequestEvent | StudioToolQuestionResultEvent;
|
|
468
|
+
type AgentRunStreamEvent = AgentStreamEvent | StudioToolApprovalRequestEvent | StudioToolApprovalResultEvent | StudioToolQuestionRequestEvent | StudioToolQuestionResultEvent | StudioSessionLogEvent | StudioPipelineLogEvent | StudioPipelineFinalEvent;
|
|
325
469
|
type StudioErrorCode = "bad_request" | "conflict" | "not_found" | "unsupported_capability" | "internal_error";
|
|
326
470
|
type StudioErrorResponse = {
|
|
327
471
|
error: {
|
|
@@ -352,7 +496,7 @@ declare class Studio implements AnviaStudio {
|
|
|
352
496
|
private studio;
|
|
353
497
|
private server;
|
|
354
498
|
private sigintHandler;
|
|
355
|
-
constructor(
|
|
499
|
+
constructor(targets?: StudioTarget[], options?: StudioOptions);
|
|
356
500
|
get app(): Hono;
|
|
357
501
|
fetch(request: Request): Response | Promise<Response>;
|
|
358
502
|
config(): StudioConfig;
|
|
@@ -364,6 +508,6 @@ declare class Studio implements AnviaStudio {
|
|
|
364
508
|
type SqliteSessionStoreOptions = {
|
|
365
509
|
path?: string;
|
|
366
510
|
};
|
|
367
|
-
declare function createSqliteSessionStore(options?: SqliteSessionStoreOptions): StudioSessionStore & StudioTraceStore;
|
|
511
|
+
declare function createSqliteSessionStore(options?: SqliteSessionStoreOptions): StudioSessionStore & StudioTraceStore & StudioPipelineLogStore;
|
|
368
512
|
|
|
369
|
-
export { type AgentRunRequest, type AgentRunResponse, type AgentRunStreamEvent, type AnviaStudio, type SqliteSessionStoreOptions, Studio, type StudioAgent, type StudioAgentConfig, type StudioAgentKnowledgeConfig, type StudioCapability, type StudioCapabilityConfig, type StudioConfig, type StudioErrorCode, type StudioErrorResponse, type StudioKnowledgeEvidence, type StudioKnowledgeEvidenceDocument, type StudioKnowledgeSourceKind, type StudioKnowledgeSourceSummary, type StudioKnowledgeSummary, type StudioOptions, type StudioServeOptions, type StudioSession, type StudioSessionCreateInput, type StudioSessionListOptions, type StudioSessionRunStatus, type StudioSessionRunTranscriptInput, type StudioSessionStore, type StudioSessionSummary, type StudioSessionTraceListOptions, type StudioStaticKnowledgeDocument, type StudioStores, type StudioToolApproval, type StudioToolApprovalDecision, type StudioToolApprovalRequestEvent, type StudioToolApprovalResultEvent, type StudioToolApprovalStatus, type StudioToolApprovalTranscript, type StudioToolQuestion, type StudioToolQuestionAnswer, type StudioToolQuestionChoice, type StudioToolQuestionPrompt, type StudioToolQuestionRequestEvent, type StudioToolQuestionResultEvent, type StudioToolQuestionStatus, type StudioToolQuestionTranscript, type StudioTrace, type StudioTraceListOptions, type StudioTraceObservation, type StudioTraceObservationKind, StudioTraceObserver, type StudioTraceObserverOptions, type StudioTraceStatus, type StudioTraceStore, type StudioTraceSummary, type StudioTranscriptChatEntry, type StudioTranscriptChildAgentEvent, type StudioTranscriptEntry, type StudioTranscriptReasoningEntry, type StudioTranscriptToolEntry, type StudioUiOptions, createSqliteSessionStore };
|
|
513
|
+
export { type AgentRunRequest, type AgentRunResponse, type AgentRunStreamEvent, type AnviaStudio, type SqliteSessionStoreOptions, Studio, type StudioAgent, type StudioAgentConfig, type StudioAgentKnowledgeConfig, type StudioAgentMcpServerMetadata, type StudioAgentMcpToolMetadata, type StudioAgentMcpsSummary, type StudioAgentToolApprovalMetadata, type StudioAgentToolMetadata, type StudioAgentToolSource, type StudioAgentToolsSummary, type StudioCapability, type StudioCapabilityConfig, type StudioConfig, type StudioErrorCode, type StudioErrorResponse, type StudioKnowledgeEvidence, type StudioKnowledgeEvidenceDocument, type StudioKnowledgeSourceKind, type StudioKnowledgeSourceSummary, type StudioKnowledgeSummary, type StudioOptions, type StudioPipeline, type StudioPipelineConfig, type StudioPipelineDetail, type StudioPipelineFinalEvent, type StudioPipelineLogAppendInput, type StudioPipelineLogCategory, type StudioPipelineLogEntry, type StudioPipelineLogEvent, type StudioPipelineLogLevel, type StudioPipelineLogListOptions, type StudioPipelineLogStore, type StudioPipelineRunRequest, type StudioPipelineRunResponse, type StudioServeOptions, type StudioSession, type StudioSessionCreateInput, type StudioSessionListOptions, type StudioSessionLogAppendInput, type StudioSessionLogCategory, type StudioSessionLogEntry, type StudioSessionLogEvent, type StudioSessionLogLevel, type StudioSessionLogListOptions, type StudioSessionRunStatus, type StudioSessionRunTranscriptInput, type StudioSessionStore, type StudioSessionSummary, type StudioSessionTraceListOptions, type StudioStaticKnowledgeDocument, type StudioStores, type StudioTarget, type StudioToolApproval, type StudioToolApprovalDecision, type StudioToolApprovalRequestEvent, type StudioToolApprovalResultEvent, type StudioToolApprovalStatus, type StudioToolApprovalTranscript, type StudioToolQuestion, type StudioToolQuestionAnswer, type StudioToolQuestionChoice, type StudioToolQuestionPrompt, type StudioToolQuestionRequestEvent, type StudioToolQuestionResultEvent, type StudioToolQuestionStatus, type StudioToolQuestionTranscript, type StudioTrace, type StudioTraceListOptions, type StudioTraceObservation, type StudioTraceObservationKind, StudioTraceObserver, type StudioTraceObserverOptions, type StudioTraceStatus, type StudioTraceStore, type StudioTraceSummary, type StudioTranscriptChatEntry, type StudioTranscriptChildAgentEvent, type StudioTranscriptEntry, type StudioTranscriptReasoningEntry, type StudioTranscriptToolEntry, type StudioUiOptions, createSqliteSessionStore };
|