patchrelay 0.10.0 → 0.10.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.10.0",
4
- "commit": "5cb66438689e",
5
- "builtAt": "2026-03-22T18:39:48.709Z"
3
+ "version": "0.10.2",
4
+ "commit": "9590d03b1a4d",
5
+ "builtAt": "2026-03-22T19:12:49.577Z"
6
6
  }
@@ -18,11 +18,37 @@ export async function handleConnectCommand(params) {
18
18
  export async function handleInstallationsCommand(params) {
19
19
  const result = await params.data.listInstallations();
20
20
  if (params.json) {
21
- writeOutput(params.stdout, formatJson(result));
21
+ writeOutput(params.stdout, formatJson({
22
+ ...result,
23
+ installations: result.installations.map((item) => ({
24
+ ...item,
25
+ projects: item.linkedProjects.map((id) => {
26
+ const p = params.config.projects.find((proj) => proj.id === id);
27
+ return p ? { id: p.id, repoPath: p.repoPath, issueKeyPrefixes: p.issueKeyPrefixes, linearTeamIds: p.linearTeamIds } : { id };
28
+ }),
29
+ })),
30
+ }));
22
31
  return 0;
23
32
  }
24
- writeOutput(params.stdout, `${(result.installations.length > 0
25
- ? result.installations.map((item) => `${item.installation.id} ${item.installation.workspaceName ?? item.installation.actorName ?? "-"} projects=${item.linkedProjects.join(",") || "-"}`)
26
- : ["No installations found."]).join("\n")}\n`);
33
+ if (result.installations.length === 0) {
34
+ writeOutput(params.stdout, "No installations found.\n");
35
+ return 0;
36
+ }
37
+ const lines = [];
38
+ for (const item of result.installations) {
39
+ const label = item.installation.workspaceName ?? item.installation.actorName ?? "-";
40
+ lines.push(`${item.installation.id} ${label} projects=${item.linkedProjects.join(",") || "-"}`);
41
+ for (const projectId of item.linkedProjects) {
42
+ const p = params.config.projects.find((proj) => proj.id === projectId);
43
+ if (!p)
44
+ continue;
45
+ const routing = [
46
+ ...(p.issueKeyPrefixes.length > 0 ? [`prefixes=${p.issueKeyPrefixes.join(",")}`] : []),
47
+ ...(p.linearTeamIds.length > 0 ? [`teams=${p.linearTeamIds.join(",")}`] : []),
48
+ ].join(" ") || "no routing";
49
+ lines.push(` ${projectId} ${p.repoPath} ${routing}`);
50
+ }
51
+ }
52
+ writeOutput(params.stdout, `${lines.join("\n")}\n`);
27
53
  return 0;
28
54
  }
package/dist/cli/index.js CHANGED
@@ -288,6 +288,7 @@ export async function runCli(argv, options) {
288
288
  json,
289
289
  stdout,
290
290
  data: operatorData,
291
+ config,
291
292
  });
292
293
  }
293
294
  if (command === "feed") {
@@ -96,6 +96,11 @@ export async function fetchLinearViewerIdentity(graphqlUrl, accessToken, logger)
96
96
  id
97
97
  name
98
98
  }
99
+ organization {
100
+ id
101
+ name
102
+ urlKey
103
+ }
99
104
  teams {
100
105
  nodes {
101
106
  id
@@ -111,12 +116,13 @@ export async function fetchLinearViewerIdentity(graphqlUrl, accessToken, logger)
111
116
  if (!response.ok || !payload?.data) {
112
117
  throw new Error(`Linear viewer lookup failed with HTTP ${response.status}`);
113
118
  }
119
+ const org = payload.data.organization;
114
120
  const teams = payload.data.teams?.nodes ?? [];
115
121
  const firstTeam = teams.find((team) => team?.id || team?.name || team?.key);
116
122
  const result = {
117
- ...(firstTeam?.id ? { workspaceId: firstTeam.id } : {}),
118
- ...(firstTeam?.name ? { workspaceName: firstTeam.name } : {}),
119
- ...(firstTeam?.key ? { workspaceKey: firstTeam.key } : {}),
123
+ ...(org?.id ? { workspaceId: org.id } : firstTeam?.id ? { workspaceId: firstTeam.id } : {}),
124
+ ...(org?.name ? { workspaceName: org.name } : {}),
125
+ ...(org?.urlKey ? { workspaceKey: org.urlKey } : firstTeam?.key ? { workspaceKey: firstTeam.key } : {}),
120
126
  ...(payload.data.viewer?.id ? { actorId: payload.data.viewer.id } : {}),
121
127
  ...(payload.data.viewer?.name ? { actorName: payload.data.viewer.name } : {}),
122
128
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {