@camerontaylor/paseo-protocol 0.11.2-fork.2 → 0.12.0-fork.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/dist/agent-message.d.ts +18 -0
- package/dist/agent-message.js +11 -0
- package/dist/agent-types.d.ts +2 -0
- package/dist/browser-automation/rpc-schemas.d.ts +3 -3
- package/dist/generated/validation/ws-outbound-schema-metadata.d.ts +16984 -0
- package/dist/generated/validation/ws-outbound-schema-metadata.js +246 -0
- package/dist/generated/validation/ws-outbound.aot.d.ts +487 -1
- package/dist/generated/validation/ws-outbound.aot.js +121459 -108058
- package/dist/messages.d.ts +971 -24
- package/dist/messages.js +59 -8
- package/dist/paseo-tool-call-detail.d.ts +1 -14
- package/dist/paseo-tool-call-detail.js +2 -304
- package/dist/paseo-tool-presentation/agent-message.d.ts +10 -0
- package/dist/paseo-tool-presentation/agent-message.js +22 -0
- package/dist/paseo-tool-presentation/catalog.d.ts +309 -0
- package/dist/paseo-tool-presentation/catalog.js +315 -0
- package/dist/paseo-tool-presentation/detail-sections.d.ts +15 -0
- package/dist/paseo-tool-presentation/detail-sections.js +161 -0
- package/dist/paseo-tool-presentation/index.d.ts +22 -0
- package/dist/paseo-tool-presentation/index.js +62 -0
- package/dist/paseo-tool-presentation/summary-text.d.ts +7 -0
- package/dist/paseo-tool-presentation/summary-text.js +22 -0
- package/dist/provider-icon-names.js +4 -0
- package/dist/tool-call-display.d.ts +3 -1
- package/dist/tool-call-display.js +16 -8
- package/dist/validation/ws-outbound-envelope.d.ts +16258 -0
- package/dist/validation/ws-outbound-envelope.js +17 -0
- package/dist/validation/ws-outbound.d.ts +3 -3
- package/dist/validation/ws-outbound.js +34 -4
- package/dist/websocket-message-limit.d.ts +5 -0
- package/dist/websocket-message-limit.js +5 -0
- package/package.json +1 -1
- package/dist/validation/ws-outbound-schema-metadata.d.ts +0 -16062
- package/dist/validation/ws-outbound-schema-metadata.js +0 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SessionOutboundMessageSchema, WSHelloRejectedMessageSchema, WSPongMessageSchema, } from "../messages.js";
|
|
3
|
+
export const sessionOutboundMessageOptions = SessionOutboundMessageSchema.options;
|
|
4
|
+
const [firstSessionTag, ...otherSessionTags] = sessionOutboundMessageOptions.map((option) => z.object({ type: option.shape.type }));
|
|
5
|
+
// WSOutboundMessageSchema with every session message reduced to its tag. It reports the same
|
|
6
|
+
// envelope and discriminator issues, while each session message gets its own generated validator:
|
|
7
|
+
// one function for the whole protocol is large enough that V8's Maglev tier spends hundreds of MB
|
|
8
|
+
// and seconds compiling it.
|
|
9
|
+
export const WSOutboundEnvelopeSchema = z.discriminatedUnion("type", [
|
|
10
|
+
WSPongMessageSchema,
|
|
11
|
+
z.object({
|
|
12
|
+
type: z.literal("session"),
|
|
13
|
+
message: z.discriminatedUnion("type", [firstSessionTag, ...otherSessionTags]),
|
|
14
|
+
}),
|
|
15
|
+
WSHelloRejectedMessageSchema,
|
|
16
|
+
]);
|
|
17
|
+
//# sourceMappingURL=ws-outbound-envelope.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import type { WSOutboundMessage } from "../messages.js";
|
|
3
|
-
type
|
|
3
|
+
type ValidationResult<T> = {
|
|
4
4
|
success: true;
|
|
5
|
-
data:
|
|
5
|
+
data: T;
|
|
6
6
|
} | {
|
|
7
7
|
success: false;
|
|
8
8
|
error: z.ZodError;
|
|
9
9
|
};
|
|
10
|
-
export declare function validateWSOutboundMessage(input: unknown):
|
|
10
|
+
export declare function validateWSOutboundMessage(input: unknown): ValidationResult<WSOutboundMessage>;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=ws-outbound.d.ts.map
|
|
@@ -1,8 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ZodRealError } from "zod";
|
|
2
|
+
import { SessionOutboundMessageValidators, WSOutboundEnvelope, } from "../generated/validation/ws-outbound.aot.js";
|
|
3
|
+
// zod-aot emits runtime JavaScript from the envelope and message schemas but not its TypeScript surface.
|
|
3
4
|
// Protocol regression tests cover the patched compiler cases behind this boundary.
|
|
4
|
-
const
|
|
5
|
+
const envelopeValidator = WSOutboundEnvelope;
|
|
6
|
+
const sessionMessageValidators = SessionOutboundMessageValidators;
|
|
7
|
+
// The message validator reports paths relative to the message, nested issues included.
|
|
8
|
+
function underMessage(issue) {
|
|
9
|
+
const path = ["message", ...issue.path];
|
|
10
|
+
switch (issue.code) {
|
|
11
|
+
case "invalid_union":
|
|
12
|
+
return issue.inclusive === false
|
|
13
|
+
? { ...issue, path }
|
|
14
|
+
: { ...issue, path, errors: issue.errors.map((branch) => branch.map(underMessage)) };
|
|
15
|
+
case "invalid_key":
|
|
16
|
+
case "invalid_element":
|
|
17
|
+
return { ...issue, path, issues: issue.issues.map(underMessage) };
|
|
18
|
+
default:
|
|
19
|
+
return { ...issue, path };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
5
22
|
export function validateWSOutboundMessage(input) {
|
|
6
|
-
|
|
23
|
+
const envelope = envelopeValidator.safeParse(input);
|
|
24
|
+
if (!envelope.success || envelope.data.type !== "session") {
|
|
25
|
+
return envelope;
|
|
26
|
+
}
|
|
27
|
+
const message = envelope.data.message;
|
|
28
|
+
const result = sessionMessageValidators[message.type].safeParse(message);
|
|
29
|
+
if (!result.success) {
|
|
30
|
+
return { success: false, error: new ZodRealError(result.error.issues.map(underMessage)) };
|
|
31
|
+
}
|
|
32
|
+
// Message validators return a new object when they apply defaults.
|
|
33
|
+
if (result.data === message) {
|
|
34
|
+
return envelope;
|
|
35
|
+
}
|
|
36
|
+
return { success: true, data: { ...envelope.data, message: result.data } };
|
|
7
37
|
}
|
|
8
38
|
//# sourceMappingURL=ws-outbound.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Largest WebSocket message the daemon accepts. A bigger one closes the connection with 1009. */
|
|
2
|
+
export declare const MAX_WEBSOCKET_MESSAGE_BYTES: number;
|
|
3
|
+
/** Largest encrypted frame the relay accepts. */
|
|
4
|
+
export declare const MAX_RELAY_WEBSOCKET_MESSAGE_BYTES: number;
|
|
5
|
+
//# sourceMappingURL=websocket-message-limit.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Largest WebSocket message the daemon accepts. A bigger one closes the connection with 1009. */
|
|
2
|
+
export const MAX_WEBSOCKET_MESSAGE_BYTES = 100 * 1024 * 1024;
|
|
3
|
+
/** Largest encrypted frame the relay accepts. */
|
|
4
|
+
export const MAX_RELAY_WEBSOCKET_MESSAGE_BYTES = 32 * 1024 * 1024;
|
|
5
|
+
//# sourceMappingURL=websocket-message-limit.js.map
|