opencode-swarm 6.6.1 → 6.8.1
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 +121 -6
- package/dist/index.js +26976 -22154
- package/dist/src/agents/architect.d.ts +8 -0
- package/dist/{agents/test-engineer.d.ts → src/agents/coder.d.ts} +2 -1
- package/dist/src/agents/critic.d.ts +3 -0
- package/dist/src/agents/designer.d.ts +3 -0
- package/dist/src/agents/docs.d.ts +3 -0
- package/dist/src/agents/explorer.d.ts +3 -0
- package/dist/src/agents/model.d.ts +2 -0
- package/dist/{agents → src/agents}/reviewer.d.ts +2 -1
- package/dist/src/agents/sme.d.ts +3 -0
- package/dist/src/agents/test-engineer.d.ts +3 -0
- package/dist/src/agents/test-engineer.security.test.d.ts +1 -0
- package/dist/src/background/circuit-breaker.d.ts +149 -0
- package/dist/src/background/event-bus.d.ts +60 -0
- package/dist/src/background/evidence-summary-integration.d.ts +73 -0
- package/dist/src/background/index.d.ts +22 -0
- package/dist/src/background/manager.d.ts +122 -0
- package/dist/src/background/plan-sync-worker.d.ts +117 -0
- package/dist/src/background/queue.d.ts +116 -0
- package/dist/src/background/status-artifact.d.ts +115 -0
- package/dist/src/background/trigger.d.ts +159 -0
- package/dist/src/background/trigger.vulnerability.test.d.ts +1 -0
- package/dist/src/background/worker.d.ts +92 -0
- package/dist/src/commands/command-adapters.security.test.d.ts +14 -0
- package/dist/src/commands/commands.test.d.ts +1 -0
- package/dist/src/commands/diagnose.d.ts +1 -0
- package/dist/src/commands/doctor.d.ts +5 -0
- package/dist/src/commands/evidence.d.ts +1 -0
- package/dist/src/commands/export.d.ts +1 -0
- package/dist/src/commands/history.d.ts +1 -0
- package/dist/{commands → src/commands}/index.d.ts +3 -0
- package/dist/src/commands/plan.d.ts +1 -0
- package/dist/src/commands/preflight.d.ts +1 -0
- package/dist/src/commands/status.d.ts +1 -0
- package/dist/src/commands/sync-plan.d.ts +8 -0
- package/dist/{config → src/config}/index.d.ts +2 -2
- package/dist/src/config/loader.d.ts +16 -0
- package/dist/{config → src/config}/schema.d.ts +224 -0
- package/dist/{hooks → src/hooks}/index.d.ts +1 -0
- package/dist/src/hooks/phase-monitor.d.ts +16 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/{plan → src/plan}/manager.d.ts +13 -6
- package/dist/src/services/config-doctor.d.ts +125 -0
- package/dist/src/services/config-doctor.security.test.d.ts +1 -0
- package/dist/src/services/config-doctor.test.d.ts +1 -0
- package/dist/src/services/decision-drift-analyzer.d.ts +96 -0
- package/dist/src/services/diagnose-service.d.ts +31 -0
- package/dist/src/services/evidence-service.d.ts +65 -0
- package/dist/src/services/evidence-summary-service.d.ts +75 -0
- package/dist/src/services/export-service.d.ts +23 -0
- package/dist/src/services/history-service.d.ts +35 -0
- package/dist/src/services/index.d.ts +11 -0
- package/dist/src/services/plan-service.d.ts +25 -0
- package/dist/src/services/preflight-integration.d.ts +38 -0
- package/dist/src/services/preflight-service.d.ts +62 -0
- package/dist/src/services/status-service.d.ts +28 -0
- package/dist/{state.d.ts → src/state.d.ts} +5 -0
- package/dist/{tools → src/tools}/gitingest.d.ts +2 -1
- package/dist/{tools → src/tools}/secretscan.d.ts +4 -0
- package/dist/{tools/test-runner.d.ts → src/tools/test-runner/constants.d.ts} +0 -4
- package/dist/src/tools/test-runner/detect.d.ts +2 -0
- package/dist/src/tools/test-runner/discover.d.ts +4 -0
- package/dist/src/tools/test-runner/index.d.ts +6 -0
- package/dist/src/tools/test-runner/run.d.ts +2 -0
- package/dist/src/tools/test-runner/validate.d.ts +2 -0
- package/dist/src/utils/index.d.ts +8 -0
- package/package.json +1 -1
- package/dist/agents/architect.d.ts +0 -7
- package/dist/agents/coder.d.ts +0 -2
- package/dist/agents/critic.d.ts +0 -2
- package/dist/agents/designer.d.ts +0 -2
- package/dist/agents/docs.d.ts +0 -2
- package/dist/agents/explorer.d.ts +0 -2
- package/dist/agents/sme.d.ts +0 -2
- package/dist/commands/diagnose.d.ts +0 -5
- package/dist/commands/evidence.d.ts +0 -5
- package/dist/commands/export.d.ts +0 -5
- package/dist/commands/history.d.ts +0 -5
- package/dist/commands/plan.d.ts +0 -1
- package/dist/commands/status.d.ts +0 -2
- package/dist/config/loader.d.ts +0 -32
- package/dist/index.d.ts +0 -15
- package/dist/utils/index.d.ts +0 -3
- package/dist/{agents/test-engineer.security.test.d.ts → src/__tests__/security-adversarial.test.d.ts} +0 -0
- package/dist/{agents → src/agents}/index.d.ts +0 -0
- package/dist/{agents → src/agents}/test-engineer.adversarial.test.d.ts +0 -0
- package/dist/{cli → src/cli}/index.d.ts +0 -0
- package/dist/{commands → src/commands}/agents.d.ts +0 -0
- package/dist/{commands → src/commands}/archive.d.ts +0 -0
- package/dist/{commands → src/commands}/benchmark.d.ts +0 -0
- package/dist/{commands → src/commands}/config.d.ts +0 -0
- package/dist/{commands → src/commands}/reset.d.ts +0 -0
- package/dist/{commands → src/commands}/retrieve.d.ts +0 -0
- package/dist/{config → src/config}/constants.d.ts +0 -0
- package/dist/{config → src/config}/evidence-schema.d.ts +0 -0
- package/dist/{config → src/config}/plan-schema.d.ts +4 -4
- /package/dist/{evidence → src/evidence}/index.d.ts +0 -0
- /package/dist/{evidence → src/evidence}/manager.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/agent-activity.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/compaction-customizer.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/context-budget.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/context-scoring.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/delegation-gate.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/delegation-tracker.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/extractors.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/guardrails.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/pipeline-tracker.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/system-enhancer.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/tool-summarizer.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/utils.d.ts +0 -0
- /package/dist/{plan → src/plan}/index.d.ts +0 -0
- /package/dist/{summaries → src/summaries}/index.d.ts +0 -0
- /package/dist/{summaries → src/summaries}/manager.d.ts +0 -0
- /package/dist/{summaries → src/summaries}/summarizer.d.ts +0 -0
- /package/dist/{tools → src/tools}/checkpoint.d.ts +0 -0
- /package/dist/{tools → src/tools}/complexity-hotspots.d.ts +0 -0
- /package/dist/{tools → src/tools}/diff.d.ts +0 -0
- /package/dist/{tools → src/tools}/domain-detector.d.ts +0 -0
- /package/dist/{tools → src/tools}/evidence-check.d.ts +0 -0
- /package/dist/{tools → src/tools}/file-extractor.d.ts +0 -0
- /package/dist/{tools → src/tools}/imports.d.ts +0 -0
- /package/dist/{tools → src/tools}/index.d.ts +0 -0
- /package/dist/{tools → src/tools}/lint.d.ts +0 -0
- /package/dist/{tools → src/tools}/pkg-audit.d.ts +0 -0
- /package/dist/{tools → src/tools}/retrieve-summary.d.ts +0 -0
- /package/dist/{tools → src/tools}/schema-drift.d.ts +0 -0
- /package/dist/{tools → src/tools}/symbols.d.ts +0 -0
- /package/dist/{tools → src/tools}/test-runner.security-adversarial.test.d.ts +0 -0
- /package/dist/{tools → src/tools}/todo-extract.d.ts +0 -0
- /package/dist/{utils → src/utils}/errors.d.ts +0 -0
- /package/dist/{utils → src/utils}/logger.d.ts +0 -0
- /package/dist/{utils → src/utils}/merge.d.ts +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence Summary Service
|
|
3
|
+
*
|
|
4
|
+
* Provides deterministic evidence aggregation per task and phase.
|
|
5
|
+
* Produces machine-readable and human-readable summary artifacts.
|
|
6
|
+
*/
|
|
7
|
+
import type { PhaseStatus, TaskStatus } from '../config/plan-schema';
|
|
8
|
+
/** Evidence types required for task completion */
|
|
9
|
+
export declare const REQUIRED_EVIDENCE_TYPES: readonly ["review", "test"];
|
|
10
|
+
export type RequiredEvidenceType = (typeof REQUIRED_EVIDENCE_TYPES)[number];
|
|
11
|
+
/** Summary artifact schema version */
|
|
12
|
+
export declare const EVIDENCE_SUMMARY_VERSION = "1.0.0";
|
|
13
|
+
/** Evidence summary for a single task */
|
|
14
|
+
export interface TaskEvidenceSummary {
|
|
15
|
+
taskId: string;
|
|
16
|
+
phase: number;
|
|
17
|
+
taskStatus: TaskStatus;
|
|
18
|
+
evidenceCount: number;
|
|
19
|
+
hasReview: boolean;
|
|
20
|
+
hasTest: boolean;
|
|
21
|
+
hasApproval: boolean;
|
|
22
|
+
missingEvidence: string[];
|
|
23
|
+
isComplete: boolean;
|
|
24
|
+
blockers: string[];
|
|
25
|
+
lastEvidenceTimestamp: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** Phase evidence summary */
|
|
28
|
+
export interface PhaseEvidenceSummary {
|
|
29
|
+
phaseId: number;
|
|
30
|
+
phaseName: string;
|
|
31
|
+
phaseStatus: PhaseStatus;
|
|
32
|
+
totalTasks: number;
|
|
33
|
+
completedTasks: number;
|
|
34
|
+
tasksWithEvidence: number;
|
|
35
|
+
tasksWithCompleteEvidence: number;
|
|
36
|
+
completionRatio: number;
|
|
37
|
+
missingEvidenceByType: Record<string, string[]>;
|
|
38
|
+
blockers: PhaseBlocker[];
|
|
39
|
+
tasks: TaskEvidenceSummary[];
|
|
40
|
+
}
|
|
41
|
+
/** Blockers preventing phase closure */
|
|
42
|
+
export interface PhaseBlocker {
|
|
43
|
+
type: 'missing_evidence' | 'incomplete_task' | 'blocked_task';
|
|
44
|
+
taskId: string;
|
|
45
|
+
reason: string;
|
|
46
|
+
severity: 'high' | 'medium' | 'low';
|
|
47
|
+
}
|
|
48
|
+
/** Full evidence summary artifact */
|
|
49
|
+
export interface EvidenceSummaryArtifact {
|
|
50
|
+
schema_version: typeof EVIDENCE_SUMMARY_VERSION;
|
|
51
|
+
generated_at: string;
|
|
52
|
+
planTitle: string;
|
|
53
|
+
currentPhase: number;
|
|
54
|
+
phaseSummaries: PhaseEvidenceSummary[];
|
|
55
|
+
overallCompletionRatio: number;
|
|
56
|
+
overallBlockers: PhaseBlocker[];
|
|
57
|
+
summaryText: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Build complete evidence summary artifact
|
|
61
|
+
*
|
|
62
|
+
* Aggregates evidence per task and phase, producing deterministic
|
|
63
|
+
* summary artifacts including completion ratio, missing evidence,
|
|
64
|
+
* blockers, and per-task status.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildEvidenceSummary(directory: string, currentPhase?: number): Promise<EvidenceSummaryArtifact | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Check if auto-summaries are enabled via feature flags
|
|
69
|
+
*/
|
|
70
|
+
export declare function isAutoSummaryEnabled(automationConfig?: {
|
|
71
|
+
capabilities?: {
|
|
72
|
+
evidence_auto_summaries?: boolean;
|
|
73
|
+
};
|
|
74
|
+
mode?: string;
|
|
75
|
+
}): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured export data.
|
|
3
|
+
*/
|
|
4
|
+
export interface ExportData {
|
|
5
|
+
version: string;
|
|
6
|
+
exported: string;
|
|
7
|
+
plan: unknown;
|
|
8
|
+
context: string | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get export data from the swarm directory.
|
|
12
|
+
* Returns structured data for GUI, background flows, or commands.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getExportData(directory: string): Promise<ExportData>;
|
|
15
|
+
/**
|
|
16
|
+
* Format export data as markdown with JSON code block for command output.
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatExportMarkdown(exportData: ExportData): string;
|
|
19
|
+
/**
|
|
20
|
+
* Handle export command - delegates to service and formats output.
|
|
21
|
+
* Kept for backward compatibility - thin adapter.
|
|
22
|
+
*/
|
|
23
|
+
export declare function handleExportCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured history data for a single phase.
|
|
3
|
+
*/
|
|
4
|
+
export interface PhaseHistoryData {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
status: 'complete' | 'in_progress' | 'pending' | 'blocked';
|
|
8
|
+
statusText: string;
|
|
9
|
+
statusIcon: string;
|
|
10
|
+
completedTasks: number;
|
|
11
|
+
totalTasks: number;
|
|
12
|
+
tasksDisplay: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Structured history data returned by the history service.
|
|
16
|
+
*/
|
|
17
|
+
export interface HistoryData {
|
|
18
|
+
hasPlan: boolean;
|
|
19
|
+
phases: PhaseHistoryData[];
|
|
20
|
+
isLegacy: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get history data from the swarm directory.
|
|
24
|
+
* Returns structured data for GUI, background flows, or commands.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getHistoryData(directory: string): Promise<HistoryData>;
|
|
27
|
+
/**
|
|
28
|
+
* Format history data as markdown for command output.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatHistoryMarkdown(history: HistoryData): string;
|
|
31
|
+
/**
|
|
32
|
+
* Handle history command - delegates to service and formats output.
|
|
33
|
+
* Kept for backward compatibility - thin adapter.
|
|
34
|
+
*/
|
|
35
|
+
export declare function handleHistoryCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { analyzeDecisionDrift, DEFAULT_DRIFT_CONFIG, type Decision, type DriftAnalysisResult, type DriftAnalyzerConfig, type DriftSeverity, type DriftSignal, extractDecisionsFromContext, findContradictions, formatDriftForContext, } from './decision-drift-analyzer';
|
|
2
|
+
export { applySafeAutoFixes, type ConfigBackup, type ConfigDoctorResult, type ConfigFinding, type ConfigFix, createConfigBackup, type FindingSeverity, getConfigPaths, runConfigDoctor, runConfigDoctorWithFixes, shouldRunOnStartup, writeBackupArtifact, writeDoctorArtifact, } from './config-doctor';
|
|
3
|
+
export { type DiagnoseData, formatDiagnoseMarkdown, getDiagnoseData, type HealthCheck, handleDiagnoseCommand, } from './diagnose-service';
|
|
4
|
+
export { type EvidenceEntryData, type EvidenceListData, formatEvidenceListMarkdown, formatTaskEvidenceMarkdown, getEvidenceListData, getTaskEvidenceData, getVerdictEmoji, handleEvidenceCommand, type TaskEvidenceData, } from './evidence-service';
|
|
5
|
+
export { buildEvidenceSummary, EVIDENCE_SUMMARY_VERSION, type EvidenceSummaryArtifact, isAutoSummaryEnabled, type PhaseBlocker, type PhaseEvidenceSummary, REQUIRED_EVIDENCE_TYPES, type TaskEvidenceSummary, } from './evidence-summary-service';
|
|
6
|
+
export { type ExportData, formatExportMarkdown, getExportData, handleExportCommand, } from './export-service';
|
|
7
|
+
export { formatHistoryMarkdown, getHistoryData, type HistoryData, handleHistoryCommand, type PhaseHistoryData, } from './history-service';
|
|
8
|
+
export { formatPlanMarkdown, getPlanData, handlePlanCommand, type PlanData, } from './plan-service';
|
|
9
|
+
export { createPreflightIntegration, type PreflightIntegrationConfig, runManualPreflight, } from './preflight-integration';
|
|
10
|
+
export { formatPreflightMarkdown, handlePreflightCommand, type PreflightCheckResult, type PreflightCheckType, type PreflightConfig, type PreflightReport, runPreflight, } from './preflight-service';
|
|
11
|
+
export { formatStatusMarkdown, getStatusData, handleStatusCommand, type StatusData, } from './status-service';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured plan data for a specific phase or full plan.
|
|
3
|
+
*/
|
|
4
|
+
export interface PlanData {
|
|
5
|
+
hasPlan: boolean;
|
|
6
|
+
fullMarkdown: string;
|
|
7
|
+
requestedPhase: number | null;
|
|
8
|
+
phaseMarkdown: string | null;
|
|
9
|
+
errorMessage: string | null;
|
|
10
|
+
isLegacy: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get plan data from the swarm directory.
|
|
14
|
+
* Returns structured data for GUI, background flows, or commands.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getPlanData(directory: string, phaseArg?: string | number): Promise<PlanData>;
|
|
17
|
+
/**
|
|
18
|
+
* Format plan data as markdown for command output.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatPlanMarkdown(planData: PlanData): string;
|
|
21
|
+
/**
|
|
22
|
+
* Handle plan command - delegates to service and formats output.
|
|
23
|
+
* Kept for backward compatibility - thin adapter.
|
|
24
|
+
*/
|
|
25
|
+
export declare function handlePlanCommand(directory: string, args: string[]): Promise<string>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preflight Background Integration
|
|
3
|
+
*
|
|
4
|
+
* Wires the preflight service to background automation:
|
|
5
|
+
* - Subscribes to preflight.requested events
|
|
6
|
+
* - Runs preflight checks
|
|
7
|
+
* - Updates status artifact with results
|
|
8
|
+
*/
|
|
9
|
+
import { PreflightTriggerManager } from '../background/trigger';
|
|
10
|
+
import type { AutomationConfig } from '../config/schema';
|
|
11
|
+
import { type PreflightConfig, type PreflightReport } from '../services/preflight-service';
|
|
12
|
+
/** Integration configuration */
|
|
13
|
+
export interface PreflightIntegrationConfig {
|
|
14
|
+
/** Automation configuration (required for capability gating) */
|
|
15
|
+
automationConfig: AutomationConfig;
|
|
16
|
+
/** Directory to run preflight in */
|
|
17
|
+
directory: string;
|
|
18
|
+
/** Swarm directory for status artifact */
|
|
19
|
+
swarmDir: string;
|
|
20
|
+
/** Preflight check configuration */
|
|
21
|
+
preflightConfig?: PreflightConfig;
|
|
22
|
+
/** Whether to update status artifact (default true) */
|
|
23
|
+
updateStatusArtifact?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create preflight integration
|
|
27
|
+
*
|
|
28
|
+
* Sets up the handler that will be called when preflight is requested.
|
|
29
|
+
* Returns the trigger manager and cleanup function.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createPreflightIntegration(config: PreflightIntegrationConfig): {
|
|
32
|
+
manager: PreflightTriggerManager;
|
|
33
|
+
cleanup: () => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Run preflight manually (for testing or CLI)
|
|
37
|
+
*/
|
|
38
|
+
export declare function runManualPreflight(directory: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preflight Automation Service
|
|
3
|
+
*
|
|
4
|
+
* Runs automated preflight checks for release readiness:
|
|
5
|
+
* - lint check
|
|
6
|
+
* - tests check (sane verification scope)
|
|
7
|
+
* - secrets check
|
|
8
|
+
* - evidence completeness check
|
|
9
|
+
* - version consistency check
|
|
10
|
+
*
|
|
11
|
+
* Returns deterministic structured result with per-check status + overall verdict.
|
|
12
|
+
* Callable by background flow (from preflight.requested events).
|
|
13
|
+
*/
|
|
14
|
+
/** Preflight check types */
|
|
15
|
+
export type PreflightCheckType = 'lint' | 'tests' | 'secrets' | 'evidence' | 'version';
|
|
16
|
+
/** Individual check status */
|
|
17
|
+
export interface PreflightCheckResult {
|
|
18
|
+
type: PreflightCheckType;
|
|
19
|
+
status: 'pass' | 'fail' | 'skip' | 'error';
|
|
20
|
+
message: string;
|
|
21
|
+
details?: Record<string, unknown>;
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Preflight report structure */
|
|
25
|
+
export interface PreflightReport {
|
|
26
|
+
id: string;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
phase: number;
|
|
29
|
+
overall: 'pass' | 'fail' | 'skipped';
|
|
30
|
+
checks: PreflightCheckResult[];
|
|
31
|
+
totalDurationMs: number;
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
/** Preflight configuration */
|
|
35
|
+
export interface PreflightConfig {
|
|
36
|
+
/** Timeout per check in ms (default 60s, min 5s, max 300s) */
|
|
37
|
+
checkTimeoutMs?: number;
|
|
38
|
+
/** Skip tests check (default false) */
|
|
39
|
+
skipTests?: boolean;
|
|
40
|
+
/** Skip secrets check (default false) */
|
|
41
|
+
skipSecrets?: boolean;
|
|
42
|
+
/** Skip evidence check (default false) */
|
|
43
|
+
skipEvidence?: boolean;
|
|
44
|
+
/** Skip version check (default false) */
|
|
45
|
+
skipVersion?: boolean;
|
|
46
|
+
/** Test scope (default 'convention' for faster preflight) */
|
|
47
|
+
testScope?: 'all' | 'convention' | 'graph';
|
|
48
|
+
/** Linter to use (default 'biome') */
|
|
49
|
+
linter?: 'biome' | 'eslint';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Run all preflight checks
|
|
53
|
+
*/
|
|
54
|
+
export declare function runPreflight(dir: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
55
|
+
/**
|
|
56
|
+
* Format preflight report as markdown
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatPreflightMarkdown(report: PreflightReport): string;
|
|
59
|
+
/**
|
|
60
|
+
* Handle preflight command - thin adapter for CLI
|
|
61
|
+
*/
|
|
62
|
+
export declare function handlePreflightCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AgentDefinition } from '../agents';
|
|
2
|
+
/**
|
|
3
|
+
* Structured status data returned by the status service.
|
|
4
|
+
* This can be used by GUI, background flows, or command adapters.
|
|
5
|
+
*/
|
|
6
|
+
export interface StatusData {
|
|
7
|
+
hasPlan: boolean;
|
|
8
|
+
currentPhase: string;
|
|
9
|
+
completedTasks: number;
|
|
10
|
+
totalTasks: number;
|
|
11
|
+
agentCount: number;
|
|
12
|
+
isLegacy: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get status data from the swarm directory.
|
|
16
|
+
* Returns structured data that can be used by GUI, background flows, or commands.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getStatusData(directory: string, agents: Record<string, AgentDefinition>): Promise<StatusData>;
|
|
19
|
+
/**
|
|
20
|
+
* Format status data as markdown for command output.
|
|
21
|
+
* This is the thin adapter that delegates to the service.
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatStatusMarkdown(status: StatusData): string;
|
|
24
|
+
/**
|
|
25
|
+
* Handle status command - delegates to service and formats output.
|
|
26
|
+
* Kept for backward compatibility - thin adapter.
|
|
27
|
+
*/
|
|
28
|
+
export declare function handleStatusCommand(directory: string, agents: Record<string, AgentDefinition>): Promise<string>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* chat.message, system-enhancer) to share state like active agents, tool call tracking,
|
|
7
7
|
* and delegation chains.
|
|
8
8
|
*/
|
|
9
|
+
export declare const MAX_DELEGATION_CHAIN_SESSIONS = 1000;
|
|
9
10
|
/**
|
|
10
11
|
* Represents a single tool call entry for tracking purposes
|
|
11
12
|
*/
|
|
@@ -108,6 +109,10 @@ export declare const swarmState: {
|
|
|
108
109
|
* Reset all state to initial values - useful for testing
|
|
109
110
|
*/
|
|
110
111
|
export declare function resetSwarmState(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Ensure toolAggregates stays below the configured cap by evicting the oldest entry.
|
|
114
|
+
*/
|
|
115
|
+
export declare function enforceToolAggregateCapacity(key: string): void;
|
|
111
116
|
/**
|
|
112
117
|
* Start a new agent session with initialized guardrail state.
|
|
113
118
|
* Also removes any stale sessions older than staleDurationMs.
|
|
@@ -8,10 +8,11 @@ export interface GitingestArgs {
|
|
|
8
8
|
export declare const GITINGEST_TIMEOUT_MS = 10000;
|
|
9
9
|
export declare const GITINGEST_MAX_RESPONSE_BYTES = 5242880;
|
|
10
10
|
export declare const GITINGEST_MAX_RETRIES = 2;
|
|
11
|
+
export declare const GITINGEST_DEFAULT_ENDPOINT = "https://gitingest.com/api/ingest";
|
|
11
12
|
/**
|
|
12
13
|
* Fetch repository content via gitingest.com API with timeout, size guard, and retry logic
|
|
13
14
|
*/
|
|
14
|
-
export declare function fetchGitingest(args: GitingestArgs): Promise<string>;
|
|
15
|
+
export declare function fetchGitingest(args: GitingestArgs, endpoint?: string): Promise<string>;
|
|
15
16
|
/**
|
|
16
17
|
* Gitingest tool for fetching GitHub repository contents
|
|
17
18
|
*/
|
|
@@ -28,4 +28,8 @@ export interface SecretscanErrorResult {
|
|
|
28
28
|
skipped_files: 0;
|
|
29
29
|
}
|
|
30
30
|
export declare const secretscan: ReturnType<typeof tool>;
|
|
31
|
+
/**
|
|
32
|
+
* Run secretscan programmatically
|
|
33
|
+
*/
|
|
34
|
+
export declare function runSecretscan(directory: string): Promise<SecretscanResult | SecretscanErrorResult>;
|
|
31
35
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { tool } from '@opencode-ai/plugin';
|
|
2
1
|
export declare const MAX_OUTPUT_BYTES = 512000;
|
|
3
2
|
export declare const MAX_COMMAND_LENGTH = 500;
|
|
4
3
|
export declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
@@ -43,6 +42,3 @@ export interface TestErrorResult {
|
|
|
43
42
|
message?: string;
|
|
44
43
|
}
|
|
45
44
|
export type TestResult = TestSuccessResult | TestErrorResult;
|
|
46
|
-
export declare function detectTestFramework(): Promise<TestFramework>;
|
|
47
|
-
export declare function runTests(framework: TestFramework, scope: 'all' | 'convention' | 'graph', files: string[], coverage: boolean, timeout_ms: number): Promise<TestResult>;
|
|
48
|
-
export declare const test_runner: ReturnType<typeof tool>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getTestFilesFromConvention(sourceFiles: string[]): string[];
|
|
2
|
+
export declare function getTestFilesFromGraph(sourceFiles: string[]): Promise<string[]>;
|
|
3
|
+
export declare const SOURCE_EXTENSIONS: Set<string>;
|
|
4
|
+
export declare function findSourceFiles(dir: string, files?: string[]): string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { tool } from '@opencode-ai/plugin';
|
|
2
|
+
export type { TestErrorResult, TestFramework, TestResult, TestRunnerArgs, TestSuccessResult, TestTotals, } from './constants';
|
|
3
|
+
export { DEFAULT_TIMEOUT_MS, MAX_COMMAND_LENGTH, MAX_OUTPUT_BYTES, MAX_TIMEOUT_MS, SUPPORTED_FRAMEWORKS, } from './constants';
|
|
4
|
+
export { detectTestFramework } from './detect';
|
|
5
|
+
export { runTests } from './run';
|
|
6
|
+
export declare const test_runner: ReturnType<typeof tool>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { CLIError, ConfigError, HookError, SwarmError, ToolError, } from './errors';
|
|
2
|
+
export { error, log, warn } from './logger';
|
|
3
|
+
export { deepMerge, MAX_MERGE_DEPTH } from './merge';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the user configuration directory, respecting XDG Base Directory spec.
|
|
6
|
+
* Uses XDG_CONFIG_HOME env var if set, otherwise falls back to ~/.config
|
|
7
|
+
*/
|
|
8
|
+
export declare function getUserConfigDir(): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.1",
|
|
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",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AgentConfig } from '@opencode-ai/sdk';
|
|
2
|
-
export interface AgentDefinition {
|
|
3
|
-
name: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
config: AgentConfig;
|
|
6
|
-
}
|
|
7
|
-
export declare function createArchitectAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/coder.d.ts
DELETED
package/dist/agents/critic.d.ts
DELETED
package/dist/agents/docs.d.ts
DELETED
package/dist/agents/sme.d.ts
DELETED
package/dist/commands/plan.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function handlePlanCommand(directory: string, args: string[]): Promise<string>;
|
package/dist/config/loader.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type PluginConfig } from './schema';
|
|
2
|
-
export declare const MAX_CONFIG_FILE_BYTES = 102400;
|
|
3
|
-
export { deepMerge, MAX_MERGE_DEPTH } from '../utils/merge';
|
|
4
|
-
/**
|
|
5
|
-
* Load plugin configuration from user and project config files.
|
|
6
|
-
*
|
|
7
|
-
* Config locations:
|
|
8
|
-
* 1. User config: ~/.config/opencode/opencode-swarm.json
|
|
9
|
-
* 2. Project config: <directory>/.opencode/opencode-swarm.json
|
|
10
|
-
*
|
|
11
|
-
* Project config takes precedence. Nested objects are deep-merged.
|
|
12
|
-
* IMPORTANT: Raw configs are merged BEFORE Zod parsing so that
|
|
13
|
-
* Zod defaults don't override explicit user values.
|
|
14
|
-
*/
|
|
15
|
-
export declare function loadPluginConfig(directory: string): PluginConfig;
|
|
16
|
-
/**
|
|
17
|
-
* Internal variant of loadPluginConfig that also returns loader metadata.
|
|
18
|
-
* Used only by src/index.ts to determine guardrails fallback behavior.
|
|
19
|
-
* NOT part of the public API — use loadPluginConfig() for all other callers.
|
|
20
|
-
*/
|
|
21
|
-
export declare function loadPluginConfigWithMeta(directory: string): {
|
|
22
|
-
config: PluginConfig;
|
|
23
|
-
loadedFromFile: boolean;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Load custom prompt for an agent from the prompts directory.
|
|
27
|
-
* Checks for {agent}.md (replaces default) and {agent}_append.md (appends).
|
|
28
|
-
*/
|
|
29
|
-
export declare function loadAgentPrompt(agentName: string): {
|
|
30
|
-
prompt?: string;
|
|
31
|
-
appendPrompt?: string;
|
|
32
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '@opencode-ai/plugin';
|
|
2
|
-
/**
|
|
3
|
-
* OpenCode Swarm Plugin
|
|
4
|
-
*
|
|
5
|
-
* Architect-centric agentic swarm for code generation.
|
|
6
|
-
* Hub-and-spoke architecture with:
|
|
7
|
-
* - Architect as central orchestrator
|
|
8
|
-
* - Dynamic SME consultation (serial)
|
|
9
|
-
* - Code generation with QA review
|
|
10
|
-
* - Iterative refinement with triage
|
|
11
|
-
*/
|
|
12
|
-
declare const OpenCodeSwarm: Plugin;
|
|
13
|
-
export default OpenCodeSwarm;
|
|
14
|
-
export type { AgentDefinition } from './agents';
|
|
15
|
-
export type { AgentName, PipelineAgentName, PluginConfig, QAAgentName, } from './config';
|
package/dist/utils/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -7,8 +7,8 @@ export declare const TaskStatusSchema: z.ZodEnum<{
|
|
|
7
7
|
}>;
|
|
8
8
|
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
|
|
9
9
|
export declare const TaskSizeSchema: z.ZodEnum<{
|
|
10
|
-
medium: "medium";
|
|
11
10
|
small: "small";
|
|
11
|
+
medium: "medium";
|
|
12
12
|
large: "large";
|
|
13
13
|
}>;
|
|
14
14
|
export type TaskSize = z.infer<typeof TaskSizeSchema>;
|
|
@@ -35,8 +35,8 @@ export declare const TaskSchema: z.ZodObject<{
|
|
|
35
35
|
blocked: "blocked";
|
|
36
36
|
}>>;
|
|
37
37
|
size: z.ZodDefault<z.ZodEnum<{
|
|
38
|
-
medium: "medium";
|
|
39
38
|
small: "small";
|
|
39
|
+
medium: "medium";
|
|
40
40
|
large: "large";
|
|
41
41
|
}>>;
|
|
42
42
|
description: z.ZodString;
|
|
@@ -66,8 +66,8 @@ export declare const PhaseSchema: z.ZodObject<{
|
|
|
66
66
|
blocked: "blocked";
|
|
67
67
|
}>>;
|
|
68
68
|
size: z.ZodDefault<z.ZodEnum<{
|
|
69
|
-
medium: "medium";
|
|
70
69
|
small: "small";
|
|
70
|
+
medium: "medium";
|
|
71
71
|
large: "large";
|
|
72
72
|
}>>;
|
|
73
73
|
description: z.ZodString;
|
|
@@ -103,8 +103,8 @@ export declare const PlanSchema: z.ZodObject<{
|
|
|
103
103
|
blocked: "blocked";
|
|
104
104
|
}>>;
|
|
105
105
|
size: z.ZodDefault<z.ZodEnum<{
|
|
106
|
-
medium: "medium";
|
|
107
106
|
small: "small";
|
|
107
|
+
medium: "medium";
|
|
108
108
|
large: "large";
|
|
109
109
|
}>>;
|
|
110
110
|
description: z.ZodString;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|