@sweny-ai/core 0.1.1 → 0.1.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.
- package/dist/skills/github.js +17 -0
- package/dist/skills/linear.js +13 -0
- package/dist/workflows/triage.js +12 -9
- package/package.json +1 -1
package/dist/skills/github.js
CHANGED
|
@@ -92,6 +92,23 @@ export const github = {
|
|
|
92
92
|
body: JSON.stringify({ title: input.title, body: input.body, labels: input.labels }),
|
|
93
93
|
}),
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
name: "github_add_comment",
|
|
97
|
+
description: "Add a comment to a GitHub issue or pull request",
|
|
98
|
+
input_schema: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: {
|
|
101
|
+
repo: { type: "string", description: "owner/repo" },
|
|
102
|
+
issue_number: { type: "number", description: "Issue or PR number" },
|
|
103
|
+
body: { type: "string", description: "Comment body (markdown)" },
|
|
104
|
+
},
|
|
105
|
+
required: ["repo", "issue_number", "body"],
|
|
106
|
+
},
|
|
107
|
+
handler: async (input, ctx) => gh(`/repos/${input.repo}/issues/${input.issue_number}/comments`, ctx, {
|
|
108
|
+
method: "POST",
|
|
109
|
+
body: JSON.stringify({ body: input.body }),
|
|
110
|
+
}),
|
|
111
|
+
},
|
|
95
112
|
{
|
|
96
113
|
name: "github_create_pr",
|
|
97
114
|
description: "Create a pull request",
|
package/dist/skills/linear.js
CHANGED
|
@@ -66,6 +66,19 @@ export const linear = {
|
|
|
66
66
|
}
|
|
67
67
|
}`, { query: input.query, first: input.limit ?? 10 }, ctx),
|
|
68
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: "linear_add_comment",
|
|
71
|
+
description: "Add a comment to a Linear issue",
|
|
72
|
+
input_schema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
issueId: { type: "string", description: "Linear issue ID" },
|
|
76
|
+
body: { type: "string", description: "Comment body (markdown)" },
|
|
77
|
+
},
|
|
78
|
+
required: ["issueId", "body"],
|
|
79
|
+
},
|
|
80
|
+
handler: async (input, ctx) => linearGql(`mutation($input: CommentCreateInput!) { commentCreate(input: $input) { success comment { id body } } }`, { input: { issueId: input.issueId, body: input.body } }, ctx),
|
|
81
|
+
},
|
|
69
82
|
{
|
|
70
83
|
name: "linear_update_issue",
|
|
71
84
|
description: "Update an existing Linear issue",
|
package/dist/workflows/triage.js
CHANGED
|
@@ -41,8 +41,8 @@ Be thorough — the investigation step depends on complete context. Use every to
|
|
|
41
41
|
4. Determine affected services and users.
|
|
42
42
|
5. Recommend a fix approach.
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
skills: ["github"],
|
|
44
|
+
**Novelty check (REQUIRED):** Search the issue tracker for existing open issues that cover the same root cause. Use github_search_issues and/or linear_search_issues with relevant keywords. If you find an existing issue that matches, set is_duplicate=true and duplicate_of to the issue identifier (e.g. "#42" or "ENG-123").`,
|
|
45
|
+
skills: ["github", "linear"],
|
|
46
46
|
output: {
|
|
47
47
|
type: "object",
|
|
48
48
|
properties: {
|
|
@@ -58,15 +58,18 @@ If this is a known issue that already has a ticket, mark it as duplicate.`,
|
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
create_issue: {
|
|
61
|
-
name: "Create Issue",
|
|
62
|
-
instruction: `
|
|
61
|
+
name: "Create or Update Issue",
|
|
62
|
+
instruction: `Before creating anything, check whether this root cause is already tracked:
|
|
63
63
|
|
|
64
|
-
1.
|
|
65
|
-
2.
|
|
66
|
-
3.
|
|
67
|
-
|
|
64
|
+
1. Search for existing open issues using github_search_issues and/or linear_search_issues with keywords from the root cause, affected service, and error message.
|
|
65
|
+
2. **If a matching issue exists**: Add a comment to it (using github_add_comment or linear_add_comment) noting this re-occurrence with the current timestamp and any new context. Do NOT create a new issue. Return the existing issue's identifier and URL.
|
|
66
|
+
3. **If no matching issue exists**: Create a new issue with:
|
|
67
|
+
- A clear, actionable title
|
|
68
|
+
- Root cause, severity, affected services, reproduction steps, and recommended fix
|
|
69
|
+
- Appropriate labels (bug, severity level, affected service)
|
|
70
|
+
- Links to relevant commits, PRs, or existing issues
|
|
68
71
|
|
|
69
|
-
|
|
72
|
+
Use whichever tracker is available to you.`,
|
|
70
73
|
skills: ["linear", "github"],
|
|
71
74
|
},
|
|
72
75
|
notify: {
|