@wolfx/oh-my-openagent 3.17.6 → 3.17.13

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 (135) hide show
  1. package/README.ja.md +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/README.ru.md +1 -1
  5. package/README.zh-cn.md +1 -1
  6. package/dist/agents/hephaestus/gpt-5-5.d.ts +3 -9
  7. package/dist/agents/sisyphus/gpt-5-5.d.ts +3 -17
  8. package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +2 -11
  9. package/dist/features/background-agent/attempt-lifecycle.d.ts +12 -0
  10. package/dist/features/background-agent/background-task-notification-template.d.ts +2 -1
  11. package/dist/features/background-agent/constants.d.ts +1 -0
  12. package/dist/features/background-agent/fallback-retry-handler.d.ts +8 -0
  13. package/dist/features/background-agent/manager.d.ts +21 -8
  14. package/dist/features/background-agent/types.d.ts +32 -8
  15. package/dist/features/background-agent/wait-for-task-session.d.ts +1 -1
  16. package/dist/features/team-mode/resolve-caller-team-lead.d.ts +8 -0
  17. package/dist/features/team-mode/types.d.ts +1 -1
  18. package/dist/hooks/auto-update-checker/hook/background-update-check.d.ts +1 -1
  19. package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
  20. package/dist/hooks/model-fallback/controller-accessor.d.ts +1 -0
  21. package/dist/hooks/model-fallback/fallback-state-controller.d.ts +1 -0
  22. package/dist/hooks/model-fallback/hook.d.ts +2 -1
  23. package/dist/hooks/preemptive-compaction-degradation-monitor.d.ts +1 -0
  24. package/dist/hooks/preemptive-compaction-no-text-tail.d.ts +1 -0
  25. package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +7 -0
  26. package/dist/hooks/session-notification-scheduler.d.ts +2 -4
  27. package/dist/hooks/session-notification-utils.d.ts +1 -0
  28. package/dist/index.js +2284 -5849
  29. package/dist/plugin/event.d.ts +1 -0
  30. package/dist/{cli/config-manager → shared}/config-context.d.ts +1 -1
  31. package/dist/shared/dynamic-truncator.d.ts +9 -10
  32. package/dist/shared/model-error-classifier.d.ts +2 -2
  33. package/dist/tools/background-task/clients.d.ts +1 -0
  34. package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
  35. package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
  36. package/dist/tools/delegate-task/constants.d.ts +1 -1
  37. package/dist/tools/delegate-task/executor-types.d.ts +1 -0
  38. package/dist/tools/delegate-task/openai-categories.d.ts +3 -0
  39. package/dist/tools/delegate-task/sync-task-fallback.d.ts +3 -0
  40. package/package.json +14 -14
  41. package/dist/cli/cli-installer.d.ts +0 -2
  42. package/dist/cli/cli-program.d.ts +0 -1
  43. package/dist/cli/config-manager/add-plugin-to-opencode-config.d.ts +0 -2
  44. package/dist/cli/config-manager/backup-config.d.ts +0 -6
  45. package/dist/cli/config-manager/deep-merge-record.d.ts +0 -1
  46. package/dist/cli/config-manager/detect-current-config.d.ts +0 -2
  47. package/dist/cli/config-manager/ensure-config-directory-exists.d.ts +0 -1
  48. package/dist/cli/config-manager/format-error-with-suggestion.d.ts +0 -1
  49. package/dist/cli/config-manager/generate-omo-config.d.ts +0 -2
  50. package/dist/cli/config-manager/npm-dist-tags.d.ts +0 -7
  51. package/dist/cli/config-manager/opencode-binary.d.ts +0 -2
  52. package/dist/cli/config-manager/opencode-config-format.d.ts +0 -5
  53. package/dist/cli/config-manager/parse-opencode-config-file.d.ts +0 -10
  54. package/dist/cli/config-manager/plugin-name-with-version.d.ts +0 -1
  55. package/dist/cli/config-manager/version-compatibility.d.ts +0 -9
  56. package/dist/cli/config-manager/write-omo-config.d.ts +0 -2
  57. package/dist/cli/config-manager.d.ts +0 -15
  58. package/dist/cli/doctor/checks/config.d.ts +0 -2
  59. package/dist/cli/doctor/checks/dependencies.d.ts +0 -4
  60. package/dist/cli/doctor/checks/index.d.ts +0 -7
  61. package/dist/cli/doctor/checks/model-resolution-cache.d.ts +0 -2
  62. package/dist/cli/doctor/checks/model-resolution-config.d.ts +0 -2
  63. package/dist/cli/doctor/checks/model-resolution-details.d.ts +0 -6
  64. package/dist/cli/doctor/checks/model-resolution-effective-model.d.ts +0 -3
  65. package/dist/cli/doctor/checks/model-resolution-types.d.ts +0 -40
  66. package/dist/cli/doctor/checks/model-resolution-variant.d.ts +0 -5
  67. package/dist/cli/doctor/checks/model-resolution.d.ts +0 -11
  68. package/dist/cli/doctor/checks/system-binary.d.ts +0 -13
  69. package/dist/cli/doctor/checks/system-loaded-version.d.ts +0 -10
  70. package/dist/cli/doctor/checks/system-plugin.d.ts +0 -15
  71. package/dist/cli/doctor/checks/system.d.ts +0 -16
  72. package/dist/cli/doctor/checks/tools-gh.d.ts +0 -10
  73. package/dist/cli/doctor/checks/tools-lsp.d.ts +0 -4
  74. package/dist/cli/doctor/checks/tools-mcp.d.ts +0 -3
  75. package/dist/cli/doctor/checks/tools.d.ts +0 -3
  76. package/dist/cli/doctor/constants.d.ts +0 -29
  77. package/dist/cli/doctor/format-default.d.ts +0 -2
  78. package/dist/cli/doctor/format-shared.d.ts +0 -6
  79. package/dist/cli/doctor/format-status.d.ts +0 -2
  80. package/dist/cli/doctor/format-verbose.d.ts +0 -2
  81. package/dist/cli/doctor/formatter.d.ts +0 -3
  82. package/dist/cli/doctor/index.d.ts +0 -5
  83. package/dist/cli/doctor/runner.d.ts +0 -5
  84. package/dist/cli/doctor/spawn-with-timeout.d.ts +0 -8
  85. package/dist/cli/doctor/types.d.ts +0 -120
  86. package/dist/cli/fallback-chain-resolution.d.ts +0 -10
  87. package/dist/cli/get-local-version/formatter.d.ts +0 -3
  88. package/dist/cli/get-local-version/get-local-version.d.ts +0 -2
  89. package/dist/cli/get-local-version/index.d.ts +0 -2
  90. package/dist/cli/get-local-version/types.d.ts +0 -13
  91. package/dist/cli/index.d.ts +0 -2
  92. package/dist/cli/install-validators.d.ts +0 -34
  93. package/dist/cli/install.d.ts +0 -2
  94. package/dist/cli/mcp-oauth/index.d.ts +0 -6
  95. package/dist/cli/mcp-oauth/login.d.ts +0 -11
  96. package/dist/cli/mcp-oauth/logout.d.ts +0 -4
  97. package/dist/cli/mcp-oauth/status.d.ts +0 -1
  98. package/dist/cli/minimum-opencode-version.d.ts +0 -1
  99. package/dist/cli/model-fallback-requirements.d.ts +0 -3
  100. package/dist/cli/model-fallback-types.d.ts +0 -31
  101. package/dist/cli/model-fallback.d.ts +0 -5
  102. package/dist/cli/openai-only-model-catalog.d.ts +0 -3
  103. package/dist/cli/provider-availability.d.ts +0 -4
  104. package/dist/cli/provider-model-id-transform.d.ts +0 -1
  105. package/dist/cli/refresh-model-capabilities.d.ts +0 -15
  106. package/dist/cli/run/agent-profile-colors.d.ts +0 -2
  107. package/dist/cli/run/agent-resolver.d.ts +0 -5
  108. package/dist/cli/run/completion.d.ts +0 -2
  109. package/dist/cli/run/continuation-state.d.ts +0 -10
  110. package/dist/cli/run/display-chars.d.ts +0 -5
  111. package/dist/cli/run/event-formatting.d.ts +0 -3
  112. package/dist/cli/run/event-handlers.d.ts +0 -11
  113. package/dist/cli/run/event-state.d.ts +0 -47
  114. package/dist/cli/run/event-stream-processor.d.ts +0 -3
  115. package/dist/cli/run/events.d.ts +0 -4
  116. package/dist/cli/run/index.d.ts +0 -10
  117. package/dist/cli/run/json-output.d.ts +0 -12
  118. package/dist/cli/run/model-resolver.d.ts +0 -4
  119. package/dist/cli/run/on-complete-hook.d.ts +0 -7
  120. package/dist/cli/run/opencode-binary-resolver.d.ts +0 -5
  121. package/dist/cli/run/output-renderer.d.ts +0 -7
  122. package/dist/cli/run/poll-for-completion.d.ts +0 -10
  123. package/dist/cli/run/runner.d.ts +0 -5
  124. package/dist/cli/run/server-connection.d.ts +0 -6
  125. package/dist/cli/run/session-resolver.d.ts +0 -6
  126. package/dist/cli/run/stdin-suppression.d.ts +0 -12
  127. package/dist/cli/run/timestamp-output.d.ts +0 -5
  128. package/dist/cli/run/tool-input-preview.d.ts +0 -6
  129. package/dist/cli/run/types.d.ts +0 -131
  130. package/dist/cli/tui-install-prompts.d.ts +0 -2
  131. package/dist/cli/tui-installer.d.ts +0 -2
  132. package/dist/cli/types.d.ts +0 -46
  133. package/dist/shared/posthog-activity-state.d.ts +0 -11
  134. package/dist/shared/posthog.d.ts +0 -19
  135. /package/dist/{cli/config-manager → shared}/bun-install.d.ts +0 -0
