opencode-swarm 7.104.0 → 7.105.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.
@@ -57,7 +57,7 @@ import {
57
57
  readDoctorArtifact,
58
58
  removeStraySwarmDir,
59
59
  runConfigDoctor
60
- } from "./index-5tywmqeh.js";
60
+ } from "./index-hxnnp4qj.js";
61
61
  import {
62
62
  AGENT_TOOL_MAP,
63
63
  ALL_SUBAGENT_NAMES,
@@ -70,7 +70,7 @@ import {
70
70
  TOOL_NAME_SET,
71
71
  resolveExternalSkillsConfig,
72
72
  stripKnownSwarmPrefix
73
- } from "./index-t1vfvtg9.js";
73
+ } from "./index-5qzchq7p.js";
74
74
  import {
75
75
  MAX_TRANSIENT_RETRIES,
76
76
  PlanSchema,
@@ -912,7 +912,7 @@ var init_executor = __esm(() => {
912
912
  // package.json
913
913
  var package_default = {
914
914
  name: "opencode-swarm",
915
- version: "7.104.0",
915
+ version: "7.105.0",
916
916
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
917
917
  main: "dist/index.js",
918
918
  types: "dist/index.d.ts",
@@ -967,6 +967,7 @@ var package_default = {
967
967
  ".opencode/skills/design-docs",
968
968
  ".opencode/skills/swarm-pr-review",
969
969
  ".opencode/skills/swarm-pr-feedback",
970
+ ".opencode/skills/swarm-pr-subscribe",
970
971
  ".opencode/skills/issue-ingest",
971
972
  ".opencode/skills/plan",
972
973
  ".opencode/skills/critic-gate",
@@ -1410,6 +1411,7 @@ var BUNDLED_PROJECT_SKILLS = [
1410
1411
  "design-docs",
1411
1412
  "swarm-pr-review",
1412
1413
  "swarm-pr-feedback",
1414
+ "swarm-pr-subscribe",
1413
1415
  "issue-ingest",
1414
1416
  "plan",
1415
1417
  "critic-gate",
@@ -13377,7 +13379,7 @@ async function runFinalizeStage(ctx) {
13377
13379
  }
13378
13380
  }
13379
13381
  try {
13380
- const { CuratorConfigSchema: CCS } = await import("./schema-yxkdx5g5.js");
13382
+ const { CuratorConfigSchema: CCS } = await import("./schema-3a02876y.js");
13381
13383
  const { config: pmLoadedConfig } = _internals20.loadPluginConfigWithMeta(ctx.directory);
13382
13384
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
13383
13385
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -17203,7 +17205,7 @@ async function handleDoctorCommand(directory, args) {
17203
17205
  const result = runConfigDoctor(config, directory);
17204
17206
  let output;
17205
17207
  if (enableAutoFix && result.hasAutoFixableIssues) {
17206
- const { runConfigDoctorWithFixes } = await import("./config-doctor-5m8z8jeg.js");
17208
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-4dhkq5qe.js");
17207
17209
  const fixResult = await runConfigDoctorWithFixes(directory, config, true);
17208
17210
  output = formatDoctorMarkdown(fixResult.result);
17209
17211
  } else {
@@ -26067,7 +26069,7 @@ async function handlePrSubscribeCommand(directory, args, sessionID) {
26067
26069
  return [
26068
26070
  "Usage: /swarm pr subscribe <pr-url|owner/repo#N|N>",
26069
26071
  "",
26070
- "Subscribes the current session to receive advisory notifications",
26072
+ "Subscribes the current session to PR state-change events",
26071
26073
  "for the specified PR. Requires pr_monitor.enabled: true in config.",
26072
26074
  "",
26073
26075
  " /swarm pr subscribe https://github.com/owner/repo/pull/42",
@@ -26126,15 +26128,19 @@ async function handlePrSubscribeCommand(directory, args, sessionID) {
26126
26128
  prUrl,
26127
26129
  maxSubscriptions: prMonitorConfig?.max_subscriptions
26128
26130
  });
26131
+ const deliveryMode = prMonitorConfig?.event_delivery === "advisory" ? "advisory" : "prompt";
26132
+ const deliveryLine = deliveryMode === "prompt" ? "Delivery mode: prompt \u2014 events wake this session with a <pr-activity> message." : "Delivery mode: advisory \u2014 events queue as session advisories for the next turn.";
26129
26133
  return [
26130
26134
  `Subscribed to ${prUrl}`,
26131
26135
  `Session: ${sessionID}`,
26132
26136
  `PR: ${repoFullName}#${prInfo.number}`,
26133
26137
  "",
26134
- "The background PR monitor will now check this PR for",
26135
- "CI failures, new comments, review state changes, and",
26136
- "merge/close events. Notifications appear as session-scoped",
26137
- "advisories with dedup tokens."
26138
+ "The background PR monitor will now watch this PR and deliver",
26139
+ "the events enabled by your pr_monitor config: CI failures, new",
26140
+ "comments, review activity (changes requested / approved), merge",
26141
+ "conflicts and resolutions, merge/close, and (off by default)",
26142
+ "CI success. Each event type is gated by its notify_* flag.",
26143
+ deliveryLine
26138
26144
  ].join(`
26139
26145
  `);
26140
26146
  } catch (err) {
@@ -33965,7 +33971,7 @@ function buildDetailedHelp(commandName, entry) {
33965
33971
  async function handleHelpCommand(ctx) {
33966
33972
  const targetCommand = ctx.args.join(" ");
33967
33973
  if (!targetCommand) {
33968
- const { buildHelpText } = await import("./index-e7nhwa9k.js");
33974
+ const { buildHelpText } = await import("./index-8mj10cds.js");
33969
33975
  return buildHelpText();
33970
33976
  }
33971
33977
  const tokens = targetCommand.split(/\s+/);
@@ -33974,7 +33980,7 @@ async function handleHelpCommand(ctx) {
33974
33980
  return _internals47.buildDetailedHelp(resolved.key, resolved.entry);
33975
33981
  }
33976
33982
  const similar = _internals47.findSimilarCommands(targetCommand);
33977
- const { buildHelpText: fullHelp } = await import("./index-e7nhwa9k.js");
33983
+ const { buildHelpText: fullHelp } = await import("./index-8mj10cds.js");
33978
33984
  if (similar.length > 0) {
33979
33985
  return `Command '/swarm ${targetCommand}' not found.
33980
33986
 
@@ -34107,7 +34113,7 @@ var COMMAND_REGISTRY = {
34107
34113
  },
34108
34114
  "guardrail explain": {
34109
34115
  handler: async (ctx) => {
34110
- const { handleGuardrailExplain } = await import("./guardrail-explain-2zat1bxh.js");
34116
+ const { handleGuardrailExplain } = await import("./guardrail-explain-9br76zh5.js");
34111
34117
  return handleGuardrailExplain(ctx.directory, ctx.args);
34112
34118
  },
34113
34119
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -34117,7 +34123,7 @@ var COMMAND_REGISTRY = {
34117
34123
  },
34118
34124
  "guardrail-log": {
34119
34125
  handler: async (ctx) => {
34120
- const { handleGuardrailLog } = await import("./guardrail-log-zhshjbpk.js");
34126
+ const { handleGuardrailLog } = await import("./guardrail-log-peftzya3.js");
34121
34127
  return handleGuardrailLog(ctx.directory, ctx.args);
34122
34128
  },
34123
34129
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -34462,9 +34468,9 @@ Subcommands:
34462
34468
  handler: (ctx) => handlePrSubscribeCommand(ctx.directory, ctx.args, ctx.sessionID),
34463
34469
  description: "Subscribe the current session to PR state-change notifications",
34464
34470
  args: "<pr-url|owner/repo#N|N>",
34465
- details: "Subscribes the current session to receive advisory notifications for the specified PR. When pr_monitor.enabled is true, the background polling worker will detect CI failures, new comments, merge conflicts, review state changes, and merge/close events. Notifications are delivered as session-scoped advisories with dedup tokens. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin). Requires pr_monitor.enabled: true in config.",
34471
+ details: 'Subscribes the current session to PR state-change events for the specified PR. When pr_monitor.enabled is true, the background polling worker detects CI failures, new comments, review state changes (changes requested / approved), merge conflicts and conflict resolutions, and merge/close events \u2014 each gated by its pr_monitor notify_* config flag (notify_ci_success defaults to false). Delivery follows pr_monitor.event_delivery: "prompt" (default) wakes the subscribed session with a structured <pr-activity> message; "advisory" queues session-scoped advisories with dedup tokens for the next turn. Subscriptions are idempotent, capped by pr_monitor.max_subscriptions, and agent-callable. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin). Requires pr_monitor.enabled: true in config.',
34466
34472
  category: "agent",
34467
- toolPolicy: "human-only"
34473
+ toolPolicy: "agent"
34468
34474
  },
34469
34475
  "pr-subscribe": {
34470
34476
  handler: (ctx) => handlePrSubscribeCommand(ctx.directory, ctx.args, ctx.sessionID),
@@ -34476,9 +34482,9 @@ Subcommands:
34476
34482
  handler: (ctx) => handlePrUnsubscribeCommand(ctx.directory, ctx.args, ctx.sessionID),
34477
34483
  description: "Unsubscribe the current session from PR state-change notifications",
34478
34484
  args: "<pr-url|owner/repo#N|N>",
34479
- details: "Unsubscribes the current session from receiving advisory notifications for the specified PR. Removes the active subscription record. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin).",
34485
+ details: "Unsubscribes the current session from PR state-change events for the specified PR. Removes the active subscription record (idempotent; agent-callable). Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin).",
34480
34486
  category: "agent",
34481
- toolPolicy: "human-only"
34487
+ toolPolicy: "agent"
34482
34488
  },
34483
34489
  "pr-unsubscribe": {
34484
34490
  handler: (ctx) => handlePrUnsubscribeCommand(ctx.directory, ctx.args, ctx.sessionID),
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-n3ys2eny.js";
15
+ } from "./index-qnapygnz.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-kcbcy6wq.js";
22
+ } from "./index-50qqqbrb.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
package/dist/cli/index.js CHANGED
@@ -7,15 +7,15 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-n3ys2eny.js";
11
- import"./index-kcbcy6wq.js";
10
+ } from "./index-qnapygnz.js";
11
+ import"./index-50qqqbrb.js";
12
12
  import"./index-ydgy7vg5.js";
13
13
  import"./index-vwyjkzgs.js";
14
14
  import"./index-f7nma02k.js";
15
- import"./index-5tywmqeh.js";
15
+ import"./index-hxnnp4qj.js";
16
16
  import {
17
17
  DEFAULT_AGENT_CONFIGS
18
- } from "./index-t1vfvtg9.js";
18
+ } from "./index-5qzchq7p.js";
19
19
  import"./index-k2rmw9sz.js";
20
20
  import"./index-8w4d325g.js";
21
21
  import"./index-v4fcn4tr.js";
@@ -85,7 +85,7 @@ import {
85
85
  resolveGeneratedAgentRole,
86
86
  resolveGuardrailsConfig,
87
87
  stripKnownSwarmPrefix
88
- } from "./index-t1vfvtg9.js";
88
+ } from "./index-5qzchq7p.js";
89
89
  import"./index-p0arc26j.js";
90
90
  import"./index-293f68mj.js";
91
91
  import"./index-a76rekgs.js";
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * Subscribes the current session to PR state-change notifications. When
5
5
  * `pr_monitor.enabled` is true, the background polling worker will detect CI
6
- * failures, new comments, merge conflicts, review state changes, and
7
- * merge/close events. Notifications are delivered as session-scoped advisories
8
- * with dedup tokens.
6
+ * failures, new comments, merge conflicts (and resolutions), review state
7
+ * changes, and merge/close events each gated by its `notify_*` config flag.
8
+ * Events are delivered per `pr_monitor.event_delivery`: 'prompt' (default)
9
+ * wakes the subscribed session with a structured <pr-activity> message;
10
+ * 'advisory' queues session-scoped advisories with dedup tokens.
9
11
  *
10
12
  * Input contract (PR reference is required):
11
13
  * /swarm pr subscribe 155 → subscribe via bare number
@@ -502,9 +502,9 @@ export declare const COMMAND_REGISTRY: {
502
502
  readonly handler: (ctx: CommandContext) => Promise<string>;
503
503
  readonly description: "Subscribe the current session to PR state-change notifications";
504
504
  readonly args: "<pr-url|owner/repo#N|N>";
505
- readonly details: "Subscribes the current session to receive advisory notifications for the specified PR. When pr_monitor.enabled is true, the background polling worker will detect CI failures, new comments, merge conflicts, review state changes, and merge/close events. Notifications are delivered as session-scoped advisories with dedup tokens. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin). Requires pr_monitor.enabled: true in config.";
505
+ readonly details: "Subscribes the current session to PR state-change events for the specified PR. When pr_monitor.enabled is true, the background polling worker detects CI failures, new comments, review state changes (changes requested / approved), merge conflicts and conflict resolutions, and merge/close events — each gated by its pr_monitor notify_* config flag (notify_ci_success defaults to false). Delivery follows pr_monitor.event_delivery: \"prompt\" (default) wakes the subscribed session with a structured <pr-activity> message; \"advisory\" queues session-scoped advisories with dedup tokens for the next turn. Subscriptions are idempotent, capped by pr_monitor.max_subscriptions, and agent-callable. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin). Requires pr_monitor.enabled: true in config.";
506
506
  readonly category: "agent";
507
- readonly toolPolicy: "human-only";
507
+ readonly toolPolicy: "agent";
508
508
  };
509
509
  readonly 'pr-subscribe': {
510
510
  readonly handler: (ctx: CommandContext) => Promise<string>;
@@ -516,9 +516,9 @@ export declare const COMMAND_REGISTRY: {
516
516
  readonly handler: (ctx: CommandContext) => Promise<string>;
517
517
  readonly description: "Unsubscribe the current session from PR state-change notifications";
518
518
  readonly args: "<pr-url|owner/repo#N|N>";
519
- readonly details: "Unsubscribes the current session from receiving advisory notifications for the specified PR. Removes the active subscription record. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin).";
519
+ readonly details: "Unsubscribes the current session from PR state-change events for the specified PR. Removes the active subscription record (idempotent; agent-callable). Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin).";
520
520
  readonly category: "agent";
521
- readonly toolPolicy: "human-only";
521
+ readonly toolPolicy: "agent";
522
522
  };
523
523
  readonly 'pr-unsubscribe': {
524
524
  readonly handler: (ctx: CommandContext) => Promise<string>;
@@ -1,4 +1,4 @@
1
- export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "design-docs", "swarm-pr-review", "swarm-pr-feedback", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr"];
1
+ export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "design-docs", "swarm-pr-review", "swarm-pr-feedback", "swarm-pr-subscribe", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr"];
2
2
  interface CopyState {
3
3
  files: number;
4
4
  bytes: number;
@@ -1001,7 +1001,16 @@ export declare const PrMonitorConfigSchema: z.ZodObject<{
1001
1001
  notify_ci_failure: z.ZodDefault<z.ZodBoolean>;
1002
1002
  notify_new_comments: z.ZodDefault<z.ZodBoolean>;
1003
1003
  notify_merge_conflict: z.ZodDefault<z.ZodBoolean>;
1004
+ notify_review_activity: z.ZodDefault<z.ZodBoolean>;
1005
+ notify_merged: z.ZodDefault<z.ZodBoolean>;
1006
+ notify_closed: z.ZodDefault<z.ZodBoolean>;
1007
+ notify_ci_success: z.ZodDefault<z.ZodBoolean>;
1004
1008
  auto_pr_feedback: z.ZodDefault<z.ZodBoolean>;
1009
+ event_delivery: z.ZodDefault<z.ZodEnum<{
1010
+ advisory: "advisory";
1011
+ prompt: "prompt";
1012
+ }>>;
1013
+ auto_subscribe_on_pr_create: z.ZodDefault<z.ZodBoolean>;
1005
1014
  }, z.core.$strict>;
1006
1015
  export type PrMonitorConfig = z.infer<typeof PrMonitorConfigSchema>;
1007
1016
  export declare const ParallelizationConfigSchema: z.ZodObject<{
@@ -2257,7 +2266,16 @@ export declare const PluginConfigSchema: z.ZodObject<{
2257
2266
  notify_ci_failure: z.ZodDefault<z.ZodBoolean>;
2258
2267
  notify_new_comments: z.ZodDefault<z.ZodBoolean>;
2259
2268
  notify_merge_conflict: z.ZodDefault<z.ZodBoolean>;
2269
+ notify_review_activity: z.ZodDefault<z.ZodBoolean>;
2270
+ notify_merged: z.ZodDefault<z.ZodBoolean>;
2271
+ notify_closed: z.ZodDefault<z.ZodBoolean>;
2272
+ notify_ci_success: z.ZodDefault<z.ZodBoolean>;
2260
2273
  auto_pr_feedback: z.ZodDefault<z.ZodBoolean>;
2274
+ event_delivery: z.ZodDefault<z.ZodEnum<{
2275
+ advisory: "advisory";
2276
+ prompt: "prompt";
2277
+ }>>;
2278
+ auto_subscribe_on_pr_create: z.ZodDefault<z.ZodBoolean>;
2261
2279
  }, z.core.$strict>>;
2262
2280
  external_skills: z.ZodOptional<z.ZodObject<{
2263
2281
  curation_enabled: z.ZodDefault<z.ZodBoolean>;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * PR auto-subscribe hook (tool.execute.after).
3
+ *
4
+ * When `pr_monitor.enabled` and `pr_monitor.auto_subscribe_on_pr_create`
5
+ * are set, a successful `gh pr create` run through the bash tool
6
+ * automatically subscribes the current session to the created PR — closing
7
+ * the commit-pr → swarm-pr-review → swarm-pr-feedback → swarm-pr-subscribe
8
+ * lifecycle without a manual `/swarm pr subscribe` step.
9
+ *
10
+ * Detection: the bash command must contain `gh pr create` and the tool
11
+ * output must contain a GitHub PR URL. Only the first URL in a bounded
12
+ * slice of the output is used. The subscribe call is idempotent (keyed by
13
+ * session::repo::number) and lazy-starts the PR monitor worker via the
14
+ * store's onSubscriptionCreated callback.
15
+ *
16
+ * Fail-open: never throws, never blocks the hook chain, no subprocesses.
17
+ */
18
+ import { subscribe } from '../background/pr-subscriptions.js';
19
+ import type { PrMonitorConfig } from '../config/schema.js';
20
+ import { log } from '../utils';
21
+ export interface PrAutoSubscribeHook {
22
+ toolAfter: (input: {
23
+ tool: string;
24
+ sessionID?: string;
25
+ args?: unknown;
26
+ }, output: {
27
+ output?: unknown;
28
+ args?: unknown;
29
+ }) => Promise<void>;
30
+ }
31
+ /** DI seam for testability. */
32
+ export declare const _internals: {
33
+ subscribe: typeof subscribe;
34
+ log: typeof log;
35
+ };
36
+ /**
37
+ * Extract `{ repoFullName, prNumber, prUrl }` from the first GitHub PR URL
38
+ * in the given text, or null when none is present. The returned prUrl is
39
+ * re-canonicalized from the captures so it always satisfies the
40
+ * subscription store's strict URL schema.
41
+ */
42
+ export declare function extractPrUrl(text: string): {
43
+ repoFullName: string;
44
+ prNumber: number;
45
+ prUrl: string;
46
+ } | null;
47
+ /**
48
+ * Create the auto-subscribe hook. Cheap to construct (no I/O); all gating
49
+ * happens inside toolAfter.
50
+ */
51
+ export declare function createPrAutoSubscribeHook(directory: string, config: PrMonitorConfig): PrAutoSubscribeHook;