@getpaseo/protocol 0.1.109 → 0.2.0-beta.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.
@@ -90,6 +90,7 @@ export interface ProviderSnapshotEntry {
90
90
  provider: AgentProvider;
91
91
  status: ProviderStatus;
92
92
  enabled: boolean;
93
+ source?: "builtin" | "custom";
93
94
  error?: string;
94
95
  models?: AgentModelDefinition[];
95
96
  modes?: AgentMode[];
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Declarative manifest of the git forges Paseo knows how to present, mirroring
3
+ * provider-manifest.ts. Pure build-time data shared by BOTH the client (icon,
4
+ * brand label, PR↔MR relabel) and the server (registry host-matching, prompt
5
+ * branding). It is NEVER serialized over the wire, so adding a forge here is not
6
+ * a protocol change.
7
+ *
8
+ * Keep this a pure leaf: no imports, no zod, no functions with runtime deps.
9
+ * Behavioural concerns (CLI invocation, host probing, REST adapters) live in the
10
+ * server adapter keyed by {@link ForgeDefinition.id}; this file is only the
11
+ * declarative half.
12
+ */
13
+ /**
14
+ * Declarative sign-in recipe for a forge. The client renders install/sign-in
15
+ * hints from this data alone — no per-CLI switch — so a new forge wires its auth
16
+ * UX entirely from the manifest. Behavioural auth (the actual host probe) stays
17
+ * in the server adapter; this is only what the user is told to run.
18
+ */
19
+ export interface ForgeSignInCommand {
20
+ /** Binary the user installs, e.g. "gh" — shown in the install-CLI hint. */
21
+ cli: string;
22
+ /** Full sign-in command, e.g. "gh auth login". */
23
+ command: string;
24
+ /**
25
+ * Flag that targets a self-hosted host, e.g. "--hostname". When present and a
26
+ * host is known, the client appends `${command} ${hostnameFlag} ${host}`.
27
+ * Omit when the command already targets the right host on its own.
28
+ */
29
+ hostnameFlag?: string;
30
+ }
31
+ export interface ForgeDefinition {
32
+ /** Registry id, matches the server adapter and the wire `forge` value. */
33
+ id: string;
34
+ /** Human brand name, e.g. for "Open on GitLab". */
35
+ displayName: string;
36
+ /** Short change-request noun: "PR" for GitHub, "MR" for GitLab. */
37
+ changeRequestAbbrev: string;
38
+ /** Full change-request noun: "pull request" vs "merge request". */
39
+ changeRequestNoun: string;
40
+ /** Prefix before a change-request number: "#" vs "!". */
41
+ changeRequestNumberPrefix: string;
42
+ /** Prefix before an issue number ("#" on every forge so far). */
43
+ issueNumberPrefix: string;
44
+ /** Icon key; the client falls back to a generic git icon for unknown values. */
45
+ iconKind: string;
46
+ /** Sign-in recipe, or null when the forge has no Paseo-driven sign-in. */
47
+ signIn: ForgeSignInCommand | null;
48
+ /**
49
+ * Public cloud hosts this forge owns exactly. A BOUNDED list, never an
50
+ * allowlist for self-hosted detection — self-hosted/Enterprise instances are
51
+ * recognized at runtime by the adapter's host probe, not by this field.
52
+ */
53
+ cloudHosts?: string[];
54
+ }
55
+ export declare const FORGE_DEFINITIONS: ForgeDefinition[];
56
+ /** Forge definitions only present in dev builds (none today; mirrors providers). */
57
+ export declare const DEV_FORGE_DEFINITIONS: ForgeDefinition[];
58
+ export declare const FORGE_IDS: string[];
59
+ export declare function getForgeDefinition(id: string, definitions?: ForgeDefinition[]): ForgeDefinition | null;
60
+ /**
61
+ * Resolve a forge definition, synthesizing a neutral one for a forge id the
62
+ * client has never heard of (e.g. a self-hosted forge a newer daemon reports to
63
+ * an older client). The neutral shape renders generic, never GitHub-branded.
64
+ */
65
+ export declare function getForgeDefinitionOrNeutral(id: string): ForgeDefinition;
66
+ //# sourceMappingURL=forge-manifest.d.ts.map
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Declarative manifest of the git forges Paseo knows how to present, mirroring
3
+ * provider-manifest.ts. Pure build-time data shared by BOTH the client (icon,
4
+ * brand label, PR↔MR relabel) and the server (registry host-matching, prompt
5
+ * branding). It is NEVER serialized over the wire, so adding a forge here is not
6
+ * a protocol change.
7
+ *
8
+ * Keep this a pure leaf: no imports, no zod, no functions with runtime deps.
9
+ * Behavioural concerns (CLI invocation, host probing, REST adapters) live in the
10
+ * server adapter keyed by {@link ForgeDefinition.id}; this file is only the
11
+ * declarative half.
12
+ */
13
+ export const FORGE_DEFINITIONS = [
14
+ {
15
+ id: "github",
16
+ displayName: "GitHub",
17
+ changeRequestAbbrev: "PR",
18
+ changeRequestNoun: "pull request",
19
+ changeRequestNumberPrefix: "#",
20
+ issueNumberPrefix: "#",
21
+ iconKind: "github",
22
+ signIn: { cli: "gh", command: "gh auth login" },
23
+ cloudHosts: ["github.com", "ssh.github.com"],
24
+ },
25
+ {
26
+ id: "gitlab",
27
+ displayName: "GitLab",
28
+ changeRequestAbbrev: "MR",
29
+ changeRequestNoun: "merge request",
30
+ changeRequestNumberPrefix: "!",
31
+ issueNumberPrefix: "#",
32
+ iconKind: "gitlab",
33
+ signIn: { cli: "glab", command: "glab auth login", hostnameFlag: "--hostname" },
34
+ cloudHosts: ["gitlab.com"],
35
+ },
36
+ {
37
+ id: "gitea",
38
+ displayName: "Gitea",
39
+ changeRequestAbbrev: "PR",
40
+ changeRequestNoun: "pull request",
41
+ changeRequestNumberPrefix: "#",
42
+ issueNumberPrefix: "#",
43
+ iconKind: "gitea",
44
+ signIn: { cli: "tea", command: "tea login add" },
45
+ cloudHosts: ["gitea.com"],
46
+ },
47
+ {
48
+ id: "forgejo",
49
+ displayName: "Forgejo",
50
+ changeRequestAbbrev: "PR",
51
+ changeRequestNoun: "pull request",
52
+ changeRequestNumberPrefix: "#",
53
+ issueNumberPrefix: "#",
54
+ iconKind: "forgejo",
55
+ signIn: { cli: "tea", command: "tea login add" },
56
+ },
57
+ {
58
+ id: "codeberg",
59
+ displayName: "Codeberg",
60
+ changeRequestAbbrev: "PR",
61
+ changeRequestNoun: "pull request",
62
+ changeRequestNumberPrefix: "#",
63
+ issueNumberPrefix: "#",
64
+ iconKind: "codeberg",
65
+ signIn: { cli: "tea", command: "tea login add" },
66
+ cloudHosts: ["codeberg.org"],
67
+ },
68
+ ];
69
+ /** Forge definitions only present in dev builds (none today; mirrors providers). */
70
+ export const DEV_FORGE_DEFINITIONS = [];
71
+ export const FORGE_IDS = FORGE_DEFINITIONS.map((definition) => definition.id);
72
+ export function getForgeDefinition(id, definitions = [...FORGE_DEFINITIONS, ...DEV_FORGE_DEFINITIONS]) {
73
+ return definitions.find((definition) => definition.id === id) ?? null;
74
+ }
75
+ /**
76
+ * Resolve a forge definition, synthesizing a neutral one for a forge id the
77
+ * client has never heard of (e.g. a self-hosted forge a newer daemon reports to
78
+ * an older client). The neutral shape renders generic, never GitHub-branded.
79
+ */
80
+ export function getForgeDefinitionOrNeutral(id) {
81
+ return (getForgeDefinition(id) ?? {
82
+ id,
83
+ displayName: id,
84
+ changeRequestAbbrev: "PR",
85
+ changeRequestNoun: "pull request",
86
+ changeRequestNumberPrefix: "#",
87
+ issueNumberPrefix: "#",
88
+ iconKind: "git",
89
+ signIn: null,
90
+ });
91
+ }
92
+ //# sourceMappingURL=forge-manifest.js.map