@camerontaylor/paseo-protocol 0.8.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.
Files changed (118) hide show
  1. package/README.md +12 -0
  2. package/dist/agent-attention-notification.d.ts +43 -0
  3. package/dist/agent-attention-notification.js +141 -0
  4. package/dist/agent-deep-link.d.ts +8 -0
  5. package/dist/agent-deep-link.js +49 -0
  6. package/dist/agent-labels.d.ts +10 -0
  7. package/dist/agent-labels.js +21 -0
  8. package/dist/agent-lifecycle.d.ts +3 -0
  9. package/dist/agent-lifecycle.js +8 -0
  10. package/dist/agent-state-bucket.d.ts +14 -0
  11. package/dist/agent-state-bucket.js +41 -0
  12. package/dist/agent-title-limits.d.ts +2 -0
  13. package/dist/agent-title-limits.js +2 -0
  14. package/dist/agent-types.d.ts +478 -0
  15. package/dist/agent-types.js +22 -0
  16. package/dist/binary-frames/demux.d.ts +11 -0
  17. package/dist/binary-frames/demux.js +23 -0
  18. package/dist/binary-frames/file-transfer.d.ts +51 -0
  19. package/dist/binary-frames/file-transfer.js +108 -0
  20. package/dist/binary-frames/index.d.ts +4 -0
  21. package/dist/binary-frames/index.js +4 -0
  22. package/dist/binary-frames/terminal.d.ts +35 -0
  23. package/dist/binary-frames/terminal.js +100 -0
  24. package/dist/branch-slug.d.ts +14 -0
  25. package/dist/branch-slug.js +49 -0
  26. package/dist/browser-automation/capabilities.d.ts +7 -0
  27. package/dist/browser-automation/capabilities.js +31 -0
  28. package/dist/browser-automation/rpc-schemas.d.ts +1112 -0
  29. package/dist/browser-automation/rpc-schemas.js +462 -0
  30. package/dist/chat/rpc-schemas.d.ts +158 -0
  31. package/dist/chat/rpc-schemas.js +104 -0
  32. package/dist/chat/types.d.ts +30 -0
  33. package/dist/chat/types.js +23 -0
  34. package/dist/check-traits.d.ts +11 -0
  35. package/dist/check-traits.js +10 -0
  36. package/dist/client-capabilities.d.ts +20 -0
  37. package/dist/client-capabilities.js +47 -0
  38. package/dist/connection-offer.d.ts +36 -0
  39. package/dist/connection-offer.js +53 -0
  40. package/dist/daemon-endpoints.d.ts +47 -0
  41. package/dist/daemon-endpoints.js +201 -0
  42. package/dist/error-utils.d.ts +11 -0
  43. package/dist/error-utils.js +27 -0
  44. package/dist/forge-manifest.d.ts +66 -0
  45. package/dist/forge-manifest.js +92 -0
  46. package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
  47. package/dist/generated/validation/ws-outbound.aot.js +98097 -0
  48. package/dist/git-remote.d.ts +33 -0
  49. package/dist/git-remote.js +94 -0
  50. package/dist/gitea-status.d.ts +10 -0
  51. package/dist/gitea-status.js +23 -0
  52. package/dist/gitlab-pipeline.d.ts +10 -0
  53. package/dist/gitlab-pipeline.js +17 -0
  54. package/dist/host-connection-schema.d.ts +11 -0
  55. package/dist/host-connection-schema.js +9 -0
  56. package/dist/literal-union.d.ts +2 -0
  57. package/dist/literal-union.js +2 -0
  58. package/dist/loop/rpc-schemas.d.ts +636 -0
  59. package/dist/loop/rpc-schemas.js +164 -0
  60. package/dist/messages.d.ts +60742 -0
  61. package/dist/messages.js +6152 -0
  62. package/dist/paseo-config-schema.d.ts +138 -0
  63. package/dist/paseo-config-schema.js +98 -0
  64. package/dist/paseo-tool-call-detail.d.ts +15 -0
  65. package/dist/paseo-tool-call-detail.js +305 -0
  66. package/dist/path-utils.d.ts +2 -0
  67. package/dist/path-utils.js +16 -0
  68. package/dist/plugin-requirements.d.ts +11 -0
  69. package/dist/plugin-requirements.js +26 -0
  70. package/dist/plugin-source-reference.d.ts +7 -0
  71. package/dist/plugin-source-reference.js +41 -0
  72. package/dist/provider-config.d.ts +139 -0
  73. package/dist/provider-config.js +115 -0
  74. package/dist/provider-icon-names.d.ts +5 -0
  75. package/dist/provider-icon-names.js +54 -0
  76. package/dist/provider-manifest.d.ts +37 -0
  77. package/dist/provider-manifest.js +261 -0
  78. package/dist/provider-snapshot-codec.d.ts +18 -0
  79. package/dist/provider-snapshot-codec.js +71 -0
  80. package/dist/schedule/cadence.d.ts +6 -0
  81. package/dist/schedule/cadence.js +28 -0
  82. package/dist/schedule/cron-expression.d.ts +13 -0
  83. package/dist/schedule/cron-expression.js +97 -0
  84. package/dist/schedule/rpc-schemas.d.ts +568 -0
  85. package/dist/schedule/rpc-schemas.js +155 -0
  86. package/dist/schedule/types.d.ts +201 -0
  87. package/dist/schedule/types.js +68 -0
  88. package/dist/search/text-match.d.ts +71 -0
  89. package/dist/search/text-match.js +291 -0
  90. package/dist/ssh-transport.d.ts +11 -0
  91. package/dist/ssh-transport.js +72 -0
  92. package/dist/terminal-activity.d.ts +21 -0
  93. package/dist/terminal-activity.js +25 -0
  94. package/dist/terminal-input-mode.d.ts +30 -0
  95. package/dist/terminal-input-mode.js +180 -0
  96. package/dist/terminal-key-input.d.ts +13 -0
  97. package/dist/terminal-key-input.js +210 -0
  98. package/dist/terminal-profiles.d.ts +41 -0
  99. package/dist/terminal-profiles.js +270 -0
  100. package/dist/terminal-snapshot.d.ts +3 -0
  101. package/dist/terminal-snapshot.js +184 -0
  102. package/dist/terminal-stream-protocol.d.ts +2 -0
  103. package/dist/terminal-stream-protocol.js +2 -0
  104. package/dist/terminal-subscription-key.d.ts +2 -0
  105. package/dist/terminal-subscription-key.js +9 -0
  106. package/dist/timeline-identity.d.ts +3 -0
  107. package/dist/timeline-identity.js +8 -0
  108. package/dist/tool-call-display.d.ts +11 -0
  109. package/dist/tool-call-display.js +136 -0
  110. package/dist/tool-name-normalization.d.ts +9 -0
  111. package/dist/tool-name-normalization.js +82 -0
  112. package/dist/validation/ws-outbound-schema-metadata.d.ts +11418 -0
  113. package/dist/validation/ws-outbound-schema-metadata.js +3 -0
  114. package/dist/validation/ws-outbound.d.ts +12 -0
  115. package/dist/validation/ws-outbound.js +8 -0
  116. package/dist/workspace-labels.d.ts +9 -0
  117. package/dist/workspace-labels.js +19 -0
  118. package/package.json +44 -0
