opencode-swarm 6.8.0 → 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.
Files changed (126) hide show
  1. package/README.md +76 -5
  2. package/dist/index.js +1252 -1316
  3. package/dist/src/agents/architect.d.ts +8 -0
  4. package/dist/{agents/test-engineer.d.ts → src/agents/coder.d.ts} +2 -1
  5. package/dist/src/agents/critic.d.ts +3 -0
  6. package/dist/src/agents/designer.d.ts +3 -0
  7. package/dist/src/agents/docs.d.ts +3 -0
  8. package/dist/src/agents/explorer.d.ts +3 -0
  9. package/dist/src/agents/model.d.ts +2 -0
  10. package/dist/{agents → src/agents}/reviewer.d.ts +2 -1
  11. package/dist/src/agents/sme.d.ts +3 -0
  12. package/dist/src/agents/test-engineer.d.ts +3 -0
  13. package/dist/{background → src/background}/trigger.d.ts +0 -16
  14. package/dist/src/config/loader.d.ts +16 -0
  15. package/dist/{config → src/config}/schema.d.ts +171 -0
  16. package/dist/{index.d.ts → src/index.d.ts} +0 -10
  17. package/dist/{state.d.ts → src/state.d.ts} +5 -0
  18. package/dist/{tools → src/tools}/gitingest.d.ts +2 -1
  19. package/dist/{tools/test-runner.d.ts → src/tools/test-runner/constants.d.ts} +0 -4
  20. package/dist/src/tools/test-runner/detect.d.ts +2 -0
  21. package/dist/src/tools/test-runner/discover.d.ts +4 -0
  22. package/dist/src/tools/test-runner/index.d.ts +6 -0
  23. package/dist/src/tools/test-runner/run.d.ts +2 -0
  24. package/dist/src/tools/test-runner/validate.d.ts +2 -0
  25. package/dist/src/utils/index.d.ts +8 -0
  26. package/package.json +1 -1
  27. package/dist/agents/architect.d.ts +0 -7
  28. package/dist/agents/coder.d.ts +0 -2
  29. package/dist/agents/critic.d.ts +0 -2
  30. package/dist/agents/designer.d.ts +0 -2
  31. package/dist/agents/docs.d.ts +0 -2
  32. package/dist/agents/explorer.d.ts +0 -2
  33. package/dist/agents/sme.d.ts +0 -2
  34. package/dist/config/loader.d.ts +0 -32
  35. package/dist/utils/index.d.ts +0 -3
  36. /package/dist/{__tests__ → src/__tests__}/security-adversarial.test.d.ts +0 -0
  37. /package/dist/{agents → src/agents}/index.d.ts +0 -0
  38. /package/dist/{agents → src/agents}/test-engineer.adversarial.test.d.ts +0 -0
  39. /package/dist/{agents → src/agents}/test-engineer.security.test.d.ts +0 -0
  40. /package/dist/{background → src/background}/circuit-breaker.d.ts +0 -0
  41. /package/dist/{background → src/background}/event-bus.d.ts +0 -0
  42. /package/dist/{background → src/background}/evidence-summary-integration.d.ts +0 -0
  43. /package/dist/{background → src/background}/index.d.ts +0 -0
  44. /package/dist/{background → src/background}/manager.d.ts +0 -0
  45. /package/dist/{background → src/background}/plan-sync-worker.d.ts +0 -0
  46. /package/dist/{background → src/background}/queue.d.ts +0 -0
  47. /package/dist/{background → src/background}/status-artifact.d.ts +0 -0
  48. /package/dist/{background → src/background}/trigger.vulnerability.test.d.ts +0 -0
  49. /package/dist/{background → src/background}/worker.d.ts +0 -0
  50. /package/dist/{cli → src/cli}/index.d.ts +0 -0
  51. /package/dist/{commands → src/commands}/agents.d.ts +0 -0
  52. /package/dist/{commands → src/commands}/archive.d.ts +0 -0
  53. /package/dist/{commands → src/commands}/benchmark.d.ts +0 -0
  54. /package/dist/{commands → src/commands}/command-adapters.security.test.d.ts +0 -0
  55. /package/dist/{commands → src/commands}/commands.test.d.ts +0 -0
  56. /package/dist/{commands → src/commands}/config.d.ts +0 -0
  57. /package/dist/{commands → src/commands}/diagnose.d.ts +0 -0
  58. /package/dist/{commands → src/commands}/doctor.d.ts +0 -0
  59. /package/dist/{commands → src/commands}/evidence.d.ts +0 -0
  60. /package/dist/{commands → src/commands}/export.d.ts +0 -0
  61. /package/dist/{commands → src/commands}/history.d.ts +0 -0
  62. /package/dist/{commands → src/commands}/index.d.ts +0 -0
  63. /package/dist/{commands → src/commands}/plan.d.ts +0 -0
  64. /package/dist/{commands → src/commands}/preflight.d.ts +0 -0
  65. /package/dist/{commands → src/commands}/reset.d.ts +0 -0
  66. /package/dist/{commands → src/commands}/retrieve.d.ts +0 -0
  67. /package/dist/{commands → src/commands}/status.d.ts +0 -0
  68. /package/dist/{commands → src/commands}/sync-plan.d.ts +0 -0
  69. /package/dist/{config → src/config}/constants.d.ts +0 -0
  70. /package/dist/{config → src/config}/evidence-schema.d.ts +0 -0
  71. /package/dist/{config → src/config}/index.d.ts +0 -0
  72. /package/dist/{config → src/config}/plan-schema.d.ts +0 -0
  73. /package/dist/{evidence → src/evidence}/index.d.ts +0 -0
  74. /package/dist/{evidence → src/evidence}/manager.d.ts +0 -0
  75. /package/dist/{hooks → src/hooks}/agent-activity.d.ts +0 -0
  76. /package/dist/{hooks → src/hooks}/compaction-customizer.d.ts +0 -0
  77. /package/dist/{hooks → src/hooks}/context-budget.d.ts +0 -0
  78. /package/dist/{hooks → src/hooks}/context-scoring.d.ts +0 -0
  79. /package/dist/{hooks → src/hooks}/delegation-gate.d.ts +0 -0
  80. /package/dist/{hooks → src/hooks}/delegation-tracker.d.ts +0 -0
  81. /package/dist/{hooks → src/hooks}/extractors.d.ts +0 -0
  82. /package/dist/{hooks → src/hooks}/guardrails.d.ts +0 -0
  83. /package/dist/{hooks → src/hooks}/index.d.ts +0 -0
  84. /package/dist/{hooks → src/hooks}/phase-monitor.d.ts +0 -0
  85. /package/dist/{hooks → src/hooks}/pipeline-tracker.d.ts +0 -0
  86. /package/dist/{hooks → src/hooks}/system-enhancer.d.ts +0 -0
  87. /package/dist/{hooks → src/hooks}/tool-summarizer.d.ts +0 -0
  88. /package/dist/{hooks → src/hooks}/utils.d.ts +0 -0
  89. /package/dist/{plan → src/plan}/index.d.ts +0 -0
  90. /package/dist/{plan → src/plan}/manager.d.ts +0 -0
  91. /package/dist/{services → src/services}/config-doctor.d.ts +0 -0
  92. /package/dist/{services → src/services}/config-doctor.security.test.d.ts +0 -0
  93. /package/dist/{services → src/services}/config-doctor.test.d.ts +0 -0
  94. /package/dist/{services → src/services}/decision-drift-analyzer.d.ts +0 -0
  95. /package/dist/{services → src/services}/diagnose-service.d.ts +0 -0
  96. /package/dist/{services → src/services}/evidence-service.d.ts +0 -0
  97. /package/dist/{services → src/services}/evidence-summary-service.d.ts +0 -0
  98. /package/dist/{services → src/services}/export-service.d.ts +0 -0
  99. /package/dist/{services → src/services}/history-service.d.ts +0 -0
  100. /package/dist/{services → src/services}/index.d.ts +0 -0
  101. /package/dist/{services → src/services}/plan-service.d.ts +0 -0
  102. /package/dist/{services → src/services}/preflight-integration.d.ts +0 -0
  103. /package/dist/{services → src/services}/preflight-service.d.ts +0 -0
  104. /package/dist/{services → src/services}/status-service.d.ts +0 -0
  105. /package/dist/{summaries → src/summaries}/index.d.ts +0 -0
  106. /package/dist/{summaries → src/summaries}/manager.d.ts +0 -0
  107. /package/dist/{summaries → src/summaries}/summarizer.d.ts +0 -0
  108. /package/dist/{tools → src/tools}/checkpoint.d.ts +0 -0
  109. /package/dist/{tools → src/tools}/complexity-hotspots.d.ts +0 -0
  110. /package/dist/{tools → src/tools}/diff.d.ts +0 -0
  111. /package/dist/{tools → src/tools}/domain-detector.d.ts +0 -0
  112. /package/dist/{tools → src/tools}/evidence-check.d.ts +0 -0
  113. /package/dist/{tools → src/tools}/file-extractor.d.ts +0 -0
  114. /package/dist/{tools → src/tools}/imports.d.ts +0 -0
  115. /package/dist/{tools → src/tools}/index.d.ts +0 -0
  116. /package/dist/{tools → src/tools}/lint.d.ts +0 -0
  117. /package/dist/{tools → src/tools}/pkg-audit.d.ts +0 -0
  118. /package/dist/{tools → src/tools}/retrieve-summary.d.ts +0 -0
  119. /package/dist/{tools → src/tools}/schema-drift.d.ts +0 -0
  120. /package/dist/{tools → src/tools}/secretscan.d.ts +0 -0
  121. /package/dist/{tools → src/tools}/symbols.d.ts +0 -0
  122. /package/dist/{tools → src/tools}/test-runner.security-adversarial.test.d.ts +0 -0
  123. /package/dist/{tools → src/tools}/todo-extract.d.ts +0 -0
  124. /package/dist/{utils → src/utils}/errors.d.ts +0 -0
  125. /package/dist/{utils → src/utils}/logger.d.ts +0 -0
  126. /package/dist/{utils → src/utils}/merge.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ import type { AgentConfig } from '@opencode-ai/sdk';
