@otto-code/protocol 0.5.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 +12 -0
- package/dist/agent-attention-notification.d.ts +41 -0
- package/dist/agent-attention-notification.js +140 -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-personalities.d.ts +32 -0
- package/dist/agent-personalities.js +69 -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 +479 -0
- package/dist/agent-types.js +22 -0
- package/dist/artifacts/rpc-schemas.d.ts +396 -0
- package/dist/artifacts/rpc-schemas.js +175 -0
- package/dist/artifacts/types.d.ts +166 -0
- package/dist/artifacts/types.js +73 -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 +50 -0
- package/dist/binary-frames/file-transfer.js +107 -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 +31 -0
- package/dist/binary-frames/terminal.js +99 -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 +1329 -0
- package/dist/browser-automation/rpc-schemas.js +555 -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 +8 -0
- package/dist/client-capabilities.js +16 -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/default-personalities.d.ts +3 -0
- package/dist/default-personalities.js +127 -0
- package/dist/effort.d.ts +32 -0
- package/dist/effort.js +99 -0
- package/dist/error-utils.d.ts +11 -0
- package/dist/error-utils.js +27 -0
- package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
- package/dist/generated/validation/ws-outbound.aot.js +48755 -0
- package/dist/git-hosting.d.ts +21 -0
- package/dist/git-hosting.js +36 -0
- package/dist/git-remote.d.ts +18 -0
- package/dist/git-remote.js +84 -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 +38505 -0
- package/dist/messages.js +4719 -0
- package/dist/otto-config-schema.d.ts +136 -0
- package/dist/otto-config-schema.js +96 -0
- package/dist/path-utils.d.ts +2 -0
- package/dist/path-utils.js +16 -0
- package/dist/provider-config.d.ts +266 -0
- package/dist/provider-config.js +238 -0
- package/dist/provider-icon-names.d.ts +5 -0
- package/dist/provider-icon-names.js +52 -0
- package/dist/provider-manifest.d.ts +34 -0
- package/dist/provider-manifest.js +227 -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 +667 -0
- package/dist/schedule/rpc-schemas.js +155 -0
- package/dist/schedule/types.d.ts +236 -0
- package/dist/schedule/types.js +84 -0
- package/dist/terminal-activity.d.ts +21 -0
- package/dist/terminal-activity.js +25 -0
- package/dist/terminal-input-mode.d.ts +26 -0
- package/dist/terminal-input-mode.js +151 -0
- package/dist/terminal-key-input.d.ts +13 -0
- package/dist/terminal-key-input.js +201 -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 +7256 -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 +42 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GitHostingProviderIdSchema: z.ZodEnum<{
|
|
3
|
+
github: "github";
|
|
4
|
+
"bitbucket-cloud": "bitbucket-cloud";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const GitHostingProviderIdWireSchema: z.ZodString;
|
|
7
|
+
export declare const GitHostingCapabilitiesSchema: z.ZodObject<{
|
|
8
|
+
autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
mergeQueue: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
checkAnnotations: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
checkDetails: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
|
+
draftPrs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
13
|
+
reviewDecisions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
14
|
+
issues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type GitHostingProviderId = z.infer<typeof GitHostingProviderIdSchema>;
|
|
17
|
+
export type GitHostingCapabilities = z.infer<typeof GitHostingCapabilitiesSchema>;
|
|
18
|
+
export declare const GIT_HOSTING_PROVIDER_IDS: ("github" | "bitbucket-cloud")[];
|
|
19
|
+
export declare function isGitHostingProviderId(value: unknown): value is GitHostingProviderId;
|
|
20
|
+
export declare function normalizeGitHostingProviderId(value: string | null | undefined): GitHostingProviderId | null;
|
|
21
|
+
//# sourceMappingURL=git-hosting.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Git hosting providers ────────────────────────────────────────────────
|
|
3
|
+
// A project's git hosting provider (GitHub, Bitbucket Cloud, ...) is chosen
|
|
4
|
+
// per project in otto.json; all PR/issue functionality follows that choice.
|
|
5
|
+
// Shared by messages.ts (wire schemas) and otto-config-schema.ts (project
|
|
6
|
+
// config) — lives here to avoid a module cycle between those two.
|
|
7
|
+
export const GitHostingProviderIdSchema = z.enum(["github", "bitbucket-cloud"]);
|
|
8
|
+
// Wire form of the provider id. Deliberately an OPEN string, not the enum, so a
|
|
9
|
+
// newer peer that adds a third provider (e.g. "gitlab") never makes an older
|
|
10
|
+
// peer's validator drop the whole message. Consumers normalize to the known set
|
|
11
|
+
// with normalizeGitHostingProviderId (mirrors normalizePersonalityRoles) and
|
|
12
|
+
// degrade gracefully for unknown ids. Keep the enum for otto.json config and the
|
|
13
|
+
// GIT_HOSTING_PROVIDER_IDS known-set.
|
|
14
|
+
export const GitHostingProviderIdWireSchema = z.string();
|
|
15
|
+
// What a provider can do. The client renders only capability-true actions —
|
|
16
|
+
// no emulation of missing features (feature contract).
|
|
17
|
+
export const GitHostingCapabilitiesSchema = z.object({
|
|
18
|
+
autoMerge: z.boolean().optional().default(false),
|
|
19
|
+
mergeQueue: z.boolean().optional().default(false),
|
|
20
|
+
checkAnnotations: z.boolean().optional().default(false),
|
|
21
|
+
checkDetails: z.boolean().optional().default(false),
|
|
22
|
+
draftPrs: z.boolean().optional().default(false),
|
|
23
|
+
reviewDecisions: z.boolean().optional().default(false),
|
|
24
|
+
issues: z.boolean().optional().default(false),
|
|
25
|
+
});
|
|
26
|
+
export const GIT_HOSTING_PROVIDER_IDS = GitHostingProviderIdSchema.options;
|
|
27
|
+
export function isGitHostingProviderId(value) {
|
|
28
|
+
return GitHostingProviderIdSchema.safeParse(value).success;
|
|
29
|
+
}
|
|
30
|
+
// Narrow an open wire provider id to the known set, or null when it's a provider
|
|
31
|
+
// this build doesn't recognize (a message from a newer peer). Callers render a
|
|
32
|
+
// neutral fallback for null rather than dropping the message.
|
|
33
|
+
export function normalizeGitHostingProviderId(value) {
|
|
34
|
+
return isGitHostingProviderId(value) ? value : null;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=git-hosting.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface GitRemoteLocation {
|
|
2
|
+
transport: "scp" | "ssh" | "http" | "https";
|
|
3
|
+
host: string;
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GitHubRemoteIdentity {
|
|
7
|
+
owner: string;
|
|
8
|
+
name: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseGitHubRemoteUrl(remoteUrl: string): GitHubRemoteIdentity | null;
|
|
12
|
+
export declare function isBitbucketCloudHost(host: string): boolean;
|
|
13
|
+
export declare function parseBitbucketCloudRemoteUrl(remoteUrl: string): GitHubRemoteIdentity | null;
|
|
14
|
+
export declare function parseGitRemoteLocation(remoteUrl: string): GitRemoteLocation | null;
|
|
15
|
+
export declare function parseGitHubRemoteIdentity(path: string): GitHubRemoteIdentity | null;
|
|
16
|
+
export declare function isGitHubHost(host: string): boolean;
|
|
17
|
+
export declare function normalizeHost(host: string): string;
|
|
18
|
+
//# sourceMappingURL=git-remote.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const GITHUB_HOSTS = new Set(["github.com", "ssh.github.com"]);
|
|
2
|
+
const BITBUCKET_CLOUD_HOSTS = new Set(["bitbucket.org", "altssh.bitbucket.org"]);
|
|
3
|
+
const TRANSPORT_BY_PROTOCOL = {
|
|
4
|
+
"https:": "https",
|
|
5
|
+
"http:": "http",
|
|
6
|
+
"ssh:": "ssh",
|
|
7
|
+
};
|
|
8
|
+
export function parseGitHubRemoteUrl(remoteUrl) {
|
|
9
|
+
const location = parseGitRemoteLocation(remoteUrl);
|
|
10
|
+
if (!location || !isGitHubHost(location.host))
|
|
11
|
+
return null;
|
|
12
|
+
return parseGitHubRemoteIdentity(location.path);
|
|
13
|
+
}
|
|
14
|
+
export function isBitbucketCloudHost(host) {
|
|
15
|
+
return BITBUCKET_CLOUD_HOSTS.has(host);
|
|
16
|
+
}
|
|
17
|
+
// Bitbucket Cloud remotes share GitHub's two-segment workspace/repo shape, so
|
|
18
|
+
// identity parsing is common; only host classification differs.
|
|
19
|
+
export function parseBitbucketCloudRemoteUrl(remoteUrl) {
|
|
20
|
+
const location = parseGitRemoteLocation(remoteUrl);
|
|
21
|
+
if (!location || !isBitbucketCloudHost(location.host))
|
|
22
|
+
return null;
|
|
23
|
+
return parseGitHubRemoteIdentity(location.path);
|
|
24
|
+
}
|
|
25
|
+
export function parseGitRemoteLocation(remoteUrl) {
|
|
26
|
+
const trimmed = remoteUrl.trim();
|
|
27
|
+
if (!trimmed)
|
|
28
|
+
return null;
|
|
29
|
+
const scpLike = trimmed.match(/^[^@]+@([^:]+):(.+)$/u);
|
|
30
|
+
if (scpLike) {
|
|
31
|
+
const host = normalizeHost(scpLike[1] ?? "");
|
|
32
|
+
const path = normalizeRemotePath(scpLike[2] ?? "");
|
|
33
|
+
if (!isValidRemoteHost(host) || !path)
|
|
34
|
+
return null;
|
|
35
|
+
return { transport: "scp", host, path };
|
|
36
|
+
}
|
|
37
|
+
let parsed;
|
|
38
|
+
try {
|
|
39
|
+
parsed = new URL(trimmed);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const transport = TRANSPORT_BY_PROTOCOL[parsed.protocol.toLowerCase()];
|
|
45
|
+
if (!transport)
|
|
46
|
+
return null;
|
|
47
|
+
const host = normalizeHost(parsed.hostname);
|
|
48
|
+
let path;
|
|
49
|
+
try {
|
|
50
|
+
path = decodeURIComponent(parsed.pathname);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const normalizedPath = normalizeRemotePath(path);
|
|
56
|
+
if (!isValidRemoteHost(host) || !normalizedPath)
|
|
57
|
+
return null;
|
|
58
|
+
return { transport, host, path: normalizedPath };
|
|
59
|
+
}
|
|
60
|
+
export function parseGitHubRemoteIdentity(path) {
|
|
61
|
+
const segments = path.split("/").filter(Boolean);
|
|
62
|
+
if (segments.length !== 2)
|
|
63
|
+
return null;
|
|
64
|
+
const [owner, name] = segments;
|
|
65
|
+
if (!owner || !name)
|
|
66
|
+
return null;
|
|
67
|
+
return { owner, name, repo: `${owner}/${name}` };
|
|
68
|
+
}
|
|
69
|
+
export function isGitHubHost(host) {
|
|
70
|
+
return GITHUB_HOSTS.has(host);
|
|
71
|
+
}
|
|
72
|
+
export function normalizeHost(host) {
|
|
73
|
+
return host.trim().replace(/\.+$/u, "").toLowerCase();
|
|
74
|
+
}
|
|
75
|
+
function normalizeRemotePath(path) {
|
|
76
|
+
let normalized = path.trim().replace(/^\/+|\/+$/gu, "");
|
|
77
|
+
if (normalized.endsWith(".git"))
|
|
78
|
+
normalized = normalized.slice(0, -4);
|
|
79
|
+
return normalized || null;
|
|
80
|
+
}
|
|
81
|
+
function isValidRemoteHost(host) {
|
|
82
|
+
return /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/u.test(host);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=git-remote.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DirectTcpHostConnectionSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodLiteral<"directTcp">;
|
|
5
|
+
endpoint: z.ZodString;
|
|
6
|
+
useTls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
+
password: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type DirectTcpHostConnection = z.input<typeof DirectTcpHostConnectionSchema>;
|
|
10
|
+
export type NormalizedDirectTcpHostConnection = z.output<typeof DirectTcpHostConnectionSchema>;
|
|
11
|
+
//# sourceMappingURL=host-connection-schema.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const DirectTcpHostConnectionSchema = z.object({
|
|
3
|
+
id: z.string(),
|
|
4
|
+
type: z.literal("directTcp"),
|
|
5
|
+
endpoint: z.string(),
|
|
6
|
+
useTls: z.boolean().optional().default(false),
|
|
7
|
+
password: z.string().optional(),
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=host-connection-schema.js.map
|