package/README.ja.md CHANGED
@@ -117,7 +117,7 @@ curl -s https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/head
117
117
 
118
118
  **注記**: 公開されているパッケージおよびバイナリ名は `oh-my-opencode` を使用してください。`opencode.json` 内では、互換性レイヤーがプラグインエントリ `oh-my-openagent` を優先しますが、従来の `oh-my-opencode` エントリも警告付きで読み込まれます。プラグイン設定ファイルは依然として `oh-my-opencode.json` または `oh-my-opencode.jsonc` を使用するのが一般的で、移行期間中は従来のファイル名と改名後のファイル名の両方が認識されます。
119
119
 
120
- 匿名のテレメトリは、インストールとランタイムの信頼性向上のためにデフォルトで有効になっています。これは PostHog を使用し、生のホスト名ではなくハッシュ化されたインストール識別子を使用します。無効化するには `OMO_SEND_ANONYMOUS_TELEMETRY=0` または `OMO_DISABLE_POSTHOG=1` を設定してください。[プライバシーポリシー](docs/legal/privacy-policy.md)と[利用規約](docs/legal/terms-of-service.md)をご覧ください。
120
+ 匿名のテレメトリは、アクティブなインストール数(DAU/WAU/MAU)の集計のためにデフォルトで有効になっています。マシン1台につきUTC日あたり最大1回イベントが送信され、ハッシュ化されたインストール識別子を使用し、生のホスト名は使用せず、PostHog person profile も作成されません。無効化するには `OMO_SEND_ANONYMOUS_TELEMETRY=0` または `OMO_DISABLE_POSTHOG=1` を設定してください。[プライバシーポリシー](docs/legal/privacy-policy.md)と[利用規約](docs/legal/terms-of-service.md)をご覧ください。
121
121
 
