@otto-code/protocol 0.7.5 → 0.7.6
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-attention-notification.d.ts +2 -0
- package/dist/agent-attention-notification.js +1 -0
- package/dist/agent-deep-link.d.ts +8 -0
- package/dist/agent-deep-link.js +49 -0
- package/dist/agent-types.d.ts +2 -0
- package/dist/binary-frames/file-transfer.d.ts +1 -0
- package/dist/binary-frames/file-transfer.js +1 -0
- package/dist/client-capabilities.d.ts +3 -0
- package/dist/client-capabilities.js +9 -0
- package/dist/forge-manifest.d.ts +66 -0
- package/dist/forge-manifest.js +92 -0
- package/dist/generated/validation/ws-outbound.aot.js +66327 -44876
- package/dist/git-remote.d.ts +17 -0
- package/dist/git-remote.js +23 -2
- package/dist/messages.d.ts +8118 -254
- package/dist/messages.js +1120 -24
- package/dist/otto-config-schema.d.ts +21 -0
- package/dist/otto-config-schema.js +22 -0
- package/dist/provider-manifest.d.ts +2 -0
- package/dist/provider-manifest.js +32 -4
- package/dist/schedule/cadence.d.ts +6 -0
- package/dist/schedule/cadence.js +28 -0
- package/dist/validation/ws-outbound-schema-metadata.d.ts +1421 -41
- package/package.json +1 -1
package/dist/git-remote.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export interface GitRemoteLocation {
|
|
2
2
|
transport: "scp" | "ssh" | "http" | "https";
|
|
3
3
|
host: string;
|
|
4
|
+
/**
|
|
5
|
+
* Explicit non-default port from the remote (e.g. a self-hosted forge on
|
|
6
|
+
* `:60443`), or undefined for a default-port or scp-form remote. Kept separate
|
|
7
|
+
* from `host` so host-identity matching (forge detection, cloud-host checks)
|
|
8
|
+
* stays port-agnostic; only consumers that reconstruct a URL (web links) use it.
|
|
9
|
+
*/
|
|
10
|
+
port?: string;
|
|
4
11
|
path: string;
|
|
5
12
|
}
|
|
6
13
|
export interface GitHubRemoteIdentity {
|
|
@@ -15,4 +22,14 @@ export declare function parseGitRemoteLocation(remoteUrl: string): GitRemoteLoca
|
|
|
15
22
|
export declare function parseGitHubRemoteIdentity(path: string): GitHubRemoteIdentity | null;
|
|
16
23
|
export declare function isGitHubHost(host: string): boolean;
|
|
17
24
|
export declare function normalizeHost(host: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether `repo` is already a complete git remote (a URL or scp-like address)
|
|
27
|
+
* rather than `owner/repo` shorthand that still needs a clone protocol picked.
|
|
28
|
+
*
|
|
29
|
+
* Clients (app + CLI) and the daemon must agree on this classification: the
|
|
30
|
+
* daemon treats `parseGitRemoteLocation(repo) !== null` as "complete remote"
|
|
31
|
+
* and everything else as shorthand, so reuse the same parser here instead of a
|
|
32
|
+
* separate regex that would drift (e.g. accepting `git://` the parser rejects).
|
|
33
|
+
*/
|
|
34
|
+
export declare function isCompleteGitRemote(repo: string): boolean;
|
|
18
35
|
//# sourceMappingURL=git-remote.d.ts.map
|
package/dist/git-remote.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
const GITHUB_HOSTS = new Set(["github.com", "ssh.github.com"]);
|
|
2
2
|
const BITBUCKET_CLOUD_HOSTS = new Set(["bitbucket.org", "altssh.bitbucket.org"]);
|
|
3
|
+
const DEFAULT_PORT_BY_PROTOCOL = {
|
|
4
|
+
"https:": "443",
|
|
5
|
+
"http:": "80",
|
|
6
|
+
"ssh:": "22",
|
|
7
|
+
};
|
|
3
8
|
const TRANSPORT_BY_PROTOCOL = {
|
|
4
9
|
"https:": "https",
|
|
5
10
|
"http:": "http",
|
|
@@ -26,7 +31,9 @@ export function parseGitRemoteLocation(remoteUrl) {
|
|
|
26
31
|
const trimmed = remoteUrl.trim();
|
|
27
32
|
if (!trimmed)
|
|
28
33
|
return null;
|
|
29
|
-
|
|
34
|
+
// scp form has no scheme. Testing it first would match `ssh://git@host:22/x`
|
|
35
|
+
// — `[^@]+` happily eats `ssh://git` — and swallow the port into the path.
|
|
36
|
+
const scpLike = trimmed.includes("://") ? null : trimmed.match(/^[^@]+@([^:]+):(.+)$/u);
|
|
30
37
|
if (scpLike) {
|
|
31
38
|
const host = normalizeHost(scpLike[1] ?? "");
|
|
32
39
|
const path = normalizeRemotePath(scpLike[2] ?? "");
|
|
@@ -55,7 +62,9 @@ export function parseGitRemoteLocation(remoteUrl) {
|
|
|
55
62
|
const normalizedPath = normalizeRemotePath(path);
|
|
56
63
|
if (!isValidRemoteHost(host) || !normalizedPath)
|
|
57
64
|
return null;
|
|
58
|
-
|
|
65
|
+
const protocol = parsed.protocol.toLowerCase();
|
|
66
|
+
const port = parsed.port && parsed.port !== DEFAULT_PORT_BY_PROTOCOL[protocol] ? parsed.port : undefined;
|
|
67
|
+
return { transport, host, port, path: normalizedPath };
|
|
59
68
|
}
|
|
60
69
|
export function parseGitHubRemoteIdentity(path) {
|
|
61
70
|
const segments = path.split("/").filter(Boolean);
|
|
@@ -81,4 +90,16 @@ function normalizeRemotePath(path) {
|
|
|
81
90
|
function isValidRemoteHost(host) {
|
|
82
91
|
return /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/u.test(host);
|
|
83
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether `repo` is already a complete git remote (a URL or scp-like address)
|
|
95
|
+
* rather than `owner/repo` shorthand that still needs a clone protocol picked.
|
|
96
|
+
*
|
|
97
|
+
* Clients (app + CLI) and the daemon must agree on this classification: the
|
|
98
|
+
* daemon treats `parseGitRemoteLocation(repo) !== null` as "complete remote"
|
|
99
|
+
* and everything else as shorthand, so reuse the same parser here instead of a
|
|
100
|
+
* separate regex that would drift (e.g. accepting `git://` the parser rejects).
|
|
101
|
+
*/
|
|
102
|
+
export function isCompleteGitRemote(repo) {
|
|
103
|
+
return parseGitRemoteLocation(repo) !== null;
|
|
104
|
+
}
|
|
84
105
|
//# sourceMappingURL=git-remote.js.map
|