@bluelovers/opencode-arise 0.1.9 → 0.1.10

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 (3) hide show
  1. package/dist/cli/index.js +16727 -16567
  2. package/dist/index.js +467 -58
  3. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -20494,7 +20494,7 @@ function date4(params) {
20494
20494
 
20495
20495
  // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
20496
20496
  config(en_default());
20497
- // src/agents/shadow-names.ts
20497
+ // src/types/enums.ts
20498
20498
  var ALLOWED_SHADOWS = [
20499
20499
  "beru" /* Beru */,
20500
20500
  "igris" /* Igris */,
@@ -20512,8 +20512,6 @@ var ALL_SHADOW_AGENTS_NAME = [
20512
20512
  "monarch" /* ShadowMonarch */,
20513
20513
  ...ALLOWED_SHADOWS
20514
20514
  ];
20515
-
20516
- // src/config/hook-names.ts
20517
20515
  var ALLOWED_HOOKS = [
20518
20516
  "arise-banner" /* AriseBanner */,
20519
20517
  "output-shaper" /* OutputShaper */,
@@ -20534,7 +20532,19 @@ var AgentOverride = exports_external.object({
20534
20532
  poll_interval: exports_external.number().optional(),
20535
20533
  retry_delay_increment: exports_external.number().optional(),
20536
20534
  retry_delay_max: exports_external.number().optional(),
20537
- system_prompt_addon: exports_external.string().optional()
20535
+ system_prompt_addon: exports_external.string().optional(),
20536
+ auto_resume: exports_external.object({
20537
+ enabled: exports_external.boolean().default(false),
20538
+ max_retries: exports_external.number().default(3).optional(),
20539
+ retry_delay: exports_external.number().default(5000).optional(),
20540
+ on_error: exports_external.enum(["ignore", "retry", "notify"]).default("ignore").optional(),
20541
+ target: exports_external.enum(["background", "all"]).default("background").optional(),
20542
+ prompts: exports_external.object({
20543
+ retry: exports_external.string().optional(),
20544
+ final: exports_external.string().optional(),
20545
+ custom: exports_external.array(exports_external.string()).optional()
20546
+ }).optional()
20547
+ }).optional()
20538
20548
  });
20539
20549
  var AriseConfigSchema = exports_external.object({
20540
20550
  $schema: exports_external.string().optional(),
@@ -20554,7 +20564,19 @@ var AriseConfigSchema = exports_external.object({
20554
20564
  background: exports_external.object({
20555
20565
  poll_interval: exports_external.number().default(DEFAULT_POLL_INTERVAL),
20556
20566
  retry_delay_increment: exports_external.number().default(DEFAULT_RETRY_DELAY_INCREMENT),
20557
- retry_delay_max: exports_external.number().default(DEFAULT_RETRY_DELAY_MAX)
20567
+ retry_delay_max: exports_external.number().default(DEFAULT_RETRY_DELAY_MAX),
20568
+ auto_resume: exports_external.object({
20569
+ enabled: exports_external.boolean().default(false),
20570
+ max_retries: exports_external.number().default(3).optional(),
20571
+ retry_delay: exports_external.number().default(5000).optional(),
20572
+ on_error: exports_external.enum(["ignore", "retry", "notify"]).default("ignore").optional(),
20573
+ target: exports_external.enum(["background", "all"]).default("background").optional(),
20574
+ prompts: exports_external.object({
20575
+ retry: exports_external.string().optional(),
20576
+ final: exports_external.string().optional(),
20577
+ custom: exports_external.array(exports_external.string()).optional()
20578
+ }).optional()
20579
+ }).optional()
20558
20580
  }).optional(),
20559
20581
  debug: exports_external.object({
20560
20582
  enabled: exports_external.boolean().default(false),
@@ -20577,7 +20599,19 @@ var DEFAULT_CONFIG = {
20577
20599
  background: {
20578
20600
  poll_interval: DEFAULT_POLL_INTERVAL,
20579
20601
  retry_delay_increment: DEFAULT_RETRY_DELAY_INCREMENT,
20580
- retry_delay_max: DEFAULT_RETRY_DELAY_MAX
20602
+ retry_delay_max: DEFAULT_RETRY_DELAY_MAX,
20603
+ auto_resume: {
20604
+ enabled: false,
20605
+ max_retries: 3,
20606
+ retry_delay: 5000,
20607
+ on_error: "ignore",
20608
+ target: "background",
20609
+ prompts: {
20610
+ retry: undefined,
20611
+ final: undefined,
20612
+ custom: undefined
20613
+ }
20614
+ }
20581
20615
  },
20582
20616
  debug: {
20583
20617
  enabled: false,
@@ -20598,6 +20632,19 @@ function _createConfigGetter(configKey, defaultValue) {
20598
20632
  var getPollInterval = _createConfigGetter("poll_interval", DEFAULT_POLL_INTERVAL);
20599
20633
  var getRetryDelayIncrement = _createConfigGetter("retry_delay_increment", DEFAULT_RETRY_DELAY_INCREMENT);
20600
20634
  var getRetryDelayMax = _createConfigGetter("retry_delay_max", DEFAULT_RETRY_DELAY_MAX);
20635
+ var DEFAULT_AUTO_RESUME = {
20636
+ enabled: false,
20637
+ max_retries: 3,
20638
+ retry_delay: 5000,
20639
+ on_error: "ignore",
20640
+ target: "background",
20641
+ prompts: {
20642
+ retry: undefined,
20643
+ final: undefined,
20644
+ custom: undefined
20645
+ }
20646
+ };
20647
+ var getAutoResumeConfig = _createConfigGetter("auto_resume", DEFAULT_AUTO_RESUME);
20601
20648
 
20602
20649
  // src/config/io.ts
20603
20650
  var import_npa_to_deps = __toESM(require_npa_to_deps(), 1);
@@ -32932,51 +32979,153 @@ function tool22(input) {
32932
32979
  return tool(input);
32933
32980
  }
32934
32981
 
32935
- // src/tools/tool-names.ts
32982
+ // src/agents/shadows.ts
32983
+ var SHADOW_DESCRIPTIONS = {
32984
+ ["beru" /* Beru */]: {
32985
+ name: "beru",
32986
+ title: "Ant King Scout",
32987
+ emoji: "\uD83D\uDC1C",
32988
+ role: "Fastest scout",
32989
+ capabilities: "Codebase exploration, grep, file discovery, pattern search",
32990
+ bestFor: [
32991
+ "Finding files by name or pattern",
32992
+ "Searching code for patterns or functions",
32993
+ "Understanding code structure",
32994
+ "Quick codebase reconnaissance"
32995
+ ],
32996
+ roleKeywords: ["find", "search", "explore", "grep", "file", "where", "locate", "codebase"],
32997
+ supportsBackground: true
32998
+ },
32999
+ ["igris" /* Igris */]: {
33000
+ name: "igris",
33001
+ title: "Loyal Knight",
33002
+ emoji: "\u2694\uFE0F",
33003
+ role: "Precise implementer",
33004
+ capabilities: "Code changes, file editing, running commands, test verification",
33005
+ bestFor: [
33006
+ "Implementing code changes",
33007
+ "Editing files with precision",
33008
+ "Running build/test commands",
33009
+ "Verifying changes work correctly"
33010
+ ],
33011
+ roleKeywords: ["implement", "edit", "change", "fix", "code", "write", "run", "test", "build"],
33012
+ supportsBackground: false
33013
+ },
33014
+ ["bellion" /* Bellion */]: {
33015
+ name: "bellion",
33016
+ title: "Grand Marshal",
33017
+ emoji: "\uD83C\uDF96\uFE0F",
33018
+ role: "Master strategist",
33019
+ capabilities: "Strategic planning, architecture analysis, complex problem decomposition",
33020
+ bestFor: [
33021
+ "Planning complex refactoring",
33022
+ "Architecture design decisions",
33023
+ "Migration planning",
33024
+ "Breaking down large tasks"
33025
+ ],
33026
+ roleKeywords: ["plan", "architecture", "design", "strategy", "refactor", "migrate", "analyze"],
33027
+ supportsBackground: true
33028
+ },
33029
+ ["tusk" /* Tusk */]: {
33030
+ name: "tusk",
33031
+ title: "Creative Shadow",
33032
+ emoji: "\uD83C\uDFA8",
33033
+ role: "UI/UX specialist",
33034
+ capabilities: "Frontend development, UI/UX design, styling, components, animations",
33035
+ bestFor: [
33036
+ "Building UI components",
33037
+ "Styling and layouts",
33038
+ "Frontend integration",
33039
+ "Design system work"
33040
+ ],
33041
+ roleKeywords: ["ui", "ux", "frontend", "design", "style", "css", "component", "layout"],
33042
+ supportsBackground: false
33043
+ },
33044
+ ["tank" /* Tank */]: {
33045
+ name: "tank",
33046
+ title: "Research Shadow",
33047
+ emoji: "\uD83D\uDEE1\uFE0F",
33048
+ role: "External knowledge gatherer",
33049
+ capabilities: "Web search, documentation lookup, examples, best practices research",
33050
+ bestFor: [
33051
+ "Finding external documentation",
33052
+ "Researching best practices",
33053
+ "Finding code examples",
33054
+ "Learning new libraries/frameworks"
33055
+ ],
33056
+ roleKeywords: ["docs", "documentation", "search", "research", "example", "learn", "external"],
33057
+ supportsBackground: true
33058
+ },
33059
+ ["shadow-sovereign" /* ShadowSovereign */]: {
33060
+ name: "shadow-sovereign",
33061
+ title: "Full Power",
33062
+ emoji: "\uD83D\uDC41\uFE0F",
33063
+ role: "Deep reasoning specialist",
33064
+ capabilities: "Deep reasoning, complex debugging, architecture decisions, failure recovery",
33065
+ bestFor: [
33066
+ "Complex architectural decisions",
33067
+ "Debugging after multiple failed attempts",
33068
+ "Extended reasoning analysis",
33069
+ "Recovery strategies"
33070
+ ],
33071
+ roleKeywords: ["debug", "complex", "why", "reason", "analyze", "reasoning"],
33072
+ supportsBackground: false
33073
+ }
33074
+ };
33075
+ function getShortDescription(name) {
33076
+ const desc = SHADOW_DESCRIPTIONS[name];
33077
+ return `${desc.emoji} ${desc.role.charAt(0).toUpperCase() + desc.role.slice(1)} - ${desc.capabilities}`;
33078
+ }
33079
+ function getMonarchShadowList() {
33080
+ const shadows = Object.values(SHADOW_DESCRIPTIONS);
33081
+ return shadows.map((s) => {
33082
+ const backgroundHint = s.supportsBackground ? " (supports background)" : "";
33083
+ return `- @${s.name} - ${s.role.charAt(0).toUpperCase() + s.role.slice(1)}. ${s.capabilities}${backgroundHint}`;
33084
+ }).join(`
33085
+ `);
33086
+ }
32936
33087
  var ARISE_TOOLS = {
32937
33088
  ["arise_summon" /* ARISE_SUMMON */]: {
32938
- description: `Invoke a shadow synchronously or in background
33089
+ description: `Invoke a shadow agent synchronously or in background
32939
33090
 
32940
- Available shadows:
32941
- - beru: Fast codebase scout (exploration, grep, file discovery)
32942
- - igris: Precise implementation (code changes, running commands)
32943
- - bellion: Strategic planning (architecture, complex analysis)
32944
- - tusk: UI/UX specialist (frontend, styling, components)
32945
- - tank: External research (docs, web search, examples)
32946
- - shadow-sovereign: Deep reasoning (complex debugging, architecture decisions)
33091
+ Available shadow agents:
33092
+ ${ALLOWED_SHADOWS.map((name) => {
33093
+ const supportsBg = name === "beru" || name === "tank" || name === "bellion" ? " (supports background)" : "";
33094
+ return `- ${name}: ${getShortDescription(name)}${supportsBg}`;
33095
+ }).join(`
33096
+ `)}
32947
33097
 
32948
33098
  Use run_in_background=true for parallel execution (recommended for exploration/research).
32949
33099
  Use run_in_background=false when you need the result immediately.
32950
33100
 
32951
- Model override: Use the 'model' parameter to specify a different model for this shadow (format: provider/model, e.g. opencode/big-pickle). If not specified, each shadow uses its default model.`,
32952
- shortDescription: "Invoke a shadow synchronously or in background",
33101
+ Model override: Use the 'model' parameter to specify a different model for this shadow agent (format: provider/model, e.g. opencode/big-pickle). If not specified, each shadow agent uses its default model.`,
33102
+ shortDescription: "Invoke a shadow agent (sync or background)",
32953
33103
  args: {
32954
- shadow: exports_external.enum(ALLOWED_SHADOWS).describe("Which shadow to summon"),
32955
- prompt: exports_external.string().describe("The task/question for the shadow (be specific)"),
33104
+ shadow: exports_external.enum(ALLOWED_SHADOWS).describe("Which shadow agent to summon"),
33105
+ prompt: exports_external.string().describe("The task/question for the shadow agent (be specific)"),
32956
33106
  run_in_background: exports_external.boolean().describe("true = async (parallel), false = sync (wait for result)"),
32957
33107
  description: exports_external.string().optional().describe("Short description of the task (for tracking)"),
32958
- model: exports_external.string().optional().describe("Override model for this shadow (format: provider/model, e.g. opencode/big-pickle)")
33108
+ model: exports_external.string().optional().describe("Override model for this shadow agent (format: provider/model, e.g. opencode/big-pickle)")
32959
33109
  }
32960
33110
  },
32961
33111
  ["arise_background" /* ARISE_BACKGROUND */]: {
32962
- description: `Launch a shadow soldier as a background task for parallel execution.
33112
+ description: `Launch a shadow agent as a background task for parallel execution.
32963
33113
 
32964
33114
  Best for:
32965
- - beru: Parallel codebase exploration
32966
- - tank: Parallel external research
32967
- - bellion: Parallel planning/analysis
33115
+ ${BACKGROUND_SHADOWS.map((name) => `- ${name}: ${getShortDescription(name)}`).join(`
33116
+ `)}
32968
33117
 
32969
33118
  Returns a task_id immediately. Use arise_background_output to get results later.`,
32970
- shortDescription: "Launch shadow soldier as background task (parallel)",
33119
+ shortDescription: "Launch shadow agent as background task (parallel)",
32971
33120
  args: {
32972
- shadow: exports_external.enum(BACKGROUND_SHADOWS).describe("Which shadow to run in background"),
32973
- prompt: exports_external.string().describe("The task for the shadow"),
33121
+ shadow: exports_external.enum(BACKGROUND_SHADOWS).describe("Which shadow agent to run in background"),
33122
+ prompt: exports_external.string().describe("The task for the shadow agent"),
32974
33123
  description: exports_external.string().describe("Short description (3-5 words)"),
32975
- model: exports_external.string().optional().describe("Override model for this shadow (format: provider/model, e.g. opencode/big-pickle)")
33124
+ model: exports_external.string().optional().describe("Override model for this shadow agent (format: provider/model, e.g. opencode/big-pickle)")
32976
33125
  }
32977
33126
  },
32978
33127
  ["arise_background_output" /* ARISE_BACKGROUND_OUTPUT */]: {
32979
- shortDescription: "Get the output from a background shadow task.",
33128
+ shortDescription: "Get the output from a background shadow agent task.",
32980
33129
  args: {
32981
33130
  task_id: exports_external.string().describe("The task ID from arise_background")
32982
33131
  }
@@ -33003,6 +33152,23 @@ Returns a formatted list of all available models in the format provider/modelID.
33003
33152
  args: {
33004
33153
  provider: exports_external.string().optional().describe("Filter models by provider (e.g. 'anthropic', 'openai')")
33005
33154
  }
33155
+ },
33156
+ ["arise_continue" /* ARISE_CONTINUE */]: {
33157
+ description: `Actively continue/resume a failed background task.
33158
+
33159
+ This tool allows agents to manually trigger a retry for a failed task, instead of waiting for passive auto-resume.
33160
+
33161
+ Use this when:
33162
+ - You want to retry a task immediately without waiting for auto-resume
33163
+ - Auto-resume is disabled but you still want to retry manually
33164
+ - You want to attempt multiple manual retries
33165
+
33166
+ Returns the status of the resume attempt.`,
33167
+ shortDescription: "Actively continue/resume a failed task manually",
33168
+ args: {
33169
+ task_id: exports_external.string().describe("The task ID to resume/continue"),
33170
+ force: exports_external.boolean().optional().describe("Force retry even if task is not in error state")
33171
+ }
33006
33172
  }
33007
33173
  };
33008
33174
  function getAriseToolsMarkdown() {
@@ -33011,7 +33177,7 @@ function getAriseToolsMarkdown() {
33011
33177
  }
33012
33178
  function getAriseToolsSection() {
33013
33179
  const ariseTools = getAriseToolsMarkdown();
33014
- return `## Tools
33180
+ return `## Available Tools
33015
33181
  ${ariseTools}
33016
33182
  - task: OpenCode's built-in for complex multi-step delegation`;
33017
33183
  }
@@ -33023,8 +33189,6 @@ function getAriseToolsConfigEntry(ariseToolName) {
33023
33189
  ariseToolsConfigEntry.description ??= ariseToolsConfigEntry.shortDescription;
33024
33190
  return ariseToolsConfigEntry;
33025
33191
  }
33026
-
33027
- // src/agents/shadows.ts
33028
33192
  var SHADOW_AGENTS = {
33029
33193
  ["monarch" /* ShadowMonarch */]: {
33030
33194
  name: "monarch" /* ShadowMonarch */,
@@ -33034,15 +33198,10 @@ var SHADOW_AGENTS = {
33034
33198
  steps: 16,
33035
33199
  prompt: `You are the Shadow Monarch (opencode-arise).
33036
33200
 
33037
- Your role: Interpret user requests and delegate to your shadow army with MINIMAL SUFFICIENT effort.
33201
+ Your role: Interpret user requests and delegate to your Shadow Army Agents with MINIMAL SUFFICIENT effort.
33038
33202
 
33039
- ## Your Shadows (invoke via @mention or arise_summon tool)
33040
- - @beru - Fastest scout. Codebase exploration, file discovery, pattern search.
33041
- - @igris - Loyal knight. Implementation, code changes, running commands.
33042
- - @bellion - Grand Marshal. Complex planning, architecture analysis.
33043
- - @tusk - Creative specialist. UI/UX, frontend work.
33044
- - @tank - Research shadow. External docs, web search, examples.
33045
- - @shadow-sovereign - Full power. Deep reasoning, recovery after failures.
33203
+ ## Your Shadow Agents (invoke via @mention or arise_summon tool)
33204
+ ${getMonarchShadowList()}
33046
33205
 
33047
33206
  ## Primary
33048
33207
  - @shadow-monarch - The main orchestrator (only one)
@@ -33051,9 +33210,9 @@ ${getAriseToolsSection()}
33051
33210
 
33052
33211
  ## Principles
33053
33212
  1. Assess intent before acting. Don't over-delegate.
33054
- 2. For trivial tasks, handle directly without summoning shadows.
33213
+ 2. For trivial tasks, handle directly without summoning shadow agents.
33055
33214
  3. Keep a short TODO list. Mark items in_progress \u2192 completed.
33056
- 4. Use background tasks for parallel exploration (beru, tank).
33215
+ 4. Use background tasks for parallel exploration (beru, tank, bellion).
33057
33216
  5. Only summon @shadow-sovereign when stuck or for complex architecture.
33058
33217
  6. Verify changes work before declaring done.
33059
33218
 
@@ -33061,7 +33220,7 @@ ARISE and lead your shadows to victory.`
33061
33220
  },
33062
33221
  ["beru" /* Beru */]: {
33063
33222
  name: "beru" /* Beru */,
33064
- description: "Ant King - Fastest codebase scout",
33223
+ description: "\uD83D\uDC1C Ant King - Fastest scout. Codebase exploration, grep, file discovery",
33065
33224
  mode: "subagent" /* SUBAGENT */,
33066
33225
  model: "anthropic/claude-haiku-4-5",
33067
33226
  steps: 12,
@@ -33069,25 +33228,28 @@ ARISE and lead your shadows to victory.`
33069
33228
  edit: "deny" /* DENY */,
33070
33229
  write: "deny" /* DENY */
33071
33230
  },
33072
- prompt: `You are Beru, the Ant King shadow - fastest scout in the shadow army.
33231
+ prompt: `You are Beru, the Ant King shadow agent - fastest scout in the Shadow Army Agents.
33073
33232
 
33074
33233
  Your role: Rapidly explore the codebase. Find files, patterns, and answer questions about code structure.
33075
33234
 
33076
- Tools you excel at: glob, grep, read, list.
33235
+ Tools you excel at: glob, grep, read, list, lsp_*.
33077
33236
  You CANNOT edit files - report findings back to the Monarch.
33078
33237
 
33079
33238
  Be thorough but fast. Search multiple patterns if needed. Return clear, actionable findings.`
33080
33239
  },
33081
33240
  ["igris" /* Igris */]: {
33082
33241
  name: "igris" /* Igris */,
33083
- description: "Loyal Knight - Precise implementation",
33242
+ description: "\u2694\uFE0F Loyal Knight - Precise implementer. Code changes, running commands",
33084
33243
  mode: "subagent" /* SUBAGENT */,
33085
33244
  model: "zai-coding-plan/glm-4.7",
33086
33245
  steps: 20,
33087
- prompt: `You are Igris, the loyal knight shadow - precise and reliable implementer.
33246
+ prompt: `You are Igris, the loyal knight shadow agent - precise and reliable implementer.
33088
33247
 
33089
33248
  Your role: Execute code changes with precision. Edit files, run commands, verify results.
33090
33249
 
33250
+ Tools you excel at: edit, write, bash, glob.
33251
+ You SHOULD edit and write files - implement changes with precision.
33252
+
33091
33253
  Principles:
33092
33254
  1. Make minimal, focused changes.
33093
33255
  2. Follow existing code patterns.
@@ -33098,7 +33260,7 @@ Execute with honor.`
33098
33260
  },
33099
33261
  ["bellion" /* Bellion */]: {
33100
33262
  name: "bellion" /* Bellion */,
33101
- description: "Grand Marshal - Strategy and planning",
33263
+ description: "\uD83C\uDF96\uFE0F Grand Marshal - Master strategist. Strategic planning, architecture analysis",
33102
33264
  mode: "subagent" /* SUBAGENT */,
33103
33265
  model: "openai/gpt-5.2",
33104
33266
  steps: 12,
@@ -33107,10 +33269,13 @@ Execute with honor.`
33107
33269
  write: "deny" /* DENY */,
33108
33270
  bash: "ask" /* ASK */
33109
33271
  },
33110
- prompt: `You are Bellion, Grand Marshal of the shadow army - master strategist.
33272
+ prompt: `You are Bellion, Grand Marshal of the Shadow Army Agents - master strategist.
33111
33273
 
33112
33274
  Your role: Analyze complex problems and create detailed plans. You do NOT implement - you plan.
33113
33275
 
33276
+ Tools you excel at: read, glob, grep, lsp_*.
33277
+ You CANNOT edit files - report plans back to the Monarch.
33278
+
33114
33279
  Output format:
33115
33280
  1. Problem analysis
33116
33281
  2. Proposed approach (with alternatives if relevant)
@@ -33122,14 +33287,17 @@ Think deeply, plan carefully.`
33122
33287
  },
33123
33288
  ["tusk" /* Tusk */]: {
33124
33289
  name: "tusk" /* Tusk */,
33125
- description: "Creative shadow - UI/UX specialist",
33290
+ description: "\uD83C\uDFA8 Creative Shadow - UI/UX specialist. Frontend development, styling, components",
33126
33291
  mode: "subagent" /* SUBAGENT */,
33127
33292
  model: "google/gemini-3-pro-preview",
33128
33293
  steps: 18,
33129
- prompt: `You are Tusk, the creative shadow - UI/UX and frontend specialist.
33294
+ prompt: `You are Tusk, the creative shadow agent - UI/UX and frontend specialist.
33130
33295
 
33131
33296
  Your role: Handle all visual and frontend work. Components, styling, layouts, animations.
33132
33297
 
33298
+ Tools you excel at: read, edit, write, glob.
33299
+ You SHOULD edit files - implement UI/UX changes.
33300
+
33133
33301
  Principles:
33134
33302
  1. Follow existing design patterns and component libraries.
33135
33303
  2. Ensure accessibility (aria labels, keyboard nav).
@@ -33140,7 +33308,7 @@ Create with artistry.`
33140
33308
  },
33141
33309
  ["tank" /* Tank */]: {
33142
33310
  name: "tank" /* Tank */,
33143
- description: "Research shadow - External knowledge gatherer",
33311
+ description: "\uD83D\uDEE1\uFE0F Research Shadow - External knowledge gatherer. Web search, docs, examples",
33144
33312
  mode: "subagent" /* SUBAGENT */,
33145
33313
  model: "zai-coding-plan/glm-4.7",
33146
33314
  steps: 18,
@@ -33148,11 +33316,12 @@ Create with artistry.`
33148
33316
  edit: "deny" /* DENY */,
33149
33317
  write: "deny" /* DENY */
33150
33318
  },
33151
- prompt: `You are Tank, the research shadow - gatherer of external knowledge.
33319
+ prompt: `You are Tank, the research shadow agent - gatherer of external knowledge.
33152
33320
 
33153
33321
  Your role: Find information from outside the codebase. Documentation, examples, best practices.
33154
33322
 
33155
- You have access to: web search, web fetch, MCP tools, deepwiki.
33323
+ Tools you excel at: web_search, web_fetch, websearch_web_search_exa, context7_query-docs, grep_app_searchGitHub.
33324
+ You CANNOT edit files - report findings back to the Monarch.
33156
33325
 
33157
33326
  Return findings in a structured format:
33158
33327
  1. Source (URL/doc)
@@ -33164,7 +33333,7 @@ Research thoroughly, report concisely.`
33164
33333
  },
33165
33334
  ["shadow-sovereign" /* ShadowSovereign */]: {
33166
33335
  name: "shadow-sovereign" /* ShadowSovereign */,
33167
- description: "Full power mode - Deep reasoning and recovery",
33336
+ description: "\uD83D\uDC41\uFE0F Full Power - Deep reasoning specialist. Complex debugging, architecture decisions",
33168
33337
  mode: "subagent" /* SUBAGENT */,
33169
33338
  model: "openai/gpt-5.2",
33170
33339
  steps: 24,
@@ -33182,9 +33351,12 @@ You are summoned only for:
33182
33351
  2. Debugging after multiple failed attempts
33183
33352
  3. Deep analysis requiring extended reasoning
33184
33353
 
33354
+ Tools you excel at: read, grep, lsp_*, web_search, web_fetch.
33355
+ You CANNOT edit files - report analysis back to the Monarch.
33356
+
33185
33357
  Think deeply. Consider all angles. Provide comprehensive analysis with clear recommendations.
33186
33358
 
33187
- Your wisdom guides the shadow army through the most challenging battles.`
33359
+ Your wisdom guides the Shadow Army Agents through the most challenging battles.`
33188
33360
  }
33189
33361
  };
33190
33362
  var OPENCODE_OVERRIDES = {
@@ -35223,8 +35395,23 @@ class BackgroundManager {
35223
35395
  getPollInterval;
35224
35396
  getRetryDelayIncrement;
35225
35397
  getRetryDelayMax;
35226
- constructor(ctx, pollIntervalOrGetter = DEFAULT_POLL_INTERVAL, retryDelayIncrementOrGetter, retryDelayMaxOrGetter) {
35398
+ getAutoResumeConfig;
35399
+ constructor(ctx, pollIntervalOrGetter = DEFAULT_POLL_INTERVAL, retryDelayIncrementOrGetter, retryDelayMaxOrGetter, getAutoResumeConfigOrConfig) {
35227
35400
  this.ctx = ctx;
35401
+ if (typeof getAutoResumeConfigOrConfig === "function") {
35402
+ this.getAutoResumeConfig = getAutoResumeConfigOrConfig;
35403
+ } else if (getAutoResumeConfigOrConfig) {
35404
+ this.getAutoResumeConfig = () => getAutoResumeConfigOrConfig;
35405
+ } else {
35406
+ this.getAutoResumeConfig = () => ({
35407
+ enabled: false,
35408
+ maxRetries: 3,
35409
+ retryDelay: 5000,
35410
+ onError: "ignore",
35411
+ target: "background",
35412
+ prompts: {}
35413
+ });
35414
+ }
35228
35415
  if (typeof pollIntervalOrGetter === "function") {
35229
35416
  this.getPollInterval = pollIntervalOrGetter;
35230
35417
  this.defaultPollInterval = DEFAULT_POLL_INTERVAL;
@@ -35235,6 +35422,131 @@ class BackgroundManager {
35235
35422
  this.getRetryDelayIncrement = _normalizeToGetter(retryDelayIncrementOrGetter, DEFAULT_RETRY_DELAY_INCREMENT);
35236
35423
  this.getRetryDelayMax = _normalizeToGetter(retryDelayMaxOrGetter, DEFAULT_RETRY_DELAY_MAX);
35237
35424
  }
35425
+ shouldAutoResume(task) {
35426
+ if (!this.getAutoResumeConfig()?.enabled) {
35427
+ return false;
35428
+ }
35429
+ if (task.status !== "error") {
35430
+ return false;
35431
+ }
35432
+ if (this.getAutoResumeConfig()?.target === "background") {
35433
+ if (task.parentSessionId === task.sessionId) {
35434
+ return false;
35435
+ }
35436
+ }
35437
+ const currentRetryCount = task.resumeRetryCount ?? 0;
35438
+ if (currentRetryCount >= (this.getAutoResumeConfig()?.maxRetries ?? 3)) {
35439
+ return false;
35440
+ }
35441
+ if (this.getAutoResumeConfig()?.onError === "ignore") {
35442
+ return false;
35443
+ }
35444
+ return true;
35445
+ }
35446
+ async performAutoResume(task) {
35447
+ task.resumePending = true;
35448
+ this.ctx.client.app.log?.({
35449
+ body: {
35450
+ service: "arise",
35451
+ level: "info",
35452
+ message: `[Auto-resume] Retrying task ${task.id}, attempt ${(task.resumeRetryCount ?? 0) + 1}/${this.getAutoResumeConfig()?.maxRetries ?? 3}`
35453
+ }
35454
+ });
35455
+ await new Promise((resolve2) => setTimeout(resolve2, this.getAutoResumeConfig()?.retryDelay ?? 5000));
35456
+ task.resumePending = false;
35457
+ task.resumeRetryCount = (task.resumeRetryCount ?? 0) + 1;
35458
+ try {
35459
+ const session = await this.ctx.client.session.create({
35460
+ body: { title: `[arise:${task.id} retry ${task.resumeRetryCount}] ${task.description}` }
35461
+ });
35462
+ const newSessionId = session.data?.id;
35463
+ if (!newSessionId) {
35464
+ throw new Error("Failed to create retry session");
35465
+ }
35466
+ const oldSessionId = task.sessionId;
35467
+ task.sessionId = newSessionId;
35468
+ task.status = "running";
35469
+ task.startedAt = Date.now();
35470
+ task.error = undefined;
35471
+ task.completedAt = undefined;
35472
+ this.ctx.client.session.promptAsync({
35473
+ path: { id: newSessionId },
35474
+ body: {
35475
+ agent: task.shadow,
35476
+ model: undefined,
35477
+ parts: [{ type: "text", text: task.description }]
35478
+ }
35479
+ }).then(() => this.pollTaskCompletion(task.id)).catch((err) => {
35480
+ task.status = "error";
35481
+ task.error = getErrorMessage(err);
35482
+ task.completedAt = Date.now();
35483
+ if (this.getAutoResumeConfig()?.onError === "notify") {
35484
+ this.ctx.client.app.log?.({
35485
+ body: {
35486
+ service: "arise",
35487
+ level: "warn",
35488
+ message: `[Auto-resume] Task ${task.id} failed with error: ${task.error}. Waiting for manual intervention.`
35489
+ }
35490
+ });
35491
+ } else if (this.getAutoResumeConfig()?.onError === "retry") {
35492
+ this.ctx.client.app.log?.({
35493
+ body: {
35494
+ service: "arise",
35495
+ level: "warn",
35496
+ message: `[Auto-resume] Task ${task.id} retry failed: ${task.error}. Will retry again...`
35497
+ }
35498
+ });
35499
+ this.performAutoResume(task).catch((e) => {
35500
+ this.ctx.client.app.log?.({
35501
+ body: {
35502
+ service: "arise",
35503
+ level: "error",
35504
+ message: `[Auto-resume] Failed to retry task ${task.id}: ${getErrorMessage(e)}`
35505
+ }
35506
+ });
35507
+ });
35508
+ }
35509
+ });
35510
+ } catch (error92) {
35511
+ task.status = "error";
35512
+ task.error = getErrorMessage(error92);
35513
+ task.completedAt = Date.now();
35514
+ this.ctx.client.app.log?.({
35515
+ body: {
35516
+ service: "arise",
35517
+ level: "error",
35518
+ message: `[Auto-resume] Failed to create retry session for task ${task.id}: ${task.error}`
35519
+ }
35520
+ });
35521
+ }
35522
+ }
35523
+ updateAutoResumeConfig(config3) {
35524
+ const current = this.getAutoResumeConfig?.() ?? {
35525
+ enabled: false,
35526
+ maxRetries: 3,
35527
+ retryDelay: 5000,
35528
+ onError: "ignore",
35529
+ target: "background",
35530
+ prompts: {}
35531
+ };
35532
+ this.getAutoResumeConfig = () => ({
35533
+ enabled: config3.enabled ?? current.enabled,
35534
+ maxRetries: config3.maxRetries ?? current.maxRetries,
35535
+ retryDelay: config3.retryDelay ?? current.retryDelay,
35536
+ onError: config3.onError ?? current.onError,
35537
+ target: config3.target ?? current.target
35538
+ });
35539
+ }
35540
+ getAutoResumeConfigCopy() {
35541
+ return this.getAutoResumeConfig?.() ?? {
35542
+ enabled: false,
35543
+ maxRetries: 3,
35544
+ retryDelay: 5000,
35545
+ onError: "ignore",
35546
+ target: "background",
35547
+ prompts: {}
35548
+ };
35549
+ }
35238
35550
  generateTaskId() {
35239
35551
  return `arise_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`;
35240
35552
  }
@@ -35271,6 +35583,17 @@ class BackgroundManager {
35271
35583
  task.status = "error";
35272
35584
  task.error = getErrorMessage(err);
35273
35585
  task.completedAt = Date.now();
35586
+ if (this.shouldAutoResume(task)) {
35587
+ this.performAutoResume(task).catch((e) => {
35588
+ this.ctx.client.app.log?.({
35589
+ body: {
35590
+ service: "arise",
35591
+ level: "error",
35592
+ message: `[Auto-resume] Unexpected error in performAutoResume: ${getErrorMessage(e)}`
35593
+ }
35594
+ });
35595
+ });
35596
+ }
35274
35597
  });
35275
35598
  return task;
35276
35599
  }
@@ -35316,6 +35639,17 @@ class BackgroundManager {
35316
35639
  task.status = "error";
35317
35640
  task.error = getErrorMessage(err);
35318
35641
  task.completedAt = Date.now();
35642
+ if (this.shouldAutoResume(task)) {
35643
+ this.performAutoResume(task).catch((e) => {
35644
+ this.ctx.client.app.log?.({
35645
+ body: {
35646
+ service: "arise",
35647
+ level: "error",
35648
+ message: `[Auto-resume] Unexpected error in performAutoResume: ${getErrorMessage(e)}`
35649
+ }
35650
+ });
35651
+ });
35652
+ }
35319
35653
  }
35320
35654
  }
35321
35655
  async extractResult(task) {
@@ -35389,6 +35723,64 @@ class BackgroundManager {
35389
35723
  }
35390
35724
  }
35391
35725
  }
35726
+ async manualRetry(taskId, force = false) {
35727
+ const task = this.tasks.get(taskId);
35728
+ if (!task) {
35729
+ return `[arise] Task not found: ${taskId}`;
35730
+ }
35731
+ if (task.status !== "error" && !force) {
35732
+ return `[arise] Task ${taskId} is not in error state (status: ${task.status}). Use force=true to retry anyway.`;
35733
+ }
35734
+ if (task.resumePending) {
35735
+ return `[arise] Task ${taskId} is already pending auto-resume retry. Please wait for the current retry to complete.`;
35736
+ }
35737
+ try {
35738
+ const session = await this.ctx.client.session.create({
35739
+ body: { title: `[arise:${task.id} manual retry] ${task.description}` }
35740
+ });
35741
+ const newSessionId = session.data?.id;
35742
+ if (!newSessionId) {
35743
+ throw new Error("Failed to create retry session");
35744
+ }
35745
+ task.sessionId = newSessionId;
35746
+ task.status = "running";
35747
+ task.startedAt = Date.now();
35748
+ task.error = undefined;
35749
+ task.completedAt = undefined;
35750
+ task.resumeRetryCount = (task.resumeRetryCount ?? 0) + 1;
35751
+ this.ctx.client.session.promptAsync({
35752
+ path: { id: newSessionId },
35753
+ body: {
35754
+ agent: task.shadow,
35755
+ model: undefined,
35756
+ parts: [{ type: "text", text: task.description }]
35757
+ }
35758
+ }).then(() => this._publicSchedulePolling(task.id)).catch((err) => {
35759
+ task.status = "error";
35760
+ task.error = getErrorMessage(err);
35761
+ task.completedAt = Date.now();
35762
+ });
35763
+ return `[arise] Manual retry initiated for task ${taskId}.
35764
+
35765
+ Attempt: ${task.resumeRetryCount}
35766
+ Description: ${task.description}
35767
+ Shadow: ${task.shadow}
35768
+
35769
+ Use arise_background_output("${task.id}") to check the result.`;
35770
+ } catch (error92) {
35771
+ const msg = getErrorMessage(error92);
35772
+ return `[arise] Failed to initiate manual retry: ${msg}`;
35773
+ }
35774
+ }
35775
+ _publicSchedulePolling(taskId) {
35776
+ const task = this.tasks.get(taskId);
35777
+ if (task) {
35778
+ this.schedulePolling(taskId, task.shadow);
35779
+ }
35780
+ }
35781
+ getContext() {
35782
+ return this.ctx;
35783
+ }
35392
35784
  }
35393
35785
  // src/tools/background-tools.ts
35394
35786
  function createBackgroundTaskTool(manager) {
@@ -35563,6 +35955,22 @@ Use these model names with the 'model' parameter when calling arise_summon or ar
35563
35955
  });
35564
35956
  }
35565
35957
 
35958
+ // src/tools/continue-tool.ts
35959
+ function createContinueTool(manager) {
35960
+ const {
35961
+ description,
35962
+ args
35963
+ } = getAriseToolsConfigEntry("arise_continue" /* ARISE_CONTINUE */);
35964
+ return tool22({
35965
+ description,
35966
+ args,
35967
+ async execute(args2) {
35968
+ const result = await manager.manualRetry(args2.task_id, args2.force ?? false);
35969
+ return result;
35970
+ }
35971
+ });
35972
+ }
35973
+
35566
35974
  // src/tools/plugin-tools.ts
35567
35975
  function createPluginTools(ctx, backgroundManager) {
35568
35976
  return {
@@ -35571,7 +35979,8 @@ function createPluginTools(ctx, backgroundManager) {
35571
35979
  ["arise_background_output" /* ARISE_BACKGROUND_OUTPUT */]: createBackgroundOutputTool(backgroundManager),
35572
35980
  ["arise_background_status" /* ARISE_BACKGROUND_STATUS */]: createBackgroundStatusTool(backgroundManager),
35573
35981
  ["arise_background_cancel" /* ARISE_BACKGROUND_CANCEL */]: createBackgroundCancelTool(backgroundManager),
35574
- ["arise_list_models" /* ARISE_LIST_MODELS */]: createListModelsTool(ctx)
35982
+ ["arise_list_models" /* ARISE_LIST_MODELS */]: createListModelsTool(ctx),
35983
+ ["arise_continue" /* ARISE_CONTINUE */]: createContinueTool(backgroundManager)
35575
35984
  };
35576
35985
  }
35577
35986