opencode-swarm 7.28.0 → 7.28.2

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/dist/cli/index.js CHANGED
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.28.0",
37
+ version: "7.28.2",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
@@ -5,6 +5,7 @@
5
5
  * Uses experimental.chat.messages.transform to provide non-blocking guidance.
6
6
  */
7
7
  import type { PluginConfig } from '../config';
8
+ import type { AgentSessionState } from '../state';
8
9
  import type { DelegationEnvelope, EnvelopeValidationResult } from '../types/delegation.js';
9
10
  /**
10
11
  * v6.33.1 CRIT-1: Fallback map for declared coder scope by taskId.
@@ -53,6 +54,26 @@ interface MessageWithParts {
53
54
  info: MessageInfo;
54
55
  parts: MessagePart[];
55
56
  }
57
+ declare function resolveDelegatedPlanTaskId(args: Record<string, unknown>, knownPlanTaskIds?: ReadonlySet<string>): string | null;
58
+ /**
59
+ * Resolves the correct task ID for evidence recording by chaining:
60
+ * 1. Explicit task_id in direct args (structured field)
61
+ * 2. Prompt-text extraction via resolveDelegatedPlanTaskId (plan-aware)
62
+ * 3. Session-state fallback via getEvidenceTaskId
63
+ *
64
+ * This fixes parallel evidence recording where multiple reviewer/test_engineer
65
+ * agents are dispatched for different tasks from the same architect session.
66
+ * Issue #970.
67
+ */
68
+ declare function resolveEvidenceTaskId(args: Record<string, unknown> | undefined, session: AgentSessionState, directory: string): Promise<string | null>;
69
+ /**
70
+ * _internals export for testing — do not use in production code.
71
+ * Exposes resolveEvidenceTaskId and resolveDelegatedPlanTaskId for unit testing.
72
+ */
73
+ export declare const _internals: {
74
+ resolveEvidenceTaskId: typeof resolveEvidenceTaskId;
75
+ resolveDelegatedPlanTaskId: typeof resolveDelegatedPlanTaskId;
76
+ };
56
77
  /**
57
78
  * Creates the experimental.chat.messages.transform hook for delegation gating.
58
79
  * Inspects coder delegations and warns when tasks are oversized or batched.
@@ -58,6 +58,7 @@ export declare const _internals: {
58
58
  appendSkillUsageEntry: typeof appendSkillUsageEntry;
59
59
  readSkillUsageEntries: typeof readSkillUsageEntries;
60
60
  readSkillUsageEntriesTail: typeof readSkillUsageEntriesTail;
61
+ extractSkillsFieldFromPrompt: typeof extractSkillsFieldFromPrompt;
61
62
  parseSkillPaths: typeof parseSkillPaths;
62
63
  extractTaskIdFromPrompt: typeof extractTaskIdFromPrompt;
63
64
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
@@ -82,6 +83,15 @@ export declare function parseDelegationArgs(args: unknown): {
82
83
  targetAgent: string;
83
84
  skillsField: string;
84
85
  } | null;
86
+ /**
87
+ * Extracts the value of a SKILLS field from a delegation prompt. Supports both
88
+ * legacy one-line fields (`SKILLS: file:...`) and description-rich blocks:
89
+ *
90
+ * SKILLS:
91
+ * - file:.claude/skills/writing-tests/SKILL.md - test conventions
92
+ * - file:.claude/skills/react/SKILL.md - React UI patterns
93
+ */
94
+ export declare function extractSkillsFieldFromPrompt(prompt: string): string;
85
95
  /** Write a warning event to .swarm/events.jsonl (sync, best-effort). */
86
96
  export declare function writeWarnEvent(directory: string, record: Record<string, unknown>): void;
87
97
  /**
@@ -33,11 +33,22 @@ export interface SkillStats {
33
33
  count: number;
34
34
  }>;
35
35
  }
36
+ /** Metadata extracted from a SKILL.md frontmatter block. */
37
+ export interface SkillMetadata {
38
+ /** Repo-relative path to the skill file. */
39
+ path: string;
40
+ /** Human-readable skill name. */
41
+ name: string;
42
+ /** Short description from frontmatter, or a fallback when absent. */
43
+ description: string;
44
+ }
36
45
  export declare const _internals: {
37
46
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
38
47
  rankSkillsForContext: typeof rankSkillsForContext;
39
48
  getSkillStats: typeof getSkillStats;
40
49
  formatSkillIndexWithContext: typeof formatSkillIndexWithContext;
50
+ parseSkillFrontmatter: typeof parseSkillFrontmatter;
51
+ readSkillMetadata: typeof readSkillMetadata;
41
52
  extractSkillName: typeof extractSkillName;
42
53
  computeRecencyScore: typeof computeRecencyScore;
43
54
  computeContextMatchScore: typeof computeContextMatchScore;
@@ -47,6 +58,18 @@ export declare const _internals: {
47
58
  * E.g. `.claude/skills/writing-tests/SKILL.md` → `writing-tests`
48
59
  */
49
60
  declare function extractSkillName(skillPath: string): string;
61
+ /**
62
+ * Parse the YAML-like frontmatter from a SKILL.md file. This intentionally
63
+ * supports only the small subset skills use today: scalar `name` and scalar,
64
+ * folded (`>`), or literal (`|`) `description`.
65
+ */
66
+ export declare function parseSkillFrontmatter(content: string, skillPath: string): SkillMetadata;
67
+ /**
68
+ * Extract skill metadata from a repo-relative SKILL.md path. Fails open to
69
+ * path-derived metadata when the file is missing, outside the project, or has
70
+ * malformed frontmatter.
71
+ */
72
+ export declare function readSkillMetadata(skillPath: string, directory: string): SkillMetadata;
50
73
  /**
51
74
  * Computes a recency score in [0, 1] based on how recently the skill was used.
52
75
  * Full score (1.0) for usage within 24 hours, linearly decaying to 0 over 30 days.