Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
179 lines (153 loc) · 4.33 KB
/
Copy pathtypes.ts
File metadata and controls
179 lines (153 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { ServerCapabilities } from '@modelcontextprotocol/sdk/types.js';
import type { AngieChatMetadata } from './metadata';
export { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
// Backward compatibility
export enum AngieMCPTransport {
POST_MESSAGE = 'postMessage',
}
export enum AngieLocalServerTransport {
POST_MESSAGE = 'postMessage',
}
export enum AngieRemoteServerTransport {
STREAMABLE_HTTP = 'streamableHttp',
SSE = 'sse',
}
export enum AngieServerType {
LOCAL = 'local',
REMOTE = 'remote',
}
export type AngieBaseServerConfig = {
name: string;
title?: string;
version: string;
description: string;
capabilities?: ServerCapabilities;
type?: AngieServerType;
}
export type AngieLocalServerConfig = AngieBaseServerConfig & {
server: Server | McpServer;
transport?: AngieLocalServerTransport;
type?: AngieServerType.LOCAL;
}
export type AngieRemoteServerConfig = AngieBaseServerConfig & {
url: string;
transport?: AngieRemoteServerTransport;
type?: AngieServerType.REMOTE;
}
export type AngieServerConfig = AngieLocalServerConfig | AngieRemoteServerConfig;
export interface ServerRegistration {
id: string;
config: AngieServerConfig;
timestamp: number;
status: 'pending' | 'registered' | 'failed';
error?: string;
}
export interface AngiePluginMarker {
available: boolean;
version?: string;
}
export interface AngieDetectionResult {
isReady: boolean;
version?: string;
capabilities?: string[];
}
declare global {
interface Window {
angiePlugin?: AngiePluginMarker;
}
}
export interface AngieMessage<T = unknown> {
type: string;
payload: T;
origin?: string;
timestamp: number;
}
export interface ClientCreationRequest {
serverId: string;
serverName: string;
serverTitle?: string;
description: string;
serverVersion: string;
transport?: AngieLocalServerTransport | AngieRemoteServerTransport;
capabilities?: ServerCapabilities;
instanceId?: string;
// Remote server support
remote?: {
url: string;
};
}
export interface ClientCreationResponse {
success: boolean;
clientId?: string;
error?: string;
}
export interface ContextAttachment {
label: string;
content: string;
}
export interface PromptSuggestion {
label: string;
value: string;
autoSend?: boolean;
color?: string;
isNew?: boolean;
requiresPrompt?: string;
}
export interface AngieTriggerRequest {
prompt?: string;
context?: {
source?: string;
} & Record<string, unknown>;
contextAttachment?: ContextAttachment;
suggestions?: { items: PromptSuggestion[] };
options?: {
timeout?: number;
newChat?: boolean;
autoSend?: boolean;
};
/** Flat attribution data stored on chats created after this trigger. Replaces the previous value. */
metadata?: AngieChatMetadata;
}
export interface AngieTriggerResponse {
success: boolean;
response?: string;
error?: string;
requestId: string;
}
export enum AngieInteractionMode {
AGENT = 'agent',
PLAN = 'plan',
ASK = 'ask',
SUPER_ADMIN = 'super-admin',
}
export enum MessageEventType {
SDK_ANGIE_READY_PING = 'sdk-angie-ready-ping',
SDK_ANGIE_REFRESH_PING = 'sdk-angie-refresh-ping',
SDK_ANGIE_ALL_SERVERS_REGISTERED = 'sdk-angie-all-servers-registered',
SDK_REQUEST_CLIENT_CREATION = 'sdk-request-client-creation',
SDK_REQUEST_INIT_SERVER = 'sdk-request-init-server',
SDK_INIT_TRIGGER_ANGIE = 'sdk-init-trigger-angie',
SDK_TRIGGER_ANGIE = 'sdk-trigger-angie',
SDK_TRIGGER_ANGIE_RESPONSE = 'sdk-trigger-angie-response',
ANGIE_SIDEBAR_RESIZED = 'angie-sidebar-resized',
ANGIE_SIDEBAR_TOGGLED = 'angie-sidebar-toggled',
ANGIE_CHAT_TOGGLE = 'angie-chat-toggle',
ANGIE_STUDIO_TOGGLE = 'angie-studio-toggle',
ANGIE_NAVIGATE_TO_URL = 'angie/navigate-to-url',
ANGIE_PAGE_RELOAD = 'angie/page-reload',
ANGIE_DISABLE_NAVIGATION_PREVENTION = 'angie/disable-navigation-prevention',
ANGIE_NAVIGATE_AFTER_RESPONSE = 'angie/navigate-after-response',
ANGIE_SET_INTERACTION_MODE = 'angie/set-interaction-mode',
}
export enum HostLocalStorageEventType {
SET = 'ANGIE_SET_LOCALSTORAGE',
GET = 'ANGIE_GET_LOCALSTORAGE',
}
export enum HostEventType {
RESET_HASH = 'reset-hash',
HOST_READY = 'host/ready',
ANGIE_LOADED = 'angie/loaded',
ANGIE_READY = 'angie/ready',
}