@hopper-agent/protocol 0.1.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/LICENSE +179 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/src/constants.d.ts +3 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +3 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/event-schemas.d.ts +521 -0
- package/dist/src/event-schemas.d.ts.map +1 -0
- package/dist/src/event-schemas.js +114 -0
- package/dist/src/event-schemas.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/json-rpc.d.ts +162 -0
- package/dist/src/json-rpc.d.ts.map +1 -0
- package/dist/src/json-rpc.js +41 -0
- package/dist/src/json-rpc.js.map +1 -0
- package/dist/src/methods.d.ts +112 -0
- package/dist/src/methods.d.ts.map +1 -0
- package/dist/src/methods.js +40 -0
- package/dist/src/methods.js.map +1 -0
- package/dist/src/tool-schemas.d.ts +85 -0
- package/dist/src/tool-schemas.d.ts.map +1 -0
- package/dist/src/tool-schemas.js +23 -0
- package/dist/src/tool-schemas.js.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const JsonRpcRequestSchema: z.ZodObject<{
|
|
3
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
4
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
5
|
+
method: z.ZodString;
|
|
6
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
id: string | number;
|
|
9
|
+
jsonrpc: "2.0";
|
|
10
|
+
method: string;
|
|
11
|
+
params?: Record<string, unknown> | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
id: string | number;
|
|
14
|
+
jsonrpc: "2.0";
|
|
15
|
+
method: string;
|
|
16
|
+
params?: Record<string, unknown> | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const JsonRpcNotificationSchema: z.ZodObject<{
|
|
19
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
20
|
+
method: z.ZodString;
|
|
21
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
jsonrpc: "2.0";
|
|
24
|
+
method: string;
|
|
25
|
+
params?: Record<string, unknown> | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
jsonrpc: "2.0";
|
|
28
|
+
method: string;
|
|
29
|
+
params?: Record<string, unknown> | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const JsonRpcResponseSchema: z.ZodObject<{
|
|
32
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
33
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
34
|
+
result: z.ZodUnknown;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
id: string | number;
|
|
37
|
+
jsonrpc: "2.0";
|
|
38
|
+
result?: unknown;
|
|
39
|
+
}, {
|
|
40
|
+
id: string | number;
|
|
41
|
+
jsonrpc: "2.0";
|
|
42
|
+
result?: unknown;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const JsonRpcErrorSchema: z.ZodObject<{
|
|
45
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
46
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
47
|
+
error: z.ZodObject<{
|
|
48
|
+
code: z.ZodNumber;
|
|
49
|
+
message: z.ZodString;
|
|
50
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
code: number;
|
|
53
|
+
message: string;
|
|
54
|
+
data?: unknown;
|
|
55
|
+
}, {
|
|
56
|
+
code: number;
|
|
57
|
+
message: string;
|
|
58
|
+
data?: unknown;
|
|
59
|
+
}>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
id: string | number;
|
|
62
|
+
error: {
|
|
63
|
+
code: number;
|
|
64
|
+
message: string;
|
|
65
|
+
data?: unknown;
|
|
66
|
+
};
|
|
67
|
+
jsonrpc: "2.0";
|
|
68
|
+
}, {
|
|
69
|
+
id: string | number;
|
|
70
|
+
error: {
|
|
71
|
+
code: number;
|
|
72
|
+
message: string;
|
|
73
|
+
data?: unknown;
|
|
74
|
+
};
|
|
75
|
+
jsonrpc: "2.0";
|
|
76
|
+
}>;
|
|
77
|
+
export declare const JsonRpcMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
78
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
79
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
80
|
+
method: z.ZodString;
|
|
81
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
id: string | number;
|
|
84
|
+
jsonrpc: "2.0";
|
|
85
|
+
method: string;
|
|
86
|
+
params?: Record<string, unknown> | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
id: string | number;
|
|
89
|
+
jsonrpc: "2.0";
|
|
90
|
+
method: string;
|
|
91
|
+
params?: Record<string, unknown> | undefined;
|
|
92
|
+
}>, z.ZodObject<{
|
|
93
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
94
|
+
method: z.ZodString;
|
|
95
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
jsonrpc: "2.0";
|
|
98
|
+
method: string;
|
|
99
|
+
params?: Record<string, unknown> | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
jsonrpc: "2.0";
|
|
102
|
+
method: string;
|
|
103
|
+
params?: Record<string, unknown> | undefined;
|
|
104
|
+
}>, z.ZodObject<{
|
|
105
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
106
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
107
|
+
result: z.ZodUnknown;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
id: string | number;
|
|
110
|
+
jsonrpc: "2.0";
|
|
111
|
+
result?: unknown;
|
|
112
|
+
}, {
|
|
113
|
+
id: string | number;
|
|
114
|
+
jsonrpc: "2.0";
|
|
115
|
+
result?: unknown;
|
|
116
|
+
}>, z.ZodObject<{
|
|
117
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
118
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
119
|
+
error: z.ZodObject<{
|
|
120
|
+
code: z.ZodNumber;
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
code: number;
|
|
125
|
+
message: string;
|
|
126
|
+
data?: unknown;
|
|
127
|
+
}, {
|
|
128
|
+
code: number;
|
|
129
|
+
message: string;
|
|
130
|
+
data?: unknown;
|
|
131
|
+
}>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
id: string | number;
|
|
134
|
+
error: {
|
|
135
|
+
code: number;
|
|
136
|
+
message: string;
|
|
137
|
+
data?: unknown;
|
|
138
|
+
};
|
|
139
|
+
jsonrpc: "2.0";
|
|
140
|
+
}, {
|
|
141
|
+
id: string | number;
|
|
142
|
+
error: {
|
|
143
|
+
code: number;
|
|
144
|
+
message: string;
|
|
145
|
+
data?: unknown;
|
|
146
|
+
};
|
|
147
|
+
jsonrpc: "2.0";
|
|
148
|
+
}>]>;
|
|
149
|
+
export type JsonRpcRequest = z.infer<typeof JsonRpcRequestSchema>;
|
|
150
|
+
export type JsonRpcNotification = z.infer<typeof JsonRpcNotificationSchema>;
|
|
151
|
+
export type JsonRpcResponse = z.infer<typeof JsonRpcResponseSchema>;
|
|
152
|
+
export type JsonRpcError = z.infer<typeof JsonRpcErrorSchema>;
|
|
153
|
+
export type JsonRpcMessage = z.infer<typeof JsonRpcMessageSchema>;
|
|
154
|
+
export declare const JsonRpcErrorCode: {
|
|
155
|
+
readonly ParseError: -32700;
|
|
156
|
+
readonly InvalidRequest: -32600;
|
|
157
|
+
readonly MethodNotFound: -32601;
|
|
158
|
+
readonly InvalidParams: -32602;
|
|
159
|
+
readonly InternalError: -32603;
|
|
160
|
+
readonly ServerError: -32000;
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=json-rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-rpc.d.ts","sourceRoot":"","sources":["../../src/json-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;CAOnB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const JsonRpcRequestSchema = z.object({
|
|
3
|
+
jsonrpc: z.literal('2.0'),
|
|
4
|
+
id: z.union([z.number(), z.string()]),
|
|
5
|
+
method: z.string(),
|
|
6
|
+
params: z.record(z.string(), z.unknown()).optional(),
|
|
7
|
+
});
|
|
8
|
+
export const JsonRpcNotificationSchema = z.object({
|
|
9
|
+
jsonrpc: z.literal('2.0'),
|
|
10
|
+
method: z.string(),
|
|
11
|
+
params: z.record(z.string(), z.unknown()).optional(),
|
|
12
|
+
});
|
|
13
|
+
export const JsonRpcResponseSchema = z.object({
|
|
14
|
+
jsonrpc: z.literal('2.0'),
|
|
15
|
+
id: z.union([z.number(), z.string()]),
|
|
16
|
+
result: z.unknown(),
|
|
17
|
+
});
|
|
18
|
+
export const JsonRpcErrorSchema = z.object({
|
|
19
|
+
jsonrpc: z.literal('2.0'),
|
|
20
|
+
id: z.union([z.number(), z.string()]),
|
|
21
|
+
error: z.object({
|
|
22
|
+
code: z.number(),
|
|
23
|
+
message: z.string(),
|
|
24
|
+
data: z.unknown().optional(),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
export const JsonRpcMessageSchema = z.union([
|
|
28
|
+
JsonRpcRequestSchema,
|
|
29
|
+
JsonRpcNotificationSchema,
|
|
30
|
+
JsonRpcResponseSchema,
|
|
31
|
+
JsonRpcErrorSchema,
|
|
32
|
+
]);
|
|
33
|
+
export const JsonRpcErrorCode = {
|
|
34
|
+
ParseError: -32700,
|
|
35
|
+
InvalidRequest: -32600,
|
|
36
|
+
MethodNotFound: -32601,
|
|
37
|
+
InvalidParams: -32602,
|
|
38
|
+
InternalError: -32603,
|
|
39
|
+
ServerError: -32000,
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=json-rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-rpc.js","sourceRoot":"","sources":["../../src/json-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,oBAAoB;IACpB,yBAAyB;IACzB,qBAAqB;IACrB,kBAAkB;CACnB,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,CAAC,KAAK;IAClB,cAAc,EAAE,CAAC,KAAK;IACtB,cAAc,EAAE,CAAC,KAAK;IACtB,aAAa,EAAE,CAAC,KAAK;IACrB,aAAa,EAAE,CAAC,KAAK;IACrB,WAAW,EAAE,CAAC,KAAK;CACX,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SessionListSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
3
|
+
export declare const SessionGetSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
id: string;
|
|
7
|
+
}, {
|
|
8
|
+
id: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const SessionSendSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
text: z.ZodString;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
id: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}, {
|
|
17
|
+
id: string;
|
|
18
|
+
text: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const SessionCancelSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, {
|
|
25
|
+
id: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const SessionResumeSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const OrchestraPanesSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
35
|
+
export declare const OrchestraBroadcastSchema: z.ZodObject<{
|
|
36
|
+
paneIds: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
text: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
text: string;
|
|
40
|
+
paneIds: string[];
|
|
41
|
+
}, {
|
|
42
|
+
text: string;
|
|
43
|
+
paneIds: string[];
|
|
44
|
+
}>;
|
|
45
|
+
export declare const WikiQuerySchema: z.ZodObject<{
|
|
46
|
+
query: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
query: string;
|
|
49
|
+
}, {
|
|
50
|
+
query: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const WikiPageGetSchema: z.ZodObject<{
|
|
53
|
+
slug: z.ZodString;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
slug: string;
|
|
56
|
+
}, {
|
|
57
|
+
slug: string;
|
|
58
|
+
}>;
|
|
59
|
+
export declare const ApprovalPendingSchema: z.ZodObject<{
|
|
60
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
sessionId?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
sessionId?: string | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const ApprovalDecideSchema: z.ZodObject<{
|
|
67
|
+
toolCallId: z.ZodString;
|
|
68
|
+
decision: z.ZodEnum<["allow", "deny"]>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
toolCallId: string;
|
|
71
|
+
decision: "allow" | "deny";
|
|
72
|
+
}, {
|
|
73
|
+
toolCallId: string;
|
|
74
|
+
decision: "allow" | "deny";
|
|
75
|
+
}>;
|
|
76
|
+
export declare const ToolRegistrySchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
77
|
+
export declare const ProviderListSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
78
|
+
export declare const ConfigGetSchema: z.ZodObject<{
|
|
79
|
+
key: z.ZodString;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
key: string;
|
|
82
|
+
}, {
|
|
83
|
+
key: string;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const ConfigSetSchema: z.ZodObject<{
|
|
86
|
+
key: z.ZodString;
|
|
87
|
+
value: z.ZodUnknown;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
key: string;
|
|
90
|
+
value?: unknown;
|
|
91
|
+
}, {
|
|
92
|
+
key: string;
|
|
93
|
+
value?: unknown;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const Method: {
|
|
96
|
+
readonly SESSION_LIST: "session.list";
|
|
97
|
+
readonly SESSION_GET: "session.get";
|
|
98
|
+
readonly SESSION_SEND: "session.send";
|
|
99
|
+
readonly SESSION_CANCEL: "session.cancel";
|
|
100
|
+
readonly SESSION_RESUME: "session.resume";
|
|
101
|
+
readonly ORCHESTRA_PANES: "orchestra.panes";
|
|
102
|
+
readonly ORCHESTRA_BROADCAST: "orchestra.broadcast";
|
|
103
|
+
readonly WIKI_QUERY: "wiki.query";
|
|
104
|
+
readonly WIKI_PAGE_GET: "wiki.page.get";
|
|
105
|
+
readonly APPROVAL_PENDING: "approval.pending";
|
|
106
|
+
readonly APPROVAL_DECIDE: "approval.decide";
|
|
107
|
+
readonly TOOL_REGISTRY: "tool.registry";
|
|
108
|
+
readonly PROVIDER_LIST: "provider.list";
|
|
109
|
+
readonly CONFIG_GET: "config.get";
|
|
110
|
+
readonly CONFIG_SET: "config.set";
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB,gDAAe,CAAC;AAC9C,eAAO,MAAM,gBAAgB;;;;;;EAA+B,CAAC;AAC7D,eAAO,MAAM,iBAAiB;;;;;;;;;EAAiD,CAAC;AAChF,eAAO,MAAM,mBAAmB;;;;;;EAA+B,CAAC;AAChE,eAAO,MAAM,mBAAmB;;;;;;EAA0C,CAAC;AAE3E,eAAO,MAAM,oBAAoB,gDAAe,CAAC;AACjD,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;EAAkC,CAAC;AAC/D,eAAO,MAAM,iBAAiB;;;;;;EAAiC,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;;;EAAiD,CAAC;AACpF,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAEH,eAAO,MAAM,kBAAkB,gDAAe,CAAC;AAC/C,eAAO,MAAM,kBAAkB,gDAAe,CAAC;AAE/C,eAAO,MAAM,eAAe;;;;;;EAAgC,CAAC;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;EAAoD,CAAC;AAEjF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;CAgBT,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SessionListSchema = z.object({});
|
|
3
|
+
export const SessionGetSchema = z.object({ id: z.string() });
|
|
4
|
+
export const SessionSendSchema = z.object({ id: z.string(), text: z.string() });
|
|
5
|
+
export const SessionCancelSchema = z.object({ id: z.string() });
|
|
6
|
+
export const SessionResumeSchema = z.object({ id: z.string().optional() });
|
|
7
|
+
export const OrchestraPanesSchema = z.object({});
|
|
8
|
+
export const OrchestraBroadcastSchema = z.object({
|
|
9
|
+
paneIds: z.array(z.string()),
|
|
10
|
+
text: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export const WikiQuerySchema = z.object({ query: z.string() });
|
|
13
|
+
export const WikiPageGetSchema = z.object({ slug: z.string() });
|
|
14
|
+
export const ApprovalPendingSchema = z.object({ sessionId: z.string().optional() });
|
|
15
|
+
export const ApprovalDecideSchema = z.object({
|
|
16
|
+
toolCallId: z.string(),
|
|
17
|
+
decision: z.enum(['allow', 'deny']),
|
|
18
|
+
});
|
|
19
|
+
export const ToolRegistrySchema = z.object({});
|
|
20
|
+
export const ProviderListSchema = z.object({});
|
|
21
|
+
export const ConfigGetSchema = z.object({ key: z.string() });
|
|
22
|
+
export const ConfigSetSchema = z.object({ key: z.string(), value: z.unknown() });
|
|
23
|
+
export const Method = {
|
|
24
|
+
SESSION_LIST: 'session.list',
|
|
25
|
+
SESSION_GET: 'session.get',
|
|
26
|
+
SESSION_SEND: 'session.send',
|
|
27
|
+
SESSION_CANCEL: 'session.cancel',
|
|
28
|
+
SESSION_RESUME: 'session.resume',
|
|
29
|
+
ORCHESTRA_PANES: 'orchestra.panes',
|
|
30
|
+
ORCHESTRA_BROADCAST: 'orchestra.broadcast',
|
|
31
|
+
WIKI_QUERY: 'wiki.query',
|
|
32
|
+
WIKI_PAGE_GET: 'wiki.page.get',
|
|
33
|
+
APPROVAL_PENDING: 'approval.pending',
|
|
34
|
+
APPROVAL_DECIDE: 'approval.decide',
|
|
35
|
+
TOOL_REGISTRY: 'tool.registry',
|
|
36
|
+
PROVIDER_LIST: 'provider.list',
|
|
37
|
+
CONFIG_GET: 'config.get',
|
|
38
|
+
CONFIG_SET: 'config.set',
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/methods.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ToolSchemaSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"object">;
|
|
4
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
5
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
additionalProperties: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
type: "object";
|
|
9
|
+
properties: Record<string, unknown>;
|
|
10
|
+
required?: string[] | undefined;
|
|
11
|
+
additionalProperties?: boolean | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
type: "object";
|
|
14
|
+
properties: Record<string, unknown>;
|
|
15
|
+
required?: string[] | undefined;
|
|
16
|
+
additionalProperties?: boolean | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ToolDefinitionSchema: z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
inputSchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"object">;
|
|
23
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
24
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
additionalProperties: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
type: "object";
|
|
28
|
+
properties: Record<string, unknown>;
|
|
29
|
+
required?: string[] | undefined;
|
|
30
|
+
additionalProperties?: boolean | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
type: "object";
|
|
33
|
+
properties: Record<string, unknown>;
|
|
34
|
+
required?: string[] | undefined;
|
|
35
|
+
additionalProperties?: boolean | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object";
|
|
42
|
+
properties: Record<string, unknown>;
|
|
43
|
+
required?: string[] | undefined;
|
|
44
|
+
additionalProperties?: boolean | undefined;
|
|
45
|
+
};
|
|
46
|
+
}, {
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: "object";
|
|
51
|
+
properties: Record<string, unknown>;
|
|
52
|
+
required?: string[] | undefined;
|
|
53
|
+
additionalProperties?: boolean | undefined;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
export type ToolDefinition = z.infer<typeof ToolDefinitionSchema>;
|
|
57
|
+
export declare const ToolCallSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
input: Record<string, unknown>;
|
|
65
|
+
}, {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
input: Record<string, unknown>;
|
|
69
|
+
}>;
|
|
70
|
+
export type ToolCall = z.infer<typeof ToolCallSchema>;
|
|
71
|
+
export declare const ToolResultSchema: z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
output: z.ZodUnknown;
|
|
74
|
+
error: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
id: string;
|
|
77
|
+
output?: unknown;
|
|
78
|
+
error?: string | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
id: string;
|
|
81
|
+
output?: unknown;
|
|
82
|
+
error?: string | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
export type ToolResult = z.infer<typeof ToolResultSchema>;
|
|
85
|
+
//# sourceMappingURL=tool-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-schemas.d.ts","sourceRoot":"","sources":["../../src/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc;;;;;;;;;;;;EAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const ToolSchemaSchema = z.object({
|
|
3
|
+
type: z.literal('object'),
|
|
4
|
+
properties: z.record(z.string(), z.unknown()),
|
|
5
|
+
required: z.array(z.string()).optional(),
|
|
6
|
+
additionalProperties: z.boolean().optional(),
|
|
7
|
+
});
|
|
8
|
+
export const ToolDefinitionSchema = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
description: z.string(),
|
|
11
|
+
inputSchema: ToolSchemaSchema,
|
|
12
|
+
});
|
|
13
|
+
export const ToolCallSchema = z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
name: z.string(),
|
|
16
|
+
input: z.record(z.string(), z.unknown()),
|
|
17
|
+
});
|
|
18
|
+
export const ToolResultSchema = z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
output: z.unknown(),
|
|
21
|
+
error: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=tool-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-schemas.js","sourceRoot":"","sources":["../../src/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,gBAAgB;CAC9B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;CACzC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hopper-agent/protocol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/src/index.js",
|
|
9
|
+
"types": "./dist/src/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/src/index.js",
|
|
13
|
+
"types": "./dist/src/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"zod": "^3.25.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^22.0.0",
|
|
21
|
+
"typescript": "^5.9.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc --project tsconfig.json",
|
|
25
|
+
"dev": "tsc --watch --project tsconfig.json",
|
|
26
|
+
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
27
|
+
"lint": "eslint src/",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"clean": "npx rimraf dist"
|
|
30
|
+
}
|
|
31
|
+
}
|