2
+ import { type ModelSentinel } from './model';
3
+ export interface AgentDefinition {
4
+ name: string;
5
+ description?: string;
6
+ config: AgentConfig;
7
+ }
8
+ export declare function createArchitectAgent(model?: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -1,2 +1,3 @@
1
1
  import type { AgentDefinition } from './architect';
2
- export declare function createTestEngineerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createCoderAgent(model: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createCriticAgent(model: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createDesignerAgent(model?: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createDocsAgent(model: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createExplorerAgent(model?: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ export type ModelSentinel = string | undefined;
2
+ export declare function resolveModel(model?: string): ModelSentinel;
@@ -1,5 +1,6 @@
1
1
  import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
2
3
  /** OWASP Top 10 2021 categories for security-focused review passes */
3
4
  export declare const SECURITY_CATEGORIES: readonly ["broken-access-control", "cryptographic-failures", "injection", "insecure-design", "security-misconfiguration", "vulnerable-components", "auth-failures", "data-integrity-failures", "logging-monitoring-failures", "ssrf"];
4
5
  export type SecurityCategory = (typeof SECURITY_CATEGORIES)[number];
5
- export declare function createReviewerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
6
+ export declare function createReviewerAgent(model: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createSMEAgent(model: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './architect';
2
+ import { type ModelSentinel } from './model';
3
+ export declare function createTestEngineerAgent(model: ModelSentinel, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -44,22 +44,6 @@ export interface PreflightRequest {
44
44
  reason: string;
45
45
  metadata?: Record<string, unknown>;
46
46
  }
47
- /** Phase boundary detection result */
48
- export interface PhaseBoundaryResult {
49
- detected: boolean;
50
- previousPhase: number;
51
- currentPhase: number;
52
- reason: string;
53
- completedTaskCount: number;
54
- totalTaskCount: number;
55
- }
56
- /** Preflight trigger configuration */
57
- export interface PreflightTriggerConfig {
58
- /** Minimum tasks that must be completed in a phase to trigger */
59
- minCompletedTasksThreshold?: number;
60
- /** Enable trigger even if no tasks (phase auto-complete mode) */
61
- allowZeroTaskTrigger?: boolean;
62
- }
63
47
  /**
64
48
  * Phase-Boundary Trigger Detector
65
49
  *
@@ -0,0 +1,16 @@
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
+ export declare function loadPluginConfig(directory: string): PluginConfig;
5
+ export declare function loadPluginConfigWithMeta(directory: string): {
6
+ config: PluginConfig;
7
+ loadedFromFile: boolean;
8
+ };
9
+ /**
10
+ * Load custom prompt for an agent from the prompts directory.
11
+ * Checks for {agent}.md (replaces default) and {agent}_append.md (appends).
12
+ */
13
+ export declare function loadAgentPrompt(agentName: string): {
14
+ prompt?: string;
15
+ appendPrompt?: string;
16
+ };
@@ -245,6 +245,11 @@ export declare const CheckpointConfigSchema: z.ZodObject<{
245
245
  auto_checkpoint_threshold: z.ZodDefault<z.ZodNumber>;
246
246
  }, z.core.$strip>;
247
247
  export type CheckpointConfig = z.infer<typeof CheckpointConfigSchema>;
248
+ export declare const GitingestConfigSchema: z.ZodObject<{
249
+ enabled: z.ZodDefault<z.ZodBoolean>;
250
+ endpoint: z.ZodDefault<z.ZodString>;
251
+ }, z.core.$strip>;
252
+ export type GitingestConfig = z.infer<typeof GitingestConfigSchema>;
248
253
  export declare const AutomationModeSchema: z.ZodEnum<{
249
254
  auto: "auto";
250
255
  manual: "manual";
@@ -277,6 +282,168 @@ declare const AutomationConfigSchemaBase: z.ZodObject<{
277
282
  }, z.core.$strip>;
278
283
  export type AutomationConfig = z.infer<typeof AutomationConfigSchemaBase>;
279
284
  export declare const AutomationConfigSchema: z.ZodType<AutomationConfig>;
285
+ export declare const pluginConfigShape: {
286
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
287
+ model: z.ZodOptional<z.ZodString>;
288
+ temperature: z.ZodOptional<z.ZodNumber>;
289
+ disabled: z.ZodOptional<z.ZodBoolean>;
290
+ }, z.core.$strip>>>;
291
+ swarms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
292
+ name: z.ZodOptional<z.ZodString>;
293
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
294
+ model: z.ZodOptional<z.ZodString>;
295
+ temperature: z.ZodOptional<z.ZodNumber>;
296
+ disabled: z.ZodOptional<z.ZodBoolean>;
297
+ }, z.core.$strip>>>;
298
+ }, z.core.$strip>>>;
299
+ max_iterations: z.ZodDefault<z.ZodNumber>;
300
+ qa_retry_limit: z.ZodDefault<z.ZodNumber>;
301
+ inject_phase_reminders: z.ZodDefault<z.ZodBoolean>;
302
+ hooks: z.ZodOptional<z.ZodObject<{
303
+ system_enhancer: z.ZodDefault<z.ZodBoolean>;
304
+ compaction: z.ZodDefault<z.ZodBoolean>;
305
+ agent_activity: z.ZodDefault<z.ZodBoolean>;
306
+ delegation_tracker: z.ZodDefault<z.ZodBoolean>;
307
+ agent_awareness_max_chars: z.ZodDefault<z.ZodNumber>;
308
+ delegation_gate: z.ZodDefault<z.ZodBoolean>;
309
+ delegation_max_chars: z.ZodDefault<z.ZodNumber>;
310
+ }, z.core.$strip>>;
311
+ context_budget: z.ZodOptional<z.ZodObject<{
312
+ enabled: z.ZodDefault<z.ZodBoolean>;
313
+ warn_threshold: z.ZodDefault<z.ZodNumber>;
314
+ critical_threshold: z.ZodDefault<z.ZodNumber>;
315
+ model_limits: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
316
+ max_injection_tokens: z.ZodDefault<z.ZodNumber>;
317
+ scoring: z.ZodOptional<z.ZodObject<{
318
+ enabled: z.ZodDefault<z.ZodBoolean>;
319
+ max_candidates: z.ZodDefault<z.ZodNumber>;
320
+ weights: z.ZodOptional<z.ZodObject<{
321
+ phase: z.ZodDefault<z.ZodNumber>;
322
+ current_task: z.ZodDefault<z.ZodNumber>;
323
+ blocked_task: z.ZodDefault<z.ZodNumber>;
324
+ recent_failure: z.ZodDefault<z.ZodNumber>;
325
+ recent_success: z.ZodDefault<z.ZodNumber>;
326
+ evidence_presence: z.ZodDefault<z.ZodNumber>;
327
+ decision_recency: z.ZodDefault<z.ZodNumber>;
328
+ dependency_proximity: z.ZodDefault<z.ZodNumber>;
329
+ }, z.core.$strip>>;
330
+ decision_decay: z.ZodOptional<z.ZodObject<{
331
+ mode: z.ZodDefault<z.ZodEnum<{
332
+ linear: "linear";
333
+ exponential: "exponential";
334
+ }>>;
335
+ half_life_hours: z.ZodDefault<z.ZodNumber>;
336
+ }, z.core.$strip>>;
337
+ token_ratios: z.ZodOptional<z.ZodObject<{
338
+ prose: z.ZodDefault<z.ZodNumber>;
339
+ code: z.ZodDefault<z.ZodNumber>;
340
+ markdown: z.ZodDefault<z.ZodNumber>;
341
+ json: z.ZodDefault<z.ZodNumber>;
342
+ }, z.core.$strip>>;
343
+ }, z.core.$strip>>;
344
+ }, z.core.$strip>>;
345
+ guardrails: z.ZodOptional<z.ZodObject<{
346
+ enabled: z.ZodDefault<z.ZodBoolean>;
347
+ max_tool_calls: z.ZodDefault<z.ZodNumber>;
348
+ max_duration_minutes: z.ZodDefault<z.ZodNumber>;
349
+ max_repetitions: z.ZodDefault<z.ZodNumber>;
350
+ max_consecutive_errors: z.ZodDefault<z.ZodNumber>;
351
+ warning_threshold: z.ZodDefault<z.ZodNumber>;
352
+ idle_timeout_minutes: z.ZodDefault<z.ZodNumber>;
353
+ profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
354
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
355
+ max_duration_minutes: z.ZodOptional<z.ZodNumber>;
356
+ max_repetitions: z.ZodOptional<z.ZodNumber>;
357
+ max_consecutive_errors: z.ZodOptional<z.ZodNumber>;
358
+ warning_threshold: z.ZodOptional<z.ZodNumber>;
359
+ idle_timeout_minutes: z.ZodOptional<z.ZodNumber>;
360
+ }, z.core.$strip>>>;
361
+ }, z.core.$strip>>;
362
+ evidence: z.ZodOptional<z.ZodObject<{
363
+ enabled: z.ZodDefault<z.ZodBoolean>;
364
+ max_age_days: z.ZodDefault<z.ZodNumber>;
365
+ max_bundles: z.ZodDefault<z.ZodNumber>;
366
+ auto_archive: z.ZodDefault<z.ZodBoolean>;
367
+ }, z.core.$strip>>;
368
+ summaries: z.ZodOptional<z.ZodObject<{
369
+ enabled: z.ZodDefault<z.ZodBoolean>;
370
+ threshold_bytes: z.ZodDefault<z.ZodNumber>;
371
+ max_summary_chars: z.ZodDefault<z.ZodNumber>;
372
+ max_stored_bytes: z.ZodDefault<z.ZodNumber>;
373
+ retention_days: z.ZodDefault<z.ZodNumber>;
374
+ }, z.core.$strip>>;
375
+ review_passes: z.ZodOptional<z.ZodObject<{
376
+ always_security_review: z.ZodDefault<z.ZodBoolean>;
377
+ security_globs: z.ZodDefault<z.ZodArray<z.ZodString>>;
378
+ }, z.core.$strip>>;
379
+ integration_analysis: z.ZodOptional<z.ZodObject<{
380
+ enabled: z.ZodDefault<z.ZodBoolean>;
381
+ }, z.core.$strip>>;
382
+ docs: z.ZodOptional<z.ZodObject<{
383
+ enabled: z.ZodDefault<z.ZodBoolean>;
384
+ doc_patterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
385
+ }, z.core.$strip>>;
386
+ gitingest: z.ZodOptional<z.ZodObject<{
387
+ enabled: z.ZodDefault<z.ZodBoolean>;
388
+ endpoint: z.ZodDefault<z.ZodString>;
389
+ }, z.core.$strip>>;
390
+ ui_review: z.ZodOptional<z.ZodObject<{
391
+ enabled: z.ZodDefault<z.ZodBoolean>;
392
+ trigger_paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
393
+ trigger_keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
394
+ }, z.core.$strip>>;
395
+ compaction_advisory: z.ZodOptional<z.ZodObject<{
396
+ enabled: z.ZodDefault<z.ZodBoolean>;
397
+ thresholds: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
398
+ message: z.ZodDefault<z.ZodString>;
399
+ }, z.core.$strip>>;
400
+ lint: z.ZodOptional<z.ZodObject<{
401
+ enabled: z.ZodDefault<z.ZodBoolean>;
402
+ mode: z.ZodDefault<z.ZodEnum<{
403
+ check: "check";
404
+ fix: "fix";
405
+ }>>;
406
+ linter: z.ZodDefault<z.ZodEnum<{
407
+ biome: "biome";
408
+ eslint: "eslint";
409
+ auto: "auto";
410
+ }>>;
411
+ patterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
412
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
413
+ }, z.core.$strip>>;
414
+ secretscan: z.ZodOptional<z.ZodObject<{
415
+ enabled: z.ZodDefault<z.ZodBoolean>;
416
+ patterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
417
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
418
+ extensions: z.ZodDefault<z.ZodArray<z.ZodString>>;
419
+ }, z.core.$strip>>;
420
+ checkpoint: z.ZodOptional<z.ZodObject<{
421
+ enabled: z.ZodDefault<z.ZodBoolean>;
422
+ auto_checkpoint_threshold: z.ZodDefault<z.ZodNumber>;
423
+ }, z.core.$strip>>;
424
+ automation: z.ZodOptional<z.ZodType<{
425
+ mode: "auto" | "manual" | "hybrid";
426
+ capabilities: {
427
+ plan_sync: boolean;
428
+ phase_preflight: boolean;
429
+ config_doctor_on_startup: boolean;
430
+ config_doctor_autofix: boolean;
431
+ evidence_auto_summaries: boolean;
432
+ decision_drift_detection: boolean;
433
+ };
434
+ }, unknown, z.core.$ZodTypeInternals<{
435
+ mode: "auto" | "manual" | "hybrid";
436
+ capabilities: {
437
+ plan_sync: boolean;
438
+ phase_preflight: boolean;
439
+ config_doctor_on_startup: boolean;
440
+ config_doctor_autofix: boolean;
441
+ evidence_auto_summaries: boolean;
442
+ decision_drift_detection: boolean;
443
+ };
444
+ }, unknown>>>;
445
+ };
446
+ export declare const PLUGIN_CONFIG_ALLOWED_KEYS: Set<string>;
280
447
  export declare const PluginConfigSchema: z.ZodObject<{
281
448
  agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
282
449
  model: z.ZodOptional<z.ZodString>;
@@ -378,6 +545,10 @@ export declare const PluginConfigSchema: z.ZodObject<{
378
545
  enabled: z.ZodDefault<z.ZodBoolean>;
379
546
  doc_patterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
380
547
  }, z.core.$strip>>;
548
+ gitingest: z.ZodOptional<z.ZodObject<{
549
+ enabled: z.ZodDefault<z.ZodBoolean>;
550
+ endpoint: z.ZodDefault<z.ZodString>;
551
+ }, z.core.$strip>>;
381
552
  ui_review: z.ZodOptional<z.ZodObject<{
382
553
  enabled: z.ZodDefault<z.ZodBoolean>;
383
554
  trigger_paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1,14 +1,4 @@
1
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
2
  declare const OpenCodeSwarm: Plugin;
13
3
  export default OpenCodeSwarm;
14
4
  export type { AgentDefinition } from './agents';
@@ -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
  */
@@ -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,2 @@
1
+ import type { TestFramework } from './constants';
2
+ export declare function detectTestFramework(): Promise<TestFramework>;
@@ -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,2 @@
1
+ import type { TestFramework, TestResult } from './constants';
2
+ export declare function runTests(framework: TestFramework, scope: 'all' | 'convention' | 'graph', files: string[], coverage: boolean, timeout_ms: number): Promise<TestResult>;
@@ -0,0 +1,2 @@
1
+ import type { TestRunnerArgs } from './constants';
2
+ export declare function validateArgs(args: unknown): args is TestRunnerArgs;
@@ -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.8.0",
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;
@@ -1,2 +0,0 @@
1
- import type { AgentDefinition } from './architect';
2
- export declare function createCoderAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -1,2 +0,0 @@
1
- import type { AgentDefinition } from './architect';
2
- export declare function createCriticAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -1,2 +0,0 @@
1
- import type { AgentDefinition } from './architect';
2
- export declare function createDesignerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -1,2 +0,0 @@
1
- import type { AgentDefinition } from './architect';
2
- export declare function createDocsAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -1,2 +0,0 @@
1
- import type { AgentDefinition } from './architect';
2
- export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -1,2 +0,0 @@
1
- import type { AgentDefinition } from './architect';
2
- export declare function createSMEAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -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
- };
@@ -1,3 +0,0 @@
1
- export { CLIError, ConfigError, HookError, SwarmError, ToolError, } from './errors';
2
- export { error, log, warn } from './logger';
3
- export { deepMerge, MAX_MERGE_DEPTH } from './merge';
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
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
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