@@ -0,0 +1,33 @@
1
+ export interface GitRemoteLocation {
2
+ transport: "scp" | "ssh" | "http" | "https";
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;
11
+ path: string;
12
+ }
13
+ export interface GitHubRemoteIdentity {
14
+ owner: string;
15
+ name: string;
16
+ repo: string;
17
+ }
18
+ export declare function parseGitHubRemoteUrl(remoteUrl: string): GitHubRemoteIdentity | null;
19
+ /**
20
+ * Whether `repo` is already a complete git remote (a URL or scp-like address)
21
+ * rather than `owner/repo` shorthand that still needs a clone protocol picked.
22
+ *
23
+ * Clients (app + CLI) and the daemon must agree on this classification: the
24
+ * daemon treats `parseGitRemoteLocation(repo) !== null` as "complete remote"
25
+ * and everything else as shorthand, so reuse the same parser here instead of a
26
+ * separate regex that would drift (e.g. accepting `git://` the parser rejects).
27
+ */
28
+ export declare function isCompleteGitRemote(repo: string): boolean;
29
+ export declare function parseGitRemoteLocation(remoteUrl: string): GitRemoteLocation | null;
30
+ export declare function parseGitHubRemoteIdentity(path: string): GitHubRemoteIdentity | null;
31
+ export declare function isGitHubHost(host: string): boolean;
32
+ export declare function normalizeHost(host: string): string;
33
+ //# sourceMappingURL=git-remote.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { getForgeDefinition } from "./forge-manifest.js";
2
+ const GITHUB_HOSTS = new Set(getForgeDefinition("github")?.cloudHosts ?? []);
3
+ const TRANSPORT_BY_PROTOCOL = {
4
+ "https:": "https",
5
+ "http:": "http",
6
+ "ssh:": "ssh",
7
+ };
8
+ const DEFAULT_PORT_BY_PROTOCOL = {
9
+ "https:": "443",
10
+ "http:": "80",
11
+ "ssh:": "22",
12
+ };
13
+ export function parseGitHubRemoteUrl(remoteUrl) {
14
+ const location = parseGitRemoteLocation(remoteUrl);
15
+ if (!location || !isGitHubHost(location.host))
16
+ return null;
17
+ return parseGitHubRemoteIdentity(location.path);
18
+ }
19
+ /**
20
+ * Whether `repo` is already a complete git remote (a URL or scp-like address)
21
+ * rather than `owner/repo` shorthand that still needs a clone protocol picked.
22
+ *
23
+ * Clients (app + CLI) and the daemon must agree on this classification: the
24
+ * daemon treats `parseGitRemoteLocation(repo) !== null` as "complete remote"
25
+ * and everything else as shorthand, so reuse the same parser here instead of a
26
+ * separate regex that would drift (e.g. accepting `git://` the parser rejects).
27
+ */
28
+ export function isCompleteGitRemote(repo) {
29
+ return parseGitRemoteLocation(repo) !== null;
30
+ }
31
+ export function parseGitRemoteLocation(remoteUrl) {
32
+ const trimmed = remoteUrl.trim();
33
+ if (!trimmed)
34
+ return null;
35
+ // scp form has no scheme. Testing it first would match `ssh://git@host:22/x`
36
+ // — `[^@]+` happily eats `ssh://git` — and swallow the port into the path.
37
+ const scpLike = trimmed.includes("://") ? null : trimmed.match(/^[^@]+@([^:]+):(.+)$/u);
38
+ if (scpLike) {
39
+ const host = normalizeHost(scpLike[1] ?? "");
40
+ const path = normalizeRemotePath(scpLike[2] ?? "");
41
+ if (!isValidRemoteHost(host) || !path)
42
+ return null;
43
+ return { transport: "scp", host, path };
44
+ }
45
+ let parsed;
46
+ try {
47
+ parsed = new URL(trimmed);
48
+ }
49
+ catch {
50
+ return null;
51
+ }
52
+ const transport = TRANSPORT_BY_PROTOCOL[parsed.protocol.toLowerCase()];
53
+ if (!transport)
54
+ return null;
55
+ const host = normalizeHost(parsed.hostname);
56
+ let path;
57
+ try {
58
+ path = decodeURIComponent(parsed.pathname);
59
+ }
60
+ catch {
61
+ return null;
62
+ }
63
+ const normalizedPath = normalizeRemotePath(path);
64
+ if (!isValidRemoteHost(host) || !normalizedPath)
65
+ return null;
66
+ const protocol = parsed.protocol.toLowerCase();
67
+ const port = parsed.port && parsed.port !== DEFAULT_PORT_BY_PROTOCOL[protocol] ? parsed.port : undefined;
68
+ return { transport, host, port, path: normalizedPath };
69
+ }
70
+ export function parseGitHubRemoteIdentity(path) {
71
+ const segments = path.split("/").filter(Boolean);
72
+ if (segments.length !== 2)
73
+ return null;
74
+ const [owner, name] = segments;
75
+ if (!owner || !name)
76
+ return null;
77
+ return { owner, name, repo: `${owner}/${name}` };
78
+ }
79
+ export function isGitHubHost(host) {
80
+ return GITHUB_HOSTS.has(host);
81
+ }
82
+ export function normalizeHost(host) {
83
+ return host.trim().replace(/\.+$/u, "").toLowerCase();
84
+ }
85
+ function normalizeRemotePath(path) {
86
+ let normalized = path.trim().replace(/^\/+|\/+$/gu, "");
87
+ if (normalized.endsWith(".git"))
88
+ normalized = normalized.slice(0, -4);
89
+ return normalized || null;
90
+ }
91
+ function isValidRemoteHost(host) {
92
+ return /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/u.test(host);
93
+ }
94
+ //# sourceMappingURL=git-remote.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Maps a Gitea/Forgejo commit-status state (individual status or the combined
3
+ * aggregate, e.g. a forge fact's ciStatus) onto the neutral check status.
4
+ * Shared by the daemon's Gitea adapter and the app's Gitea forge module so the
5
+ * "warning is terminal and non-passing" rule lives in one place: upstream
6
+ * treats warning as IsSuccess() == false, so it blocks merges and must not
7
+ * render as a plain pass or hang as pending.
8
+ */
9
+ export declare function mapGiteaCommitState(state: string): "success" | "failure" | "pending" | "skipped";
10
+ //# sourceMappingURL=gitea-status.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Maps a Gitea/Forgejo commit-status state (individual status or the combined
3
+ * aggregate, e.g. a forge fact's ciStatus) onto the neutral check status.
4
+ * Shared by the daemon's Gitea adapter and the app's Gitea forge module so the
5
+ * "warning is terminal and non-passing" rule lives in one place: upstream
6
+ * treats warning as IsSuccess() == false, so it blocks merges and must not
7
+ * render as a plain pass or hang as pending.
8
+ */
9
+ export function mapGiteaCommitState(state) {
10
+ switch (state.toLowerCase()) {
11
+ case "success":
12
+ return "success";
13
+ case "failure":
14
+ case "error":
15
+ case "warning":
16
+ return "failure";
17
+ case "skipped":
18
+ return "skipped";
19
+ default:
20
+ return "pending";
21
+ }
22
+ }
23
+ //# sourceMappingURL=gitea-status.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Canonical set of GitLab pipeline/job statuses that count as "still active"
3
+ * (not yet terminal). Shared by the daemon (merge-capability facts, checks
4
+ * aggregation) and the app (pipeline presentation) so a new GitLab transitional
5
+ * status only needs to be added in one place.
6
+ */
7
+ export declare const GITLAB_ACTIVE_PIPELINE_STATUSES: readonly ["created", "waiting_for_resource", "preparing", "pending", "running", "canceling", "scheduled"];
8
+ export type GitLabActivePipelineStatus = (typeof GITLAB_ACTIVE_PIPELINE_STATUSES)[number];
9
+ export declare const GITLAB_ACTIVE_PIPELINE_STATUS_SET: Set<string>;
10
+ //# sourceMappingURL=gitlab-pipeline.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Canonical set of GitLab pipeline/job statuses that count as "still active"
3
+ * (not yet terminal). Shared by the daemon (merge-capability facts, checks
4
+ * aggregation) and the app (pipeline presentation) so a new GitLab transitional
5
+ * status only needs to be added in one place.
6
+ */
7
+ export const GITLAB_ACTIVE_PIPELINE_STATUSES = [
8
+ "created",
9
+ "waiting_for_resource",
10
+ "preparing",
11
+ "pending",
12
+ "running",
13
+ "canceling",
14
+ "scheduled",
15
+ ];
16
+ export const GITLAB_ACTIVE_PIPELINE_STATUS_SET = new Set(GITLAB_ACTIVE_PIPELINE_STATUSES);
17
+ //# sourceMappingURL=gitlab-pipeline.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
@@ -0,0 +1,2 @@
1
+ export type LiteralUnion<T extends U, U extends string> = T | (U & Record<never, never>);
2
+ //# sourceMappingURL=literal-union.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=literal-union.js.map