opencode-swarm 6.33.9 → 6.34.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/README.md +60 -5
- package/dist/agents/critic.d.ts +5 -2
- package/dist/cli/index.js +22 -1
- package/dist/config/agent-categories.d.ts +12 -0
- package/dist/config/constants.d.ts +3 -3
- package/dist/config/schema.d.ts +2 -2
- package/dist/gate-evidence.d.ts +6 -0
- package/dist/index.d.ts +0 -10
- package/dist/index.js +1760 -1090
- package/dist/telemetry.d.ts +53 -0
- package/dist/telemetry.test.d.ts +1 -0
- package/dist/tools/completion-verify.d.ts +23 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/tool-names.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type TelemetryEvent = 'session_started' | 'session_ended' | 'agent_activated' | 'delegation_begin' | 'delegation_end' | 'task_state_changed' | 'gate_passed' | 'gate_failed' | 'phase_changed' | 'budget_updated' | 'model_fallback' | 'hard_limit_hit' | 'revision_limit_hit' | 'loop_detected' | 'scope_violation' | 'qa_skip_violation' | 'heartbeat' | 'turbo_mode_changed';
|
|
2
|
+
export type TelemetryListener = (event: TelemetryEvent, data: Record<string, unknown>) => void;
|
|
3
|
+
/** @internal - For testing only */
|
|
4
|
+
export declare function resetTelemetryForTesting(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize telemetry with the project directory.
|
|
7
|
+
* Creates `.swarm/` if it doesn't exist and opens `telemetry.jsonl` for appending.
|
|
8
|
+
* Idempotent — calling multiple times has no effect after the first successful call.
|
|
9
|
+
* @param projectDirectory - Absolute path to the project root
|
|
10
|
+
*/
|
|
11
|
+
export declare function initTelemetry(projectDirectory: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Emit a telemetry event.
|
|
14
|
+
* Writes a JSONL line to `.swarm/telemetry.jsonl` and notifies all registered listeners.
|
|
15
|
+
* Fire-and-forget — errors are silently swallowed and never propagate to the caller.
|
|
16
|
+
* @param event - The event type
|
|
17
|
+
* @param data - Arbitrary event payload (sessionId always required by convention)
|
|
18
|
+
*/
|
|
19
|
+
export declare function emit(event: TelemetryEvent, data: Record<string, unknown>): void;
|
|
20
|
+
/**
|
|
21
|
+
* Register a listener for telemetry events.
|
|
22
|
+
* Listeners receive every event that is emitted (if telemetry is not disabled).
|
|
23
|
+
* Listener errors are silently swallowed — they never break execution.
|
|
24
|
+
* @param callback - Function called with (event, data) on each emit
|
|
25
|
+
*/
|
|
26
|
+
export declare function addTelemetryListener(callback: TelemetryListener): void;
|
|
27
|
+
/**
|
|
28
|
+
* Rotate telemetry file if it exceeds maxBytes.
|
|
29
|
+
* Renames `telemetry.jsonl` → `telemetry.jsonl.1` and reopens a fresh stream.
|
|
30
|
+
* Errors are silently swallowed.
|
|
31
|
+
* @param maxBytes - Size threshold in bytes (default: 10MB)
|
|
32
|
+
*/
|
|
33
|
+
export declare function rotateTelemetryIfNeeded(maxBytes?: number): void;
|
|
34
|
+
export declare const telemetry: {
|
|
35
|
+
sessionStarted(sessionId: string, agentName: string): void;
|
|
36
|
+
sessionEnded(sessionId: string, reason: string): void;
|
|
37
|
+
agentActivated(sessionId: string, agentName: string, oldName?: string): void;
|
|
38
|
+
delegationBegin(sessionId: string, agentName: string, taskId: string): void;
|
|
39
|
+
delegationEnd(sessionId: string, agentName: string, taskId: string, result: string): void;
|
|
40
|
+
taskStateChanged(sessionId: string, taskId: string, newState: string, oldState?: string): void;
|
|
41
|
+
gatePassed(sessionId: string, gate: string, taskId: string): void;
|
|
42
|
+
gateFailed(sessionId: string, gate: string, taskId: string, reason: string): void;
|
|
43
|
+
phaseChanged(sessionId: string, oldPhase: number, newPhase: number): void;
|
|
44
|
+
budgetUpdated(sessionId: string, budgetPct: number, agentName: string): void;
|
|
45
|
+
modelFallback(sessionId: string, agentName: string, fromModel: string, toModel: string, reason: string): void;
|
|
46
|
+
hardLimitHit(sessionId: string, agentName: string, limitType: string, value: number): void;
|
|
47
|
+
revisionLimitHit(sessionId: string, agentName: string): void;
|
|
48
|
+
loopDetected(sessionId: string, agentName: string, loopType: string): void;
|
|
49
|
+
scopeViolation(sessionId: string, agentName: string, file: string, reason: string): void;
|
|
50
|
+
qaSkipViolation(sessionId: string, agentName: string, skipCount: number): void;
|
|
51
|
+
heartbeat(sessionId: string): void;
|
|
52
|
+
turboModeChanged(sessionId: string, enabled: boolean, agentName: string): void;
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion verification tool - deterministic pre-check verifying that plan task
|
|
3
|
+
* identifiers exist in their target source files before phase completion.
|
|
4
|
+
* Blocks if obviously incomplete.
|
|
5
|
+
*/
|
|
6
|
+
import { type ToolDefinition } from '@opencode-ai/plugin';
|
|
7
|
+
/**
|
|
8
|
+
* Arguments for the completion_verify tool
|
|
9
|
+
*/
|
|
10
|
+
export interface CompletionVerifyArgs {
|
|
11
|
+
/** The phase number to check */
|
|
12
|
+
phase: number;
|
|
13
|
+
/** Session ID (optional, auto-provided by plugin context) */
|
|
14
|
+
sessionID?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Execute the completion verification check
|
|
18
|
+
*/
|
|
19
|
+
export declare function executeCompletionVerify(args: CompletionVerifyArgs, directory: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Tool definition for completion_verify
|
|
22
|
+
*/
|
|
23
|
+
export declare const completion_verify: ToolDefinition;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { build_check } from './build-check';
|
|
2
2
|
export { check_gate_status } from './check-gate-status';
|
|
3
3
|
export { checkpoint } from './checkpoint';
|
|
4
|
+
export { completion_verify } from './completion-verify';
|
|
4
5
|
export { complexity_hotspots } from './complexity-hotspots';
|
|
5
6
|
export { curator_analyze } from './curator-analyze';
|
|
6
7
|
export { declare_scope } from './declare-scope';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Used for constants and agent setup references.
|
|
4
4
|
*/
|
|
5
5
|
/** Union type of all valid tool names */
|
|
6
|
-
export type ToolName = 'diff' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'write_retro' | 'declare_scope' | 'knowledge_query';
|
|
6
|
+
export type ToolName = 'diff' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'write_retro' | 'declare_scope' | 'knowledge_query';
|
|
7
7
|
/** Readonly array of all tool names */
|
|
8
8
|
export declare const TOOL_NAMES: readonly ToolName[];
|
|
9
9
|
/** Set for O(1) tool name validation */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.34.0",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|