opencode-swarm-plugin 0.42.9 → 0.44.0
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/.hive/issues.jsonl +14 -0
- package/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +110 -0
- package/README.md +296 -6
- package/bin/cass.characterization.test.ts +422 -0
- package/bin/swarm.test.ts +683 -0
- package/bin/swarm.ts +501 -0
- package/dist/contributor-tools.d.ts +42 -0
- package/dist/contributor-tools.d.ts.map +1 -0
- package/dist/dashboard.d.ts +83 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/error-enrichment.d.ts +49 -0
- package/dist/error-enrichment.d.ts.map +1 -0
- package/dist/export-tools.d.ts +76 -0
- package/dist/export-tools.d.ts.map +1 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +95 -2
- package/dist/observability-tools.d.ts +2 -2
- package/dist/plugin.js +95 -2
- package/dist/query-tools.d.ts +59 -0
- package/dist/query-tools.d.ts.map +1 -0
- package/dist/replay-tools.d.ts +28 -0
- package/dist/replay-tools.d.ts.map +1 -0
- package/dist/sessions/agent-discovery.d.ts +59 -0
- package/dist/sessions/agent-discovery.d.ts.map +1 -0
- package/dist/sessions/index.d.ts +10 -0
- package/dist/sessions/index.d.ts.map +1 -0
- package/docs/planning/ADR-010-cass-inhousing.md +1215 -0
- package/evals/fixtures/cass-baseline.ts +217 -0
- package/examples/plugin-wrapper-template.ts +89 -0
- package/package.json +1 -1
- package/src/contributor-tools.test.ts +133 -0
- package/src/contributor-tools.ts +201 -0
- package/src/dashboard.test.ts +611 -0
- package/src/dashboard.ts +462 -0
- package/src/error-enrichment.test.ts +403 -0
- package/src/error-enrichment.ts +219 -0
- package/src/export-tools.test.ts +476 -0
- package/src/export-tools.ts +257 -0
- package/src/index.ts +8 -3
- package/src/query-tools.test.ts +636 -0
- package/src/query-tools.ts +324 -0
- package/src/replay-tools.test.ts +496 -0
- package/src/replay-tools.ts +240 -0
- package/src/sessions/agent-discovery.test.ts +137 -0
- package/src/sessions/agent-discovery.ts +112 -0
- package/src/sessions/index.ts +15 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Enrichment - Structured error context for swarm agents
|
|
3
|
+
*
|
|
4
|
+
* TDD GREEN: Minimal implementation to pass tests
|
|
5
|
+
*/
|
|
6
|
+
export interface SwarmErrorContext {
|
|
7
|
+
file?: string;
|
|
8
|
+
line?: number;
|
|
9
|
+
agent?: string;
|
|
10
|
+
epic_id?: string;
|
|
11
|
+
bead_id?: string;
|
|
12
|
+
recent_events?: Array<{
|
|
13
|
+
type: string;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* SwarmError - Error class with structured context
|
|
20
|
+
*/
|
|
21
|
+
export declare class SwarmError extends Error {
|
|
22
|
+
context: SwarmErrorContext;
|
|
23
|
+
constructor(message: string, context?: SwarmErrorContext);
|
|
24
|
+
toJSON(): {
|
|
25
|
+
name: string;
|
|
26
|
+
message: string;
|
|
27
|
+
context: SwarmErrorContext;
|
|
28
|
+
stack: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* enrichError - Convert any error to SwarmError with context
|
|
33
|
+
*/
|
|
34
|
+
export declare function enrichError(error: unknown, context: SwarmErrorContext): SwarmError;
|
|
35
|
+
/**
|
|
36
|
+
* debugLog - Conditional logging based on DEBUG env var
|
|
37
|
+
*
|
|
38
|
+
* Patterns:
|
|
39
|
+
* - DEBUG=swarm:* (all)
|
|
40
|
+
* - DEBUG=swarm:coordinator
|
|
41
|
+
* - DEBUG=swarm:worker
|
|
42
|
+
* - DEBUG=swarm:mail
|
|
43
|
+
*/
|
|
44
|
+
export declare function debugLog(namespace: string, message: string, data?: unknown): void;
|
|
45
|
+
/**
|
|
46
|
+
* suggestFix - Pattern matching for common swarm errors
|
|
47
|
+
*/
|
|
48
|
+
export declare function suggestFix(error: Error | SwarmError): string | null;
|
|
49
|
+
//# sourceMappingURL=error-enrichment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-enrichment.d.ts","sourceRoot":"","sources":["../src/error-enrichment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,iBAAiB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,KAAK,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,OAAO,EAAE,iBAAiB,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;IAW5D,MAAM;;;;;;CAQN;AAED;;GAEG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,iBAAiB,GACxB,UAAU,CAyBZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,OAAO,GACZ,IAAI,CAyBN;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CA8EnE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export Tools - Convert Cell Events to Various Formats
|
|
3
|
+
*
|
|
4
|
+
* GREEN PHASE: Minimal implementation to pass tests
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - OTLP (OpenTelemetry Protocol) - for distributed tracing
|
|
8
|
+
* - CSV - for spreadsheet analysis
|
|
9
|
+
* - JSON - for generic data interchange
|
|
10
|
+
*/
|
|
11
|
+
import type { CellEvent } from "./schemas/cell-events.js";
|
|
12
|
+
/**
|
|
13
|
+
* OpenTelemetry OTLP span structure
|
|
14
|
+
*/
|
|
15
|
+
interface OTLPSpan {
|
|
16
|
+
traceId: string;
|
|
17
|
+
spanId: string;
|
|
18
|
+
name: string;
|
|
19
|
+
startTimeUnixNano: string;
|
|
20
|
+
attributes: Array<{
|
|
21
|
+
key: string;
|
|
22
|
+
value: {
|
|
23
|
+
stringValue?: string;
|
|
24
|
+
intValue?: number;
|
|
25
|
+
boolValue?: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
interface OTLPOutput {
|
|
30
|
+
resourceSpans: Array<{
|
|
31
|
+
resource: {
|
|
32
|
+
attributes: Array<{
|
|
33
|
+
key: string;
|
|
34
|
+
value: {
|
|
35
|
+
stringValue: string;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
scopeSpans: Array<{
|
|
40
|
+
scope: {
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
spans: OTLPSpan[];
|
|
44
|
+
}>;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Export cell events to OpenTelemetry OTLP format
|
|
49
|
+
*
|
|
50
|
+
* Mapping:
|
|
51
|
+
* - epic_id (from metadata) → trace_id (32 hex chars)
|
|
52
|
+
* - cell_id → span_id (16 hex chars)
|
|
53
|
+
* - timestamp → startTimeUnixNano (nanoseconds as string)
|
|
54
|
+
* - event.type → span.name
|
|
55
|
+
* - event payload → span.attributes
|
|
56
|
+
*/
|
|
57
|
+
export declare function exportToOTLP(events: CellEvent[]): OTLPOutput;
|
|
58
|
+
/**
|
|
59
|
+
* Export cell events to CSV format
|
|
60
|
+
*
|
|
61
|
+
* Format:
|
|
62
|
+
* - Headers: id,type,timestamp,project_key,cell_id,payload
|
|
63
|
+
* - Payload: JSON serialization of entire event (minus headers)
|
|
64
|
+
*/
|
|
65
|
+
export declare function exportToCSV(events: CellEvent[]): string;
|
|
66
|
+
/**
|
|
67
|
+
* Export cell events to JSON format
|
|
68
|
+
*
|
|
69
|
+
* Format:
|
|
70
|
+
* - Array of event objects
|
|
71
|
+
* - Pretty-printed with 2-space indentation
|
|
72
|
+
* - Preserves all fields and discriminated union types
|
|
73
|
+
*/
|
|
74
|
+
export declare function exportToJSON(events: CellEvent[]): string;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=export-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-tools.d.ts","sourceRoot":"","sources":["../src/export-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAO1D;;GAEG;AACH,UAAU,QAAQ;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,KAAK,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE;YACL,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,SAAS,CAAC,EAAE,OAAO,CAAC;SACrB,CAAC;KACH,CAAC,CAAC;CACJ;AAED,UAAU,UAAU;IAClB,aAAa,EAAE,KAAK,CAAC;QACnB,QAAQ,EAAE;YACR,UAAU,EAAE,KAAK,CAAC;gBAChB,GAAG,EAAE,MAAM,CAAC;gBACZ,KAAK,EAAE;oBAAE,WAAW,EAAE,MAAM,CAAA;iBAAE,CAAC;aAChC,CAAC,CAAC;SACJ,CAAC;QACF,UAAU,EAAE,KAAK,CAAC;YAChB,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM,CAAC;aACd,CAAC;YACF,KAAK,EAAE,QAAQ,EAAE,CAAC;SACnB,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ;AA6ED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAiD5D;AAsBD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAoBvD;AAMD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAMxD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import type { Plugin } from "@opencode-ai/plugin";
|
|
|
35
35
|
* - skills:* - Agent skills discovery, activation, and execution
|
|
36
36
|
* - mandate:* - Agent voting system for collaborative knowledge curation
|
|
37
37
|
* - semantic-memory:* - Semantic memory with vector embeddings (Ollama + PGLite)
|
|
38
|
+
* - contributor_lookup - GitHub contributor profile lookup with changeset credit generation
|
|
38
39
|
*
|
|
39
40
|
* @param input - Plugin context from OpenCode
|
|
40
41
|
* @returns Plugin hooks including tools, events, and tool execution hooks
|
|
@@ -139,6 +140,17 @@ export { swarmTools, SwarmError, DecompositionError, formatSubtaskPrompt, format
|
|
|
139
140
|
* Note: hiveTools includes both hive_* and beads_* (legacy aliases)
|
|
140
141
|
*/
|
|
141
142
|
export declare const allTools: {
|
|
143
|
+
readonly contributor_lookup: {
|
|
144
|
+
description: string;
|
|
145
|
+
args: {
|
|
146
|
+
login: import("zod").ZodString;
|
|
147
|
+
issue: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
148
|
+
};
|
|
149
|
+
execute(args: {
|
|
150
|
+
login: string;
|
|
151
|
+
issue?: number | undefined;
|
|
152
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
153
|
+
};
|
|
142
154
|
readonly swarm_analytics: {
|
|
143
155
|
description: string;
|
|
144
156
|
args: {
|
|
@@ -171,13 +183,13 @@ export declare const allTools: {
|
|
|
171
183
|
args: {
|
|
172
184
|
sql: import("zod").ZodString;
|
|
173
185
|
format: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
174
|
-
json: "json";
|
|
175
186
|
table: "table";
|
|
187
|
+
json: "json";
|
|
176
188
|
}>>;
|
|
177
189
|
};
|
|
178
190
|
execute(args: {
|
|
179
191
|
sql: string;
|
|
180
|
-
format?: "
|
|
192
|
+
format?: "table" | "json" | undefined;
|
|
181
193
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
182
194
|
};
|
|
183
195
|
readonly swarm_diagnose: {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;AA+CtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,WAAW,EAAE,MA6QlB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAe,WAAW,CAAC;AAM3B;;GAEG;AACH,cAAc,WAAW,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,cAAc,QAAQ,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,EACtB,oBAA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AAa,GACnB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -119504,6 +119504,97 @@ var evalTools = {
|
|
|
119504
119504
|
eval_run
|
|
119505
119505
|
};
|
|
119506
119506
|
|
|
119507
|
+
// src/contributor-tools.ts
|
|
119508
|
+
init_dist();
|
|
119509
|
+
init_zod();
|
|
119510
|
+
var GitHubUserSchema = exports_external.object({
|
|
119511
|
+
login: exports_external.string(),
|
|
119512
|
+
name: exports_external.string().nullable(),
|
|
119513
|
+
twitter_username: exports_external.string().nullable(),
|
|
119514
|
+
blog: exports_external.string().nullable(),
|
|
119515
|
+
bio: exports_external.string().nullable(),
|
|
119516
|
+
avatar_url: exports_external.string(),
|
|
119517
|
+
html_url: exports_external.string(),
|
|
119518
|
+
public_repos: exports_external.number().optional(),
|
|
119519
|
+
followers: exports_external.number().optional()
|
|
119520
|
+
});
|
|
119521
|
+
async function fetchGitHubUser(login) {
|
|
119522
|
+
const result = await Bun.$`gh api users/${login}`.json();
|
|
119523
|
+
return GitHubUserSchema.parse(result);
|
|
119524
|
+
}
|
|
119525
|
+
function formatCreditLine(user, issueNumber) {
|
|
119526
|
+
const issueText = issueNumber ? `reporting #${issueNumber}` : "the report";
|
|
119527
|
+
if (user.name && user.twitter_username) {
|
|
119528
|
+
return `Thanks to ${user.name} ([@${user.twitter_username}](https://x.com/${user.twitter_username})) for ${issueText}!`;
|
|
119529
|
+
}
|
|
119530
|
+
if (user.twitter_username) {
|
|
119531
|
+
return `Thanks to [@${user.twitter_username}](https://x.com/${user.twitter_username}) for ${issueText}!`;
|
|
119532
|
+
}
|
|
119533
|
+
if (user.name) {
|
|
119534
|
+
return `Thanks to ${user.name} (@${user.login} on GitHub) for ${issueText}!`;
|
|
119535
|
+
}
|
|
119536
|
+
return `Thanks to @${user.login} for ${issueText}!`;
|
|
119537
|
+
}
|
|
119538
|
+
async function storeContributorMemory(user, issueNumber) {
|
|
119539
|
+
try {
|
|
119540
|
+
const adapter = await getMemoryAdapter();
|
|
119541
|
+
const twitterPart = user.twitter_username ? ` (@${user.twitter_username} on Twitter)` : "";
|
|
119542
|
+
const issuePart = issueNumber ? `. Filed issue #${issueNumber}` : "";
|
|
119543
|
+
const bioPart = user.bio ? `. Bio: '${user.bio}'` : "";
|
|
119544
|
+
const tags = [
|
|
119545
|
+
"contributor",
|
|
119546
|
+
user.login,
|
|
119547
|
+
issueNumber ? `issue-${issueNumber}` : null
|
|
119548
|
+
].filter(Boolean).join(",");
|
|
119549
|
+
const information = `Contributor @${user.login}: ${user.name || user.login}${twitterPart}${issuePart}${bioPart}`;
|
|
119550
|
+
await adapter.store({
|
|
119551
|
+
information,
|
|
119552
|
+
tags
|
|
119553
|
+
});
|
|
119554
|
+
return true;
|
|
119555
|
+
} catch (error45) {
|
|
119556
|
+
console.error("Failed to store contributor memory:", error45);
|
|
119557
|
+
return false;
|
|
119558
|
+
}
|
|
119559
|
+
}
|
|
119560
|
+
var contributor_lookup = tool({
|
|
119561
|
+
description: "Fetch GitHub contributor profile and generate formatted changeset credit. Automatically stores contributor info in semantic-memory. Returns login, name, twitter, bio, and ready-to-paste credit_line.",
|
|
119562
|
+
args: {
|
|
119563
|
+
login: tool.schema.string().describe("GitHub username (required)"),
|
|
119564
|
+
issue: tool.schema.number().optional().describe("Issue number for context (optional)")
|
|
119565
|
+
},
|
|
119566
|
+
async execute(args2, _ctx) {
|
|
119567
|
+
try {
|
|
119568
|
+
const user = await fetchGitHubUser(args2.login);
|
|
119569
|
+
const creditLine = formatCreditLine(user, args2.issue);
|
|
119570
|
+
const memoryStored = await storeContributorMemory(user, args2.issue);
|
|
119571
|
+
const result = {
|
|
119572
|
+
login: user.login,
|
|
119573
|
+
name: user.name,
|
|
119574
|
+
twitter: user.twitter_username,
|
|
119575
|
+
bio: user.bio,
|
|
119576
|
+
credit_line: creditLine,
|
|
119577
|
+
memory_stored: memoryStored
|
|
119578
|
+
};
|
|
119579
|
+
return JSON.stringify(result, null, 2);
|
|
119580
|
+
} catch (error45) {
|
|
119581
|
+
if (error45 instanceof Error) {
|
|
119582
|
+
return JSON.stringify({
|
|
119583
|
+
error: error45.message,
|
|
119584
|
+
login: args2.login
|
|
119585
|
+
});
|
|
119586
|
+
}
|
|
119587
|
+
return JSON.stringify({
|
|
119588
|
+
error: "Unknown error fetching contributor",
|
|
119589
|
+
login: args2.login
|
|
119590
|
+
});
|
|
119591
|
+
}
|
|
119592
|
+
}
|
|
119593
|
+
});
|
|
119594
|
+
var contributorTools = {
|
|
119595
|
+
contributor_lookup
|
|
119596
|
+
};
|
|
119597
|
+
|
|
119507
119598
|
// src/output-guardrails.ts
|
|
119508
119599
|
var DEFAULT_GUARDRAIL_CONFIG = {
|
|
119509
119600
|
defaultMaxChars: 32000,
|
|
@@ -121343,7 +121434,8 @@ var SwarmPlugin = async (input) => {
|
|
|
121343
121434
|
...memoryTools,
|
|
121344
121435
|
...observabilityTools,
|
|
121345
121436
|
...researchTools,
|
|
121346
|
-
...evalTools
|
|
121437
|
+
...evalTools,
|
|
121438
|
+
...contributorTools
|
|
121347
121439
|
},
|
|
121348
121440
|
event: async ({ event }) => {
|
|
121349
121441
|
if (event.type === "session.idle") {
|
|
@@ -121448,7 +121540,8 @@ var allTools = {
|
|
|
121448
121540
|
...skillsTools,
|
|
121449
121541
|
...mandateTools,
|
|
121450
121542
|
...memoryTools,
|
|
121451
|
-
...observabilityTools
|
|
121543
|
+
...observabilityTools,
|
|
121544
|
+
...contributorTools
|
|
121452
121545
|
};
|
|
121453
121546
|
export {
|
|
121454
121547
|
withToolFallback,
|
|
@@ -126,13 +126,13 @@ export declare const observabilityTools: {
|
|
|
126
126
|
args: {
|
|
127
127
|
sql: import("zod").ZodString;
|
|
128
128
|
format: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
129
|
-
json: "json";
|
|
130
129
|
table: "table";
|
|
130
|
+
json: "json";
|
|
131
131
|
}>>;
|
|
132
132
|
};
|
|
133
133
|
execute(args: {
|
|
134
134
|
sql: string;
|
|
135
|
-
format?: "
|
|
135
|
+
format?: "table" | "json" | undefined;
|
|
136
136
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
137
137
|
};
|
|
138
138
|
swarm_diagnose: {
|
package/dist/plugin.js
CHANGED
|
@@ -119053,6 +119053,97 @@ var evalTools = {
|
|
|
119053
119053
|
eval_run
|
|
119054
119054
|
};
|
|
119055
119055
|
|
|
119056
|
+
// src/contributor-tools.ts
|
|
119057
|
+
init_dist();
|
|
119058
|
+
init_zod();
|
|
119059
|
+
var GitHubUserSchema = exports_external.object({
|
|
119060
|
+
login: exports_external.string(),
|
|
119061
|
+
name: exports_external.string().nullable(),
|
|
119062
|
+
twitter_username: exports_external.string().nullable(),
|
|
119063
|
+
blog: exports_external.string().nullable(),
|
|
119064
|
+
bio: exports_external.string().nullable(),
|
|
119065
|
+
avatar_url: exports_external.string(),
|
|
119066
|
+
html_url: exports_external.string(),
|
|
119067
|
+
public_repos: exports_external.number().optional(),
|
|
119068
|
+
followers: exports_external.number().optional()
|
|
119069
|
+
});
|
|
119070
|
+
async function fetchGitHubUser(login) {
|
|
119071
|
+
const result = await Bun.$`gh api users/${login}`.json();
|
|
119072
|
+
return GitHubUserSchema.parse(result);
|
|
119073
|
+
}
|
|
119074
|
+
function formatCreditLine(user, issueNumber) {
|
|
119075
|
+
const issueText = issueNumber ? `reporting #${issueNumber}` : "the report";
|
|
119076
|
+
if (user.name && user.twitter_username) {
|
|
119077
|
+
return `Thanks to ${user.name} ([@${user.twitter_username}](https://x.com/${user.twitter_username})) for ${issueText}!`;
|
|
119078
|
+
}
|
|
119079
|
+
if (user.twitter_username) {
|
|
119080
|
+
return `Thanks to [@${user.twitter_username}](https://x.com/${user.twitter_username}) for ${issueText}!`;
|
|
119081
|
+
}
|
|
119082
|
+
if (user.name) {
|
|
119083
|
+
return `Thanks to ${user.name} (@${user.login} on GitHub) for ${issueText}!`;
|
|
119084
|
+
}
|
|
119085
|
+
return `Thanks to @${user.login} for ${issueText}!`;
|
|
119086
|
+
}
|
|
119087
|
+
async function storeContributorMemory(user, issueNumber) {
|
|
119088
|
+
try {
|
|
119089
|
+
const adapter = await getMemoryAdapter();
|
|
119090
|
+
const twitterPart = user.twitter_username ? ` (@${user.twitter_username} on Twitter)` : "";
|
|
119091
|
+
const issuePart = issueNumber ? `. Filed issue #${issueNumber}` : "";
|
|
119092
|
+
const bioPart = user.bio ? `. Bio: '${user.bio}'` : "";
|
|
119093
|
+
const tags = [
|
|
119094
|
+
"contributor",
|
|
119095
|
+
user.login,
|
|
119096
|
+
issueNumber ? `issue-${issueNumber}` : null
|
|
119097
|
+
].filter(Boolean).join(",");
|
|
119098
|
+
const information = `Contributor @${user.login}: ${user.name || user.login}${twitterPart}${issuePart}${bioPart}`;
|
|
119099
|
+
await adapter.store({
|
|
119100
|
+
information,
|
|
119101
|
+
tags
|
|
119102
|
+
});
|
|
119103
|
+
return true;
|
|
119104
|
+
} catch (error45) {
|
|
119105
|
+
console.error("Failed to store contributor memory:", error45);
|
|
119106
|
+
return false;
|
|
119107
|
+
}
|
|
119108
|
+
}
|
|
119109
|
+
var contributor_lookup = tool({
|
|
119110
|
+
description: "Fetch GitHub contributor profile and generate formatted changeset credit. Automatically stores contributor info in semantic-memory. Returns login, name, twitter, bio, and ready-to-paste credit_line.",
|
|
119111
|
+
args: {
|
|
119112
|
+
login: tool.schema.string().describe("GitHub username (required)"),
|
|
119113
|
+
issue: tool.schema.number().optional().describe("Issue number for context (optional)")
|
|
119114
|
+
},
|
|
119115
|
+
async execute(args2, _ctx) {
|
|
119116
|
+
try {
|
|
119117
|
+
const user = await fetchGitHubUser(args2.login);
|
|
119118
|
+
const creditLine = formatCreditLine(user, args2.issue);
|
|
119119
|
+
const memoryStored = await storeContributorMemory(user, args2.issue);
|
|
119120
|
+
const result = {
|
|
119121
|
+
login: user.login,
|
|
119122
|
+
name: user.name,
|
|
119123
|
+
twitter: user.twitter_username,
|
|
119124
|
+
bio: user.bio,
|
|
119125
|
+
credit_line: creditLine,
|
|
119126
|
+
memory_stored: memoryStored
|
|
119127
|
+
};
|
|
119128
|
+
return JSON.stringify(result, null, 2);
|
|
119129
|
+
} catch (error45) {
|
|
119130
|
+
if (error45 instanceof Error) {
|
|
119131
|
+
return JSON.stringify({
|
|
119132
|
+
error: error45.message,
|
|
119133
|
+
login: args2.login
|
|
119134
|
+
});
|
|
119135
|
+
}
|
|
119136
|
+
return JSON.stringify({
|
|
119137
|
+
error: "Unknown error fetching contributor",
|
|
119138
|
+
login: args2.login
|
|
119139
|
+
});
|
|
119140
|
+
}
|
|
119141
|
+
}
|
|
119142
|
+
});
|
|
119143
|
+
var contributorTools = {
|
|
119144
|
+
contributor_lookup
|
|
119145
|
+
};
|
|
119146
|
+
|
|
119056
119147
|
// src/output-guardrails.ts
|
|
119057
119148
|
var DEFAULT_GUARDRAIL_CONFIG = {
|
|
119058
119149
|
defaultMaxChars: 32000,
|
|
@@ -120539,7 +120630,8 @@ var SwarmPlugin = async (input) => {
|
|
|
120539
120630
|
...memoryTools,
|
|
120540
120631
|
...observabilityTools,
|
|
120541
120632
|
...researchTools,
|
|
120542
|
-
...evalTools
|
|
120633
|
+
...evalTools,
|
|
120634
|
+
...contributorTools
|
|
120543
120635
|
},
|
|
120544
120636
|
event: async ({ event }) => {
|
|
120545
120637
|
if (event.type === "session.idle") {
|
|
@@ -120644,7 +120736,8 @@ var allTools = {
|
|
|
120644
120736
|
...skillsTools,
|
|
120645
120737
|
...mandateTools,
|
|
120646
120738
|
...memoryTools,
|
|
120647
|
-
...observabilityTools
|
|
120739
|
+
...observabilityTools,
|
|
120740
|
+
...contributorTools
|
|
120648
120741
|
};
|
|
120649
120742
|
|
|
120650
120743
|
// src/plugin.ts
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GREEN PHASE: SQL Query Tools Implementation
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* - 10 preset queries for observability insights
|
|
6
|
+
* - Custom SQL execution with timing
|
|
7
|
+
* - 3 output formats: Table (box-drawing), CSV, JSON
|
|
8
|
+
*/
|
|
9
|
+
import type { DatabaseAdapter } from "swarm-mail";
|
|
10
|
+
export type PresetQueryName = "failed_decompositions" | "duration_by_strategy" | "file_conflicts" | "worker_success_rate" | "review_rejections" | "blocked_tasks" | "agent_activity" | "event_frequency" | "error_patterns" | "compaction_stats";
|
|
11
|
+
export interface QueryResult {
|
|
12
|
+
columns: string[];
|
|
13
|
+
rows: Record<string, unknown>[];
|
|
14
|
+
rowCount: number;
|
|
15
|
+
executionTimeMs: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const presetQueries: Record<PresetQueryName, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Execute custom SQL against the events table.
|
|
20
|
+
*
|
|
21
|
+
* @param db - DatabaseAdapter instance
|
|
22
|
+
* @param sql - SQL query string
|
|
23
|
+
* @param params - Optional parameterized query values
|
|
24
|
+
* @returns QueryResult with rows, columns, timing
|
|
25
|
+
*/
|
|
26
|
+
export declare function executeQuery(db: DatabaseAdapter, sql: string, params?: unknown[]): Promise<QueryResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Format query result as aligned table with box-drawing characters.
|
|
29
|
+
*
|
|
30
|
+
* Example output:
|
|
31
|
+
* ┌──────────┬───────┐
|
|
32
|
+
* │ name │ count │
|
|
33
|
+
* ├──────────┼───────┤
|
|
34
|
+
* │ AgentA │ 5 │
|
|
35
|
+
* │ AgentB │ 3 │
|
|
36
|
+
* └──────────┴───────┘
|
|
37
|
+
* 2 rows in 5.2ms
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatAsTable(result: QueryResult): string;
|
|
40
|
+
/**
|
|
41
|
+
* Format query result as CSV with proper escaping.
|
|
42
|
+
*
|
|
43
|
+
* Escapes:
|
|
44
|
+
* - Commas → wrap in quotes
|
|
45
|
+
* - Quotes → double them
|
|
46
|
+
* - Newlines → wrap in quotes
|
|
47
|
+
*/
|
|
48
|
+
export declare function formatAsCSV(result: QueryResult): string;
|
|
49
|
+
/**
|
|
50
|
+
* Format query result as pretty-printed JSON array.
|
|
51
|
+
*
|
|
52
|
+
* Example:
|
|
53
|
+
* [
|
|
54
|
+
* { "name": "AgentA", "count": 5 },
|
|
55
|
+
* { "name": "AgentB", "count": 3 }
|
|
56
|
+
* ]
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatAsJSON(result: QueryResult): string;
|
|
59
|
+
//# sourceMappingURL=query-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-tools.d.ts","sourceRoot":"","sources":["../src/query-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAMlD,MAAM,MAAM,eAAe,GACxB,uBAAuB,GACvB,sBAAsB,GACtB,gBAAgB,GAChB,qBAAqB,GACrB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,kBAAkB,CAAC;AAEtB,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACxB;AAMD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAoHzD,CAAC;AAMF;;;;;;;GAOG;AACH,wBAAsB,YAAY,CACjC,EAAE,EAAE,eAAe,EACnB,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GAChB,OAAO,CAAC,WAAW,CAAC,CAiBtB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAkEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CA2BvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay Tools - Event replay with timing simulation
|
|
3
|
+
*
|
|
4
|
+
* TDD GREEN: Minimal implementation to pass tests
|
|
5
|
+
*/
|
|
6
|
+
export type ReplaySpeed = "1x" | "2x" | "instant";
|
|
7
|
+
export interface ReplayEvent {
|
|
8
|
+
session_id: string;
|
|
9
|
+
epic_id: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
event_type: "DECISION" | "VIOLATION" | "OUTCOME" | "COMPACTION";
|
|
12
|
+
decision_type?: string;
|
|
13
|
+
violation_type?: string;
|
|
14
|
+
outcome_type?: string;
|
|
15
|
+
payload: Record<string, unknown>;
|
|
16
|
+
delta_ms: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ReplayFilter {
|
|
19
|
+
type?: Array<"DECISION" | "VIOLATION" | "OUTCOME" | "COMPACTION">;
|
|
20
|
+
agent?: string;
|
|
21
|
+
since?: Date;
|
|
22
|
+
until?: Date;
|
|
23
|
+
}
|
|
24
|
+
export declare function fetchEpicEvents(epicId: string, sessionFile: string): Promise<ReplayEvent[]>;
|
|
25
|
+
export declare function filterEvents(events: ReplayEvent[], filter: ReplayFilter): ReplayEvent[];
|
|
26
|
+
export declare function replayWithTiming(events: ReplayEvent[], speed: ReplaySpeed): AsyncGenerator<ReplayEvent>;
|
|
27
|
+
export declare function formatReplayEvent(event: ReplayEvent): string;
|
|
28
|
+
//# sourceMappingURL=replay-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-tools.d.ts","sourceRoot":"","sources":["../src/replay-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,WAAW;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,CAAC;CACb;AAMD,wBAAsB,eAAe,CACpC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE,CAAC,CA4CxB;AAMD,wBAAgB,YAAY,CAC3B,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,EAAE,YAAY,GAClB,WAAW,EAAE,CAiCf;AAMD,wBAAuB,gBAAgB,CACtC,MAAM,EAAE,WAAW,EAAE,EACrB,KAAK,EAAE,WAAW,GAChB,cAAc,CAAC,WAAW,CAAC,CAuC7B;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CA0D5D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Discovery Module
|
|
3
|
+
*
|
|
4
|
+
* Maps file paths to agent types using pattern matching.
|
|
5
|
+
* Supports cross-platform paths (Unix and Windows).
|
|
6
|
+
*
|
|
7
|
+
* @module sessions/agent-discovery
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Agent type identifier
|
|
11
|
+
*/
|
|
12
|
+
export type AgentType = "opencode-swarm" | "cursor" | "opencode" | "claude" | "aider";
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for custom agent patterns
|
|
15
|
+
*/
|
|
16
|
+
interface AgentPatternConfig {
|
|
17
|
+
/** Pattern string (will be converted to RegExp) */
|
|
18
|
+
pattern: string;
|
|
19
|
+
/** Agent type identifier */
|
|
20
|
+
agentType: AgentType;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Load custom agent patterns from config
|
|
24
|
+
*
|
|
25
|
+
* @param patterns - Array of custom pattern configurations
|
|
26
|
+
* @returns Number of patterns loaded
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* loadAgentPatterns([
|
|
31
|
+
* { pattern: "\\.codex[/\\\\]", agentType: "codex" },
|
|
32
|
+
* { pattern: "\\.gemini[/\\\\]", agentType: "gemini" }
|
|
33
|
+
* ]);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function loadAgentPatterns(patterns: AgentPatternConfig[]): number;
|
|
37
|
+
/**
|
|
38
|
+
* Reset agent patterns to defaults
|
|
39
|
+
* Useful for testing
|
|
40
|
+
*/
|
|
41
|
+
export declare function resetAgentPatterns(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Detect agent type from file path
|
|
44
|
+
*
|
|
45
|
+
* @param filePath - Absolute or relative file path (Unix or Windows)
|
|
46
|
+
* @returns Agent type identifier, or null if unknown
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* detectAgentType("/home/user/.config/swarm-tools/sessions/ses_123.jsonl")
|
|
51
|
+
* // => "opencode-swarm"
|
|
52
|
+
*
|
|
53
|
+
* detectAgentType("/tmp/random.jsonl")
|
|
54
|
+
* // => null
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function detectAgentType(filePath: string): AgentType | null;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=agent-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-discovery.d.ts","sourceRoot":"","sources":["../../src/sessions/agent-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,CAAC;AA0BZ;;GAEG;AACH,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAMxE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAQzC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOlE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Indexing Module
|
|
3
|
+
*
|
|
4
|
+
* Provides agent session discovery and indexing capabilities.
|
|
5
|
+
* Part of the CASS Inhousing initiative (ADR-010).
|
|
6
|
+
*
|
|
7
|
+
* @module sessions
|
|
8
|
+
*/
|
|
9
|
+
export { detectAgentType, loadAgentPatterns, resetAgentPatterns, type AgentType, } from "./agent-discovery";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sessions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAC"}
|