@wolfx/oh-my-openagent 3.17.14 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.ja.md +153 -113
  2. package/README.ko.md +196 -149
  3. package/README.md +53 -50
  4. package/README.ru.md +92 -70
  5. package/README.zh-cn.md +112 -71
  6. package/dist/agents/agent-skill-resolution.d.ts +1 -0
  7. package/dist/agents/builtin-agents/available-skills.d.ts +1 -1
  8. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  9. package/dist/agents/builtin-agents.d.ts +1 -1
  10. package/dist/agents/dynamic-agent-core-sections.d.ts +1 -0
  11. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  12. package/dist/agents/hephaestus/gpt-5-5.d.ts +0 -4
  13. package/dist/agents/types.d.ts +1 -0
  14. package/dist/config/index.d.ts +1 -1
  15. package/dist/config/schema/agent-names.d.ts +1 -0
  16. package/dist/config/schema/agent-overrides.d.ts +45 -0
  17. package/dist/config/schema/categories.d.ts +7 -1
  18. package/dist/config/schema/commands.d.ts +1 -0
  19. package/dist/config/schema/fallback-models.d.ts +5 -0
  20. package/dist/config/schema/hooks.d.ts +1 -0
  21. package/dist/config/schema/keyword-detector.d.ts +21 -0
  22. package/dist/config/schema/oh-my-opencode-config.d.ts +70 -0
  23. package/dist/config/schema/team-mode.d.ts +16 -0
  24. package/dist/config/schema.d.ts +2 -0
  25. package/dist/create-hooks.d.ts +3 -0
  26. package/dist/features/background-agent/manager.d.ts +3 -0
  27. package/dist/features/background-agent/types.d.ts +4 -0
  28. package/dist/features/boulder-state/storage.d.ts +1 -0
  29. package/dist/features/builtin-commands/commands.d.ts +1 -0
  30. package/dist/features/builtin-commands/templates/hyperplan.d.ts +1 -0
  31. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
  32. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
  33. package/dist/features/builtin-commands/types.d.ts +1 -1
  34. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  35. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
  36. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
  37. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
  38. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
  39. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  40. package/dist/features/builtin-skills/skills/team-mode.d.ts +2 -0
  41. package/dist/features/builtin-skills/skills.d.ts +1 -0
  42. package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -0
  43. package/dist/features/hook-message-injector/injector.d.ts +2 -2
  44. package/dist/features/opencode-skill-loader/loader.d.ts +2 -2
  45. package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -0
  46. package/dist/features/team-mode/deps.d.ts +6 -0
  47. package/dist/features/team-mode/member-guidance.d.ts +2 -0
  48. package/dist/features/team-mode/member-parser.d.ts +16 -0
  49. package/dist/features/team-mode/member-session-resolution.d.ts +6 -0
  50. package/dist/features/team-mode/member-session-routing.d.ts +19 -0
  51. package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +4 -0
  52. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +26 -6
  53. package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +9 -0
  54. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +7 -0
  55. package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +8 -0
  56. package/dist/features/team-mode/team-mailbox/ack.d.ts +2 -0
  57. package/dist/features/team-mode/team-mailbox/inbox.d.ts +3 -0
  58. package/dist/features/team-mode/team-mailbox/index.d.ts +7 -0
  59. package/dist/features/team-mode/team-mailbox/poll.d.ts +10 -0
  60. package/dist/features/team-mode/team-mailbox/reservation.d.ts +11 -0
  61. package/dist/features/team-mode/team-mailbox/send.d.ts +27 -0
  62. package/dist/features/team-mode/team-registry/index.d.ts +3 -0
  63. package/dist/features/team-mode/team-registry/loader.d.ts +12 -0
  64. package/dist/features/team-mode/team-registry/paths.d.ts +13 -0
  65. package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +6 -0
  66. package/dist/features/team-mode/team-registry/validator.d.ts +10 -0
  67. package/dist/features/team-mode/team-runtime/activate-team-layout.d.ts +4 -0
  68. package/dist/features/team-mode/team-runtime/cleanup-team-run-resources.d.ts +17 -0
  69. package/dist/features/team-mode/team-runtime/create.d.ts +25 -0
  70. package/dist/features/team-mode/team-runtime/delete-team.d.ts +16 -0
  71. package/dist/features/team-mode/team-runtime/index.d.ts +2 -0
  72. package/dist/features/team-mode/team-runtime/resolve-member-dependencies.d.ts +3 -0
  73. package/dist/features/team-mode/team-runtime/resolve-member.d.ts +17 -0
  74. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +11 -0
  75. package/dist/features/team-mode/team-runtime/shutdown-test-fixtures.d.ts +46 -0
  76. package/dist/features/team-mode/team-runtime/shutdown.d.ts +5 -0
  77. package/dist/features/team-mode/team-runtime/status.d.ts +36 -0
  78. package/dist/features/team-mode/team-session-registry.d.ts +11 -0
  79. package/dist/features/team-mode/team-state-store/index.d.ts +1 -0
  80. package/dist/features/team-mode/team-state-store/locks.d.ts +12 -0
  81. package/dist/features/team-mode/team-state-store/resume.d.ts +10 -0
  82. package/dist/features/team-mode/team-state-store/store.d.ts +21 -0
  83. package/dist/features/team-mode/team-tasklist/claim.d.ts +10 -0
  84. package/dist/features/team-mode/team-tasklist/dependencies.d.ts +2 -0
  85. package/dist/features/team-mode/team-tasklist/get.d.ts +3 -0
  86. package/dist/features/team-mode/team-tasklist/index.d.ts +6 -0
  87. package/dist/features/team-mode/team-tasklist/list.d.ts +8 -0
  88. package/dist/features/team-mode/team-tasklist/store.d.ts +3 -0
  89. package/dist/features/team-mode/team-tasklist/test-support.d.ts +9 -0
  90. package/dist/features/team-mode/team-tasklist/update.d.ts +9 -0
  91. package/dist/features/team-mode/tools/index.d.ts +1 -0
  92. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +188 -0
  93. package/dist/features/team-mode/tools/lifecycle.d.ts +37 -0
  94. package/dist/features/team-mode/tools/messaging.d.ts +31 -0
  95. package/dist/features/team-mode/tools/query.d.ts +16 -0
  96. package/dist/features/team-mode/tools/tasks.d.ts +18 -0
  97. package/dist/features/team-mode/types.d.ts +137 -5
  98. package/dist/features/tmux-subagent/action-executor-core.d.ts +1 -0
  99. package/dist/features/tmux-subagent/action-executor.d.ts +1 -0
  100. package/dist/features/tmux-subagent/attachable-session-status.d.ts +4 -0
  101. package/dist/features/tmux-subagent/manager.d.ts +32 -3
  102. package/dist/features/tmux-subagent/pane-state-querier.d.ts +10 -0
  103. package/dist/features/tmux-subagent/polling.d.ts +1 -0
  104. package/dist/hooks/atlas/atlas-hook.d.ts +1 -1
  105. package/dist/hooks/atlas/boulder-continuation-injector.d.ts +2 -3
  106. package/dist/hooks/atlas/recent-model-resolver.d.ts +9 -1
  107. package/dist/hooks/atlas/tool-execute-after.d.ts +2 -1
  108. package/dist/hooks/atlas/tool-execute-before.d.ts +1 -0
  109. package/dist/hooks/atlas/types.d.ts +8 -2
  110. package/dist/hooks/index.d.ts +3 -0
  111. package/dist/hooks/keyword-detector/constants.d.ts +6 -0
  112. package/dist/hooks/keyword-detector/detector.d.ts +5 -3
  113. package/dist/hooks/keyword-detector/hook.d.ts +2 -1
  114. package/dist/hooks/keyword-detector/hyperplan/default.d.ts +13 -0
  115. package/dist/hooks/keyword-detector/hyperplan/index.d.ts +1 -0
  116. package/dist/hooks/keyword-detector/team/default.d.ts +13 -0
  117. package/dist/hooks/keyword-detector/team/index.d.ts +1 -0
  118. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +2 -2
  119. package/dist/hooks/team-mailbox-injector/hook.d.ts +31 -0
  120. package/dist/hooks/team-mailbox-injector/index.d.ts +2 -0
  121. package/dist/hooks/team-mode-status-injector/hook.d.ts +28 -0
  122. package/dist/hooks/team-mode-status-injector/index.d.ts +1 -0
  123. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +38 -0
  124. package/dist/hooks/team-session-events/team-lead-orphan-handler.d.ts +12 -0
  125. package/dist/hooks/team-session-events/team-member-error-handler.d.ts +10 -0
  126. package/dist/hooks/team-session-events/team-member-status-handler.d.ts +10 -0
  127. package/dist/hooks/team-tool-gating/hook.d.ts +3 -0
  128. package/dist/hooks/team-tool-gating/index.d.ts +1 -0
  129. package/dist/hooks/write-existing-file-guard/hook.d.ts +6 -1
  130. package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -0
  131. package/dist/index.js +89536 -80765
  132. package/dist/oh-my-opencode.schema.json +191 -47
  133. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  134. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  135. package/dist/plugin/hooks/create-transform-hooks.d.ts +3 -1
  136. package/dist/plugin/recent-synthetic-idles.d.ts +1 -0
  137. package/dist/plugin/tool-registry.d.ts +16 -0
  138. package/dist/shared/bun-spawn-shim.d.ts +40 -0
  139. package/dist/shared/project-discovery-dirs.d.ts +1 -0
  140. package/dist/shared/shell-env.d.ts +1 -0
  141. package/dist/shared/tmux/constants.d.ts +1 -1
  142. package/dist/shared/tmux/index.d.ts +1 -0
  143. package/dist/shared/tmux/runner.d.ts +13 -0
  144. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -1
  145. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +13 -1
  146. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +13 -1
  147. package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -1
  148. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +9 -2
  149. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +13 -1
  150. package/dist/shared/tmux/tmux-utils.d.ts +1 -1
  151. package/dist/tools/delegate-task/openai-categories.d.ts +1 -0
  152. package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
  153. package/dist/tools/delegate-task/subagent-resolver.d.ts +5 -1
  154. package/dist/tools/delegate-task/types.d.ts +1 -0
  155. package/dist/tools/index.d.ts +1 -0
  156. package/dist/tools/look-at/missing-file-error.d.ts +2 -0
  157. package/dist/tools/skill/types.d.ts +2 -0
  158. package/package.json +3 -1
