@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.
Files changed (97) hide show
  1. package/LICENSE +671 -0
  2. package/README.md +12 -0
  3. package/dist/agent-attention-notification.d.ts +43 -0
  4. package/dist/agent-attention-notification.js +141 -0
  5. package/dist/agent-deep-link.d.ts +8 -0
  6. package/dist/agent-deep-link.js +49 -0
  7. package/dist/agent-labels.d.ts +7 -0
  8. package/dist/agent-labels.js +11 -0
  9. package/dist/agent-lifecycle.d.ts +3 -0
  10. package/dist/agent-lifecycle.js +8 -0
  11. package/dist/agent-state-bucket.d.ts +14 -0
  12. package/dist/agent-state-bucket.js +41 -0
  13. package/dist/agent-title-limits.d.ts +2 -0
  14. package/dist/agent-title-limits.js +2 -0
  15. package/dist/agent-types.d.ts +451 -0
  16. package/dist/agent-types.js +22 -0
  17. package/dist/binary-frames/demux.d.ts +11 -0
  18. package/dist/binary-frames/demux.js +23 -0
  19. package/dist/binary-frames/file-transfer.d.ts +51 -0
  20. package/dist/binary-frames/file-transfer.js +108 -0
  21. package/dist/binary-frames/index.d.ts +4 -0
  22. package/dist/binary-frames/index.js +4 -0
  23. package/dist/binary-frames/terminal.d.ts +35 -0
  24. package/dist/binary-frames/terminal.js +100 -0
  25. package/dist/branch-slug.d.ts +14 -0
  26. package/dist/branch-slug.js +49 -0
  27. package/dist/browser-automation/capabilities.d.ts +7 -0
  28. package/dist/browser-automation/capabilities.js +31 -0
  29. package/dist/browser-automation/rpc-schemas.d.ts +1112 -0
  30. package/dist/browser-automation/rpc-schemas.js +462 -0
  31. package/dist/chat/rpc-schemas.d.ts +158 -0
  32. package/dist/chat/rpc-schemas.js +103 -0
  33. package/dist/chat/types.d.ts +30 -0
  34. package/dist/chat/types.js +22 -0
  35. package/dist/client-capabilities.d.ts +11 -0
  36. package/dist/client-capabilities.js +25 -0
  37. package/dist/connection-offer.d.ts +36 -0
  38. package/dist/connection-offer.js +53 -0
  39. package/dist/daemon-endpoints.d.ts +47 -0
  40. package/dist/daemon-endpoints.js +201 -0
  41. package/dist/error-utils.d.ts +11 -0
  42. package/dist/error-utils.js +27 -0
  43. package/dist/forge-manifest.d.ts +66 -0
  44. package/dist/forge-manifest.js +92 -0
  45. package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
  46. package/dist/generated/validation/ws-outbound.aot.js +65207 -0
  47. package/dist/git-remote.d.ts +33 -0
  48. package/dist/git-remote.js +94 -0
  49. package/dist/host-connection-schema.d.ts +11 -0
  50. package/dist/host-connection-schema.js +9 -0
  51. package/dist/literal-union.d.ts +2 -0
  52. package/dist/literal-union.js +2 -0
  53. package/dist/loop/rpc-schemas.d.ts +636 -0
  54. package/dist/loop/rpc-schemas.js +163 -0
  55. package/dist/messages.d.ts +40580 -0
  56. package/dist/messages.js +4999 -0
  57. package/dist/paseo-config-schema.d.ts +138 -0
  58. package/dist/paseo-config-schema.js +98 -0
  59. package/dist/path-utils.d.ts +2 -0
  60. package/dist/path-utils.js +16 -0
  61. package/dist/provider-config.d.ts +126 -0
  62. package/dist/provider-config.js +110 -0
  63. package/dist/provider-icon-names.d.ts +5 -0
  64. package/dist/provider-icon-names.js +52 -0
  65. package/dist/provider-manifest.d.ts +35 -0
  66. package/dist/provider-manifest.js +254 -0
  67. package/dist/schedule/cadence.d.ts +6 -0
  68. package/dist/schedule/cadence.js +28 -0
  69. package/dist/schedule/cron-expression.d.ts +13 -0
  70. package/dist/schedule/cron-expression.js +97 -0
  71. package/dist/schedule/rpc-schemas.d.ts +624 -0
  72. package/dist/schedule/rpc-schemas.js +155 -0
  73. package/dist/schedule/types.d.ts +222 -0
  74. package/dist/schedule/types.js +78 -0
  75. package/dist/terminal-activity.d.ts +21 -0
  76. package/dist/terminal-activity.js +25 -0
  77. package/dist/terminal-input-mode.d.ts +30 -0
  78. package/dist/terminal-input-mode.js +180 -0
  79. package/dist/terminal-key-input.d.ts +13 -0
  80. package/dist/terminal-key-input.js +210 -0
  81. package/dist/terminal-profiles.d.ts +6 -0
  82. package/dist/terminal-profiles.js +28 -0
  83. package/dist/terminal-snapshot.d.ts +3 -0
  84. package/dist/terminal-snapshot.js +178 -0
  85. package/dist/terminal-stream-protocol.d.ts +2 -0
  86. package/dist/terminal-stream-protocol.js +2 -0
  87. package/dist/terminal-subscription-key.d.ts +2 -0
  88. package/dist/terminal-subscription-key.js +9 -0
  89. package/dist/tool-call-display.d.ts +11 -0
  90. package/dist/tool-call-display.js +135 -0
  91. package/dist/tool-name-normalization.d.ts +9 -0
  92. package/dist/tool-name-normalization.js +82 -0
  93. package/dist/validation/ws-outbound-schema-metadata.d.ts +7570 -0
  94. package/dist/validation/ws-outbound-schema-metadata.js +3 -0
  95. package/dist/validation/ws-outbound.d.ts +12 -0
  96. package/dist/validation/ws-outbound.js +8 -0
  97. package/package.json +32 -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,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