122
122
  ---
123
123
 
package/README.ko.md CHANGED
@@ -111,7 +111,7 @@ curl -s https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/head
111
111
 
112
112
  **참고**: 배포된 패키지와 바이너리 이름은 `oh-my-opencode`를 사용하세요. `opencode.json` 내부에서는 호환성 레이어가 이제 플러그인 엔트리 `oh-my-openagent`를 우선시하며, 레거시 `oh-my-opencode` 엔트리는 경고와 함께 여전히 로드됩니다. 플러그인 설정 파일은 여전히 일반적으로 `oh-my-opencode.json` 또는 `oh-my-opencode.jsonc`를 사용하며, 전환 기간 동안 레거시와 변경된 basename 모두 인식됩니다.
113
113
 
114
- 익명 텔레메트리는 설치 런타임 안정성 개선을 위해 기본적으로 활성화되어 있습니다. PostHog를 사용하며 해시된 설치 식별자를 사용하고 원시 호스트명은 절대 사용하지 않습니다. `OMO_SEND_ANONYMOUS_TELEMETRY=0` 또는 `OMO_DISABLE_POSTHOG=1`로 비활성화할 수 있습니다. [개인정보처리방침](docs/legal/privacy-policy.md)과 [서비스 이용약관](docs/legal/terms-of-service.md)을 참조하세요.
114
+ 익명 텔레메트리는 활성 설치 수(DAU/WAU/MAU) 집계를 위해 기본적으로 활성화되어 있습니다. 머신당 UTC 하루에 최대 1회만 이벤트가 전송되며, 해시된 설치 식별자를 사용하고 원시 호스트명은 절대 사용하지 않으며 PostHog person profile은 생성되지 않습니다. `OMO_SEND_ANONYMOUS_TELEMETRY=0` 또는 `OMO_DISABLE_POSTHOG=1`로 비활성화할 수 있습니다. [개인정보처리방침](docs/legal/privacy-policy.md)과 [서비스 이용약관](docs/legal/terms-of-service.md)을 참조하세요.
115
115
 
116
116
  ---
117
117
 
package/README.md CHANGED
@@ -113,7 +113,7 @@ curl -s https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/head
113
113
 
114
114
  **Note**: Use the published package and binary name `oh-my-opencode`. Inside `opencode.json`, the compatibility layer now prefers the plugin entry `oh-my-openagent`, while legacy `oh-my-opencode` entries still load with a warning. Plugin config files still commonly use `oh-my-opencode.json` or `oh-my-opencode.jsonc`, and both legacy and renamed basenames are recognized during the transition.
115
115
 
116
- Anonymous telemetry is enabled by default to help improve install and runtime reliability. It uses PostHog with a hashed installation identifier, never the raw hostname, and can be disabled with `OMO_SEND_ANONYMOUS_TELEMETRY=0` or `OMO_DISABLE_POSTHOG=1`. See [Privacy Policy](docs/legal/privacy-policy.md) and [Terms of Service](docs/legal/terms-of-service.md).
116
+ Anonymous telemetry is enabled by default to track active installations (DAU/WAU/MAU). A single event is sent at most once per UTC day per machine using a hashed installation identifier, never the raw hostname, and PostHog person profiles are not created. Disable with `OMO_SEND_ANONYMOUS_TELEMETRY=0` or `OMO_DISABLE_POSTHOG=1`. See [Privacy Policy](docs/legal/privacy-policy.md) and [Terms of Service](docs/legal/terms-of-service.md).
117
117
 
