opencode-swarm 7.66.3 → 7.68.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.
@@ -823,6 +823,25 @@ export declare const CouncilConfigSchema: z.ZodObject<{
823
823
  }, z.core.$strict>>;
824
824
  }, z.core.$strict>;
825
825
  export type CouncilConfig = z.infer<typeof CouncilConfigSchema>;
826
+ export declare const PrMonitorConfigSchema: z.ZodObject<{
827
+ enabled: z.ZodDefault<z.ZodBoolean>;
828
+ poll_interval_seconds: z.ZodDefault<z.ZodNumber>;
829
+ max_subscriptions: z.ZodDefault<z.ZodNumber>;
830
+ max_prs_per_cycle: z.ZodDefault<z.ZodNumber>;
831
+ max_concurrent_pr_polls: z.ZodDefault<z.ZodNumber>;
832
+ poll_timeout_ms: z.ZodDefault<z.ZodNumber>;
833
+ failure_threshold: z.ZodDefault<z.ZodNumber>;
834
+ cooldown_seconds: z.ZodDefault<z.ZodNumber>;
835
+ max_cooldown_seconds: z.ZodDefault<z.ZodNumber>;
836
+ cleanup_ttl_days: z.ZodDefault<z.ZodNumber>;
837
+ auto_unsubscribe_on_merge: z.ZodDefault<z.ZodBoolean>;
838
+ auto_unsubscribe_on_close: z.ZodDefault<z.ZodBoolean>;
839
+ notify_ci_failure: z.ZodDefault<z.ZodBoolean>;
840
+ notify_new_comments: z.ZodDefault<z.ZodBoolean>;
841
+ notify_merge_conflict: z.ZodDefault<z.ZodBoolean>;
842
+ auto_pr_feedback: z.ZodDefault<z.ZodBoolean>;
843
+ }, z.core.$strict>;
844
+ export type PrMonitorConfig = z.infer<typeof PrMonitorConfigSchema>;
826
845
  export declare const ParallelizationConfigSchema: z.ZodObject<{
827
846
  enabled: z.ZodDefault<z.ZodBoolean>;
828
847
  maxConcurrentTasks: z.ZodDefault<z.ZodNumber>;
@@ -1782,6 +1801,24 @@ export declare const PluginConfigSchema: z.ZodObject<{
1782
1801
  every_minutes: z.ZodDefault<z.ZodNumber>;
1783
1802
  }, z.core.$strip>>;
1784
1803
  }, z.core.$strip>>>;
