@wolfx/oh-my-openagent 3.17.15 → 4.1.1

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 (225) hide show
  1. package/README.ja.md +178 -113
  2. package/README.ko.md +221 -149
  3. package/README.md +79 -51
  4. package/README.ru.md +118 -71
  5. package/README.zh-cn.md +139 -73
  6. package/dist/agents/agent-skill-resolution.d.ts +1 -0
  7. package/dist/agents/atlas/agent.d.ts +7 -12
  8. package/dist/agents/atlas/default-prompt-sections.d.ts +5 -5
  9. package/dist/agents/atlas/gemini-prompt-sections.d.ts +4 -4
  10. package/dist/agents/atlas/gpt-prompt-sections.d.ts +5 -5
  11. package/dist/agents/atlas/kimi-prompt-sections.d.ts +6 -0
  12. package/dist/agents/atlas/kimi.d.ts +2 -0
  13. package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +6 -0
  14. package/dist/agents/atlas/opus-4-7.d.ts +2 -0
  15. package/dist/agents/atlas/shared-prompt.d.ts +1 -1
  16. package/dist/agents/builtin-agents/available-skills.d.ts +1 -1
  17. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  18. package/dist/agents/builtin-agents.d.ts +1 -1
  19. package/dist/agents/dynamic-agent-core-sections.d.ts +1 -0
  20. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  21. package/dist/agents/hephaestus/gpt-5-5.d.ts +0 -4
  22. package/dist/agents/prometheus/plan-generation.d.ts +1 -1
  23. package/dist/agents/types.d.ts +1 -0
  24. package/dist/config/index.d.ts +1 -1
  25. package/dist/config/schema/agent-names.d.ts +1 -0
  26. package/dist/config/schema/agent-overrides.d.ts +45 -0
  27. package/dist/config/schema/categories.d.ts +7 -1
  28. package/dist/config/schema/commands.d.ts +1 -0
  29. package/dist/config/schema/fallback-models.d.ts +5 -0
  30. package/dist/config/schema/hooks.d.ts +2 -0
  31. package/dist/config/schema/keyword-detector.d.ts +21 -0
  32. package/dist/config/schema/oh-my-opencode-config.d.ts +71 -0
  33. package/dist/config/schema/team-mode.d.ts +16 -0
  34. package/dist/config/schema.d.ts +2 -0
  35. package/dist/create-hooks.d.ts +4 -0
  36. package/dist/create-managers.d.ts +2 -0
  37. package/dist/features/background-agent/manager.d.ts +13 -0
  38. package/dist/features/background-agent/spawner.d.ts +4 -2
  39. package/dist/features/background-agent/task-poller.d.ts +1 -0
  40. package/dist/features/background-agent/types.d.ts +5 -0
  41. package/dist/features/boulder-state/format-duration.d.ts +1 -0
  42. package/dist/features/boulder-state/index.d.ts +1 -0
  43. package/dist/features/boulder-state/storage.d.ts +40 -1
  44. package/dist/features/boulder-state/types.d.ts +43 -0
  45. package/dist/features/builtin-commands/commands.d.ts +1 -0
  46. package/dist/features/builtin-commands/templates/hyperplan.d.ts +1 -0
  47. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
  48. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
  49. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  50. package/dist/features/builtin-commands/types.d.ts +1 -1
  51. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  52. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
  53. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
  54. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
  55. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
  56. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  57. package/dist/features/builtin-skills/skills/team-mode.d.ts +2 -0
  58. package/dist/features/builtin-skills/skills.d.ts +1 -0
  59. package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -0
  60. package/dist/features/hook-message-injector/injector.d.ts +2 -2
  61. package/dist/features/opencode-skill-loader/loader.d.ts +2 -2
  62. package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -0
  63. package/dist/features/team-mode/deps.d.ts +6 -0
  64. package/dist/features/team-mode/member-guidance.d.ts +2 -0
  65. package/dist/features/team-mode/member-parser.d.ts +16 -0
  66. package/dist/features/team-mode/member-session-resolution.d.ts +6 -0
  67. package/dist/features/team-mode/member-session-routing.d.ts +19 -0
  68. package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +4 -0
  69. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +26 -6
  70. package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +9 -0
  71. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +7 -0
  72. package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +8 -0
  73. package/dist/features/team-mode/team-mailbox/ack.d.ts +2 -0
  74. package/dist/features/team-mode/team-mailbox/inbox.d.ts +3 -0
  75. package/dist/features/team-mode/team-mailbox/index.d.ts +7 -0
  76. package/dist/features/team-mode/team-mailbox/poll.d.ts +10 -0
  77. package/dist/features/team-mode/team-mailbox/reservation.d.ts +11 -0
  78. package/dist/features/team-mode/team-mailbox/send.d.ts +27 -0
  79. package/dist/features/team-mode/team-registry/index.d.ts +3 -0
  80. package/dist/features/team-mode/team-registry/loader.d.ts +12 -0
  81. package/dist/features/team-mode/team-registry/paths.d.ts +13 -0
  82. package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +6 -0
  83. package/dist/features/team-mode/team-registry/validator.d.ts +10 -0
  84. package/dist/features/team-mode/team-runtime/activate-team-layout.d.ts +4 -0
  85. package/dist/features/team-mode/team-runtime/cleanup-team-run-resources.d.ts +17 -0
  86. package/dist/features/team-mode/team-runtime/create.d.ts +25 -0
  87. package/dist/features/team-mode/team-runtime/delete-team.d.ts +16 -0
  88. package/dist/features/team-mode/team-runtime/index.d.ts +2 -0
  89. package/dist/features/team-mode/team-runtime/resolve-member-dependencies.d.ts +3 -0
  90. package/dist/features/team-mode/team-runtime/resolve-member.d.ts +17 -0
  91. package/dist/features/team-mode/team-runtime/session-cleanup.d.ts +21 -0
  92. package/dist/features/team-mode/team-runtime/session-team-run-registry.d.ts +4 -0
  93. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +11 -0
  94. package/dist/features/team-mode/team-runtime/shutdown-test-fixtures.d.ts +46 -0
  95. package/dist/features/team-mode/team-runtime/shutdown.d.ts +5 -0
  96. package/dist/features/team-mode/team-runtime/status.d.ts +36 -0
  97. package/dist/features/team-mode/team-session-registry.d.ts +11 -0
  98. package/dist/features/team-mode/team-state-store/index.d.ts +1 -0
  99. package/dist/features/team-mode/team-state-store/locks.d.ts +12 -0
  100. package/dist/features/team-mode/team-state-store/resume.d.ts +10 -0
  101. package/dist/features/team-mode/team-state-store/store.d.ts +21 -0
  102. package/dist/features/team-mode/team-tasklist/claim.d.ts +10 -0
  103. package/dist/features/team-mode/team-tasklist/dependencies.d.ts +2 -0
  104. package/dist/features/team-mode/team-tasklist/get.d.ts +3 -0
  105. package/dist/features/team-mode/team-tasklist/index.d.ts +6 -0
  106. package/dist/features/team-mode/team-tasklist/list.d.ts +8 -0
  107. package/dist/features/team-mode/team-tasklist/store.d.ts +3 -0
  108. package/dist/features/team-mode/team-tasklist/test-support.d.ts +9 -0
  109. package/dist/features/team-mode/team-tasklist/update.d.ts +9 -0
  110. package/dist/features/team-mode/tools/index.d.ts +1 -0
  111. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +188 -0
  112. package/dist/features/team-mode/tools/lifecycle.d.ts +37 -0
  113. package/dist/features/team-mode/tools/messaging.d.ts +31 -0
  114. package/dist/features/team-mode/tools/query.d.ts +16 -0
  115. package/dist/features/team-mode/tools/tasks.d.ts +18 -0
  116. package/dist/features/team-mode/types.d.ts +137 -5
  117. package/dist/features/tmux-subagent/action-executor-core.d.ts +1 -0
  118. package/dist/features/tmux-subagent/action-executor.d.ts +1 -0
  119. package/dist/features/tmux-subagent/attachable-session-status.d.ts +4 -0
  120. package/dist/features/tmux-subagent/cleanup.d.ts +10 -0
  121. package/dist/features/tmux-subagent/manager.d.ts +32 -3
  122. package/dist/features/tmux-subagent/pane-state-querier.d.ts +10 -0
  123. package/dist/features/tmux-subagent/polling.d.ts +1 -0
  124. package/dist/features/tmux-subagent/session-created-handler.d.ts +23 -0
  125. package/dist/features/tmux-subagent/session-deleted-handler.d.ts +16 -0
  126. package/dist/hooks/atlas/atlas-hook.d.ts +1 -1
  127. package/dist/hooks/atlas/boulder-continuation-injector.d.ts +3 -4
  128. package/dist/hooks/atlas/recent-model-resolver.d.ts +9 -1
  129. package/dist/hooks/atlas/system-reminder-templates.d.ts +1 -0
  130. package/dist/hooks/atlas/tool-execute-after.d.ts +3 -1
  131. package/dist/hooks/atlas/tool-execute-before.d.ts +2 -0
  132. package/dist/hooks/atlas/types.d.ts +10 -2
  133. package/dist/hooks/compaction-context-injector/recovery.d.ts +1 -1
  134. package/dist/hooks/compaction-context-injector/types.d.ts +1 -0
  135. package/dist/hooks/compaction-todo-preserver/hook.d.ts +11 -0
  136. package/dist/hooks/fsync-skip-warning/index.d.ts +18 -0
  137. package/dist/hooks/index.d.ts +4 -0
  138. package/dist/hooks/keyword-detector/constants.d.ts +6 -0
  139. package/dist/hooks/keyword-detector/detector.d.ts +5 -3
  140. package/dist/hooks/keyword-detector/hook.d.ts +2 -1
  141. package/dist/hooks/keyword-detector/hyperplan/default.d.ts +13 -0
  142. package/dist/hooks/keyword-detector/hyperplan/index.d.ts +1 -0
  143. package/dist/hooks/keyword-detector/team/default.d.ts +13 -0
  144. package/dist/hooks/keyword-detector/team/index.d.ts +1 -0
  145. package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +7 -1
  146. package/dist/hooks/ralph-loop/iteration-continuation.d.ts +9 -1
  147. package/dist/hooks/ralph-loop/loop-state-controller.d.ts +1 -0
  148. package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +3 -0
  149. package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +2 -0
  150. package/dist/hooks/ralph-loop/types.d.ts +1 -0
  151. package/dist/hooks/ralph-loop/verification-failure-handler.d.ts +3 -1
  152. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +2 -2
  153. package/dist/hooks/shared/session-idle-settle.d.ts +11 -0
  154. package/dist/hooks/team-mailbox-injector/hook.d.ts +31 -0
  155. package/dist/hooks/team-mailbox-injector/index.d.ts +2 -0
  156. package/dist/hooks/team-mode-status-injector/hook.d.ts +28 -0
  157. package/dist/hooks/team-mode-status-injector/index.d.ts +1 -0
  158. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +42 -0
  159. package/dist/hooks/team-session-events/team-lead-orphan-handler.d.ts +12 -0
  160. package/dist/hooks/team-session-events/team-member-error-handler.d.ts +10 -0
  161. package/dist/hooks/team-session-events/team-member-status-handler.d.ts +10 -0
  162. package/dist/hooks/team-tool-gating/hook.d.ts +3 -0
  163. package/dist/hooks/team-tool-gating/index.d.ts +1 -0
  164. package/dist/hooks/todo-description-override/description.d.ts +1 -1
  165. package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
  166. package/dist/hooks/write-existing-file-guard/hook.d.ts +6 -1
  167. package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -0
  168. package/dist/index.js +93264 -81453
  169. package/dist/oh-my-opencode.schema.json +199 -47
  170. package/dist/plugin/hooks/create-core-hooks.d.ts +4 -0
  171. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +3 -1
  172. package/dist/plugin/hooks/create-transform-hooks.d.ts +3 -1
  173. package/dist/plugin/recent-synthetic-idles.d.ts +1 -0
  174. package/dist/plugin/session-compacting.d.ts +31 -0
  175. package/dist/plugin/tool-registry.d.ts +16 -0
  176. package/dist/plugin-dispose.d.ts +13 -0
  177. package/dist/plugin-handlers/agent-priority-order.d.ts +6 -6
  178. package/dist/shared/agent-ordering.d.ts +8 -0
  179. package/dist/shared/agent-sort-shim.d.ts +8 -8
  180. package/dist/shared/agent-tool-restrictions.d.ts +5 -1
  181. package/dist/shared/bun-file-shim.d.ts +8 -0
  182. package/dist/shared/bun-hash-shim.d.ts +1 -0
  183. package/dist/shared/bun-spawn-shim.d.ts +1 -0
  184. package/dist/shared/bun-which-shim.d.ts +1 -0
  185. package/dist/shared/classify-path-environment.d.ts +3 -0
  186. package/dist/shared/event-session-id.d.ts +2 -0
  187. package/dist/shared/extract-semver.d.ts +1 -0
  188. package/dist/shared/fsync-skip-tracker.d.ts +12 -0
  189. package/dist/shared/fsync-skip-warning-formatter.d.ts +2 -0
  190. package/dist/shared/index.d.ts +3 -0
  191. package/dist/shared/internal-initiator-marker.d.ts +8 -0
  192. package/dist/shared/model-capability-heuristics.d.ts +1 -0
  193. package/dist/shared/opencode-version.d.ts +14 -1
  194. package/dist/shared/project-discovery-dirs.d.ts +1 -0
  195. package/dist/shared/session-route.d.ts +18 -0
  196. package/dist/shared/shell-env.d.ts +1 -0
  197. package/dist/shared/tmux/cmux-detect.d.ts +8 -0
  198. package/dist/shared/tmux/constants.d.ts +1 -1
  199. package/dist/shared/tmux/index.d.ts +2 -0
  200. package/dist/shared/tmux/runner.d.ts +13 -0
  201. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -1
  202. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +13 -1
  203. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +13 -1
  204. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +9 -2
  205. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +13 -1
  206. package/dist/shared/tmux/tmux-utils.d.ts +1 -1
  207. package/dist/shared/tolerant-fsync.d.ts +5 -0
  208. package/dist/shared/write-file-atomically.d.ts +4 -1
  209. package/dist/tools/call-omo-agent/agent-resolver.d.ts +5 -12
  210. package/dist/tools/call-omo-agent/constants.d.ts +2 -2
  211. package/dist/tools/delegate-task/model-string-parser.d.ts +9 -0
  212. package/dist/tools/delegate-task/openai-categories.d.ts +1 -0
  213. package/dist/tools/delegate-task/resolve-call-id.d.ts +2 -0
  214. package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
  215. package/dist/tools/delegate-task/subagent-resolver.d.ts +5 -1
  216. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -0
  217. package/dist/tools/delegate-task/sync-result-fetcher.d.ts +3 -1
  218. package/dist/tools/delegate-task/types.d.ts +1 -0
  219. package/dist/tools/index.d.ts +1 -0
  220. package/dist/tools/interactive-bash/constants.d.ts +1 -0
  221. package/dist/tools/interactive-bash/tmux-path-resolver.d.ts +1 -0
  222. package/dist/tools/look-at/missing-file-error.d.ts +2 -0
  223. package/dist/tools/skill/types.d.ts +2 -0
  224. package/package.json +3 -4
  225. package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +0 -11