118
118
  ---
119
119
 
package/README.ru.md CHANGED
@@ -103,7 +103,7 @@ curl -s https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/head
103
103
 
104
104
  **Примечание**: Используйте опубликованное имя пакета и бинарника `oh-my-opencode`. Внутри `opencode.json` слой совместимости теперь предпочитает точку входа плагина `oh-my-openagent`, в то время как устаревшие записи `oh-my-opencode` все еще загружаются с предупреждением. Файлы конфигурации плагина по-прежнему часто используют `oh-my-opencode.json` или `oh-my-opencode.jsonc`, и как устаревшие, так и переименованные базовые имена распознаются во время переходного периода.
105
105
 
106
- Анонимная телеметрия включена по умолчанию для улучшения надежности установки и работы. Она использует PostHog с хешированным идентификатором установки, никогда не используя исходное имя хоста, и может быть отключена с помощью `OMO_SEND_ANONYMOUS_TELEMETRY=0` или `OMO_DISABLE_POSTHOG=1`. См. [Политику конфиденциальности](docs/legal/privacy-policy.md) и [Условия обслуживания](docs/legal/terms-of-service.md).
106
+ Анонимная телеметрия включена по умолчанию для подсчёта активных установок (DAU/WAU/MAU). Не более одного события на машину за UTC-сутки, использует хешированный идентификатор установки, никогда не использует исходное имя хоста, и не создаёт PostHog person profile. Можно отключить через `OMO_SEND_ANONYMOUS_TELEMETRY=0` или `OMO_DISABLE_POSTHOG=1`. См. [Политику конфиденциальности](docs/legal/privacy-policy.md) и [Условия обслуживания](docs/legal/terms-of-service.md).
107
107
 
108
108
  ------
109
109
 
package/README.zh-cn.md CHANGED
@@ -118,7 +118,7 @@ curl -s https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/head
118
118
 
119
119
  **注意**:请使用已发布的包名和二进制名 `oh-my-opencode`。在 `opencode.json` 中,兼容性层现在优先使用插件入口 `oh-my-openagent`,而旧的 `oh-my-opencode` 条目仍会加载并显示警告。插件配置文件通常仍使用 `oh-my-opencode.json` 或 `oh-my-opencode.jsonc`,在过渡期间新旧两种文件名都会被识别。
120
120
 
121
- 匿名遥测默认开启,用于帮助提升安装和运行时的可靠性。它使用 PostHog,并采用哈希化的安装标识符,绝不会使用原始主机名,可通过 `OMO_SEND_ANONYMOUS_TELEMETRY=0` 或 `OMO_DISABLE_POSTHOG=1` 禁用。详见 [隐私政策](docs/legal/privacy-policy.md) 和 [服务条款](docs/legal/terms-of-service.md)。
121
+ 匿名遥测默认开启,用于统计活跃安装数(DAU/WAU/MAU)。每台机器每个 UTC 日最多发送一次事件,使用哈希化的安装标识符,绝不会使用原始主机名,且不会创建 PostHog person profile。可通过 `OMO_SEND_ANONYMOUS_TELEMETRY=0` 或 `OMO_DISABLE_POSTHOG=1` 禁用。详见 [隐私政策](docs/legal/privacy-policy.md) 和 [服务条款](docs/legal/terms-of-service.md)。
122
122
 
123
123
  ---
124
124
 
@@ -1,12 +1,6 @@
1
1
  /**
2
- * GPT-5.5 Hephaestus prompt - outcome-first, manual-QA-gated.
3
- *
4
- * Lifts Sisyphus's "FULL DELEGATION -> FULL MANUAL QA" rule into
5
- * the Delegation Contract: on every delegated task, re-read code,
6
- * run lsp/tests, and drive the artifact through its matching
7
- * surface (interactive_bash for TUI/CLI, playwright for browser,
8
- * curl for HTTP, driver script for library). Decision rules over
9
- * absolutes; hard invariants live in Stop Rules.
2
+ * GPT-5.5 Hephaestus prompt - outcome-first autonomous deep worker,
3
+ * gated on personal manual QA of the artifact through its surface.
10
4
  */
11
5
  import type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory } from "../dynamic-agent-prompt-builder";
