opencode-swarm-plugin 0.33.0 → 0.35.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.
Files changed (41) hide show
  1. package/.hive/issues.jsonl +12 -0
  2. package/.hive/memories.jsonl +255 -1
  3. package/.turbo/turbo-build.log +4 -4
  4. package/.turbo/turbo-test.log +289 -289
  5. package/CHANGELOG.md +133 -0
  6. package/README.md +29 -1
  7. package/bin/swarm.test.ts +342 -1
  8. package/bin/swarm.ts +351 -4
  9. package/dist/compaction-hook.d.ts +1 -1
  10. package/dist/compaction-hook.d.ts.map +1 -1
  11. package/dist/index.d.ts +95 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +11848 -124
  14. package/dist/logger.d.ts +34 -0
  15. package/dist/logger.d.ts.map +1 -0
  16. package/dist/plugin.js +11722 -112
  17. package/dist/swarm-orchestrate.d.ts +105 -0
  18. package/dist/swarm-orchestrate.d.ts.map +1 -1
  19. package/dist/swarm-prompts.d.ts +54 -2
  20. package/dist/swarm-prompts.d.ts.map +1 -1
  21. package/dist/swarm-research.d.ts +127 -0
  22. package/dist/swarm-research.d.ts.map +1 -0
  23. package/dist/swarm-review.d.ts.map +1 -1
  24. package/dist/swarm.d.ts +56 -1
  25. package/dist/swarm.d.ts.map +1 -1
  26. package/evals/compaction-resumption.eval.ts +289 -0
  27. package/evals/coordinator-behavior.eval.ts +307 -0
  28. package/evals/fixtures/compaction-cases.ts +350 -0
  29. package/evals/scorers/compaction-scorers.ts +305 -0
  30. package/evals/scorers/index.ts +12 -0
  31. package/package.json +5 -2
  32. package/src/compaction-hook.test.ts +639 -1
  33. package/src/compaction-hook.ts +488 -18
  34. package/src/index.ts +29 -0
  35. package/src/logger.test.ts +189 -0
  36. package/src/logger.ts +135 -0
  37. package/src/swarm-decompose.ts +0 -7
  38. package/src/swarm-prompts.test.ts +164 -1
  39. package/src/swarm-prompts.ts +179 -12
  40. package/src/swarm-review.test.ts +177 -0
  41. package/src/swarm-review.ts +12 -47
package/bin/swarm.ts CHANGED
@@ -1153,9 +1153,17 @@ const result2 = await Task(subagent_type="swarm/worker", prompt="<from above>")
1153
1153
  4. **SEND FEEDBACK** - Approve or request changes
