@otto-code/protocol 0.7.5 → 0.8.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.
Files changed (66) hide show
  1. package/dist/agent-attention-notification.d.ts +2 -0
  2. package/dist/agent-attention-notification.js +2 -1
  3. package/dist/agent-deep-link.d.ts +8 -0
  4. package/dist/agent-deep-link.js +49 -0
  5. package/dist/agent-labels.js +4 -4
  6. package/dist/agent-personalities.d.ts +2 -2
  7. package/dist/agent-personalities.js +17 -17
  8. package/dist/agent-teams.d.ts +4 -4
  9. package/dist/agent-teams.js +5 -5
  10. package/dist/agent-types.d.ts +12 -10
  11. package/dist/agent-types.js +1 -1
  12. package/dist/artifacts/rpc-schemas.js +4 -4
  13. package/dist/artifacts/types.js +3 -3
  14. package/dist/binary-frames/file-transfer.d.ts +1 -0
  15. package/dist/binary-frames/file-transfer.js +1 -0
  16. package/dist/browser-automation/rpc-schemas.js +1 -1
  17. package/dist/client-capabilities.d.ts +3 -0
  18. package/dist/client-capabilities.js +9 -0
  19. package/dist/daemon-endpoints.d.ts +1 -1
  20. package/dist/default-personalities.js +11 -11
  21. package/dist/effort.d.ts +1 -1
  22. package/dist/effort.js +2 -2
  23. package/dist/forge-manifest.d.ts +66 -0
  24. package/dist/forge-manifest.js +92 -0
  25. package/dist/generated/validation/ws-outbound.aot.js +77653 -51519
  26. package/dist/git-hosting.js +3 -3
  27. package/dist/git-remote.d.ts +17 -0
  28. package/dist/git-remote.js +23 -2
  29. package/dist/judge-verdict.d.ts +1 -1
  30. package/dist/judge-verdict.js +2 -2
  31. package/dist/messages.d.ts +10634 -135
  32. package/dist/messages.js +1744 -193
  33. package/dist/model-tiers.d.ts +3 -3
  34. package/dist/model-tiers.js +4 -4
  35. package/dist/observed-subagent-title.d.ts +2 -2
  36. package/dist/observed-subagent-title.js +4 -4
  37. package/dist/orchestration.d.ts +3 -3
  38. package/dist/orchestration.js +32 -32
  39. package/dist/otto-config-schema.d.ts +21 -0
  40. package/dist/otto-config-schema.js +23 -1
  41. package/dist/provider-config.d.ts +92 -3
  42. package/dist/provider-config.js +58 -6
  43. package/dist/provider-manifest.d.ts +11 -1
  44. package/dist/provider-manifest.js +53 -5
  45. package/dist/schedule/cadence.d.ts +6 -0
  46. package/dist/schedule/cadence.js +28 -0
  47. package/dist/schedule/rpc-schemas.d.ts +4 -4
  48. package/dist/schedule/rpc-schemas.js +1 -1
  49. package/dist/schedule/types.d.ts +1 -1
  50. package/dist/schedule/types.js +3 -3
  51. package/dist/tool-call-display.d.ts +1 -1
  52. package/dist/tool-call-display.js +3 -3
  53. package/dist/tool-name-normalization.d.ts +2 -2
  54. package/dist/tool-name-normalization.js +2 -2
  55. package/dist/validation/ws-outbound-schema-metadata.d.ts +1950 -52
  56. package/dist/widgets/bridge.d.ts +5 -5
  57. package/dist/widgets/bridge.js +5 -5
  58. package/dist/widgets/document.d.ts +1 -1
  59. package/dist/widgets/document.js +4 -4
  60. package/dist/widgets/icons.d.ts +1 -1
  61. package/dist/widgets/icons.js +1 -1
  62. package/dist/widgets/theme.d.ts +2 -2
  63. package/dist/widgets/theme.js +2 -2
  64. package/dist/widgets/types.d.ts +5 -5
  65. package/dist/widgets/types.js +5 -5
  66. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  // A project's git hosting provider (GitHub, Bitbucket Cloud, ...) is chosen