12
- export declare function buildGpt55HephaestusPrompt(_availableAgents: AvailableAgent[], _availableTools?: AvailableTool[], _availableSkills?: AvailableSkill[], _availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
6
+ export declare function buildGpt55HephaestusPrompt(availableAgents: AvailableAgent[], _availableTools?: AvailableTool[], availableSkills?: AvailableSkill[], availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
@@ -1,20 +1,6 @@
1
1
  /**
2
- * GPT-5.5 native Sisyphus prompt - ground-up rewrite styled after OpenAI Codex's
3
- * gpt-5.4 prompt architecture, tuned for GPT-5.5 instruction following.
4
- *
5
- * Design principles (from drafts/gpt-5-5/sisyphus.md):
6
- * - Codex-style section structure: `# General` -> `## Autonomy and Persistence`
7
- * -> `## Task execution` -> `## Validating your work` -> `# Working with the user`
8
- * -> `# Tool Guidelines`.
9
- * - Single `{{ personality }}` slot for per-user persona variants (default /
10
- * friendly / pragmatic). Empty string today; reserved for future substitution.
11
- * - `{{ taskSystemGuide }}` slot switches between todo-based and task-based
12
- * tracking tools depending on harness configuration.
13
- * - Prose-first output, bullets only when content is inherently list-shaped.
14
- * - Contract frames (not threat frames). GPT-5.5 follows instructions well.
15
- * - Explicit opener blacklist to block "Done -", "Got it", "Great question", etc.
16
- * - Agent identity XML block is prepended to override OpenCode's default
17
- * "You are Claude" system prompt.
2
+ * GPT-5.5 Sisyphus prompt - orchestrator that delegates work, supervises
3
+ * execution, and ships verified outcomes through the right specialists.
18
4
  */
19
5
  import type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory } from "../dynamic-agent-prompt-builder";
20
- export declare function buildGpt55SisyphusPrompt(_model: string, _availableAgents: AvailableAgent[], _availableTools?: AvailableTool[], _availableSkills?: AvailableSkill[], _availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
6
+ export declare function buildGpt55SisyphusPrompt(model: string, availableAgents: AvailableAgent[], _availableTools?: AvailableTool[], availableSkills?: AvailableSkill[], availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
@@ -1,14 +1,5 @@
1
1
  /**
2
- * GPT-5.5 native Sisyphus-Junior prompt - ground-up rewrite styled after
3
- * OpenAI Codex's gpt-5.4 prompt architecture, tuned for GPT-5.5.
4
- *
5
- * Derived from drafts/gpt-5-5/sisyphus-junior.md (reviewed 2026-04).
6
- *
7
- * Why a separate module: Sisyphus-Junior is the category-spawned counterpart
8
- * to Hephaestus. The base prompt is category-agnostic; the actual category
9
- * context (deep, quick, ultrabrain, writing) is appended at runtime via the
10
- * `promptAppend` parameter. GPT-5.5 is expected to integrate the category
11
- * context and base instructions coherently without explicit framing beyond
12
- * the "Category context" closing section.
2
+ * GPT-5.5 Sisyphus-Junior prompt - focused executor for orchestrator-routed
3
+ * categorized tasks, gated on personal manual QA of the artifact's surface.
13
4
  */
14
5
  export declare function buildGpt55SisyphusJuniorPrompt(useTaskSystem: boolean, promptAppend?: string): string;
@@ -0,0 +1,12 @@
1
+ import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
2
+ import type { BackgroundTask, BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
3
+ type TerminalAttemptStatus = Extract<BackgroundTaskStatus, "completed" | "error" | "cancelled" | "interrupt">;
4
+ export declare function getCurrentAttempt(task: BackgroundTask): BackgroundTaskAttempt | undefined;
5
+ export declare function ensureCurrentAttempt(task: BackgroundTask, model?: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
6
+ export declare function projectTaskFromCurrentAttempt(task: BackgroundTask): BackgroundTask;
7
+ export declare function startAttempt(task: BackgroundTask, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
8
+ export declare function bindAttemptSession(task: BackgroundTask, attemptID: string, sessionID: string, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt | undefined;
9
+ export declare function finalizeAttempt(task: BackgroundTask, attemptID: string, status: TerminalAttemptStatus, error?: string): BackgroundTaskAttempt | undefined;
10
+ export declare function scheduleRetryAttempt(task: BackgroundTask, failedAttemptID: string, nextModel: DelegatedModelConfig, error?: string): BackgroundTaskAttempt | undefined;
11
+ export declare function findAttemptBySession(task: BackgroundTask, sessionID: string): BackgroundTaskAttempt | undefined;
12
+ export {};
@@ -1,10 +1,11 @@
1
- import type { BackgroundTaskStatus } from "./types";
1
+ import type { BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
2
2
  export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED" | "ERROR";
3
3
  export interface BackgroundTaskNotificationTask {
4
4
  id: string;
5
5
  description: string;
6
6
  status: BackgroundTaskStatus;
7
7
  error?: string;
8
+ attempts?: BackgroundTaskAttempt[];
8
9
  }
9
10
  export declare function buildBackgroundTaskNotificationText(input: {
10
11
  task: BackgroundTaskNotificationTask;
@@ -39,6 +39,7 @@ export interface Todo {
39
39
  id?: string;
40
40
  }
41
41
  export interface QueueItem {
42
+ attemptID: string;
42
43
  task: BackgroundTask;
43
44
  input: LaunchInput;
44
45
  }
@@ -13,4 +13,12 @@ export declare function tryFallbackRetry(args: {
13
13
  idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
14
14
  queuesByKey: Map<string, QueueItem[]>;
15
15
  processKey: (key: string) => void;
16
+ onRetrying?: (details: {
17
+ task: BackgroundTask;
18
+ source: string;
19
+ previousSessionID?: string;
20
+ failedModel?: string;
21
+ failedError?: string;
22
+ nextModel: string;
23
+ }) => void;
16
24
  }): Promise<boolean>;
@@ -1,4 +1,5 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
2
3
  import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
3
4
  import { TaskHistory } from "./task-history";
4
5
  import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
@@ -20,8 +21,18 @@ export interface SubagentSessionCreatedEvent {
20
21
  title: string;
21
22
  }
22
23
  export type OnSubagentSessionCreated = (event: SubagentSessionCreatedEvent) => Promise<void>;
24
+ export interface BackgroundManagerConfig {
25
+ pluginContext: PluginInput;
26
+ config?: BackgroundTaskConfig;
27
+ tmuxConfig?: TmuxConfig;
28
+ onSubagentSessionCreated?: OnSubagentSessionCreated;
29
+ onShutdown?: () => void | Promise<void>;
30
+ enableParentSessionNotifications?: boolean;
31
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
32
+ }
23
33
  export declare class BackgroundManager {
24
34
  private tasks;
35
+ private tasksByParentSession;
25
36
  private notifications;
26
37
  private pendingNotifications;
27
38
  private pendingByParent;
@@ -46,14 +57,11 @@ export declare class BackgroundManager {
46
57
  private rootDescendantCounts;
47
58
  private preStartDescendantReservations;
48
59
  private enableParentSessionNotifications;
60
+ private modelFallbackControllerAccessor?;
61
+ private loggedSessionStatusUnavailable;
49
62
  readonly taskHistory: TaskHistory;
50
63
  private cachedCircuitBreakerSettings?;
51
- constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
52
- tmuxConfig?: TmuxConfig;
53
- onSubagentSessionCreated?: OnSubagentSessionCreated;
54
- onShutdown?: () => void | Promise<void>;
55
- enableParentSessionNotifications?: boolean;
56
- });
64
+ constructor(config: BackgroundManagerConfig);
57
65
  private abortSessionWithLogging;
58
66
  assertCanSpawn(parentSessionID: string): Promise<SubagentSpawnContext>;
59
67
  reserveSubagentSpawn(parentSessionID: string): Promise<{
@@ -67,6 +75,10 @@ export declare class BackgroundManager {
67
75
  private markPreStartDescendantReservation;
68
76
  private settlePreStartDescendantReservation;
69
77
  private rollbackPreStartDescendantReservation;
78
+ private addTask;
79
+ private removeTask;
80
+ private updateTaskParent;
81
+ private removeTaskFromParentIndex;
70
82
  launch(input: LaunchInput): Promise<BackgroundTask>;
71
83
  private processKey;
72
84
  private startTask;
@@ -74,6 +86,7 @@ export declare class BackgroundManager {
74
86
  getTasksByParentSession(sessionID: string): BackgroundTask[];
75
87
  getAllDescendantTasks(sessionID: string): BackgroundTask[];
76
88
  findBySession(sessionID: string): BackgroundTask | undefined;
89
+ private resolveTaskAttemptBySession;
77
90
  private getConcurrencyKeyFromInput;
78
91
  /**
79
92
  * Track a task created elsewhere (e.g., from task) for notification tracking.
@@ -81,8 +94,8 @@ export declare class BackgroundManager {
81
94
  */
82
95
  trackTask(input: {
83
96
  taskId: string;
84
- sessionID: string;
85
- parentSessionID: string;
97
+ sessionId: string;
98
+ parentSessionId: string;
86
99
  description: string;
87
100
  agent?: string;
88
101
  parentAgent?: string;
@@ -16,12 +16,25 @@ export interface TaskProgress {
16
16
  lastMessage?: string;
17
17
  lastMessageAt?: Date;
18
18
  }
19
+ export type BackgroundTaskAttemptStatus = BackgroundTaskStatus;
20
+ export interface BackgroundTaskAttempt {
21
+ attemptId: string;
22
+ attemptNumber: number;
23
+ sessionId?: string;
24
+ providerId?: string;
25
+ modelId?: string;
26
+ variant?: string;
27
+ status: BackgroundTaskAttemptStatus;
28
+ error?: string;
29
+ startedAt?: Date;
30
+ completedAt?: Date;
31
+ }
19
32
  export interface BackgroundTask {
20
33
  id: string;
21
- sessionID?: string;
22
- rootSessionID?: string;
23
- parentSessionID: string;
24
- parentMessageID: string;
34
+ sessionId?: string;
35
+ rootSessionId?: string;
36
+ parentSessionId: string;
37
+ parentMessageId: string;
25
38
  description: string;
26
39
  prompt: string;
27
40
  agent: string;
@@ -54,6 +67,17 @@ export interface BackgroundTask {
54
67
  isUnstableAgent?: boolean;
55
68
  /** Category used for this task (e.g., 'quick', 'visual-engineering') */
56
69
  category?: string;
70
+ /** Pending retry notification details for the next spawned retry session */
71
+ retryNotification?: {
72
+ previousSessionID?: string;
73
+ failedModel?: string;
74
+ failedError?: string;
75
+ nextModel: string;
76
+ };
77
+ /** Structured attempt history for retry observability */
78
+ attempts?: BackgroundTaskAttempt[];
79
+ /** ID of the currently active attempt */
80
+ currentAttemptID?: string;
57
81
  /** Last message count for stability detection */
58
82
  lastMsgCount?: number;
59
83
  /** Number of consecutive polls with stable message count */
@@ -65,8 +89,8 @@ export interface LaunchInput {
65
89
  description: string;
66
90
  prompt: string;
67
91
  agent: string;
68
- parentSessionID: string;
69
- parentMessageID: string;
92
+ parentSessionId: string;
93
+ parentMessageId: string;
70
94
  parentModel?: {
71
95
  providerID: string;
72
96
  modelID: string;
@@ -85,8 +109,8 @@ export interface LaunchInput {
85
109
  export interface ResumeInput {
86
110
  sessionId: string;
87
111
  prompt: string;
88
- parentSessionID: string;
89
- parentMessageID: string;
112
+ parentSessionId: string;
113
+ parentMessageId: string;
90
114
  parentModel?: {
91
115
  providerID: string;
92
116
  modelID: string;
@@ -4,7 +4,7 @@ type AbortSignalLike = {
4
4
  };
5
5
  interface TaskReader {
6
6
  getTask(taskID: string): {
7
- sessionID?: string;
7
+ sessionId?: string;
8
8
  status?: BackgroundTaskStatus;
9
9
  } | undefined;
10
10
  }
@@ -0,0 +1,8 @@
1
+ import { type TeamSpec } from "./types";
2
+ export type CallerTeamLead = {
3
+ agentTypeId?: string;
4
+ displayName?: string;
5
+ isEligibleForTeamLead: boolean;
6
+ };
7
+ export declare function resolveCallerTeamLead(rawAgentName: string | undefined): CallerTeamLead;
8
+ export declare function shouldReuseCallerLeadSession(spec: TeamSpec, callerAgentTypeId: string | undefined): boolean;
@@ -175,8 +175,8 @@ export declare const RuntimeStateSchema: z.ZodObject<{
175
175
  completed: "completed";
176
176
  running: "running";
177
177
  idle: "idle";
178
- errored: "errored";
179
178
  shutdown_approved: "shutdown_approved";
179
+ errored: "errored";
180
180
  }>;
181
181
  color: z.ZodOptional<z.ZodString>;
182
182
  worktreePath: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import { existsSync } from "node:fs";
3
3
  import { join } from "node:path";
4
- import { runBunInstallWithDetails } from "../../../cli/config-manager";
4
+ import { runBunInstallWithDetails } from "../../../shared/bun-install";
5
5
  import { log } from "../../../shared/logger";
6
6
  import { getOpenCodeCacheDir, getOpenCodeConfigPaths } from "../../../shared";
7
7
  import { invalidatePackage } from "../cache";
@@ -9,4 +9,4 @@
9
9
  * - Vietnamese: phân tích, điều tra, nghiên cứu, kiểm tra, xem xét, chẩn đoán, giải thích, tìm hiểu, gỡ lỗi, tại sao
10
10
  */
11
11
  export declare const ANALYZE_PATTERN: RegExp;
12
- export declare const ANALYZE_MESSAGE = "[analyze-mode]\nANALYSIS MODE. Gather context before diving deep:\n\nCONTEXT GATHERING (parallel):\n- 1-2 explore agents (codebase patterns, implementations)\n- 1-2 librarian agents (if external library involved)\n- Direct tools: Grep, AST-grep, LSP for targeted searches\n\nIF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:\n- **Oracle**: Conventional problems (architecture, debugging, complex logic)\n- **Artistry**: Non-conventional problems (different approach needed)\n\nSYNTHESIZE findings before proceeding.\n---\nMANDATORY task params: ALWAYS include load_skills=[] and run_in_background when calling task.\nExample: task(subagent_type=\"explore\", prompt=\"...\", run_in_background=true, load_skills=[])";
12
+ export declare const ANALYZE_MESSAGE = "[analyze-mode]\nANALYSIS MODE. Gather context before diving deep:\n\nCONTEXT GATHERING (parallel):\n- 1-2 explore agents (codebase patterns, implementations)\n- 1-2 librarian agents (if external library involved)\n- Direct tools: Grep, AST-grep, LSP for targeted searches\n\nIF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:\n- **Oracle**: Conventional problems (architecture, debugging, complex logic)\n- **Artistry**: Non-conventional problems (different approach needed)\n\nSYNTHESIZE findings before proceeding.\n---\nMANDATORY task params: ALWAYS include load_skills and run_in_background when calling task. Evaluate available skills before dispatch - pass task-appropriate skills when relevant, pass [] ONLY when no skill matches the task domain.\nExample: task(subagent_type=\"explore\", prompt=\"...\", run_in_background=true, load_skills=[])";
@@ -3,6 +3,7 @@ import type { ModelFallbackStateController } from "./fallback-state-controller";
3
3
  export type ModelFallbackControllerAccessor = {
4
4
  register: (controller: ModelFallbackStateController) => void;
5
5
  setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
6
+ getSessionFallbackChain: (sessionID: string) => FallbackEntry[] | undefined;
6
7
  clearSessionFallbackChain: (sessionID: string) => void;
7
8
  };
8
9
  export declare function createModelFallbackControllerAccessor(): ModelFallbackControllerAccessor;
@@ -10,6 +10,7 @@ type ModelFallbackStateLike = {
10
10
  export type ModelFallbackStateController = {
11
11
  lastToastKey: Map<string, string>;
12
12
  setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
13
+ getSessionFallbackChain: (sessionID: string) => FallbackEntry[] | undefined;
13
14
  clearSessionFallbackChain: (sessionID: string) => void;
14
15
  setPendingModelFallback: (sessionID: string, agentName: string, currentProviderID: string, currentModelID: string) => boolean;
15
16
  getNextFallback: (sessionID: string) => ReturnType<typeof getNextReachableFallback>;
@@ -21,7 +21,7 @@ export type ModelFallbackState = {
21
21
  attemptCount: number;
22
22
  pending: boolean;
23
23
  };
24
- type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
24
+ type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "getSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
25
25
  export type ModelFallbackHook = ModelFallbackControllerWithState & {
26
26
  "chat.message": (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
27
27
  };
@@ -32,6 +32,7 @@ type ModelFallbackHookArgs = {
32
32
  };
33
33
  export declare function setSessionFallbackChain(controller: Pick<ModelFallbackStateController, "setSessionFallbackChain">, sessionID: string, fallbackChain: FallbackEntry[] | undefined): void;
34
34
  export declare function clearSessionFallbackChain(controller: Pick<ModelFallbackStateController, "clearSessionFallbackChain">, sessionID: string): void;
35
+ export declare function getSessionFallbackChain(controller: Pick<ModelFallbackStateController, "getSessionFallbackChain">, sessionID: string): FallbackEntry[] | undefined;
35
36
  /**
36
37
  * Sets a pending model fallback for a session.
37
38
  * Called when a model error is detected in session.error handler.
@@ -40,6 +40,7 @@ interface ClientLike {
40
40
  export interface AssistantCompactionMessageInfo {
41
41
  sessionID: string;
42
42
  id?: string;
43
+ parts?: unknown;
43
44
  }
44
45
  export declare function createPostCompactionDegradationMonitor(args: {
45
46
  client: ClientLike;
@@ -15,4 +15,5 @@ export declare function resolveNoTextTailFromSession(args: {
15
15
  sessionID: string;
16
16
  messageID?: string;
17
17
  directory: string;
18
+ parts?: unknown;
18
19
  }): Promise<boolean>;
@@ -0,0 +1,7 @@
1
+ export declare function createLoopSessionRecovery(options?: {
2
+ recoveryWindowMs?: number;
3
+ }): {
4
+ isRecovering(sessionID: string): boolean;
5
+ markRecovering(sessionID: string): void;
6
+ clear(sessionID: string): void;
7
+ };
@@ -1,5 +1,4 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { Platform } from "./session-notification-sender";
3
2
  type SessionNotificationConfig = {
4
3
  playSound: boolean;
5
4
  soundPath: string;
@@ -11,11 +10,10 @@ type SessionNotificationConfig = {
11
10
  };
12
11
  export declare function createIdleNotificationScheduler(options: {
13
12
  ctx: PluginInput;
14
- platform: Platform;
15
13
  config: SessionNotificationConfig;
16
14
  hasIncompleteTodos: (ctx: PluginInput, sessionID: string) => Promise<boolean>;
17
- send: (ctx: PluginInput, platform: Platform, sessionID: string) => Promise<void>;
18
- playSound: (ctx: PluginInput, platform: Platform, soundPath: string) => Promise<void>;
15
+ send: (ctx: PluginInput, sessionID: string) => Promise<void>;
16
+ playSound: (ctx: PluginInput, soundPath: string) => Promise<void>;
19
17
  }): {
20
18
  markSessionActivity: (sessionID: string) => void;
21
19
  scheduleIdleNotification: (sessionID: string) => void;
@@ -6,5 +6,6 @@ export declare const getAfplayPath: () => Promise<string | null>;
6
6
  export declare const getPaplayPath: () => Promise<string | null>;
7
7
  export declare const getAplayPath: () => Promise<string | null>;
8
8
  export declare const getTerminalNotifierPath: () => Promise<string | null>;
9
+ export declare const getCmuxPath: () => Promise<string | null>;
9
10
  export declare function startBackgroundCheck(platform: Platform): void;
10
11
  export {};