1154
1154
  \`swarm_review_feedback(project_key, task_id, worker_id, status, issues)\`
1155
1155
 
1156
- If approved: Close cell, spawn next worker
1157
- If needs_changes: Worker retries (max 3 attempts)
1158
- If 3 failures: Mark blocked, escalate to human
1156
+ **If approved:**
1157
+ - Close cell, spawn next worker
1158
+
1159
+ **If needs_changes:**
1160
+ - \`swarm_review_feedback\` returns \`retry_context\` (NOT sends message - worker is dead)
1161
+ - Generate retry prompt: \`swarm_spawn_retry(retry_context)\`
1162
+ - Spawn NEW worker with Task() using retry prompt
1163
+ - Max 3 attempts before marking task blocked
1164
+
1165
+ **If 3 failures:**
1166
+ - Mark task blocked, escalate to human
1159
1167
 
1160
1168
  5. **ONLY THEN** - Spawn next worker or complete
1161
1169
 
@@ -2706,6 +2714,7 @@ ${cyan("Commands:")}
2706
2714
  swarm config Show paths to generated config files
2707
2715
  swarm agents Update AGENTS.md with skill awareness
2708
2716
  swarm migrate Migrate PGlite database to libSQL
2717
+ swarm log View swarm logs with filtering
2709
2718
  swarm update Update to latest version
2710
2719
  swarm version Show version and banner
2711
2720
  swarm tool Execute a tool (for plugin wrapper)
@@ -2716,6 +2725,16 @@ ${cyan("Tool Execution:")}
2716
2725
  swarm tool <name> Execute tool with no args
2717
2726
  swarm tool <name> --json '<args>' Execute tool with JSON args
2718
2727
 
2728
+ ${cyan("Log Viewing:")}
2729
+ swarm log Tail recent logs (last 50 lines)
2730
+ swarm log <module> Filter by module (e.g., compaction)
2731
+ swarm log --level <level> Filter by level (trace, debug, info, warn, error, fatal)
2732
+ swarm log --since <duration> Time filter (30s, 5m, 2h, 1d)
2733
+ swarm log --json Raw JSON output for jq
2734
+ swarm log --limit <n> Limit output to n lines (default: 50)
2735
+ swarm log --watch, -w Watch mode - continuously monitor for new logs
2736
+ swarm log --interval <ms> Poll interval in ms (default: 1000, min: 100)
2737
+
2719
2738
  ${cyan("Usage in OpenCode:")}
2720
2739
  /swarm "Add user authentication with OAuth"
2721
2740
  @swarm/planner "Decompose this into parallel tasks"
@@ -3045,7 +3064,7 @@ async function migrate() {
3045
3064
  // Show results
3046
3065
  const showStat = (label: string, stat: { migrated: number; skipped: number; failed: number }) => {
3047
3066
  if (stat.migrated > 0 || stat.skipped > 0 || stat.failed > 0) {
3048
- const parts = [];
3067
+ const parts: string[] = [];
3049
3068
  if (stat.migrated > 0) parts.push(green(`${stat.migrated} migrated`));
3050
3069
  if (stat.skipped > 0) parts.push(dim(`${stat.skipped} skipped`));
3051
3070
  if (stat.failed > 0) parts.push(`\x1b[31m${stat.failed} failed\x1b[0m`);
@@ -3073,6 +3092,330 @@ async function migrate() {
3073
3092
  }
3074
3093
  }
3075
3094
 
3095
+ // ============================================================================
3096
+ // Log Command - View swarm logs with filtering
3097
+ // ============================================================================
3098
+
3099
+ interface LogLine {
3100
+ level: number;
3101
+ time: string;
3102
+ module: string;
3103
+ msg: string;
3104
+ }
3105
+
3106
+ function parseLogLine(line: string): LogLine | null {
3107
+ try {
3108
+ const parsed = JSON.parse(line);
3109
+ if (typeof parsed.level === "number" && parsed.time && parsed.msg) {
3110
+ return {
3111
+ level: parsed.level,
3112
+ time: parsed.time,
3113
+ module: parsed.module || "unknown",
3114
+ msg: parsed.msg,
3115
+ };
3116
+ }
3117
+ } catch {
3118
+ // Invalid JSON
3119
+ }
3120
+ return null;
3121
+ }
3122
+
3123
+ function levelToName(level: number): string {
3124
+ if (level >= 60) return "FATAL";
3125
+ if (level >= 50) return "ERROR";
3126
+ if (level >= 40) return "WARN ";
3127
+ if (level >= 30) return "INFO ";
3128
+ if (level >= 20) return "DEBUG";
3129
+ return "TRACE";
3130
+ }
3131
+
3132
+ function levelToColor(level: number): (s: string) => string {
3133
+ if (level >= 50) return (s: string) => `\x1b[31m${s}\x1b[0m`; // red
3134
+ if (level >= 40) return (s: string) => `\x1b[33m${s}\x1b[0m`; // yellow
3135
+ if (level >= 30) return green; // green
3136
+ return dim; // dim for debug/trace
3137
+ }
3138
+
3139
+ function levelNameToNumber(name: string): number {
3140
+ const lower = name.toLowerCase();
3141
+ if (lower === "fatal") return 60;
3142
+ if (lower === "error") return 50;
3143
+ if (lower === "warn") return 40;
3144
+ if (lower === "info") return 30;
3145
+ if (lower === "debug") return 20;
3146
+ if (lower === "trace") return 10;
3147
+ return 30; // default to info
3148
+ }
3149
+
3150
+ function parseDuration(duration: string): number | null {
3151
+ const match = duration.match(/^(\d+)([smhd])$/);
3152
+ if (!match) return null;
3153
+
3154
+ const [, num, unit] = match;
3155
+ const value = parseInt(num, 10);
3156
+
3157
+ const multipliers: Record<string, number> = {
3158
+ s: 1000,
3159
+ m: 60 * 1000,
3160
+ h: 60 * 60 * 1000,
3161
+ d: 24 * 60 * 60 * 1000,
3162
+ };
3163
+
3164
+ return value * multipliers[unit];
3165
+ }
3166
+
3167
+ function formatLogLine(log: LogLine, useColor = true): string {
3168
+ const timestamp = new Date(log.time).toLocaleTimeString();
3169
+ const levelName = levelToName(log.level);
3170
+ const module = log.module.padEnd(12);
3171
+ const levelStr = useColor ? levelToColor(log.level)(levelName) : levelName;
3172
+
3173
+ return `${timestamp} ${levelStr} ${module} ${log.msg}`;
3174
+ }
3175
+
3176
+ function readLogFiles(dir: string): string[] {
3177
+ if (!existsSync(dir)) return [];
3178
+
3179
+ const allFiles = readdirSync(dir);
3180
+ const logFiles = allFiles
3181
+ .filter((f: string) => /\.\d+log$/.test(f))
3182
+ .sort()
3183
+ .map((f: string) => join(dir, f));
3184
+
3185
+ const lines: string[] = [];
3186
+ for (const file of logFiles) {
3187
+ try {
3188
+ const content = readFileSync(file, "utf-8");
3189
+ const fileLines = content.split("\n").filter((line: string) => line.trim());
3190
+ lines.push(...fileLines);
3191
+ } catch {
3192
+ // Skip unreadable files
3193
+ }
3194
+ }
3195
+
3196
+ return lines;
3197
+ }
3198
+
3199
+ async function logs() {
3200
+ const args = process.argv.slice(3);
3201
+
3202
+ // Parse arguments
3203
+ let moduleFilter: string | null = null;
3204
+ let levelFilter: number | null = null;
3205
+ let sinceMs: number | null = null;
3206
+ let jsonOutput = false;
3207
+ let limit = 50;
3208
+ let watchMode = false;
3209
+ let pollInterval = 1000; // 1 second default
3210
+
3211
+ for (let i = 0; i < args.length; i++) {
3212
+ const arg = args[i];
3213
+
3214
+ if (arg === "--level" && i + 1 < args.length) {
3215
+ levelFilter = levelNameToNumber(args[++i]);
3216
+ } else if (arg === "--since" && i + 1 < args.length) {
3217
+ const duration = parseDuration(args[++i]);
3218
+ if (duration === null) {
3219
+ p.log.error(`Invalid duration format: ${args[i]}`);
3220
+ p.log.message(dim(" Use format: 30s, 5m, 2h, 1d"));
3221
+ process.exit(1);
3222
+ }
3223
+ sinceMs = duration;
3224
+ } else if (arg === "--json") {
3225
+ jsonOutput = true;
3226
+ } else if (arg === "--limit" && i + 1 < args.length) {
3227
+ limit = parseInt(args[++i], 10);
3228
+ if (isNaN(limit) || limit <= 0) {
3229
+ p.log.error(`Invalid limit: ${args[i]}`);
3230
+ process.exit(1);
3231
+ }
3232
+ } else if (arg === "--watch" || arg === "-w") {
3233
+ watchMode = true;
3234
+ } else if (arg === "--interval" && i + 1 < args.length) {
3235
+ pollInterval = parseInt(args[++i], 10);
3236
+ if (isNaN(pollInterval) || pollInterval < 100) {
3237
+ p.log.error(`Invalid interval: ${args[i]} (minimum 100ms)`);
3238
+ process.exit(1);
3239
+ }
3240
+ } else if (!arg.startsWith("--") && !arg.startsWith("-")) {
3241
+ // Positional arg = module filter
3242
+ moduleFilter = arg;
3243
+ }
3244
+ }
3245
+
3246
+ // Read logs from ~/.config/swarm-tools/logs/
3247
+ const logsDir = join(homedir(), ".config", "swarm-tools", "logs");
3248
+
3249
+ if (!existsSync(logsDir)) {
3250
+ if (!jsonOutput) {
3251
+ p.log.warn("No logs directory found");
3252
+ p.log.message(dim(` Expected: ${logsDir}`));
3253
+ } else {
3254
+ console.log(JSON.stringify({ logs: [] }));
3255
+ }
3256
+ return;
3257
+ }
3258
+
3259
+ // Helper to filter logs
3260
+ const filterLogs = (rawLogs: LogLine[]): LogLine[] => {
3261
+ let filtered = rawLogs;
3262
+
3263
+ if (moduleFilter) {
3264
+ filtered = filtered.filter((log) => log.module === moduleFilter);
3265
+ }
3266
+
3267
+ if (levelFilter !== null) {
3268
+ filtered = filtered.filter((log) => log.level >= levelFilter);
3269
+ }
3270
+
3271
+ if (sinceMs !== null) {
3272
+ const cutoffTime = Date.now() - sinceMs;
3273
+ filtered = filtered.filter((log) => new Date(log.time).getTime() >= cutoffTime);
3274
+ }
3275
+
3276
+ return filtered;
3277
+ };
3278
+
3279
+ // Watch mode - continuous monitoring
3280
+ if (watchMode) {
3281
+ console.log(yellow(BANNER));
3282
+ console.log(dim(` Watching logs... (Ctrl+C to stop)`));
3283
+ if (moduleFilter) console.log(dim(` Module: ${moduleFilter}`));
3284
+ if (levelFilter !== null) console.log(dim(` Level: >=${levelToName(levelFilter)}`));
3285
+ console.log();
3286
+
3287
+ // Track file positions for incremental reads
3288
+ const filePositions: Map<string, number> = new Map();
3289
+
3290
+ // Initialize positions from current file sizes
3291
+ const initializePositions = () => {
3292
+ if (!existsSync(logsDir)) return;
3293
+ const files = readdirSync(logsDir).filter((f: string) => /\.\d+log$/.test(f));
3294
+ for (const file of files) {
3295
+ const filePath = join(logsDir, file);
3296
+ try {
3297
+ const stats = statSync(filePath);
3298
+ filePositions.set(filePath, stats.size);
3299
+ } catch {
3300
+ // Skip unreadable files
3301
+ }
3302
+ }
3303
+ };
3304
+
3305
+ // Read new lines from a file since last position
3306
+ const readNewLines = (filePath: string): string[] => {
3307
+ try {
3308
+ const stats = statSync(filePath);
3309
+ const lastPos = filePositions.get(filePath) || 0;
3310
+
3311
+ if (stats.size <= lastPos) {
3312
+ // File was truncated or no new content
3313
+ if (stats.size < lastPos) {
3314
+ filePositions.set(filePath, stats.size);
3315
+ }
3316
+ return [];
3317
+ }
3318
+
3319
+ const content = readFileSync(filePath, "utf-8");
3320
+ const newContent = content.slice(lastPos);
3321
+ filePositions.set(filePath, stats.size);
3322
+
3323
+ return newContent.split("\n").filter((line: string) => line.trim());
3324
+ } catch {
3325
+ return [];
3326
+ }
3327
+ };
3328
+
3329
+ // Print initial logs (last N lines)
3330
+ const rawLines = readLogFiles(logsDir);
3331
+ let logs: LogLine[] = rawLines
3332
+ .map(parseLogLine)
3333
+ .filter((log): log is LogLine => log !== null);
3334
+ logs = filterLogs(logs).slice(-limit);
3335
+
3336
+ for (const log of logs) {
3337
+ console.log(formatLogLine(log));
3338
+ }
3339
+
3340
+ // Initialize positions after printing initial logs
3341
+ initializePositions();
3342
+
3343
+ // Poll for new logs
3344
+ const pollForNewLogs = () => {
3345
+ if (!existsSync(logsDir)) return;
3346
+
3347
+ const files = readdirSync(logsDir).filter((f: string) => /\.\d+log$/.test(f));
3348
+
3349
+ for (const file of files) {
3350
+ const filePath = join(logsDir, file);
3351
+ const newLines = readNewLines(filePath);
3352
+
3353
+ for (const line of newLines) {
3354
+ const parsed = parseLogLine(line);
3355
+ if (parsed) {
3356
+ const filtered = filterLogs([parsed]);
3357
+ if (filtered.length > 0) {
3358
+ console.log(formatLogLine(filtered[0]));
3359
+ }
3360
+ }
3361
+ }
3362
+ }
3363
+ };
3364
+
3365
+ // Set up polling interval
3366
+ const intervalId = setInterval(pollForNewLogs, pollInterval);
3367
+
3368
+ // Handle graceful shutdown
3369
+ const cleanup = () => {
3370
+ clearInterval(intervalId);
3371
+ console.log(dim("\n Stopped watching."));
3372
+ process.exit(0);
3373
+ };
3374
+
3375
+ process.on("SIGINT", cleanup);
3376
+ process.on("SIGTERM", cleanup);
3377
+
3378
+ // Keep process alive
3379
+ await new Promise(() => {});
3380
+ return;
3381
+ }
3382
+
3383
+ // Non-watch mode - one-shot output
3384
+ const rawLines = readLogFiles(logsDir);
3385
+
3386
+ // Parse and filter
3387
+ let logs: LogLine[] = rawLines
3388
+ .map(parseLogLine)
3389
+ .filter((log): log is LogLine => log !== null);
3390
+
3391
+ logs = filterLogs(logs);
3392
+
3393
+ // Apply limit (keep most recent)
3394
+ logs = logs.slice(-limit);
3395
+
3396
+ // Output
3397
+ if (jsonOutput) {
3398
+ console.log(JSON.stringify({ logs }, null, 2));
3399
+ } else {
3400
+ if (logs.length === 0) {
3401
+ p.log.warn("No logs found matching filters");
3402
+ return;
3403
+ }
3404
+
3405
+ console.log(yellow(BANNER));
3406
+ console.log(dim(` Logs (${logs.length} entries)`));
3407
+ if (moduleFilter) console.log(dim(` Module: ${moduleFilter}`));
3408
+ if (levelFilter !== null) console.log(dim(` Level: >=${levelToName(levelFilter)}`));
3409
+ if (sinceMs !== null) console.log(dim(` Since: last ${args[args.indexOf("--since") + 1]}`));
3410
+ console.log();
3411
+
3412
+ for (const log of logs) {
3413
+ console.log(formatLogLine(log));
3414
+ }
3415
+ console.log();
3416
+ }
3417
+ }
3418
+
3076
3419
  // ============================================================================
3077
3420
  // Database Info Command
3078
3421
  // ============================================================================
@@ -3216,6 +3559,10 @@ switch (command) {
3216
3559
  case "db":
3217
3560
  await db();
3218
3561
  break;
3562
+ case "log":
3563
+ case "logs":
3564
+ await logs();
3565
+ break;
3219
3566
  case "version":
3220
3567
  case "--version":
3221
3568
  case "-v":
@@ -67,7 +67,7 @@ export declare const SWARM_DETECTION_FALLBACK = "## \uD83D\uDC1D Swarm Detection
67
67
  * });
68
68
  * ```
69
69
  */
70
- export declare function createCompactionHook(): (_input: {
70
+ export declare function createCompactionHook(): (input: {
71
71
  sessionID: string;
72
72
  }, output: {
73
73
  context: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-hook.d.ts","sourceRoot":"","sources":["../src/compaction-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AASH;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,k9DAwDpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,0nCAiCpC,CAAC;AAoIF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,KAEhC,QAAQ;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EAC7B,QAAQ;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,KAC5B,OAAO,CAAC,IAAI,CAAC,CAcjB"}
1
+ {"version":3,"file":"compaction-hook.d.ts","sourceRoot":"","sources":["../src/compaction-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AA+BH;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,k9DAwDpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,0nCAiCpC,CAAC;AAuMF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,KAEhC,OAAO;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EAC5B,QAAQ;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,KAC5B,OAAO,CAAC,IAAI,CAAC,CAmFjB"}
package/dist/index.d.ts CHANGED
@@ -601,6 +601,24 @@ export declare const allTools: {
601
601
  project_path: string;
602
602
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
603
603
  };
604
+ readonly swarm_discover_tools: {
605
+ description: string;
606
+ args: {};
607
+ execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
608
+ };
609
+ readonly swarm_get_versions: {
610
+ description: string;
611
+ args: {
612
+ projectPath: import("zod").ZodString;
613
+ packages: import("zod").ZodArray<import("zod").ZodString>;
614
+ checkUpgrades: import("zod").ZodOptional<import("zod").ZodBoolean>;
615
+ };
616
+ execute(args: {
617
+ projectPath: string;
618
+ packages: string[];
619
+ checkUpgrades?: boolean | undefined;
620
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
621
+ };
604
622
  readonly swarm_init: {
605
623
  description: string;
606
624
  args: {
@@ -747,6 +765,19 @@ export declare const allTools: {
747
765
  failure_details?: string | undefined;
748
766
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
749
767
  };
768
+ readonly swarm_research_phase: {
769
+ description: string;
770
+ args: {
771
+ task: import("zod").ZodString;
772
+ project_path: import("zod").ZodString;
773
+ check_upgrades: import("zod").ZodOptional<import("zod").ZodBoolean>;
774
+ };
775
+ execute(args: {
776
+ task: string;
777
+ project_path: string;
778
+ check_upgrades?: boolean | undefined;
779
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
780
+ };
750
781
  readonly swarm_accumulate_error: {
751
782
  description: string;
752
783
  args: {
@@ -959,6 +990,29 @@ export declare const allTools: {
959
990
  check_upgrades?: boolean | undefined;
960
991
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
961
992
  };
993
+ readonly swarm_spawn_retry: {
994
+ description: string;
995
+ args: {
996
+ bead_id: import("zod").ZodString;
997
+ epic_id: import("zod").ZodString;
998
+ original_prompt: import("zod").ZodString;
999
+ attempt: import("zod").ZodNumber;
1000
+ issues: import("zod").ZodString;
1001
+ diff: import("zod").ZodOptional<import("zod").ZodString>;
1002
+ files: import("zod").ZodArray<import("zod").ZodString>;
1003
+ project_path: import("zod").ZodOptional<import("zod").ZodString>;
1004
+ };
1005
+ execute(args: {
1006
+ bead_id: string;
1007
+ epic_id: string;
1008
+ original_prompt: string;
1009
+ attempt: number;
1010
+ issues: string;
1011
+ files: string[];
1012
+ diff?: string | undefined;
1013
+ project_path?: string | undefined;
1014
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
1015
+ };
962
1016
  readonly swarm_evaluation_prompt: {
963
1017
  description: string;
964
1018
  args: {
@@ -1554,4 +1608,45 @@ export { SWARM_COMPACTION_CONTEXT, createCompactionHook } from "./compaction-hoo
1554
1608
  */
1555
1609
  export { memoryTools, createMemoryAdapter, resetMemoryCache, type MemoryAdapter, type StoreArgs, type FindArgs, type IdArgs, type ListArgs, type StoreResult, type FindResult, type StatsResult, type HealthResult, type OperationResult, } from "./memory-tools";
1556
1610
  export type { Memory, SearchResult, SearchOptions } from "swarm-mail";
1611
+ /**
1612
+ * Re-export logger infrastructure
1613
+ *
1614
+ * Includes:
1615
+ * - getLogger - Gets or creates the main logger instance
1616
+ * - createChildLogger - Creates a module-specific child logger with separate log file
1617
+ * - logger - Default logger instance for immediate use
1618
+ *
1619
+ * Features:
1620
+ * - Daily log rotation via pino-roll (numeric format: swarm.1log, swarm.2log, etc.)
1621
+ * - 14-day retention
1622
+ * - Module-specific child loggers
1623
+ * - Pretty mode for development (SWARM_LOG_PRETTY=1)
1624
+ * - Logs to ~/.config/swarm-tools/logs/
1625
+ *
1626
+ * @example
1627
+ * ```typescript
1628
+ * import { logger, createChildLogger } from "opencode-swarm-plugin";
1629
+ *
1630
+ * // Use default logger
1631
+ * logger.info("Application started");
1632
+ *
1633
+ * // Create module-specific logger
1634
+ * const compactionLog = createChildLogger("compaction");
1635
+ * compactionLog.info("Compaction started");
1636
+ * ```
1637
+ */
1638
+ export { getLogger, createChildLogger, logger } from "./logger";
1639
+ /**
1640
+ * Re-export swarm-research module
1641
+ *
1642
+ * Includes:
1643
+ * - discoverDocTools - Discover available documentation tools
1644
+ * - getInstalledVersions - Get installed package versions from lockfile
1645
+ * - researchTools - Plugin tools for tool discovery and version detection
1646
+ *
1647
+ * Types:
1648
+ * - DiscoveredTool - Tool discovery result interface
1649
+ * - VersionInfo - Package version information
1650
+ */
1651
+ export { discoverDocTools, getInstalledVersions, researchTools, type DiscoveredTool, type VersionInfo, } from "./swarm-research";
1557
1652
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAsCtE;;;;;;;;;;;;;;;;;GAi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