@sweny-ai/core 0.1.3 → 0.1.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.
- package/dist/__tests__/skills-index.test.js +3 -6
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/cli/setup.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.js +3 -1
- package/dist/mcp.test.js +13 -0
- package/dist/skills/index.d.ts +1 -2
- package/dist/skills/index.js +2 -3
- package/dist/workflows/triage.js +1 -1
- package/package.json +1 -1
- package/dist/skills/betterstack.d.ts +0 -7
- package/dist/skills/betterstack.js +0 -114
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { github, linear, slack, sentry, datadog,
|
|
2
|
+
import { github, linear, slack, sentry, datadog, notification, builtinSkills, createSkillMap, allSkills, isSkillConfigured, validateWorkflowSkills, } from "../skills/index.js";
|
|
3
3
|
describe("skills registry", () => {
|
|
4
4
|
it("exports all builtin skills", () => {
|
|
5
|
-
expect(builtinSkills.length).toBeGreaterThanOrEqual(
|
|
5
|
+
expect(builtinSkills.length).toBeGreaterThanOrEqual(6);
|
|
6
6
|
const ids = builtinSkills.map((s) => s.id);
|
|
7
7
|
expect(ids).toContain("github");
|
|
8
8
|
expect(ids).toContain("linear");
|
|
9
9
|
expect(ids).toContain("slack");
|
|
10
10
|
expect(ids).toContain("sentry");
|
|
11
11
|
expect(ids).toContain("datadog");
|
|
12
|
-
expect(ids).toContain("betterstack");
|
|
13
12
|
expect(ids).toContain("notification");
|
|
14
13
|
});
|
|
15
14
|
it("individual skill exports match builtins", () => {
|
|
@@ -18,7 +17,6 @@ describe("skills registry", () => {
|
|
|
18
17
|
expect(builtinSkills).toContain(slack);
|
|
19
18
|
expect(builtinSkills).toContain(sentry);
|
|
20
19
|
expect(builtinSkills).toContain(datadog);
|
|
21
|
-
expect(builtinSkills).toContain(betterstack);
|
|
22
20
|
expect(builtinSkills).toContain(notification);
|
|
23
21
|
});
|
|
24
22
|
it("createSkillMap builds a correct map", () => {
|
|
@@ -78,7 +76,7 @@ describe("skills registry", () => {
|
|
|
78
76
|
it("validateWorkflowSkills detects missing providers", () => {
|
|
79
77
|
const workflow = {
|
|
80
78
|
nodes: {
|
|
81
|
-
gather: { skills: ["github", "sentry"
|
|
79
|
+
gather: { skills: ["github", "sentry"] },
|
|
82
80
|
notify: { skills: ["slack"] },
|
|
83
81
|
},
|
|
84
82
|
};
|
|
@@ -88,7 +86,6 @@ describe("skills registry", () => {
|
|
|
88
86
|
expect(result.configured).toHaveLength(1);
|
|
89
87
|
expect(result.configured[0].id).toBe("github");
|
|
90
88
|
expect(result.missing.some((m) => m.id === "sentry")).toBe(true);
|
|
91
|
-
expect(result.missing.some((m) => m.id === "betterstack")).toBe(true);
|
|
92
89
|
// gather node has github (git) but no observability → error
|
|
93
90
|
expect(result.errors.length).toBeGreaterThan(0);
|
|
94
91
|
// notify node has no notification → warning (not error)
|
package/dist/browser.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type { Skill, SkillCategory, Tool, ToolContext, ConfigField, JSONSchema,
|
|
|
9
9
|
export { consoleLogger } from "./types.js";
|
|
10
10
|
export { execute } from "./executor.js";
|
|
11
11
|
export type { ExecuteOptions } from "./executor.js";
|
|
12
|
-
export { github, linear, slack, sentry, datadog,
|
|
12
|
+
export { github, linear, slack, sentry, datadog, notification, builtinSkills, createSkillMap, allSkills, isSkillConfigured, configuredSkills, validateWorkflowSkills, } from "./skills/index.js";
|
|
13
13
|
export type { SkillValidationResult } from "./skills/index.js";
|
|
14
14
|
export { workflowZ, nodeZ, edgeZ, skillZ, parseWorkflow, validateWorkflow, workflowJsonSchema } from "./schema.js";
|
|
15
15
|
export type { WorkflowError } from "./schema.js";
|
package/dist/browser.js
CHANGED
|
@@ -9,7 +9,7 @@ export { consoleLogger } from "./types.js";
|
|
|
9
9
|
// Executor
|
|
10
10
|
export { execute } from "./executor.js";
|
|
11
11
|
// Skills
|
|
12
|
-
export { github, linear, slack, sentry, datadog,
|
|
12
|
+
export { github, linear, slack, sentry, datadog, notification, builtinSkills, createSkillMap, allSkills, isSkillConfigured, configuredSkills, validateWorkflowSkills, } from "./skills/index.js";
|
|
13
13
|
// Schema & validation
|
|
14
14
|
export { workflowZ, nodeZ, edgeZ, skillZ, parseWorkflow, validateWorkflow, workflowJsonSchema } from "./schema.js";
|
|
15
15
|
// Studio adapter
|
package/dist/cli/setup.js
CHANGED
|
@@ -120,6 +120,7 @@ async function createLinearLabel(apiKey, teamId, def, parentId) {
|
|
|
120
120
|
color: `#${def.color}`,
|
|
121
121
|
description: def.description,
|
|
122
122
|
...(parentId ? { parentId } : {}),
|
|
123
|
+
...(def === AGENT_PARENT ? { isGroup: true } : {}),
|
|
123
124
|
},
|
|
124
125
|
});
|
|
125
126
|
if (!data.issueLabelCreate.success)
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { execute } from "./executor.js";
|
|
|
27
27
|
export type { ExecuteOptions } from "./executor.js";
|
|
28
28
|
export { ClaudeClient } from "./claude.js";
|
|
29
29
|
export type { ClaudeClientOptions } from "./claude.js";
|
|
30
|
-
export { github, linear, slack, sentry, datadog,
|
|
30
|
+
export { github, linear, slack, sentry, datadog, notification, builtinSkills, createSkillMap, allSkills, isSkillConfigured, configuredSkills, validateWorkflowSkills, } from "./skills/index.js";
|
|
31
31
|
export type { SkillValidationResult } from "./skills/index.js";
|
|
32
32
|
export { workflowZ, nodeZ, edgeZ, skillZ, parseWorkflow, validateWorkflow, workflowJsonSchema } from "./schema.js";
|
|
33
33
|
export type { WorkflowError } from "./schema.js";
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export { execute } from "./executor.js";
|
|
|
27
27
|
// Claude client
|
|
28
28
|
export { ClaudeClient } from "./claude.js";
|
|
29
29
|
// Skills
|
|
30
|
-
export { github, linear, slack, sentry, datadog,
|
|
30
|
+
export { github, linear, slack, sentry, datadog, notification, builtinSkills, createSkillMap, allSkills, isSkillConfigured, configuredSkills, validateWorkflowSkills, } from "./skills/index.js";
|
|
31
31
|
// Schema & validation
|
|
32
32
|
export { workflowZ, nodeZ, edgeZ, skillZ, parseWorkflow, validateWorkflow, workflowJsonSchema } from "./schema.js";
|
|
33
33
|
// MCP auto-injection
|
package/dist/mcp.js
CHANGED
|
@@ -106,8 +106,10 @@ export function buildAutoMcpServers(config) {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
// Better Stack MCP — HTTP remote MCP; Bearer token auth.
|
|
109
|
+
// Injected whenever the token is present (not just when it's the primary provider)
|
|
110
|
+
// because BetterStack logs complement any primary observability provider.
|
|
109
111
|
const bsApiToken = creds.BETTERSTACK_API_TOKEN;
|
|
110
|
-
if (
|
|
112
|
+
if (bsApiToken) {
|
|
111
113
|
auto["betterstack"] = {
|
|
112
114
|
type: "http",
|
|
113
115
|
url: "https://mcp.betterstack.com",
|
package/dist/mcp.test.js
CHANGED
|
@@ -175,6 +175,19 @@ describe("buildAutoMcpServers", () => {
|
|
|
175
175
|
headers: { Authorization: "Bearer bst_abc" },
|
|
176
176
|
});
|
|
177
177
|
});
|
|
178
|
+
it("injects Better Stack MCP even when primary provider is not betterstack", () => {
|
|
179
|
+
const result = buildAutoMcpServers(cfg({
|
|
180
|
+
observabilityProvider: "sentry",
|
|
181
|
+
credentials: { BETTERSTACK_API_TOKEN: "bst_xyz", SENTRY_AUTH_TOKEN: "sntrx_test" },
|
|
182
|
+
}));
|
|
183
|
+
expect(result["betterstack"]).toEqual({
|
|
184
|
+
type: "http",
|
|
185
|
+
url: "https://mcp.betterstack.com",
|
|
186
|
+
headers: { Authorization: "Bearer bst_xyz" },
|
|
187
|
+
});
|
|
188
|
+
// Sentry should also be present
|
|
189
|
+
expect(result["sentry"]).toBeDefined();
|
|
190
|
+
});
|
|
178
191
|
// ── Jira MCP ────────────────────────────────────────────────────
|
|
179
192
|
it("injects Jira MCP when all 3 credentials present", () => {
|
|
180
193
|
const result = buildAutoMcpServers(cfg({
|
package/dist/skills/index.d.ts
CHANGED
|
@@ -9,10 +9,9 @@ import { linear } from "./linear.js";
|
|
|
9
9
|
import { slack } from "./slack.js";
|
|
10
10
|
import { sentry } from "./sentry.js";
|
|
11
11
|
import { datadog } from "./datadog.js";
|
|
12
|
-
import { betterstack } from "./betterstack.js";
|
|
13
12
|
import { notification } from "./notification.js";
|
|
14
13
|
export declare const builtinSkills: Skill[];
|
|
15
|
-
export { github, linear, slack, sentry, datadog,
|
|
14
|
+
export { github, linear, slack, sentry, datadog, notification };
|
|
16
15
|
/**
|
|
17
16
|
* Build a skill map from an array of skills.
|
|
18
17
|
* Pass to `execute()` as the `skills` option.
|
package/dist/skills/index.js
CHANGED
|
@@ -8,11 +8,10 @@ import { linear } from "./linear.js";
|
|
|
8
8
|
import { slack } from "./slack.js";
|
|
9
9
|
import { sentry } from "./sentry.js";
|
|
10
10
|
import { datadog } from "./datadog.js";
|
|
11
|
-
import { betterstack } from "./betterstack.js";
|
|
12
11
|
import { notification } from "./notification.js";
|
|
13
12
|
// ─── Built-in skill catalog ─────────────────────────────────────
|
|
14
|
-
export const builtinSkills = [github, linear, slack, sentry, datadog,
|
|
15
|
-
export { github, linear, slack, sentry, datadog,
|
|
13
|
+
export const builtinSkills = [github, linear, slack, sentry, datadog, notification];
|
|
14
|
+
export { github, linear, slack, sentry, datadog, notification };
|
|
16
15
|
// ─── Registry helpers ───────────────────────────────────────────
|
|
17
16
|
/**
|
|
18
17
|
* Build a skill map from an array of skills.
|
package/dist/workflows/triage.js
CHANGED
|
@@ -29,7 +29,7 @@ export const triageWorkflow = {
|
|
|
29
29
|
3. **Issue tracker**: Search for similar past issues or known problems.
|
|
30
30
|
|
|
31
31
|
Be thorough — the investigation step depends on complete context. Use every tool available to you.`,
|
|
32
|
-
skills: ["github", "sentry", "datadog", "
|
|
32
|
+
skills: ["github", "sentry", "datadog", "linear"],
|
|
33
33
|
},
|
|
34
34
|
investigate: {
|
|
35
35
|
name: "Root Cause Analysis",
|
package/package.json
CHANGED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BetterStack Skill
|
|
3
|
-
*
|
|
4
|
-
* Uptime monitoring (incidents, monitors) and log search via BetterStack APIs.
|
|
5
|
-
*/
|
|
6
|
-
const UPTIME_BASE = "https://uptime.betterstack.com/api/v2";
|
|
7
|
-
async function uptimeApi(path, ctx, init) {
|
|
8
|
-
const res = await fetch(`${UPTIME_BASE}${path}`, {
|
|
9
|
-
...init,
|
|
10
|
-
headers: {
|
|
11
|
-
Authorization: `Bearer ${ctx.config.BETTERSTACK_API_TOKEN}`,
|
|
12
|
-
"Content-Type": "application/json",
|
|
13
|
-
...init?.headers,
|
|
14
|
-
},
|
|
15
|
-
signal: AbortSignal.timeout(30_000),
|
|
16
|
-
});
|
|
17
|
-
if (!res.ok)
|
|
18
|
-
throw new Error(`[BetterStack] API request failed (HTTP ${res.status}): ${await res.text()}`);
|
|
19
|
-
return res.json();
|
|
20
|
-
}
|
|
21
|
-
export const betterstack = {
|
|
22
|
-
id: "betterstack",
|
|
23
|
-
name: "BetterStack",
|
|
24
|
-
description: "Query incidents, monitors, and logs from BetterStack (Better Uptime + Logtail)",
|
|
25
|
-
category: "observability",
|
|
26
|
-
config: {
|
|
27
|
-
BETTERSTACK_API_TOKEN: {
|
|
28
|
-
description: "BetterStack API token (from Uptime > Settings > API)",
|
|
29
|
-
required: true,
|
|
30
|
-
env: "BETTERSTACK_API_TOKEN",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
tools: [
|
|
34
|
-
{
|
|
35
|
-
name: "betterstack_list_incidents",
|
|
36
|
-
description: "List recent incidents from BetterStack Uptime. Returns ongoing and resolved incidents.",
|
|
37
|
-
input_schema: {
|
|
38
|
-
type: "object",
|
|
39
|
-
properties: {
|
|
40
|
-
from: { type: "string", description: "ISO 8601 start date (e.g. 2024-01-01T00:00:00Z)" },
|
|
41
|
-
to: { type: "string", description: "ISO 8601 end date" },
|
|
42
|
-
per_page: { type: "number", description: "Results per page (default 20, max 100)" },
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
handler: async (input, ctx) => {
|
|
46
|
-
const params = new URLSearchParams();
|
|
47
|
-
if (input.from)
|
|
48
|
-
params.set("from", input.from);
|
|
49
|
-
if (input.to)
|
|
50
|
-
params.set("to", input.to);
|
|
51
|
-
if (input.per_page)
|
|
52
|
-
params.set("per_page", String(input.per_page));
|
|
53
|
-
const qs = params.toString();
|
|
54
|
-
return uptimeApi(`/incidents${qs ? `?${qs}` : ""}`, ctx);
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "betterstack_get_incident",
|
|
59
|
-
description: "Get detailed information about a specific incident including timeline.",
|
|
60
|
-
input_schema: {
|
|
61
|
-
type: "object",
|
|
62
|
-
properties: {
|
|
63
|
-
incident_id: { type: "string", description: "Incident ID" },
|
|
64
|
-
},
|
|
65
|
-
required: ["incident_id"],
|
|
66
|
-
},
|
|
67
|
-
handler: async (input, ctx) => {
|
|
68
|
-
return uptimeApi(`/incidents/${input.incident_id}`, ctx);
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "betterstack_list_monitors",
|
|
73
|
-
description: "List all monitors (uptime checks) and their current status.",
|
|
74
|
-
input_schema: {
|
|
75
|
-
type: "object",
|
|
76
|
-
properties: {
|
|
77
|
-
per_page: { type: "number", description: "Results per page (default 20, max 100)" },
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
handler: async (input, ctx) => {
|
|
81
|
-
const params = new URLSearchParams();
|
|
82
|
-
if (input.per_page)
|
|
83
|
-
params.set("per_page", String(input.per_page));
|
|
84
|
-
const qs = params.toString();
|
|
85
|
-
return uptimeApi(`/monitors${qs ? `?${qs}` : ""}`, ctx);
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "betterstack_get_monitor",
|
|
90
|
-
description: "Get details and recent status of a specific monitor.",
|
|
91
|
-
input_schema: {
|
|
92
|
-
type: "object",
|
|
93
|
-
properties: {
|
|
94
|
-
monitor_id: { type: "string", description: "Monitor ID" },
|
|
95
|
-
},
|
|
96
|
-
required: ["monitor_id"],
|
|
97
|
-
},
|
|
98
|
-
handler: async (input, ctx) => {
|
|
99
|
-
return uptimeApi(`/monitors/${input.monitor_id}`, ctx);
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: "betterstack_list_on_call",
|
|
104
|
-
description: "List current on-call calendars and who is on-call.",
|
|
105
|
-
input_schema: {
|
|
106
|
-
type: "object",
|
|
107
|
-
properties: {},
|
|
108
|
-
},
|
|
109
|
-
handler: async (_input, ctx) => {
|
|
110
|
-
return uptimeApi("/on-calls", ctx);
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
};
|