@@ -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";
@@ -0,0 +1,188 @@
1
+ import type { ToolContext } from "@opencode-ai/plugin/tool";
2
+ import type { OpencodeClient } from "../../../tools/delegate-task/types";
3
+ import type { BackgroundManager } from "../../background-agent/manager";
4
+ import type { RuntimeState, TeamSpec } from "../types";
5
+ export declare function parseToolResult<TValue>(value: string): TValue;
6
+ export declare function createToolContext(sessionID: string): ToolContext;
7
+ export declare function getLatestShutdownRequest(runtimeState: RuntimeState, memberName: string): RuntimeState["shutdownRequests"][number] | undefined;
8
+ export declare function createSpec(): TeamSpec;
9
+ export declare function requireRuntime(teamRunId: string): RuntimeState;
10
+ export declare const createTeamRunMock: import("bun:test").Mock<(spec: TeamSpec, leadSessionId: string) => Promise<{
11
+ version: 1;
12
+ teamRunId: string;
13
+ teamName: string;
14
+ specSource: "user" | "project";
15
+ createdAt: number;
16
+ status: "deleted" | "failed" | "active" | "creating" | "shutdown_requested" | "deleting" | "orphaned";
17
+ members: {
18
+ name: string;
19
+ agentType: "leader" | "general-purpose";
20
+ status: "pending" | "completed" | "running" | "idle" | "shutdown_approved" | "errored";
21
+ pendingInjectedMessageIds: string[];
22
+ sessionId?: string | undefined;
23
+ tmuxPaneId?: string | undefined;
24
+ tmuxGridPaneId?: string | undefined;
25
+ subagent_type?: string | undefined;
26
+ category?: string | undefined;
27
+ model?: {
28
+ providerID: string;
29
+ modelID: string;
30
+ variant?: string | undefined;
31
+ reasoningEffort?: string | undefined;
32
+ temperature?: number | undefined;
33
+ top_p?: number | undefined;
34
+ maxTokens?: number | undefined;
35
+ thinking?: {
36
+ type: "enabled" | "disabled";
37
+ budgetTokens?: number | undefined;
38
+ } | undefined;
39
+ } | undefined;
40
+ color?: string | undefined;
41
+ worktreePath?: string | undefined;
42
+ lastInjectedTurnMarker?: string | undefined;
43
+ }[];
44
+ shutdownRequests: {
45
+ memberId: string;
46
+ requesterName: string;
47
+ requestedAt: number;
48
+ approvedAt?: number | undefined;
49
+ rejectedReason?: string | undefined;
50
+ rejectedAt?: number | undefined;
51
+ }[];
52
+ bounds: {
53
+ maxMembers: number;
54
+ maxParallelMembers: number;
55
+ maxMessagesPerRun: number;
56
+ maxWallClockMinutes: number;
57
+ maxMemberTurns: number;
58
+ };
59
+ leadSessionId?: string | undefined;
60
+ tmuxLayout?: {
61
+ ownedSession: boolean;
62
+ targetSessionId: string;
63
+ focusWindowId?: string | undefined;
64
+ gridWindowId?: string | undefined;
65
+ } | undefined;
66
+ }>>;
67
+ export declare const deleteTeamMock: import("bun:test").Mock<(teamRunId: string, _config?: unknown, _tmuxMgr?: unknown, _bgMgr?: unknown, options?: {
68
+ force?: boolean;
69
+ }) => Promise<{
70
+ removedWorktrees: never[];
71
+ removedLayout: boolean;
72
+ }>>;
73
+ export declare const requestShutdownOfMemberMock: import("bun:test").Mock<(teamRunId: string, targetMemberName: string, requesterName: string) => Promise<void>>;
74
+ export declare const approveShutdownMock: import("bun:test").Mock<(teamRunId: string, memberName: string) => Promise<void>>;
75
+ export declare const rejectShutdownMock: import("bun:test").Mock<(teamRunId: string, memberName: string, reason: string) => Promise<void>>;
76
+ export declare const loadTeamSpecMock: import("bun:test").Mock<() => Promise<{
77
+ version: 1;
78
+ name: string;
79
+ createdAt: number;
80
+ members: ({
81
+ name: string;
82
+ backendType: "tmux" | "in-process";
83
+ isActive: boolean;
84
+ kind: "category";
85
+ category: string;
86
+ prompt: string;
87
+ cwd?: string | undefined;
88
+ worktreePath?: string | undefined;
89
+ subscriptions?: string[] | undefined;
90
+ color?: string | undefined;
91
+ } | {
92
+ name: string;
93
+ backendType: "tmux" | "in-process";
94
+ isActive: boolean;
95
+ kind: "subagent_type";
96
+ subagent_type: string;
97
+ cwd?: string | undefined;
98
+ worktreePath?: string | undefined;
99
+ subscriptions?: string[] | undefined;
100
+ color?: string | undefined;
101
+ prompt?: string | undefined;
102
+ })[];
103
+ description?: string | undefined;
104
+ leadAgentId?: string | undefined;
105
+ teamAllowedPaths?: string[] | undefined;
106
+ sessionPermission?: string | undefined;
107
+ }>>;
108
+ export declare const listActiveTeamsMock: import("bun:test").Mock<() => Promise<{
109
+ teamRunId: string;
110
+ teamName: string;
111
+ status: "deleted" | "failed" | "active" | "creating" | "shutdown_requested" | "deleting" | "orphaned";
112
+ memberCount: number;
113
+ scope: "user" | "project";
114
+ }[]>>;
115
+ export declare const loadRuntimeStateMock: import("bun:test").Mock<(teamRunId: string) => Promise<{
116
+ version: 1;
117
+ teamRunId: string;
118
+ teamName: string;
119
+ specSource: "user" | "project";
120
+ createdAt: number;
121
+ status: "deleted" | "failed" | "active" | "creating" | "shutdown_requested" | "deleting" | "orphaned";
122
+ members: {
123
+ name: string;
124
+ agentType: "leader" | "general-purpose";
125
+ status: "pending" | "completed" | "running" | "idle" | "shutdown_approved" | "errored";
126
+ pendingInjectedMessageIds: string[];
127
+ sessionId?: string | undefined;
128
+ tmuxPaneId?: string | undefined;
129
+ tmuxGridPaneId?: string | undefined;
130
+ subagent_type?: string | undefined;
131
+ category?: string | undefined;
132
+ model?: {
133
+ providerID: string;
134
+ modelID: string;
135
+ variant?: string | undefined;
136
+ reasoningEffort?: string | undefined;
137
+ temperature?: number | undefined;
138
+ top_p?: number | undefined;
139
+ maxTokens?: number | undefined;
140
+ thinking?: {
141
+ type: "enabled" | "disabled";
142
+ budgetTokens?: number | undefined;
143
+ } | undefined;
144
+ } | undefined;
145
+ color?: string | undefined;
146
+ worktreePath?: string | undefined;
147
+ lastInjectedTurnMarker?: string | undefined;
148
+ }[];
149
+ shutdownRequests: {
150
+ memberId: string;
151
+ requesterName: string;
152
+ requestedAt: number;
153
+ approvedAt?: number | undefined;
154
+ rejectedReason?: string | undefined;
155
+ rejectedAt?: number | undefined;
156
+ }[];
157
+ bounds: {
158
+ maxMembers: number;
159
+ maxParallelMembers: number;
160
+ maxMessagesPerRun: number;
161
+ maxWallClockMinutes: number;
162
+ maxMemberTurns: number;
163
+ };
164
+ leadSessionId?: string | undefined;
165
+ tmuxLayout?: {
166
+ ownedSession: boolean;
167
+ targetSessionId: string;
168
+ focusWindowId?: string | undefined;
169
+ gridWindowId?: string | undefined;
170
+ } | undefined;
171
+ }>>;
172
+ export declare const config: {
173
+ enabled: boolean;
174
+ tmux_visualization: boolean;
175
+ max_parallel_members: number;
176
+ max_members: number;
177
+ max_messages_per_run: number;
178
+ max_wall_clock_minutes: number;
179
+ max_member_turns: number;
180
+ message_payload_max_bytes: number;
181
+ recipient_unread_max_bytes: number;
182
+ mailbox_poll_interval_ms: number;
183
+ base_dir?: string | undefined;
184
+ };
185
+ export declare const mockClient: OpencodeClient;
186
+ export declare const backgroundManager: BackgroundManager;
187
+ export declare function resetLifecycleTestState(): void;
188
+ export declare function hasRuntime(teamRunId: string): boolean;
@@ -0,0 +1,37 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
3
+ import type { CategoriesConfig, AgentOverrides } from "../../../config/schema";
4
+ import type { OpencodeClient } from "../../../tools/delegate-task/types";
5
+ import type { BackgroundManager } from "../../background-agent/manager";
6
+ import type { TmuxSessionManager } from "../../tmux-subagent/manager";
7
+ import { loadTeamSpec } from "../team-registry/loader";
8
+ import { createTeamRun } from "../team-runtime/create";
9
+ import { approveShutdown, deleteTeam, rejectShutdown, requestShutdownOfMember } from "../team-runtime/shutdown";
10
+ import { listActiveTeams, loadRuntimeState } from "../team-state-store/store";
11
+ type TeamRuntimeStoreDeps = {
12
+ listActiveTeams: typeof listActiveTeams;
13
+ loadRuntimeState: typeof loadRuntimeState;
14
+ };
15
+ type TeamShutdownToolDeps = TeamRuntimeStoreDeps & {
16
+ deleteTeam: typeof deleteTeam;
17
+ requestShutdownOfMember: typeof requestShutdownOfMember;
18
+ approveShutdown: typeof approveShutdown;
19
+ rejectShutdown: typeof rejectShutdown;
20
+ };
21
+ export type TeamCreateExecutorConfig = {
22
+ userCategories?: CategoriesConfig;
23
+ sisyphusJuniorModel?: string;
24
+ agentOverrides?: AgentOverrides;
25
+ };
26
+ type TeamCreateToolDeps = {
27
+ createTeamRun: typeof createTeamRun;
28
+ loadTeamSpec: typeof loadTeamSpec;
29
+ listActiveTeams: typeof listActiveTeams;
30
+ loadRuntimeState: typeof loadRuntimeState;
31
+ };
32
+ export declare function createTeamCreateTool(config: TeamModeConfig, client: OpencodeClient, bgMgr: BackgroundManager, tmuxMgr?: TmuxSessionManager, executorConfig?: TeamCreateExecutorConfig, deps?: TeamCreateToolDeps): ToolDefinition;
33
+ export declare function createTeamDeleteTool(config: TeamModeConfig, client: OpencodeClient, backgroundManager: BackgroundManager, tmuxMgr?: TmuxSessionManager, deps?: TeamShutdownToolDeps): ToolDefinition;
34
+ export declare function createTeamShutdownRequestTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamShutdownToolDeps): ToolDefinition;
35
+ export declare function createTeamApproveShutdownTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamShutdownToolDeps): ToolDefinition;
36
+ export declare function createTeamRejectShutdownTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamShutdownToolDeps): ToolDefinition;
37
+ export {};
@@ -0,0 +1,31 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
3
+ import { loadRuntimeState } from "../team-state-store/store";
4
+ export type LiveDeliveryClient = {
5
+ session: {
6
+ promptAsync(input: {
7
+ path: {
8
+ id: string;
9
+ };
10
+ body: {
11
+ parts: Array<{
12
+ type: "text";
13
+ text: string;
14
+ }>;
15
+ agent?: string;
16
+ model?: {
17
+ providerID: string;
18
+ modelID: string;
19
+ };
20
+ variant?: string;
21
+ };
22
+ query?: {
23
+ directory: string;
24
+ };
25
+ }): Promise<unknown>;
26
+ };
27
+ };
28
+ export type TeamSendMessageToolDeps = {
29
+ loadRuntimeState: typeof loadRuntimeState;
30
+ };
31
+ export declare function createTeamSendMessageTool(config: TeamModeConfig, client: LiveDeliveryClient, deps?: TeamSendMessageToolDeps): ToolDefinition;
@@ -0,0 +1,16 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
3
+ import type { OpencodeClient } from "../../../tools/delegate-task/types";
4
+ import { loadTeamSpec } from "../team-registry/loader";
5
+ import { aggregateStatus } from "../team-runtime/status";
6
+ import { discoverTeamSpecs } from "../team-registry/paths";
7
+ import { listActiveTeams } from "../team-state-store/store";
8
+ type QueryToolDeps = {
9
+ aggregateStatus: typeof aggregateStatus;
10
+ discoverTeamSpecs: typeof discoverTeamSpecs;
11
+ loadTeamSpec: typeof loadTeamSpec;
12
+ listActiveTeams: typeof listActiveTeams;
13
+ };
14
+ export declare function createTeamStatusTool(config: TeamModeConfig, client: OpencodeClient, backgroundManager?: Parameters<typeof aggregateStatus>[2], deps?: QueryToolDeps): ToolDefinition;
15
+ export declare function createTeamListTool(config: TeamModeConfig, client: OpencodeClient, deps?: QueryToolDeps): ToolDefinition;
16
+ export {};
@@ -0,0 +1,18 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ import type { TeamModeConfig } from "../../../config/schema/team-mode";
3
+ import type { OpencodeClient } from "../../../tools/delegate-task/types";
4
+ import { loadRuntimeState } from "../team-state-store";
5
+ import { createTask, getTask, listTasks, updateTaskStatus, claimTask } from "../team-tasklist";
6
+ type TeamTaskToolDeps = {
7
+ loadRuntimeState: typeof loadRuntimeState;
8
+ createTask: typeof createTask;
9
+ listTasks: typeof listTasks;
10
+ claimTask: typeof claimTask;
11
+ updateTaskStatus: typeof updateTaskStatus;
12
+ getTask: typeof getTask;
13
+ };
14
+ export declare function createTeamTaskCreateTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamTaskToolDeps): ToolDefinition;
15
+ export declare function createTeamTaskListTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamTaskToolDeps): ToolDefinition;
16
+ export declare function createTeamTaskUpdateTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamTaskToolDeps): ToolDefinition;
17
+ export declare function createTeamTaskGetTool(config: TeamModeConfig, client: OpencodeClient, deps?: TeamTaskToolDeps): ToolDefinition;
18
+ export {};