@anvia/studio 0.2.11 → 0.4.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/README.md +14 -7
- package/dist/index.d.ts +140 -5
- package/dist/index.js +1126 -247
- package/dist/index.js.map +1 -1
- package/dist/ui/assets/index-B0bCx2Nv.js +100 -0
- package/dist/ui/assets/index-B0bCx2Nv.js.map +1 -0
- package/dist/ui/assets/index-BiMI9T3_.css +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/index-DfSrZD9A.js +0 -100
- package/dist/ui/assets/index-DfSrZD9A.js.map +0 -1
- package/dist/ui/assets/index-Dx2LlqO-.css +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @anvia/studio
|
|
2
2
|
|
|
3
|
-
Studio UI and HTTP runtime for Anvia agents, pipelines, tools, MCPs, and knowledge inspection.
|
|
3
|
+
Studio UI and HTTP runtime for Anvia agents, pipelines, tools, MCPs, memory, status, and knowledge inspection.
|
|
4
4
|
|
|
5
|
-
Use this package to serve local agents and pipelines over HTTP, inspect sessions, traces, tools, MCPs, and Knowledge in the browser UI, and exercise tool approval workflows during development.
|
|
5
|
+
Use this package to serve local agents and pipelines over HTTP, inspect sessions, traces, tools, MCPs, Memory, Status, and Knowledge in the browser UI, and exercise tool approval workflows during development.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -50,25 +50,32 @@ Studio exposes:
|
|
|
50
50
|
|
|
51
51
|
- Chat playground and persisted sessions
|
|
52
52
|
- Trace browser and session logs
|
|
53
|
-
-
|
|
54
|
-
-
|
|
53
|
+
- Realtime observability stream for session logs, pipeline logs, and completed traces
|
|
54
|
+
- Eval suite runner for registered `runEvalSuite` configurations
|
|
55
|
+
- Pipeline graph, logs, run history, and replay-from-history controls
|
|
56
|
+
- Rich agent runtime details, direct tool invocation, static tool, dynamic tool, and MCP inspectors
|
|
57
|
+
- Memory explorer for users, conversations, messages, and transcript steps backed by the session store
|
|
58
|
+
- Status dashboard for storage adapters, record counts, and enabled capabilities
|
|
55
59
|
- Knowledge tabs for static context, dynamic context, dynamic tools, and retrieval log
|
|
56
60
|
|
|
57
61
|
## Session Storage
|
|
58
62
|
|
|
59
|
-
Studio uses
|
|
63
|
+
Studio uses an in-memory store by default. Sessions, traces, and pipeline run history are available while the process is running, but they do not create local files unless you opt in to SQLite. If you omit the port, Studio uses `RUNNER_PORT` and then falls back to `4021`.
|
|
60
64
|
|
|
61
|
-
Set `ANVIA_STUDIO_DB` to
|
|
65
|
+
Set `ANVIA_STUDIO_DB` to persist Studio data in SQLite:
|
|
62
66
|
|
|
63
67
|
```sh
|
|
64
68
|
ANVIA_STUDIO_DB=.anvia/studio.sqlite node ./dist/server.js
|
|
65
69
|
```
|
|
66
70
|
|
|
71
|
+
SQLite storage uses dedicated `anvia_studio_*` tables so it can share an application database without writing into product tables.
|
|
72
|
+
|
|
67
73
|
## Exports
|
|
68
74
|
|
|
69
75
|
- `Studio`
|
|
76
|
+
- `createInMemoryStudioStore`
|
|
70
77
|
- `createSqliteSessionStore`
|
|
71
|
-
- Studio session, trace, approval, pipeline, knowledge, tool, MCP, and runtime types
|
|
78
|
+
- Studio session, trace, approval, pipeline, memory, status, knowledge, tool, MCP, and runtime types
|
|
72
79
|
|
|
73
80
|
## Development
|
|
74
81
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
|
-
import { Message, JsonObject, AgentTraceOptions, PromptResponse, AgentStreamEvent, JsonValue, Agent, Pipeline,
|
|
2
|
+
import { Message, JsonObject, AgentTraceOptions, PromptResponse, AgentStreamEvent, JsonValue, Agent, Pipeline, RunEvalSuiteOptions, MemoryStore, ToolResultContent, Usage, AgentTraceInfo, PipelineGraph, AgentObserver, AgentRunStartArgs, AgentRunObserver } from '@anvia/core';
|
|
3
3
|
|
|
4
|
-
type StudioCapability = "agents" | "approvals" | "knowledge" | "mcps" | "observability" | "pipelines" | "sessions" | "tools" | "traces";
|
|
4
|
+
type StudioCapability = "agents" | "approvals" | "evals" | "memory" | "knowledge" | "mcps" | "observability" | "pipelines" | "sessions" | "status" | "tools" | "traces";
|
|
5
5
|
type StudioAgent = {
|
|
6
6
|
id: string;
|
|
7
7
|
agent: Agent;
|
|
@@ -10,7 +10,7 @@ type StudioAgent = {
|
|
|
10
10
|
quickPrompts?: string[];
|
|
11
11
|
metadata?: JsonObject;
|
|
12
12
|
};
|
|
13
|
-
type StudioTarget = Agent | Pipeline<
|
|
13
|
+
type StudioTarget = Agent | Pipeline<any, any>;
|
|
14
14
|
type StudioAgentConfig = {
|
|
15
15
|
id: string;
|
|
16
16
|
name?: string;
|
|
@@ -18,9 +18,28 @@ type StudioAgentConfig = {
|
|
|
18
18
|
quickPrompts: string[];
|
|
19
19
|
metadata?: JsonObject;
|
|
20
20
|
};
|
|
21
|
+
type StudioAgentRuntimeSummary = {
|
|
22
|
+
id: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
model?: JsonValue;
|
|
26
|
+
toolCount: number;
|
|
27
|
+
staticToolCount: number;
|
|
28
|
+
dynamicToolCount: number;
|
|
29
|
+
approvalToolCount: number;
|
|
30
|
+
mcpToolCount: number;
|
|
31
|
+
staticContextCount: number;
|
|
32
|
+
dynamicContextCount: number;
|
|
33
|
+
observerCount: number;
|
|
34
|
+
hasMemory: boolean;
|
|
35
|
+
hasHook: boolean;
|
|
36
|
+
hasOutputSchema: boolean;
|
|
37
|
+
defaultMaxTurns?: number;
|
|
38
|
+
metadata?: JsonObject;
|
|
39
|
+
};
|
|
21
40
|
type StudioPipeline = {
|
|
22
41
|
id: string;
|
|
23
|
-
pipeline: Pipeline<
|
|
42
|
+
pipeline: Pipeline<any, any>;
|
|
24
43
|
name?: string;
|
|
25
44
|
description?: string;
|
|
26
45
|
metadata?: JsonObject;
|
|
@@ -39,6 +58,31 @@ type StudioPipelineConfig = {
|
|
|
39
58
|
type StudioPipelineDetail = StudioPipelineConfig & {
|
|
40
59
|
graph: PipelineGraph;
|
|
41
60
|
};
|
|
61
|
+
type StudioEvalSuite<Input = unknown, Output = unknown, Expected = unknown> = RunEvalSuiteOptions<Input, Output, Expected> & {
|
|
62
|
+
id?: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
metadata?: JsonObject;
|
|
65
|
+
};
|
|
66
|
+
type StudioEvalSuiteConfig = {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
caseCount: number;
|
|
71
|
+
metricNames: string[];
|
|
72
|
+
concurrency?: number;
|
|
73
|
+
metadata?: JsonObject;
|
|
74
|
+
};
|
|
75
|
+
type StudioEvalRunRequest = {
|
|
76
|
+
concurrency?: number;
|
|
77
|
+
};
|
|
78
|
+
type StudioEvalRunResponse = {
|
|
79
|
+
runId: string;
|
|
80
|
+
suiteId: string;
|
|
81
|
+
startedAt: string;
|
|
82
|
+
endedAt: string;
|
|
83
|
+
durationMs: number;
|
|
84
|
+
result: JsonObject;
|
|
85
|
+
};
|
|
42
86
|
type StudioCapabilityConfig = {
|
|
43
87
|
enabled: boolean;
|
|
44
88
|
reason?: string;
|
|
@@ -50,6 +94,7 @@ type StudioConfig = {
|
|
|
50
94
|
version?: string;
|
|
51
95
|
agents: StudioAgentConfig[];
|
|
52
96
|
pipelines: StudioPipelineConfig[];
|
|
97
|
+
evals: StudioEvalSuiteConfig[];
|
|
53
98
|
chat: {
|
|
54
99
|
quickPrompts: Record<string, string[]>;
|
|
55
100
|
};
|
|
@@ -74,6 +119,21 @@ type StudioAgentToolsSummary = {
|
|
|
74
119
|
agentId: string;
|
|
75
120
|
tools: StudioAgentToolMetadata[];
|
|
76
121
|
};
|
|
122
|
+
type StudioToolRunRequest = {
|
|
123
|
+
args: JsonValue;
|
|
124
|
+
context?: JsonObject;
|
|
125
|
+
};
|
|
126
|
+
type StudioToolRunResponse = {
|
|
127
|
+
agentId: string;
|
|
128
|
+
toolName: string;
|
|
129
|
+
result?: JsonValue;
|
|
130
|
+
error?: JsonValue;
|
|
131
|
+
status: "success" | "error";
|
|
132
|
+
durationMs: number;
|
|
133
|
+
startedAt: string;
|
|
134
|
+
endedAt: string;
|
|
135
|
+
events: JsonValue[];
|
|
136
|
+
};
|
|
77
137
|
type StudioAgentMcpToolMetadata = {
|
|
78
138
|
name: string;
|
|
79
139
|
description: string;
|
|
@@ -243,6 +303,17 @@ type StudioTrace = StudioTraceSummary & {
|
|
|
243
303
|
input?: JsonValue;
|
|
244
304
|
observations: StudioTraceObservation[];
|
|
245
305
|
};
|
|
306
|
+
type StudioObservabilityEventType = "session_log" | "pipeline_log" | "trace";
|
|
307
|
+
type StudioObservabilityEvent = {
|
|
308
|
+
type: "session_log";
|
|
309
|
+
log: StudioSessionLogEntry;
|
|
310
|
+
} | {
|
|
311
|
+
type: "pipeline_log";
|
|
312
|
+
log: StudioPipelineLogEntry;
|
|
313
|
+
} | {
|
|
314
|
+
type: "trace";
|
|
315
|
+
trace: StudioTraceSummary;
|
|
316
|
+
};
|
|
246
317
|
type StudioTraceListOptions = {
|
|
247
318
|
limit: number;
|
|
248
319
|
agentId?: string;
|
|
@@ -326,6 +397,61 @@ type StudioKnowledgeSummary = {
|
|
|
326
397
|
agents: StudioAgentKnowledgeConfig[];
|
|
327
398
|
evidence: StudioKnowledgeEvidence[];
|
|
328
399
|
};
|
|
400
|
+
type StudioMemoryUserSummary = {
|
|
401
|
+
userId: string;
|
|
402
|
+
conversationCount: number;
|
|
403
|
+
agentIds: string[];
|
|
404
|
+
lastInteractionAt: string;
|
|
405
|
+
};
|
|
406
|
+
type StudioMemoryConversationSummary = {
|
|
407
|
+
id: string;
|
|
408
|
+
userId: string;
|
|
409
|
+
agentId: string;
|
|
410
|
+
title?: string;
|
|
411
|
+
createdAt: string;
|
|
412
|
+
updatedAt: string;
|
|
413
|
+
messageCount: number;
|
|
414
|
+
metadata?: JsonObject;
|
|
415
|
+
};
|
|
416
|
+
type StudioMemoryConversationsPage = {
|
|
417
|
+
conversations: StudioMemoryConversationSummary[];
|
|
418
|
+
total: number;
|
|
419
|
+
};
|
|
420
|
+
type StudioMemoryUsersPage = {
|
|
421
|
+
users: StudioMemoryUserSummary[];
|
|
422
|
+
total: number;
|
|
423
|
+
};
|
|
424
|
+
type StudioMemoryConversationMessages = {
|
|
425
|
+
conversation: StudioMemoryConversationSummary;
|
|
426
|
+
messages: Message[];
|
|
427
|
+
transcript: StudioTranscriptEntry[];
|
|
428
|
+
};
|
|
429
|
+
type StudioMemoryConversationSteps = {
|
|
430
|
+
conversation: StudioMemoryConversationSummary;
|
|
431
|
+
steps: StudioTranscriptEntry[];
|
|
432
|
+
};
|
|
433
|
+
type StudioStatusSummary = {
|
|
434
|
+
runner: {
|
|
435
|
+
id: string;
|
|
436
|
+
name?: string;
|
|
437
|
+
version?: string;
|
|
438
|
+
};
|
|
439
|
+
storage: {
|
|
440
|
+
sessions?: string;
|
|
441
|
+
traces?: string;
|
|
442
|
+
pipelineLogs?: string;
|
|
443
|
+
pipelineRuns?: string;
|
|
444
|
+
};
|
|
445
|
+
counts: {
|
|
446
|
+
agents: number;
|
|
447
|
+
pipelines: number;
|
|
448
|
+
sessions?: number;
|
|
449
|
+
traces?: number;
|
|
450
|
+
pipelineRuns?: number;
|
|
451
|
+
};
|
|
452
|
+
capabilities: Partial<Record<StudioCapability, StudioCapabilityConfig>>;
|
|
453
|
+
generatedAt: string;
|
|
454
|
+
};
|
|
329
455
|
type StudioStores = {
|
|
330
456
|
sessions?: StudioSessionStore | false;
|
|
331
457
|
traces?: StudioTraceStore;
|
|
@@ -341,7 +467,10 @@ type StudioUiOptions = {
|
|
|
341
467
|
protectShell?: boolean;
|
|
342
468
|
};
|
|
343
469
|
type StudioOptions = {
|
|
470
|
+
evals?: Array<StudioEvalSuite<any, any, any>>;
|
|
344
471
|
quickPrompts?: Record<string, string[]>;
|
|
472
|
+
stores?: StudioStores;
|
|
473
|
+
ui?: boolean | StudioUiOptions;
|
|
345
474
|
};
|
|
346
475
|
type StudioServeOptions = {
|
|
347
476
|
port?: number;
|
|
@@ -513,6 +642,10 @@ type StudioPipelineRunRequest = {
|
|
|
513
642
|
stream?: boolean;
|
|
514
643
|
metadata?: JsonObject;
|
|
515
644
|
};
|
|
645
|
+
type StudioPipelineReplayRequest = {
|
|
646
|
+
stream?: boolean;
|
|
647
|
+
metadata?: JsonObject;
|
|
648
|
+
};
|
|
516
649
|
type StudioPipelineRunResponse = {
|
|
517
650
|
runId: string;
|
|
518
651
|
pipelineId: string;
|
|
@@ -574,4 +707,6 @@ type SqliteSessionStoreOptions = {
|
|
|
574
707
|
};
|
|
575
708
|
declare function createSqliteSessionStore(options?: SqliteSessionStoreOptions): StudioSessionStore & StudioTraceStore & StudioPipelineLogStore & StudioPipelineRunStore;
|
|
576
709
|
|
|
577
|
-
|
|
710
|
+
declare function createInMemoryStudioStore(): StudioSessionStore & StudioTraceStore & StudioPipelineLogStore & StudioPipelineRunStore;
|
|
711
|
+
|
|
712
|
+
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 StudioAgentRuntimeSummary, type StudioAgentToolApprovalMetadata, type StudioAgentToolMetadata, type StudioAgentToolSource, type StudioAgentToolsSummary, type StudioCapability, type StudioCapabilityConfig, type StudioConfig, type StudioErrorCode, type StudioErrorResponse, type StudioEvalRunRequest, type StudioEvalRunResponse, type StudioEvalSuite, type StudioEvalSuiteConfig, type StudioKnowledgeEvidence, type StudioKnowledgeEvidenceDocument, type StudioKnowledgeItem, type StudioKnowledgeItemKind, type StudioKnowledgeItemsPage, type StudioKnowledgeSourceKind, type StudioKnowledgeSourceSummary, type StudioKnowledgeSummary, type StudioMemoryConversationMessages, type StudioMemoryConversationSteps, type StudioMemoryConversationSummary, type StudioMemoryConversationsPage, type StudioMemoryUserSummary, type StudioMemoryUsersPage, type StudioObservabilityEvent, type StudioObservabilityEventType, 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 StudioPipelineReplayRequest, type StudioPipelineRunListOptions, type StudioPipelineRunRecord, type StudioPipelineRunRequest, type StudioPipelineRunResponse, type StudioPipelineRunSaveInput, type StudioPipelineRunStatus, type StudioPipelineRunStore, 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 StudioStatusSummary, 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 StudioToolRunRequest, type StudioToolRunResponse, 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, createInMemoryStudioStore, createSqliteSessionStore };
|