pi-mono-all 1.2.2 → 1.2.3
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.
- package/CHANGELOG.md +6 -0
- package/node_modules/pi-mono-linear/CHANGELOG.md +7 -0
- package/node_modules/pi-mono-linear/README.md +1 -0
- package/node_modules/pi-mono-linear/package.json +1 -1
- package/node_modules/pi-mono-linear/src/linear-client.ts +37 -2
- package/node_modules/pi-mono-linear/src/linear-queries.ts +3 -3
- package/node_modules/pi-mono-linear/src/linear-schemas.ts +1 -1
- package/node_modules/pi-mono-linear/src/linear-tools.ts +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# pi-mono-linear
|
|
2
2
|
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update Project GraphQL selections to use `teams` instead of removed `team` fields.
|
|
8
|
+
- Resolve `linear_create_issue` team keys to UUIDs before calling the Linear mutation and return clearer errors for unknown keys.
|
|
9
|
+
|
|
3
10
|
## 0.2.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -129,6 +129,7 @@ Linear API keys are sent in the `Authorization` header as the raw key value; do
|
|
|
129
129
|
## Usage tips
|
|
130
130
|
|
|
131
131
|
- Use `linear_workspace_metadata` first when team/project/state/label/user IDs are unknown.
|
|
132
|
+
- `linear_create_issue` accepts either a team UUID or a team key; keys are resolved to UUIDs before the Linear mutation.
|
|
132
133
|
- Use `linear_search_issues` for keyword lookup.
|
|
133
134
|
- Use `linear_get_issue` before updating an issue or creating a comment.
|
|
134
135
|
- Use `linear_list_issues` for filtered issue lists by team, assignee, status, and limit.
|
|
@@ -68,6 +68,18 @@ interface FileUploadMutationResponse {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
interface LinearTeamNode {
|
|
72
|
+
id: string;
|
|
73
|
+
name?: string;
|
|
74
|
+
key?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface ListTeamsResponse {
|
|
78
|
+
teams?: {
|
|
79
|
+
nodes?: LinearTeamNode[];
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
71
83
|
export interface UploadedFileResult {
|
|
72
84
|
filename: string;
|
|
73
85
|
contentType: string;
|
|
@@ -134,8 +146,9 @@ export class LinearClient {
|
|
|
134
146
|
return this.cached(`myIssues:${limit}`, () => this.graphql(queries.LIST_MY_ISSUES, { first: limit }));
|
|
135
147
|
}
|
|
136
148
|
|
|
137
|
-
createIssue(input: CreateIssueInput): Promise<unknown> {
|
|
138
|
-
|
|
149
|
+
async createIssue(input: CreateIssueInput): Promise<unknown> {
|
|
150
|
+
const teamId = await this.resolveTeamId(input.teamId);
|
|
151
|
+
return this.graphql(queries.CREATE_ISSUE, { input: compact({ ...input, teamId }) });
|
|
139
152
|
}
|
|
140
153
|
|
|
141
154
|
updateIssue(issueId: string, input: UpdateIssueInput): Promise<unknown> {
|
|
@@ -227,6 +240,24 @@ export class LinearClient {
|
|
|
227
240
|
return this.cached(`document:${documentId}`, () => this.graphql(queries.GET_DOCUMENT, { id: documentId }));
|
|
228
241
|
}
|
|
229
242
|
|
|
243
|
+
private async resolveTeamId(teamIdOrKey: string): Promise<string> {
|
|
244
|
+
const value = teamIdOrKey.trim();
|
|
245
|
+
if (!value) throw new ApiError("teamId is required", 400, undefined, "Linear");
|
|
246
|
+
if (isUuid(value)) return value;
|
|
247
|
+
|
|
248
|
+
const teams = await this.cached("teams", () => this.graphql<ListTeamsResponse>(queries.LIST_TEAMS));
|
|
249
|
+
const nodes = teams.teams?.nodes ?? [];
|
|
250
|
+
const match = nodes.find((team) => team.key?.toLowerCase() === value.toLowerCase());
|
|
251
|
+
if (match?.id) return match.id;
|
|
252
|
+
|
|
253
|
+
throw new ApiError(
|
|
254
|
+
`teamId must be a Linear team UUID or a known team key; "${value}" did not match any team key`,
|
|
255
|
+
400,
|
|
256
|
+
{ providedTeamId: value, availableTeamKeys: nodes.map((team) => team.key).filter(Boolean) },
|
|
257
|
+
"Linear",
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
230
261
|
private async graphql<T = unknown>(query: string, variables: Variables = {}): Promise<T> {
|
|
231
262
|
return this.limiter.schedule(async () => {
|
|
232
263
|
const response = await this.http.post<GraphQlResponse<T>>("", { query, variables });
|
|
@@ -246,6 +277,10 @@ export function readLinearToken(): Promise<string> {
|
|
|
246
277
|
return readAuthToken({ envName: "LINEAR_API_KEY", authPath: ["linear", "key"] });
|
|
247
278
|
}
|
|
248
279
|
|
|
280
|
+
function isUuid(value: string): boolean {
|
|
281
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
282
|
+
}
|
|
283
|
+
|
|
249
284
|
function buildIssueFilter(options: ListIssuesOptions): Variables {
|
|
250
285
|
const filter: Variables = {};
|
|
251
286
|
if (options.teamId) filter.team = { id: { eq: options.teamId } };
|
|
@@ -51,9 +51,9 @@ export const UPDATE_ISSUE = `mutation($id: String!, $input: IssueUpdateInput!) {
|
|
|
51
51
|
issueUpdate(id: $id, input: $input) { success issue { id identifier title priority state { id name } } }
|
|
52
52
|
}`;
|
|
53
53
|
|
|
54
|
-
export const LIST_PROJECTS = `query { projects { nodes { id name description state
|
|
54
|
+
export const LIST_PROJECTS = `query { projects { nodes { id name description state teams { nodes { id name key } } } } }`;
|
|
55
55
|
export const LIST_TEAM_PROJECTS = `query($id: String!) { team(id: $id) { id name projects { nodes { id name description state } } } }`;
|
|
56
|
-
export const GET_PROJECT = `query($id: String!) { project(id: $id) { id name description state url
|
|
56
|
+
export const GET_PROJECT = `query($id: String!) { project(id: $id) { id name description state url teams { nodes { id name key } } lead { id name } } }`;
|
|
57
57
|
|
|
58
58
|
export const LIST_STATUSES = `query { workflowStates { nodes { id name type color position team { id name key } } } }`;
|
|
59
59
|
export const LIST_TEAM_STATUSES = `query($id: String!) { team(id: $id) { id name states { nodes { id name type color position } } } }`;
|
|
@@ -94,7 +94,7 @@ export const GET_DOCUMENT = `query($id: String!) { document(id: $id) { id title
|
|
|
94
94
|
|
|
95
95
|
export const WORKSPACE_METADATA = `query {
|
|
96
96
|
teams { nodes { id name key } }
|
|
97
|
-
projects { nodes { id name description state
|
|
97
|
+
projects { nodes { id name description state teams { nodes { id name key } } } }
|
|
98
98
|
workflowStates { nodes { id name type color position team { id name key } } }
|
|
99
99
|
issueLabels { nodes { id name color team { id name key } } }
|
|
100
100
|
users { nodes { id name email displayName } }
|
|
@@ -5,7 +5,7 @@ export const MaxResponseCharsSchema = Type.Optional(
|
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
export const LimitSchema = Type.Optional(Type.Number({ description: "Maximum number of records to fetch", minimum: 1, maximum: 250 }));
|
|
8
|
-
export const TeamIdSchema = Type.String({ description: "Linear team UUID or key
|
|
8
|
+
export const TeamIdSchema = Type.String({ description: "Linear team UUID or key (keys are resolved to UUIDs for issue creation)" });
|
|
9
9
|
export const IssueIdSchema = Type.String({ description: "Linear issue UUID or identifier such as ENG-123" });
|
|
10
10
|
export const UserIdSchema = Type.String({ description: "Linear user UUID" });
|
|
11
11
|
export const ProjectIdSchema = Type.String({ description: "Linear project UUID" });
|
|
@@ -157,7 +157,7 @@ export function registerLinearTools(pi: ExtensionAPI): void {
|
|
|
157
157
|
pi.registerTool({
|
|
158
158
|
name: "linear_create_issue",
|
|
159
159
|
label: "Linear Create Issue",
|
|
160
|
-
description: "Create a Linear issue. Use linear_workspace_metadata first if team/state/user/project IDs are unknown.",
|
|
160
|
+
description: "Create a Linear issue. Accepts a team UUID or team key; keys are resolved before calling Linear. Use linear_workspace_metadata first if team/state/user/project IDs are unknown.",
|
|
161
161
|
parameters: LinearCreateIssueParams,
|
|
162
162
|
async execute(_id, params, _signal, _onUpdate, ctx) {
|
|
163
163
|
const result = await withLinearAuth(ctx, () => client.createIssue({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-mono-all",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "All pi-mono extensions and bundled skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
"pi-skill"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"pi-mono-auto-fix": "0.3.1",
|
|
13
12
|
"pi-mono-ask-user-question": "1.7.4",
|
|
13
|
+
"pi-mono-auto-fix": "0.3.1",
|
|
14
14
|
"pi-mono-btw": "1.7.4",
|
|
15
|
-
"pi-mono-clear": "1.7.3",
|
|
16
15
|
"pi-mono-context": "0.1.1",
|
|
16
|
+
"pi-mono-clear": "1.7.3",
|
|
17
17
|
"pi-mono-figma": "0.2.2",
|
|
18
|
-
"pi-mono-linear": "0.2.2",
|
|
19
18
|
"pi-mono-context-guard": "1.7.3",
|
|
19
|
+
"pi-mono-linear": "0.2.3",
|
|
20
20
|
"pi-mono-loop": "1.7.3",
|
|
21
|
-
"pi-mono-review": "1.8.2",
|
|
22
|
-
"pi-mono-multi-edit": "1.7.3",
|
|
23
21
|
"pi-mono-sentinel": "1.11.0",
|
|
22
|
+
"pi-mono-review": "1.8.2",
|
|
24
23
|
"pi-mono-simplify": "1.7.3",
|
|
25
|
-
"pi-mono-
|
|
26
|
-
"pi-mono-
|
|
27
|
-
"pi-mono-web-search": "0.1.0",
|
|
24
|
+
"pi-mono-team-mode": "2.3.2",
|
|
25
|
+
"pi-mono-multi-edit": "1.7.3",
|
|
28
26
|
"pi-common": "0.1.1",
|
|
29
|
-
"pi-mono-
|
|
27
|
+
"pi-mono-web-search": "0.1.0",
|
|
28
|
+
"pi-mono-status-line": "1.7.3",
|
|
29
|
+
"pi-mono-usage": "0.1.1"
|
|
30
30
|
},
|
|
31
31
|
"bundledDependencies": [
|
|
32
32
|
"pi-mono-ask-user-question",
|