1804
+ pr_monitor: z.ZodOptional<z.ZodObject<{
1805
+ enabled: z.ZodDefault<z.ZodBoolean>;
1806
+ poll_interval_seconds: z.ZodDefault<z.ZodNumber>;
1807
+ max_subscriptions: z.ZodDefault<z.ZodNumber>;
1808
+ max_prs_per_cycle: z.ZodDefault<z.ZodNumber>;
1809
+ max_concurrent_pr_polls: z.ZodDefault<z.ZodNumber>;
1810
+ poll_timeout_ms: z.ZodDefault<z.ZodNumber>;
1811
+ failure_threshold: z.ZodDefault<z.ZodNumber>;
1812
+ cooldown_seconds: z.ZodDefault<z.ZodNumber>;
1813
+ max_cooldown_seconds: z.ZodDefault<z.ZodNumber>;
1814
+ cleanup_ttl_days: z.ZodDefault<z.ZodNumber>;
1815
+ auto_unsubscribe_on_merge: z.ZodDefault<z.ZodBoolean>;
1816
+ auto_unsubscribe_on_close: z.ZodDefault<z.ZodBoolean>;
1817
+ notify_ci_failure: z.ZodDefault<z.ZodBoolean>;
1818
+ notify_new_comments: z.ZodDefault<z.ZodBoolean>;
1819
+ notify_merge_conflict: z.ZodDefault<z.ZodBoolean>;
1820
+ auto_pr_feedback: z.ZodDefault<z.ZodBoolean>;
1821
+ }, z.core.$strict>>;
1785
1822
  external_skills: z.ZodOptional<z.ZodObject<{
1786
1823
  curation_enabled: z.ZodDefault<z.ZodBoolean>;
1787
1824
  max_candidates: z.ZodDefault<z.ZodNumber>;
package/dist/git/pr.d.ts CHANGED
@@ -1,8 +1,29 @@
1
+ export declare const GIT_TIMEOUT_MS = 30000;
1
2
  /**
2
3
  * Sanitize input string to prevent command injection
3
4
  * Removes or escapes shell metacharacters
4
5
  */
5
6
  export declare function sanitizeInput(input: string): string;
7
+ /**
8
+ * Execute gh CLI command
9
+ */
10
+ export declare function ghExec(args: string[], cwd: string): string;
11
+ /**
12
+ * Execute gh CLI command asynchronously (non-blocking).
13
+ * Used by background workers that must not block the event loop.
14
+ * Follows AGENTS.md Invariant 3: array-form spawn, explicit cwd,
15
+ * stdin: 'ignore', timeout, bounded stdout/stderr, proc.kill() in finally.
16
+ */
17
+ export declare function ghExecAsync(args: string[], cwd: string): Promise<string>;
18
+ /**
19
+ * Test-only dependency-injection seam — see `gitignore-warning.ts:_internals`.
20
+ * Production code calls `_internals.ghExec(...)` so tests can replace the
21
+ * function on this object without touching the real `child_process.spawnSync`.
22
+ */
23
+ export declare const _internals: {
24
+ ghExec: typeof ghExec;
25
+ ghExecAsync: typeof ghExecAsync;
26
+ };
6
27
  /**
7
28
  * Check if gh CLI is available
8
29
  */
@@ -26,3 +47,62 @@ export declare function createPullRequest(cwd: string, title: string, body?: str
26
47
  * Commit and push current changes
27
48
  */
28
49
  export declare function commitAndPush(cwd: string, message: string): void;
50
+ export interface PRStatusResult {
51
+ number: number;
52
+ state: 'OPEN' | 'CLOSED' | 'MERGED';
53
+ mergeable: 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN';
54
+ mergeStateStatus: string;
55
+ headRefOid: string;
56
+ statusCheckRollup: Array<{
57
+ name: string;
58
+ status: string;
59
+ conclusion: string | null;
60
+ }>;
61
+ }
62
+ export interface PRCheckResult {
63
+ name: string;
64
+ bucket: string;
65
+ state: string;
66
+ startedAt: string | null;
67
+ completedAt: string | null;
68
+ }
69
+ export interface PRCommentResult {
70
+ id: string;
71
+ author: string;
72
+ body: string;
73
+ createdAt: string;
74
+ isReviewComment: boolean;
75
+ }
76
+ export interface MergeStateResult {
77
+ mergeable: 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN';
78
+ mergeStateStatus: string;
79
+ headRefOid: string;
80
+ }
81
+ export interface ReviewStateResult {
82
+ /** Current review decision: APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED, or empty string. */
83
+ reviewDecision: string;
84
+ /** Number of requesting reviewers (non-zero means reviews are still pending). */
85
+ reviewRequestCount: number;
86
+ }
87
+ /**
88
+ * Fetch PR status via gh pr view --json
89
+ */
90
+ export declare function getPRStatus(prNumber: number, repoFullName: string, cwd: string): Promise<PRStatusResult>;
91
+ /**
92
+ * Fetch CI check results via gh pr checks --json
93
+ */
94
+ export declare function getPRChecks(prNumber: number, repoFullName: string, cwd: string): Promise<PRCheckResult[]>;
95
+ /**
96
+ * Fetch PR comments since a given timestamp via gh api
97
+ * Returns both issue comments and pull request review comments, merged together
98
+ */
99
+ export declare function getPRComments(prNumber: number, repoFullName: string, cwd: string, since?: string): Promise<PRCommentResult[]>;
100
+ /**
101
+ * Fetch merge state (mergeable + mergeStateStatus) via gh pr view --json
102
+ */
103
+ export declare function getMergeState(prNumber: number, repoFullName: string, cwd: string): Promise<MergeStateResult>;
104
+ /**
105
+ * Fetch the current review state for a PR using `gh pr view --json reviewDecision,reviewRequests`.
106
+ * Uses async ghExecAsync to avoid blocking the event loop.
107
+ */
108
+ export declare function getPRReviewState(prNumber: number, repoFullName: string, cwd: string): Promise<ReviewStateResult>;
@@ -25,6 +25,7 @@
25
25
  * curators but omit hook-dispatched ones. This is by design for hook-internal operations.
26
26
  */
27
27
  import { listSkills, parseDraftFrontmatter, retireSkill } from '../services/skill-generator.js';
28
+ import { getSkillVersion, reviseSkill } from '../services/skill-reviser.js';
28
29
  import type { ComplianceObservation, CuratorConfig, CuratorInitResult, CuratorPhaseResult, CuratorSummary, KnowledgeRecommendation } from './curator-types.js';
29
30
  import { readKnowledge } from './knowledge-store.js';
30
31
  import type { KnowledgeConfig } from './knowledge-types.js';
@@ -49,6 +50,8 @@ export declare const _internals: {
49
50
  retireSkill: typeof retireSkill;
50
51
  readFileAsync: (filePath: string, encoding: string) => Promise<string>;
51
52
  readKnowledge: typeof readKnowledge;
53
+ reviseSkill: typeof reviseSkill;
54
+ getSkillVersion: typeof getSkillVersion;
52
55
  };
53
56
  /**
54
57
  * Auto-retire generated skills whose violation rate exceeds 30% or
@@ -57,7 +60,7 @@ export declare const _internals: {
57
60
  * Non-blocking: errors are caught and logged but never propagated.
58
61
  * Returns an array of observation strings to include in the phase digest.
59
62
  */
60
- declare function autoRetireSkills(directory: string, curatorKnowledgePath: string): Promise<string[]>;
63
+ declare function autoRetireSkills(directory: string, curatorKnowledgePath: string, excludeSlugs?: ReadonlySet<string>): Promise<string[]>;
61
64
  /**
62
65
  * Parse OBSERVATIONS section from curator LLM output.
63
66
  * Expected format per line: "- entry <uuid> (<observable>): [text]"
@@ -23,6 +23,8 @@ export interface SkillUsageEntry {
23
23
  reviewerNotes?: string;
24
24
  /** Session identifier. */
25
25
  sessionID: string;
26
+ /** Skill version at the time of this usage event (omitted for pre-versioning entries). */
27
+ skillVersion?: number;
26
28
  }
27
29
  /** Filter options for reading skill-usage entries. */
28
30
  export interface SkillUsageFilterOptions {
@@ -70,6 +72,7 @@ export declare const _internals: {
70
72
  resolveSourceKnowledgeIds: typeof resolveSourceKnowledgeIds;
71
73
  applySkillUsageFeedback: typeof applySkillUsageFeedback;
72
74
  parseGeneratedFromKnowledge: typeof parseGeneratedFromKnowledge;
75
+ computeComplianceByVersion: typeof computeComplianceByVersion;
73
76
  };
74
77
  /**
75
78
  * Validate and append a single skill-usage entry to the JSONL log.
@@ -102,6 +105,13 @@ export declare const MAX_TAIL_BYTES: number;
102
105
  export declare function readSkillUsageEntriesTail(directory: string, filters: {
103
106
  sessionID?: string;
104
107
  }, maxBytes?: number): SkillUsageEntry[];
108
+ export interface VersionComplianceStats {
109
+ compliant: number;
110
+ violation: number;
111
+ total: number;
112
+ rate: number;
113
+ }
114
+ export declare function computeComplianceByVersion(entries: SkillUsageEntry[], skillPath: string): Map<number | undefined, VersionComplianceStats>;
105
115
  /**
106
116
  * Prune the skill-usage log, keeping at most `maxEntriesPerSkill` entries
107
117
  * per unique skillPath. Oldest entries beyond the limit are removed.