@agentstorm/platform-protocol 0.2.5
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 +671 -0
- package/README.md +12 -0
- package/dist/agent-attention-notification.d.ts +43 -0
- package/dist/agent-attention-notification.js +141 -0
- package/dist/agent-deep-link.d.ts +8 -0
- package/dist/agent-deep-link.js +49 -0
- package/dist/agent-labels.d.ts +7 -0
- package/dist/agent-labels.js +11 -0
- package/dist/agent-lifecycle.d.ts +3 -0
- package/dist/agent-lifecycle.js +8 -0
- package/dist/agent-state-bucket.d.ts +14 -0
- package/dist/agent-state-bucket.js +41 -0
- package/dist/agent-title-limits.d.ts +2 -0
- package/dist/agent-title-limits.js +2 -0
- package/dist/agent-types.d.ts +451 -0
- package/dist/agent-types.js +22 -0
- package/dist/binary-frames/demux.d.ts +11 -0
- package/dist/binary-frames/demux.js +23 -0
- package/dist/binary-frames/file-transfer.d.ts +51 -0
- package/dist/binary-frames/file-transfer.js +108 -0
- package/dist/binary-frames/index.d.ts +4 -0
- package/dist/binary-frames/index.js +4 -0
- package/dist/binary-frames/terminal.d.ts +35 -0
- package/dist/binary-frames/terminal.js +100 -0
- package/dist/branch-slug.d.ts +14 -0
- package/dist/branch-slug.js +49 -0
- package/dist/browser-automation/capabilities.d.ts +7 -0
- package/dist/browser-automation/capabilities.js +31 -0
- package/dist/browser-automation/rpc-schemas.d.ts +1112 -0
- package/dist/browser-automation/rpc-schemas.js +462 -0
- package/dist/chat/rpc-schemas.d.ts +158 -0
- package/dist/chat/rpc-schemas.js +103 -0
- package/dist/chat/types.d.ts +30 -0
- package/dist/chat/types.js +22 -0
- package/dist/client-capabilities.d.ts +11 -0
- package/dist/client-capabilities.js +25 -0
- package/dist/connection-offer.d.ts +36 -0
- package/dist/connection-offer.js +53 -0
- package/dist/daemon-endpoints.d.ts +47 -0
- package/dist/daemon-endpoints.js +201 -0
- package/dist/error-utils.d.ts +11 -0
- package/dist/error-utils.js +27 -0
- package/dist/forge-manifest.d.ts +66 -0
- package/dist/forge-manifest.js +92 -0
- package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
- package/dist/generated/validation/ws-outbound.aot.js +65207 -0
- package/dist/git-remote.d.ts +33 -0
- package/dist/git-remote.js +94 -0
- package/dist/host-connection-schema.d.ts +11 -0
- package/dist/host-connection-schema.js +9 -0
- package/dist/literal-union.d.ts +2 -0
- package/dist/literal-union.js +2 -0
- package/dist/loop/rpc-schemas.d.ts +636 -0
- package/dist/loop/rpc-schemas.js +163 -0
- package/dist/messages.d.ts +40580 -0
- package/dist/messages.js +4999 -0
- package/dist/paseo-config-schema.d.ts +138 -0
- package/dist/paseo-config-schema.js +98 -0
- package/dist/path-utils.d.ts +2 -0
- package/dist/path-utils.js +16 -0
- package/dist/provider-config.d.ts +126 -0
- package/dist/provider-config.js +110 -0
- package/dist/provider-icon-names.d.ts +5 -0
- package/dist/provider-icon-names.js +52 -0
- package/dist/provider-manifest.d.ts +35 -0
- package/dist/provider-manifest.js +254 -0
- package/dist/schedule/cadence.d.ts +6 -0
- package/dist/schedule/cadence.js +28 -0
- package/dist/schedule/cron-expression.d.ts +13 -0
- package/dist/schedule/cron-expression.js +97 -0
- package/dist/schedule/rpc-schemas.d.ts +624 -0
- package/dist/schedule/rpc-schemas.js +155 -0
- package/dist/schedule/types.d.ts +222 -0
- package/dist/schedule/types.js +78 -0
- package/dist/terminal-activity.d.ts +21 -0
- package/dist/terminal-activity.js +25 -0
- package/dist/terminal-input-mode.d.ts +30 -0
- package/dist/terminal-input-mode.js +180 -0
- package/dist/terminal-key-input.d.ts +13 -0
- package/dist/terminal-key-input.js +210 -0
- package/dist/terminal-profiles.d.ts +6 -0
- package/dist/terminal-profiles.js +28 -0
- package/dist/terminal-snapshot.d.ts +3 -0
- package/dist/terminal-snapshot.js +178 -0
- package/dist/terminal-stream-protocol.d.ts +2 -0
- package/dist/terminal-stream-protocol.js +2 -0
- package/dist/terminal-subscription-key.d.ts +2 -0
- package/dist/terminal-subscription-key.js +9 -0
- package/dist/tool-call-display.d.ts +11 -0
- package/dist/tool-call-display.js +135 -0
- package/dist/tool-name-normalization.d.ts +9 -0
- package/dist/tool-name-normalization.js +82 -0
- package/dist/validation/ws-outbound-schema-metadata.d.ts +7570 -0
- package/dist/validation/ws-outbound-schema-metadata.js +3 -0
- package/dist/validation/ws-outbound.d.ts +12 -0
- package/dist/validation/ws-outbound.js +8 -0
- package/package.json +32 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TerminalStateSchema } from "../messages.js";
|
|
3
|
+
export declare const TerminalStreamResizeSchema: z.ZodObject<{
|
|
4
|
+
rows: z.ZodNumber;
|
|
5
|
+
cols: z.ZodNumber;
|
|
6
|
+
intent: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
claim: "claim";
|
|
8
|
+
update: "update";
|
|
9
|
+
}>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const TerminalStreamOpcode: {
|
|
12
|
+
readonly Output: 1;
|
|
13
|
+
readonly Input: 2;
|
|
14
|
+
readonly Resize: 3;
|
|
15
|
+
readonly Snapshot: 4;
|
|
16
|
+
readonly Restore: 5;
|
|
17
|
+
};
|
|
18
|
+
export type TerminalStreamOpcode = (typeof TerminalStreamOpcode)[keyof typeof TerminalStreamOpcode];
|
|
19
|
+
export interface TerminalStreamFrame {
|
|
20
|
+
opcode: TerminalStreamOpcode;
|
|
21
|
+
slot: number;
|
|
22
|
+
payload: Uint8Array;
|
|
23
|
+
}
|
|
24
|
+
export declare function asUint8Array(data: unknown): Uint8Array | null;
|
|
25
|
+
export declare function encodeTerminalStreamFrame(input: {
|
|
26
|
+
opcode: TerminalStreamOpcode;
|
|
27
|
+
slot: number;
|
|
28
|
+
payload?: Uint8Array | ArrayBuffer | string;
|
|
29
|
+
}): Uint8Array;
|
|
30
|
+
export declare function decodeTerminalStreamFrame(bytes: Uint8Array): TerminalStreamFrame | null;
|
|
31
|
+
export declare function encodeTerminalSnapshotPayload(state: z.infer<typeof TerminalStateSchema>): Uint8Array;
|
|
32
|
+
export declare function decodeTerminalSnapshotPayload(bytes: Uint8Array): z.infer<typeof TerminalStateSchema> | null;
|
|
33
|
+
export declare function encodeTerminalResizePayload(input: z.infer<typeof TerminalStreamResizeSchema>): Uint8Array;
|
|
34
|
+
export declare function decodeTerminalResizePayload(bytes: Uint8Array): z.infer<typeof TerminalStreamResizeSchema> | null;
|
|
35
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TerminalStateSchema } from "../messages.js";
|
|
3
|
+
export const TerminalStreamResizeSchema = z.object({
|
|
4
|
+
rows: z.number().int().positive(),
|
|
5
|
+
cols: z.number().int().positive(),
|
|
6
|
+
intent: z.enum(["claim", "update"]).optional(),
|
|
7
|
+
});
|
|
8
|
+
export const TerminalStreamOpcode = {
|
|
9
|
+
Output: 0x01,
|
|
10
|
+
Input: 0x02,
|
|
11
|
+
Resize: 0x03,
|
|
12
|
+
Snapshot: 0x04,
|
|
13
|
+
Restore: 0x05,
|
|
14
|
+
};
|
|
15
|
+
export function asUint8Array(data) {
|
|
16
|
+
if (typeof data === "string") {
|
|
17
|
+
if (typeof TextEncoder !== "undefined") {
|
|
18
|
+
return new TextEncoder().encode(data);
|
|
19
|
+
}
|
|
20
|
+
if (typeof Buffer !== "undefined") {
|
|
21
|
+
return new Uint8Array(Buffer.from(data, "utf8"));
|
|
22
|
+
}
|
|
23
|
+
const out = new Uint8Array(data.length);
|
|
24
|
+
for (let index = 0; index < data.length; index += 1) {
|
|
25
|
+
out[index] = data.charCodeAt(index) & 0xff;
|
|
26
|
+
}
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
if (data instanceof Uint8Array) {
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
if (typeof ArrayBuffer !== "undefined" && data instanceof ArrayBuffer) {
|
|
33
|
+
return new Uint8Array(data);
|
|
34
|
+
}
|
|
35
|
+
if (ArrayBuffer.isView(data)) {
|
|
36
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
37
|
+
}
|
|
38
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(data)) {
|
|
39
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
function isTerminalStreamOpcode(value) {
|
|
44
|
+
return (value === TerminalStreamOpcode.Output ||
|
|
45
|
+
value === TerminalStreamOpcode.Input ||
|
|
46
|
+
value === TerminalStreamOpcode.Resize ||
|
|
47
|
+
value === TerminalStreamOpcode.Snapshot ||
|
|
48
|
+
value === TerminalStreamOpcode.Restore);
|
|
49
|
+
}
|
|
50
|
+
export function encodeTerminalStreamFrame(input) {
|
|
51
|
+
const payload = asUint8Array(input.payload ?? new Uint8Array(0)) ?? new Uint8Array(0);
|
|
52
|
+
const bytes = new Uint8Array(2 + payload.byteLength);
|
|
53
|
+
bytes[0] = input.opcode;
|
|
54
|
+
bytes[1] = input.slot & 0xff;
|
|
55
|
+
bytes.set(payload, 2);
|
|
56
|
+
return bytes;
|
|
57
|
+
}
|
|
58
|
+
export function decodeTerminalStreamFrame(bytes) {
|
|
59
|
+
if (bytes.byteLength < 2) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const opcode = bytes[0];
|
|
63
|
+
if (!isTerminalStreamOpcode(opcode)) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
opcode,
|
|
68
|
+
slot: bytes[1],
|
|
69
|
+
payload: bytes.subarray(2),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function encodeTerminalSnapshotPayload(state) {
|
|
73
|
+
return encodeJsonPayload(state);
|
|
74
|
+
}
|
|
75
|
+
export function decodeTerminalSnapshotPayload(bytes) {
|
|
76
|
+
const parsed = decodeJsonPayload(bytes);
|
|
77
|
+
const result = TerminalStateSchema.safeParse(parsed);
|
|
78
|
+
return result.success ? result.data : null;
|
|
79
|
+
}
|
|
80
|
+
export function encodeTerminalResizePayload(input) {
|
|
81
|
+
return encodeJsonPayload(input);
|
|
82
|
+
}
|
|
83
|
+
export function decodeTerminalResizePayload(bytes) {
|
|
84
|
+
const parsed = decodeJsonPayload(bytes);
|
|
85
|
+
const result = TerminalStreamResizeSchema.safeParse(parsed);
|
|
86
|
+
return result.success ? result.data : null;
|
|
87
|
+
}
|
|
88
|
+
function encodeJsonPayload(value) {
|
|
89
|
+
return new TextEncoder().encode(JSON.stringify(value));
|
|
90
|
+
}
|
|
91
|
+
function decodeJsonPayload(bytes) {
|
|
92
|
+
try {
|
|
93
|
+
const text = new TextDecoder().decode(bytes);
|
|
94
|
+
return JSON.parse(text);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate that a string is a valid git branch name slug.
|
|
3
|
+
* Must be lowercase alphanumeric with hyphens and forward slashes only.
|
|
4
|
+
*/
|
|
5
|
+
export declare function validateBranchSlug(slug: string): {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const MAX_SLUG_LENGTH = 50;
|
|
10
|
+
/**
|
|
11
|
+
* Convert a string to kebab-case for branch names.
|
|
12
|
+
*/
|
|
13
|
+
export declare function slugify(input: string): string;
|
|
14
|
+
//# sourceMappingURL=branch-slug.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate that a string is a valid git branch name slug.
|
|
3
|
+
* Must be lowercase alphanumeric with hyphens and forward slashes only.
|
|
4
|
+
*/
|
|
5
|
+
export function validateBranchSlug(slug) {
|
|
6
|
+
if (!slug || slug.length === 0) {
|
|
7
|
+
return { valid: false, error: "Branch name cannot be empty" };
|
|
8
|
+
}
|
|
9
|
+
if (slug.length > 100) {
|
|
10
|
+
return { valid: false, error: "Branch name too long (max 100 characters)" };
|
|
11
|
+
}
|
|
12
|
+
const validPattern = /^[a-z0-9-/]+$/;
|
|
13
|
+
if (!validPattern.test(slug)) {
|
|
14
|
+
return {
|
|
15
|
+
valid: false,
|
|
16
|
+
error: "Branch name must contain only lowercase letters, numbers, hyphens, and forward slashes",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
if (slug.startsWith("-") || slug.endsWith("-")) {
|
|
20
|
+
return {
|
|
21
|
+
valid: false,
|
|
22
|
+
error: "Branch name cannot start or end with a hyphen",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (slug.includes("--")) {
|
|
26
|
+
return { valid: false, error: "Branch name cannot have consecutive hyphens" };
|
|
27
|
+
}
|
|
28
|
+
return { valid: true };
|
|
29
|
+
}
|
|
30
|
+
export const MAX_SLUG_LENGTH = 50;
|
|
31
|
+
/**
|
|
32
|
+
* Convert a string to kebab-case for branch names.
|
|
33
|
+
*/
|
|
34
|
+
export function slugify(input) {
|
|
35
|
+
const slug = input
|
|
36
|
+
.toLowerCase()
|
|
37
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
38
|
+
.replace(/^-+|-+$/g, "");
|
|
39
|
+
if (slug.length <= MAX_SLUG_LENGTH) {
|
|
40
|
+
return slug;
|
|
41
|
+
}
|
|
42
|
+
const truncated = slug.slice(0, MAX_SLUG_LENGTH);
|
|
43
|
+
const lastHyphen = truncated.lastIndexOf("-");
|
|
44
|
+
if (lastHyphen > MAX_SLUG_LENGTH / 2) {
|
|
45
|
+
return truncated.slice(0, lastHyphen);
|
|
46
|
+
}
|
|
47
|
+
return truncated.replace(/-+$/, "");
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=branch-slug.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BrowserAutomationHostCapabilitySchema: z.ZodObject<{
|
|
3
|
+
supportedCommands: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<("select" | "type" | "fill" | "logs" | "list_tabs" | "new_tab" | "snapshot" | "click" | "wait" | "keypress" | "navigate" | "back" | "forward" | "reload" | "screenshot" | "upload" | "hover" | "drag" | "evaluate" | "scroll" | "resize" | "close_tab")[], string[]>>;
|
|
4
|
+
hostKind: z.ZodDefault<z.ZodString>;
|
|
5
|
+
}, z.core.$loose>;
|
|
6
|
+
export type BrowserAutomationHostCapability = z.infer<typeof BrowserAutomationHostCapabilitySchema>;
|
|
7
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BROWSER_AUTOMATION_COMMAND_NAMES, } from "./rpc-schemas.js";
|
|
3
|
+
const KNOWN_BROWSER_AUTOMATION_COMMAND_NAMES = new Set(BROWSER_AUTOMATION_COMMAND_NAMES);
|
|
4
|
+
export const BrowserAutomationHostCapabilitySchema = z
|
|
5
|
+
.object({
|
|
6
|
+
supportedCommands: z.array(z.string().min(1)).transform((commands, context) => {
|
|
7
|
+
const supportedCommands = [];
|
|
8
|
+
const seen = new Set();
|
|
9
|
+
for (const command of commands) {
|
|
10
|
+
if (!isKnownBrowserAutomationCommandName(command) || seen.has(command)) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
seen.add(command);
|
|
14
|
+
supportedCommands.push(command);
|
|
15
|
+
}
|
|
16
|
+
if (supportedCommands.length === 0) {
|
|
17
|
+
context.addIssue({
|
|
18
|
+
code: "custom",
|
|
19
|
+
message: "supportedCommands must include at least one known browser automation command",
|
|
20
|
+
});
|
|
21
|
+
return z.NEVER;
|
|
22
|
+
}
|
|
23
|
+
return supportedCommands;
|
|
24
|
+
}),
|
|
25
|
+
hostKind: z.string().min(1).default("browser host"),
|
|
26
|
+
})
|
|
27
|
+
.passthrough();
|
|
28
|
+
function isKnownBrowserAutomationCommandName(value) {
|
|
29
|
+
return KNOWN_BROWSER_AUTOMATION_COMMAND_NAMES.has(value);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=capabilities.js.map
|