@@ -0,0 +1,7 @@
1
+ export { BroadcastNotPermittedError, DuplicateMessageIdError, PayloadTooLargeError, RecipientBackpressureError, sendMessage, } from "./send";
2
+ export { listUnreadMessages } from "./inbox";
3
+ export { pollAndBuildInjection } from "./poll";
4
+ export type { InjectionResult } from "./poll";
5
+ export { ackMessages } from "./ack";
6
+ export { reserveMessageForDelivery, commitDeliveryReservation, releaseDeliveryReservation, reclaimStaleReservations, } from "./reservation";
7
+ export type { DeliveryReservation } from "./reservation";
@@ -0,0 +1,10 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Message } from "../types";
3
+ export interface InjectionResult {
4
+ injected: boolean;
5
+ content?: string;
6
+ messageIds: string[];
7
+ reason?: string;
8
+ }
9
+ export declare function buildEnvelope(message: Message): string;
10
+ export declare function pollAndBuildInjection(sessionID: string, memberName: string, teamRunId: string, config: TeamModeConfig, turnMarker: string): Promise<InjectionResult>;
@@ -0,0 +1,11 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ export interface DeliveryReservation {
3
+ reservedPath: string;
4
+ inboxPath: string;
5
+ processedPath: string;
6
+ processedDir: string;
7
+ }
8
+ export declare function reserveMessageForDelivery(teamRunId: string, recipientName: string, messageId: string, config: TeamModeConfig): Promise<DeliveryReservation | null>;
9
+ export declare function commitDeliveryReservation(reservation: DeliveryReservation): Promise<void>;
10
+ export declare function releaseDeliveryReservation(reservation: DeliveryReservation): Promise<void>;
11
+ export declare function reclaimStaleReservations(teamRunId: string, recipientName: string, config: TeamModeConfig, staleTtlMs: number): Promise<string[]>;
@@ -0,0 +1,27 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Message } from "../types";
3
+ type SendContext = {
4
+ isLead: boolean;
5
+ activeMembers: string[];
6
+ reservedRecipients?: ReadonlySet<string>;
7
+ };
8
+ export declare class BroadcastNotPermittedError extends Error {
9
+ constructor(message?: string);
10
+ }
11
+ export declare class PayloadTooLargeError extends Error {
12
+ constructor(message?: string);
13
+ }
14
+ export declare class RecipientBackpressureError extends Error {
15
+ constructor(message?: string);
16
+ }
17
+ export declare class DuplicateMessageIdError extends Error {
18
+ constructor(message?: string);
19
+ }
20
+ export declare class TeamDeletingError extends Error {
21
+ constructor(message?: string);
22
+ }
23
+ export declare function sendMessage(message: Message, teamRunId: string, config: TeamModeConfig, context: SendContext): Promise<{
24
+ messageId: string;
25
+ deliveredTo: string[];
26
+ }>;
27
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./paths";
2
+ export * from "./loader";
3
+ export * from "./validator";
@@ -0,0 +1,12 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { NormalizeTeamSpecInputOptions } from "./team-spec-input-normalizer";
3
+ import type { TeamSpec } from "../types";
4
+ export { TeamSpecValidationError } from "./validator";
5
+ export { normalizeTeamSpecInput } from "./team-spec-input-normalizer";
6
+ export declare function loadTeamSpec(teamName: string, config: TeamModeConfig, projectRoot: string, options?: NormalizeTeamSpecInputOptions): Promise<TeamSpec>;
7
+ export declare function loadAllTeamSpecs(config: TeamModeConfig, projectRoot: string): Promise<Array<{
8
+ name: string;
9
+ scope: "project" | "user";
10
+ spec?: TeamSpec;
11
+ error?: Error;
12
+ }>>;
@@ -0,0 +1,13 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ export declare function resolveBaseDir(config: TeamModeConfig): string;
3
+ export declare function getTeamSpecPath(baseDir: string, teamName: string, scope: "user" | "project", projectRoot?: string): string;
4
+ export declare function getRuntimeStateDir(baseDir: string, teamRunId: string): string;
5
+ export declare function getInboxDir(baseDir: string, teamRunId: string, memberName: string): string;
6
+ export declare function getTasksDir(baseDir: string, teamRunId: string): string;
7
+ export declare function getWorktreeDir(baseDir: string, teamRunId: string, memberName: string): string;
8
+ export declare function discoverTeamSpecs(config: TeamModeConfig, projectRoot: string): Promise<Array<{
9
+ name: string;
10
+ scope: "project" | "user";
11
+ path: string;
12
+ }>>;
13
+ export declare function ensureBaseDirs(baseDir: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { CallerTeamLead } from "../resolve-caller-team-lead";
2
+ export type NormalizeTeamSpecInputOptions = {
3
+ callerTeamLead?: CallerTeamLead;
4
+ defaultCategoryName?: string;
5
+ };
6
+ export declare function normalizeTeamSpecInput(raw: unknown, options?: NormalizeTeamSpecInputOptions): unknown;
@@ -0,0 +1,10 @@
1
+ import type { Member, TeamSpec } from "../types";
2
+ export declare class TeamSpecValidationError extends Error {
3
+ readonly code: string;
4
+ readonly field?: string | undefined;
5
+ readonly memberName?: string | undefined;
6
+ constructor(message: string, code: string, field?: string | undefined, memberName?: string | undefined);
7
+ }
8
+ export declare function validateSpec(spec: TeamSpec): void;
9
+ export declare function validateMemberEligibility(member: Member): void;
10
+ export declare function validateDualSupport(member: Member): void;
@@ -0,0 +1,4 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { TmuxSessionManager } from "../../tmux-subagent/manager";
3
+ import type { RuntimeState } from "../types";
4
+ export declare function activateTeamLayout(runtimeState: RuntimeState, config: TeamModeConfig, projectRoot: string, tmuxMgr?: TmuxSessionManager): Promise<boolean>;
@@ -0,0 +1,17 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { BackgroundManager } from "../../background-agent/manager";
3
+ import type { TmuxSessionManager } from "../../tmux-subagent/manager";
4
+ import type { TeamRunCreateError } from "./create";
5
+ type SpawnedMemberResource = {
6
+ taskId?: string;
7
+ worktreePath?: string;
8
+ };
9
+ export declare function cleanupTeamRunResources(args: {
10
+ teamRunId: string;
11
+ config: TeamModeConfig;
12
+ resources: SpawnedMemberResource[];
13
+ bgMgr: BackgroundManager;
14
+ tmuxMgr?: TmuxSessionManager;
15
+ createdLayout: boolean;
16
+ }): Promise<TeamRunCreateError["cleanupReport"]>;
17
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { ExecutorContext } from "../../../tools/delegate-task/executor-types";
3
+ import type { BackgroundManager } from "../../background-agent/manager";
4
+ import type { TmuxSessionManager } from "../../tmux-subagent/manager";
5
+ import type { RuntimeState, TeamSpec } from "../types";
6
+ type CreateTeamRunOptions = {
7
+ callerAgentTypeId?: string;
8
+ parentMessageID?: string;
9
+ };
10
+ export declare class TeamRunCreateError extends Error {
11
+ readonly cleanupReport: {
12
+ cancelledTaskIds: string[];
13
+ removedLayout: boolean;
14
+ removedWorktrees: string[];
15
+ errors: string[];
16
+ };
17
+ constructor(message: string, cleanupReport: {
18
+ cancelledTaskIds: string[];
19
+ removedLayout: boolean;
20
+ removedWorktrees: string[];
21
+ errors: string[];
22
+ }, cause: Error);
23
+ }
24
+ export declare function createTeamRun(spec: TeamSpec, leadSessionId: string, ctx: ExecutorContext, config: TeamModeConfig, bgMgr: BackgroundManager, tmuxMgr?: TmuxSessionManager, options?: CreateTeamRunOptions): Promise<RuntimeState>;
25
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import { log } from "../../../shared/logger";
3
+ import type { BackgroundManager } from "../../background-agent/manager";
4
+ import type { TmuxSessionManager } from "../../tmux-subagent/manager";
5
+ import { canVisualize, removeTeamLayout } from "../team-layout-tmux/layout";
6
+ export type DeleteTeamDeps = {
7
+ canVisualize: typeof canVisualize;
8
+ removeTeamLayout: typeof removeTeamLayout;
9
+ log: typeof log;
10
+ };
11
+ export declare function deleteTeam(teamRunId: string, config: TeamModeConfig, tmuxMgr?: TmuxSessionManager, bgMgr?: BackgroundManager, options?: {
12
+ force?: boolean;
13
+ }, deps?: DeleteTeamDeps): Promise<{
14
+ removedWorktrees: string[];
15
+ removedLayout: boolean;
16
+ }>;
@@ -0,0 +1,2 @@
1
+ export * from "./resolve-member";
2
+ export * from "./shutdown";
@@ -0,0 +1,3 @@
1
+ export { resolveCategoryExecution } from "../../../tools/delegate-task/category-resolver";
2
+ export { resolveSubagentExecution } from "../../../tools/delegate-task/subagent-resolver";
3
+ export { buildSystemContent } from "../../../tools/delegate-task/prompt-builder";
@@ -0,0 +1,17 @@
1
+ import type { FallbackEntry } from "../../../shared/model-requirements";
2
+ import type { DelegatedModelConfig } from "../../../shared/model-resolution-types";
3
+ import type { ExecutorContext } from "../../../tools/delegate-task/executor-types";
4
+ import type { Member } from "../types";
5
+ export declare class TeamMemberResolutionError extends Error {
6
+ readonly memberName: string;
7
+ readonly cause: Error;
8
+ constructor(memberName: string, cause: Error);
9
+ }
10
+ export interface ResolvedMember {
11
+ memberName: string;
12
+ agentToUse: string;
13
+ model: DelegatedModelConfig | undefined;
14
+ fallbackChain: FallbackEntry[] | undefined;
15
+ systemContent: string;
16
+ }
17
+ export declare function resolveMember(member: Member, ctx: ExecutorContext, categoryExamples: string, parentAgent?: string): Promise<ResolvedMember>;
@@ -0,0 +1,21 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import { log } from "../../../shared/logger";
3
+ import type { BackgroundManager } from "../../background-agent/manager";
4
+ import type { TmuxSessionManager } from "../../tmux-subagent/manager";
5
+ import { deleteTeam } from "./delete-team";
6
+ export { clearSessionTeamRunCleanupRegistry, getSessionCreatedTeamRunIds, registerTeamRunForSessionCleanup, unregisterTeamRunForSessionCleanup, } from "./session-team-run-registry";
7
+ export type SessionTeamCleanupReport = {
8
+ cleanedTeamRunIds: string[];
9
+ removedLayoutTeamRunIds: string[];
10
+ errors: string[];
11
+ };
12
+ export type SessionTeamCleanupDeps = {
13
+ deleteTeam: typeof deleteTeam;
14
+ log: typeof log;
15
+ };
16
+ export declare function cleanupSessionTeamRuns(args: {
17
+ config: TeamModeConfig;
18
+ tmuxMgr?: TmuxSessionManager;
19
+ bgMgr?: BackgroundManager;
20
+ deps?: SessionTeamCleanupDeps;
21
+ }): Promise<SessionTeamCleanupReport>;
@@ -0,0 +1,4 @@
1
+ export declare function registerTeamRunForSessionCleanup(teamRunId: string): void;
2
+ export declare function unregisterTeamRunForSessionCleanup(teamRunId: string): void;
3
+ export declare function getSessionCreatedTeamRunIds(): string[];
4
+ export declare function clearSessionTeamRunCleanupRegistry(): void;
@@ -0,0 +1,11 @@
1
+ import type { Message, RuntimeState } from "../types";
2
+ export declare const DELETABLE_MEMBER_STATUSES: Set<"pending" | "completed" | "running" | "idle" | "shutdown_approved" | "errored">;
3
+ export declare function createShutdownMessage(from: string, to: string, kind: Message["kind"], body: string): Message;
4
+ export declare function getRuntimeMember(runtimeState: RuntimeState, memberName: string): RuntimeState["members"][number];
5
+ export declare function getLeadMemberName(runtimeState: RuntimeState): string;
6
+ export declare function createSendContext(runtimeState: RuntimeState, senderName: string): {
7
+ isLead: boolean;
8
+ activeMembers: string[];
9
+ };
10
+ export declare function findLatestShutdownRequestIndex(runtimeState: RuntimeState, memberName: string, requesterName?: string): number;
11
+ export declare function removeWorktrees(memberPaths: Array<string | undefined>): Promise<string[]>;
@@ -0,0 +1,46 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import { sendMessage } from "../team-mailbox/send";
3
+ import { type RuntimeState, type TeamSpec } from "../types";
4
+ export declare function createConfig(baseDir: string): TeamModeConfig;
5
+ export declare function createSpec(worktreeRoot: string): TeamSpec;
6
+ export declare function createFixture(options?: {
7
+ status?: RuntimeState["status"];
8
+ }): Promise<{
9
+ baseDir: string;
10
+ config: TeamModeConfig;
11
+ teamRunId: string;
12
+ worktreePaths: string[];
13
+ }>;
14
+ export declare function updateMemberStatuses(teamRunId: string, config: TeamModeConfig, statuses: Record<string, RuntimeState["members"][number]["status"]>): Promise<void>;
15
+ export declare function readInboxMessages(teamRunId: string, memberName: string, config: TeamModeConfig): Promise<{
16
+ version: 1;
17
+ messageId: string;
18
+ from: string;
19
+ to: string;
20
+ kind: "message" | "shutdown_request" | "shutdown_approved" | "shutdown_rejected" | "announcement";
21
+ body: string;
22
+ timestamp: number;
23
+ summary?: string | undefined;
24
+ references?: {
25
+ path: string;
26
+ description?: string | undefined;
27
+ }[] | undefined;
28
+ correlationId?: string | undefined;
29
+ color?: string | undefined;
30
+ }[]>;
31
+ export declare function createTestMessage(overrides?: Partial<Parameters<typeof sendMessage>[0]>): {
32
+ version: 1;
33
+ messageId: string;
34
+ from: string;
35
+ to: string;
36
+ kind: "message" | "shutdown_request" | "shutdown_approved" | "shutdown_rejected" | "announcement";
37
+ body: string;
38
+ timestamp: number;
39
+ summary?: string | undefined;
40
+ references?: {
41
+ path: string;
42
+ description?: string | undefined;
43
+ }[] | undefined;
44
+ correlationId?: string | undefined;
45
+ color?: string | undefined;
46
+ };
@@ -0,0 +1,5 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ export { deleteTeam } from "./delete-team";
3
+ export declare function requestShutdownOfMember(teamRunId: string, targetMemberName: string, requesterName: string, config: TeamModeConfig): Promise<void>;
4
+ export declare function approveShutdown(teamRunId: string, memberName: string, approverName: string, config: TeamModeConfig): Promise<void>;
5
+ export declare function rejectShutdown(teamRunId: string, memberName: string, reason: string, config: TeamModeConfig): Promise<void>;
@@ -0,0 +1,36 @@
1
+ import type { BackgroundManager } from "../../background-agent/manager";
2
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
3
+ import type { RuntimeState } from "../types";
4
+ export interface TeamStatus {
5
+ teamName: string;
6
+ teamRunId: string;
7
+ status: RuntimeState["status"];
8
+ leadSessionId?: string;
9
+ createdAt: number;
10
+ members: Array<{
11
+ name: string;
12
+ sessionId?: string;
13
+ status: RuntimeState["members"][number]["status"];
14
+ color?: string;
15
+ worktreePath?: string;
16
+ unreadMessages: number;
17
+ paneId?: string;
18
+ }>;
19
+ tasks: {
20
+ pending: number;
21
+ claimed: number;
22
+ in_progress: number;
23
+ completed: number;
24
+ deleted: number;
25
+ total: number;
26
+ };
27
+ shutdownRequests: RuntimeState["shutdownRequests"];
28
+ concurrency: {
29
+ runningOnSameModel: number;
30
+ queuedOnSameModel: number;
31
+ teamRunIdSpecific?: number;
32
+ };
33
+ bounds: RuntimeState["bounds"];
34
+ staleLocks: string[];
35
+ }
36
+ export declare function aggregateStatus(teamRunId: string, config: TeamModeConfig, bgMgr?: BackgroundManager): Promise<TeamStatus>;
@@ -0,0 +1,11 @@
1
+ export type TeamSessionRole = "lead" | "member";
2
+ export type TeamSessionEntry = {
3
+ teamRunId: string;
4
+ memberName: string;
5
+ role: TeamSessionRole;
6
+ };
7
+ export declare function registerTeamSession(sessionId: string, entry: TeamSessionEntry): void;
8
+ export declare function lookupTeamSession(sessionId: string): TeamSessionEntry | undefined;
9
+ export declare function unregisterTeamSession(sessionId: string): void;
10
+ export declare function unregisterTeamSessionsByTeam(teamRunId: string): void;
11
+ export declare function clearTeamSessionRegistry(): void;
@@ -0,0 +1 @@
1
+ export { InvalidTransitionError, RuntimeStateError, createRuntimeState, listActiveTeams, loadRuntimeState, saveRuntimeState, transitionRuntimeState, } from "./store";
@@ -0,0 +1,12 @@
1
+ import { rename } from "node:fs/promises";
2
+ type LockOptions = {
3
+ staleAfterMs?: number;
4
+ ownerTag?: string;
5
+ };
6
+ export declare function withLock<T>(lockPath: string, fn: () => Promise<T>, opts?: LockOptions): Promise<T>;
7
+ export declare function detectStaleLock(lockPath: string, staleAfterMs: number): Promise<boolean>;
8
+ export declare function reapStaleLock(lockPath: string): Promise<void>;
9
+ export declare function atomicWrite(filePath: string, content: string | Buffer, deps?: {
10
+ rename: typeof rename;
11
+ }): Promise<void>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { ExecutorContext } from "../../../tools/delegate-task/executor-types";
3
+ export interface ResumeReport {
4
+ resumed: number;
5
+ marked_failed: number;
6
+ marked_orphaned: number;
7
+ cleaned: number;
8
+ errors: Error[];
9
+ }
10
+ export declare function resumeAllTeams(ctx: ExecutorContext, config: TeamModeConfig): Promise<ResumeReport>;
@@ -0,0 +1,21 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import { type RuntimeState, type TeamSpec } from "../types";
3
+ export declare const STALE_DELETING_TTL_MS = 60000;
4
+ export declare class RuntimeStateError extends Error {
5
+ readonly code: string;
6
+ constructor(message: string, code: string);
7
+ }
8
+ export declare class InvalidTransitionError extends Error {
9
+ constructor(from: string, to: string);
10
+ }
11
+ export declare function createRuntimeState(spec: TeamSpec, leadSessionId: string | undefined, specSource: "project" | "user", config: TeamModeConfig): Promise<RuntimeState>;
12
+ export declare function loadRuntimeState(teamRunId: string, config: TeamModeConfig): Promise<RuntimeState>;
13
+ export declare function saveRuntimeState(runtimeState: RuntimeState, config: TeamModeConfig): Promise<void>;
14
+ export declare function transitionRuntimeState(teamRunId: string, transition: (runtimeState: RuntimeState) => RuntimeState, config: TeamModeConfig): Promise<RuntimeState>;
15
+ export declare function listActiveTeams(config: TeamModeConfig): Promise<Array<{
16
+ teamRunId: string;
17
+ teamName: string;
18
+ status: string;
19
+ memberCount: number;
20
+ scope: "project" | "user";
21
+ }>>;
@@ -0,0 +1,10 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Task } from "../types";
3
+ export declare class AlreadyClaimedError extends Error {
4
+ constructor(message?: string);
5
+ }
6
+ export declare class BlockedByError extends Error {
7
+ readonly blockers: string[];
8
+ constructor(blockers: string[]);
9
+ }
10
+ export declare function claimTask(teamRunId: string, taskId: string, memberName: string, config: TeamModeConfig): Promise<Task>;
@@ -0,0 +1,2 @@
1
+ import type { Task } from "../types";
2
+ export declare function canClaim(task: Task, allTasks: Task[]): boolean;
@@ -0,0 +1,3 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Task } from "../types";
3
+ export declare function getTask(teamRunId: string, taskId: string, config: TeamModeConfig): Promise<Task>;
@@ -0,0 +1,6 @@
1
+ export { claimTask, AlreadyClaimedError, BlockedByError } from "./claim";
2
+ export { canClaim } from "./dependencies";
3
+ export { getTask } from "./get";
4
+ export { listTasks } from "./list";
5
+ export { createTask } from "./store";
6
+ export { updateTaskStatus, CrossOwnerUpdateError, InvalidTaskTransitionError } from "./update";
@@ -0,0 +1,8 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Task } from "../types";
3
+ type TaskListFilter = {
4
+ status?: Task["status"];
5
+ owner?: string;
6
+ };
7
+ export declare function listTasks(teamRunId: string, config: TeamModeConfig, filter?: TaskListFilter): Promise<Task[]>;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Task } from "../types";
3
+ export declare function createTask(teamRunId: string, taskInput: Omit<Task, "id" | "createdAt" | "updatedAt" | "version">, config: TeamModeConfig): Promise<Task>;
@@ -0,0 +1,9 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Task } from "../types";
3
+ export declare function createTasklistFixture(): Promise<{
4
+ config: TeamModeConfig;
5
+ rootDirectory: string;
6
+ teamRunId: string;
7
+ cleanup: () => Promise<void>;
8
+ }>;
9
+ export declare function createTaskInput(overrides?: Partial<Omit<Task, "id" | "createdAt" | "updatedAt" | "version">>): Omit<Task, "id" | "createdAt" | "updatedAt" | "version">;
@@ -0,0 +1,9 @@
1
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
2
+ import type { Task } from "../types";
3
+ export declare class InvalidTaskTransitionError extends Error {
4
+ constructor(currentStatus: Task["status"], nextStatus: Task["status"]);
5
+ }
6
+ export declare class CrossOwnerUpdateError extends Error {
7
+ constructor(message?: string);
8
+ }
9
+ export declare function updateTaskStatus(teamRunId: string, taskId: string, newStatus: Task["status"], memberName: string, config: TeamModeConfig): Promise<Task>;
@@ -0,0 +1 @@
1
+ export { createTeamApproveShutdownTool, createTeamCreateTool, createTeamDeleteTool, createTeamRejectShutdownTool, createTeamShutdownRequestTool } from "./lifecycle";