4
4
  // per project in otto.json; all PR/issue functionality follows that choice.
5
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.
6
+ // config) - lives here to avoid a module cycle between those two.
7
7
  export const GitHostingProviderIdSchema = z.enum(["github", "bitbucket-cloud"]);
8
8
  // Wire form of the provider id. Deliberately an OPEN string, not the enum, so a
9
9
  // newer peer that adds a third provider (e.g. "gitlab") never makes an older
@@ -12,7 +12,7 @@ export const GitHostingProviderIdSchema = z.enum(["github", "bitbucket-cloud"]);
12
12
  // degrade gracefully for unknown ids. Keep the enum for otto.json config and the
13
13
  // GIT_HOSTING_PROVIDER_IDS known-set.
14
14
  export const GitHostingProviderIdWireSchema = z.string();
15
- // What a provider can do. The client renders only capability-true actions
15
+ // What a provider can do. The client renders only capability-true actions -
16
16
  // no emulation of missing features (feature contract).
17
17
  export const GitHostingCapabilitiesSchema = z.object({
18
18
  autoMerge: z.boolean().optional().default(false),
@@ -23,7 +23,7 @@ export const GitHostingCapabilitiesSchema = z.object({
23
23
  reviewDecisions: z.boolean().optional().default(false),
24
24
  issues: z.boolean().optional().default(false),
25
25
  // COMPAT(projectScaffold): added in v0.6.9. Repository-level operations used
26
- // by the New project page enumerate the repos/owners you can reach, and
26
+ // by the New project page - enumerate the repos/owners you can reach, and
27
27
  // create a brand-new remote repository. Absent on older daemons, which is
28
28
  // read as "can't", so the page hides those choices rather than emulating them.
29
29
  listRepositories: z.boolean().optional().default(false),
@@ -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
@@ -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
- const scpLike = trimmed.match(/^[^@]+@([^:]+):(.+)$/u);
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
- return { transport, host, path: normalizedPath };
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
@@ -4,7 +4,7 @@ export type JudgeOutcome = (typeof JUDGE_OUTCOMES)[number];
4
4
  export declare function isJudgeOutcome(value: string): value is JudgeOutcome;
5
5
  /**
6
6
  * Coerce a raw verdict string to a known outcome. Anything that isn't an exact
7
- * known outcome is treated as `"fail"` an unparseable verdict must not be read
7
+ * known outcome is treated as `"fail"` - an unparseable verdict must not be read
8
8
  * as a pass, so a gate never advances on a value it doesn't understand.
9
9
  */
10
10
  export declare function normalizeJudgeOutcome(value: string | undefined): JudgeOutcome;
@@ -10,7 +10,7 @@ import { z } from "zod";
10
10
  // Wire-forward-compat: kept a pure structural schema with plain leaves (no
11
11
  // transforms), so it can later ride a protocol message without breaking older
12
12
  // peers. The outcome rides as a plain string (like personality roles and effort
13
- // levels) rather than a z.enum, so the vocabulary can grow consumers normalize
13
+ // levels) rather than a z.enum, so the vocabulary can grow - consumers normalize
14
14
  // through `isJudgeOutcome` / `normalizeJudgeOutcome` instead of trusting the raw
15
15
  // value.
16
16
  // The pass/fail decision. Binary is enough for the signature loop-until-N-good
@@ -23,7 +23,7 @@ export function isJudgeOutcome(value) {
23
23
  }
24
24
  /**
25
25
  * Coerce a raw verdict string to a known outcome. Anything that isn't an exact
26
- * known outcome is treated as `"fail"` an unparseable verdict must not be read
26
+ * known outcome is treated as `"fail"` - an unparseable verdict must not be read
27
27
  * as a pass, so a gate never advances on a value it doesn't understand.
28
28
  */
29
29
  export function normalizeJudgeOutcome(value) {