@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.
- package/README.ja.md +178 -113
- package/README.ko.md +221 -149
- package/README.md +79 -51
- package/README.ru.md +118 -71
- package/README.zh-cn.md +139 -73
- package/dist/agents/agent-skill-resolution.d.ts +1 -0
- package/dist/agents/atlas/agent.d.ts +7 -12
- package/dist/agents/atlas/default-prompt-sections.d.ts +5 -5
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +4 -4
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +5 -5
- package/dist/agents/atlas/kimi-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/kimi.d.ts +2 -0
- package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/opus-4-7.d.ts +2 -0
- package/dist/agents/atlas/shared-prompt.d.ts +1 -1
- package/dist/agents/builtin-agents/available-skills.d.ts +1 -1
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/builtin-agents.d.ts +1 -1
- package/dist/agents/dynamic-agent-core-sections.d.ts +1 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-5.d.ts +0 -4
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema/agent-names.d.ts +1 -0
- package/dist/config/schema/agent-overrides.d.ts +45 -0
- package/dist/config/schema/categories.d.ts +7 -1
- package/dist/config/schema/commands.d.ts +1 -0
- package/dist/config/schema/fallback-models.d.ts +5 -0
- package/dist/config/schema/hooks.d.ts +2 -0
- package/dist/config/schema/keyword-detector.d.ts +21 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +71 -0
- package/dist/config/schema/team-mode.d.ts +16 -0
- package/dist/config/schema.d.ts +2 -0
- package/dist/create-hooks.d.ts +4 -0
- package/dist/create-managers.d.ts +2 -0
- package/dist/features/background-agent/manager.d.ts +13 -0
- package/dist/features/background-agent/spawner.d.ts +4 -2
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +5 -0
- package/dist/features/boulder-state/format-duration.d.ts +1 -0
- package/dist/features/boulder-state/index.d.ts +1 -0
- package/dist/features/boulder-state/storage.d.ts +40 -1
- package/dist/features/boulder-state/types.d.ts +43 -0
- package/dist/features/builtin-commands/commands.d.ts +1 -0
- package/dist/features/builtin-commands/templates/hyperplan.d.ts +1 -0
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
- package/dist/features/builtin-skills/skills/index.d.ts +1 -0
- package/dist/features/builtin-skills/skills/team-mode.d.ts +2 -0
- package/dist/features/builtin-skills/skills.d.ts +1 -0
- package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -0
- package/dist/features/hook-message-injector/injector.d.ts +2 -2
- package/dist/features/opencode-skill-loader/loader.d.ts +2 -2
- package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -0
- package/dist/features/team-mode/deps.d.ts +6 -0
- package/dist/features/team-mode/member-guidance.d.ts +2 -0
- package/dist/features/team-mode/member-parser.d.ts +16 -0
- package/dist/features/team-mode/member-session-resolution.d.ts +6 -0
- package/dist/features/team-mode/member-session-routing.d.ts +19 -0
- package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +4 -0
- package/dist/features/team-mode/team-layout-tmux/layout.d.ts +26 -6
- package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +9 -0
- package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +7 -0
- package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +8 -0
- package/dist/features/team-mode/team-mailbox/ack.d.ts +2 -0
- package/dist/features/team-mode/team-mailbox/inbox.d.ts +3 -0
- package/dist/features/team-mode/team-mailbox/index.d.ts +7 -0
- package/dist/features/team-mode/team-mailbox/poll.d.ts +10 -0
- package/dist/features/team-mode/team-mailbox/reservation.d.ts +11 -0
- package/dist/features/team-mode/team-mailbox/send.d.ts +27 -0
- package/dist/features/team-mode/team-registry/index.d.ts +3 -0
- package/dist/features/team-mode/team-registry/loader.d.ts +12 -0
- package/dist/features/team-mode/team-registry/paths.d.ts +13 -0
- package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +6 -0
- package/dist/features/team-mode/team-registry/validator.d.ts +10 -0
- package/dist/features/team-mode/team-runtime/activate-team-layout.d.ts +4 -0
- package/dist/features/team-mode/team-runtime/cleanup-team-run-resources.d.ts +17 -0
- package/dist/features/team-mode/team-runtime/create.d.ts +25 -0
- package/dist/features/team-mode/team-runtime/delete-team.d.ts +16 -0
- package/dist/features/team-mode/team-runtime/index.d.ts +2 -0
- package/dist/features/team-mode/team-runtime/resolve-member-dependencies.d.ts +3 -0
- package/dist/features/team-mode/team-runtime/resolve-member.d.ts +17 -0
- package/dist/features/team-mode/team-runtime/session-cleanup.d.ts +21 -0
- package/dist/features/team-mode/team-runtime/session-team-run-registry.d.ts +4 -0
- package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +11 -0
- package/dist/features/team-mode/team-runtime/shutdown-test-fixtures.d.ts +46 -0
- package/dist/features/team-mode/team-runtime/shutdown.d.ts +5 -0
- package/dist/features/team-mode/team-runtime/status.d.ts +36 -0
- package/dist/features/team-mode/team-session-registry.d.ts +11 -0
- package/dist/features/team-mode/team-state-store/index.d.ts +1 -0
- package/dist/features/team-mode/team-state-store/locks.d.ts +12 -0
- package/dist/features/team-mode/team-state-store/resume.d.ts +10 -0
- package/dist/features/team-mode/team-state-store/store.d.ts +21 -0
- package/dist/features/team-mode/team-tasklist/claim.d.ts +10 -0
- package/dist/features/team-mode/team-tasklist/dependencies.d.ts +2 -0
- package/dist/features/team-mode/team-tasklist/get.d.ts +3 -0
- package/dist/features/team-mode/team-tasklist/index.d.ts +6 -0
- package/dist/features/team-mode/team-tasklist/list.d.ts +8 -0
- package/dist/features/team-mode/team-tasklist/store.d.ts +3 -0
- package/dist/features/team-mode/team-tasklist/test-support.d.ts +9 -0
- package/dist/features/team-mode/team-tasklist/update.d.ts +9 -0
- package/dist/features/team-mode/tools/index.d.ts +1 -0
- package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +188 -0
- package/dist/features/team-mode/tools/lifecycle.d.ts +37 -0
- package/dist/features/team-mode/tools/messaging.d.ts +31 -0
- package/dist/features/team-mode/tools/query.d.ts +16 -0
- package/dist/features/team-mode/tools/tasks.d.ts +18 -0
- package/dist/features/team-mode/types.d.ts +137 -5
- package/dist/features/tmux-subagent/action-executor-core.d.ts +1 -0
- package/dist/features/tmux-subagent/action-executor.d.ts +1 -0
- package/dist/features/tmux-subagent/attachable-session-status.d.ts +4 -0
- package/dist/features/tmux-subagent/cleanup.d.ts +10 -0
- package/dist/features/tmux-subagent/manager.d.ts +32 -3
- package/dist/features/tmux-subagent/pane-state-querier.d.ts +10 -0
- package/dist/features/tmux-subagent/polling.d.ts +1 -0
- package/dist/features/tmux-subagent/session-created-handler.d.ts +23 -0
- package/dist/features/tmux-subagent/session-deleted-handler.d.ts +16 -0
- package/dist/hooks/atlas/atlas-hook.d.ts +1 -1
- package/dist/hooks/atlas/boulder-continuation-injector.d.ts +3 -4
- package/dist/hooks/atlas/recent-model-resolver.d.ts +9 -1
- package/dist/hooks/atlas/system-reminder-templates.d.ts +1 -0
- package/dist/hooks/atlas/tool-execute-after.d.ts +3 -1
- package/dist/hooks/atlas/tool-execute-before.d.ts +2 -0
- package/dist/hooks/atlas/types.d.ts +10 -2
- package/dist/hooks/compaction-context-injector/recovery.d.ts +1 -1
- package/dist/hooks/compaction-context-injector/types.d.ts +1 -0
- package/dist/hooks/compaction-todo-preserver/hook.d.ts +11 -0
- package/dist/hooks/fsync-skip-warning/index.d.ts +18 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/keyword-detector/constants.d.ts +6 -0
- package/dist/hooks/keyword-detector/detector.d.ts +5 -3
- package/dist/hooks/keyword-detector/hook.d.ts +2 -1
- package/dist/hooks/keyword-detector/hyperplan/default.d.ts +13 -0
- package/dist/hooks/keyword-detector/hyperplan/index.d.ts +1 -0
- package/dist/hooks/keyword-detector/team/default.d.ts +13 -0
- package/dist/hooks/keyword-detector/team/index.d.ts +1 -0
- package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +7 -1
- package/dist/hooks/ralph-loop/iteration-continuation.d.ts +9 -1
- package/dist/hooks/ralph-loop/loop-state-controller.d.ts +1 -0
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +3 -0
- package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +2 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/ralph-loop/verification-failure-handler.d.ts +3 -1
- package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +2 -2
- package/dist/hooks/shared/session-idle-settle.d.ts +11 -0
- package/dist/hooks/team-mailbox-injector/hook.d.ts +31 -0
- package/dist/hooks/team-mailbox-injector/index.d.ts +2 -0
- package/dist/hooks/team-mode-status-injector/hook.d.ts +28 -0
- package/dist/hooks/team-mode-status-injector/index.d.ts +1 -0
- package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +42 -0
- package/dist/hooks/team-session-events/team-lead-orphan-handler.d.ts +12 -0
- package/dist/hooks/team-session-events/team-member-error-handler.d.ts +10 -0
- package/dist/hooks/team-session-events/team-member-status-handler.d.ts +10 -0
- package/dist/hooks/team-tool-gating/hook.d.ts +3 -0
- package/dist/hooks/team-tool-gating/index.d.ts +1 -0
- package/dist/hooks/todo-description-override/description.d.ts +1 -1
- package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
- package/dist/hooks/write-existing-file-guard/hook.d.ts +6 -1
- package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -0
- package/dist/index.js +93264 -81453
- package/dist/oh-my-opencode.schema.json +199 -47
- package/dist/plugin/hooks/create-core-hooks.d.ts +4 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +3 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +3 -1
- package/dist/plugin/recent-synthetic-idles.d.ts +1 -0
- package/dist/plugin/session-compacting.d.ts +31 -0
- package/dist/plugin/tool-registry.d.ts +16 -0
- package/dist/plugin-dispose.d.ts +13 -0
- package/dist/plugin-handlers/agent-priority-order.d.ts +6 -6
- package/dist/shared/agent-ordering.d.ts +8 -0
- package/dist/shared/agent-sort-shim.d.ts +8 -8
- package/dist/shared/agent-tool-restrictions.d.ts +5 -1
- package/dist/shared/bun-file-shim.d.ts +8 -0
- package/dist/shared/bun-hash-shim.d.ts +1 -0
- package/dist/shared/bun-spawn-shim.d.ts +1 -0
- package/dist/shared/bun-which-shim.d.ts +1 -0
- package/dist/shared/classify-path-environment.d.ts +3 -0
- package/dist/shared/event-session-id.d.ts +2 -0
- package/dist/shared/extract-semver.d.ts +1 -0
- package/dist/shared/fsync-skip-tracker.d.ts +12 -0
- package/dist/shared/fsync-skip-warning-formatter.d.ts +2 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/internal-initiator-marker.d.ts +8 -0
- package/dist/shared/model-capability-heuristics.d.ts +1 -0
- package/dist/shared/opencode-version.d.ts +14 -1
- package/dist/shared/project-discovery-dirs.d.ts +1 -0
- package/dist/shared/session-route.d.ts +18 -0
- package/dist/shared/shell-env.d.ts +1 -0
- package/dist/shared/tmux/cmux-detect.d.ts +8 -0
- package/dist/shared/tmux/constants.d.ts +1 -1
- package/dist/shared/tmux/index.d.ts +2 -0
- package/dist/shared/tmux/runner.d.ts +13 -0
- package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -1
- package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +13 -1
- package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +13 -1
- package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +9 -2
- package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +13 -1
- package/dist/shared/tmux/tmux-utils.d.ts +1 -1
- package/dist/shared/tolerant-fsync.d.ts +5 -0
- package/dist/shared/write-file-atomically.d.ts +4 -1
- package/dist/tools/call-omo-agent/agent-resolver.d.ts +5 -12
- package/dist/tools/call-omo-agent/constants.d.ts +2 -2
- package/dist/tools/delegate-task/model-string-parser.d.ts +9 -0
- package/dist/tools/delegate-task/openai-categories.d.ts +1 -0
- package/dist/tools/delegate-task/resolve-call-id.d.ts +2 -0
- package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
- package/dist/tools/delegate-task/subagent-resolver.d.ts +5 -1
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -0
- package/dist/tools/delegate-task/sync-result-fetcher.d.ts +3 -1
- package/dist/tools/delegate-task/types.d.ts +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/interactive-bash/constants.d.ts +1 -0
- package/dist/tools/interactive-bash/tmux-path-resolver.d.ts +1 -0
- package/dist/tools/look-at/missing-file-error.d.ts +2 -0
- package/dist/tools/skill/types.d.ts +2 -0
- package/package.json +3 -4
- package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +0 -11
|
@@ -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 {};
|
|
@@ -62,12 +62,12 @@ export declare const MemberSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
62
62
|
subagent_type: z.ZodString;
|
|
63
63
|
prompt: z.ZodOptional<z.ZodString>;
|
|
64
64
|
}, z.core.$strict>], "kind">;
|
|
65
|
-
export declare const TeamSpecSchema: z.ZodObject<{
|
|
66
|
-
version: z.ZodLiteral<1
|
|
65
|
+
export declare const TeamSpecSchema: z.ZodPipe<z.ZodObject<{
|
|
66
|
+
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
67
67
|
name: z.ZodString;
|
|
68
68
|
description: z.ZodOptional<z.ZodString>;
|
|
69
|
-
createdAt: z.ZodNumber
|
|
70
|
-
leadAgentId: z.ZodString
|
|
69
|
+
createdAt: z.ZodDefault<z.ZodNumber>;
|
|
70
|
+
leadAgentId: z.ZodOptional<z.ZodString>;
|
|
71
71
|
teamAllowedPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
72
|
sessionPermission: z.ZodOptional<z.ZodString>;
|
|
73
73
|
members: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -99,7 +99,69 @@ export declare const TeamSpecSchema: z.ZodObject<{
|
|
|
99
99
|
subagent_type: z.ZodString;
|
|
100
100
|
prompt: z.ZodOptional<z.ZodString>;
|
|
101
101
|
}, z.core.$strict>], "kind">>;
|
|
102
|
-
}, z.core.$strip
|
|
102
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
103
|
+
version: 1;
|
|
104
|
+
name: string;
|
|
105
|
+
createdAt: number;
|
|
106
|
+
members: ({
|
|
107
|
+
name: string;
|
|
108
|
+
backendType: "tmux" | "in-process";
|
|
109
|
+
isActive: boolean;
|
|
110
|
+
kind: "category";
|
|
111
|
+
category: string;
|
|
112
|
+
prompt: string;
|
|
113
|
+
cwd?: string | undefined;
|
|
114
|
+
worktreePath?: string | undefined;
|
|
115
|
+
subscriptions?: string[] | undefined;
|
|
116
|
+
color?: string | undefined;
|
|
117
|
+
} | {
|
|
118
|
+
name: string;
|
|
119
|
+
backendType: "tmux" | "in-process";
|
|
120
|
+
isActive: boolean;
|
|
121
|
+
kind: "subagent_type";
|
|
122
|
+
subagent_type: string;
|
|
123
|
+
cwd?: string | undefined;
|
|
124
|
+
worktreePath?: string | undefined;
|
|
125
|
+
subscriptions?: string[] | undefined;
|
|
126
|
+
color?: string | undefined;
|
|
127
|
+
prompt?: string | undefined;
|
|
128
|
+
})[];
|
|
129
|
+
description?: string | undefined;
|
|
130
|
+
leadAgentId?: string | undefined;
|
|
131
|
+
teamAllowedPaths?: string[] | undefined;
|
|
132
|
+
sessionPermission?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
version: 1;
|
|
135
|
+
name: string;
|
|
136
|
+
createdAt: number;
|
|
137
|
+
members: ({
|
|
138
|
+
name: string;
|
|
139
|
+
backendType: "tmux" | "in-process";
|
|
140
|
+
isActive: boolean;
|
|
141
|
+
kind: "category";
|
|
142
|
+
category: string;
|
|
143
|
+
prompt: string;
|
|
144
|
+
cwd?: string | undefined;
|
|
145
|
+
worktreePath?: string | undefined;
|
|
146
|
+
subscriptions?: string[] | undefined;
|
|
147
|
+
color?: string | undefined;
|
|
148
|
+
} | {
|
|
149
|
+
name: string;
|
|
150
|
+
backendType: "tmux" | "in-process";
|
|
151
|
+
isActive: boolean;
|
|
152
|
+
kind: "subagent_type";
|
|
153
|
+
subagent_type: string;
|
|
154
|
+
cwd?: string | undefined;
|
|
155
|
+
worktreePath?: string | undefined;
|
|
156
|
+
subscriptions?: string[] | undefined;
|
|
157
|
+
color?: string | undefined;
|
|
158
|
+
prompt?: string | undefined;
|
|
159
|
+
})[];
|
|
160
|
+
description?: string | undefined;
|
|
161
|
+
leadAgentId?: string | undefined;
|
|
162
|
+
teamAllowedPaths?: string[] | undefined;
|
|
163
|
+
sessionPermission?: string | undefined;
|
|
164
|
+
}>>;
|
|
103
165
|
export declare const MessageSchema: z.ZodObject<{
|
|
104
166
|
version: z.ZodLiteral<1>;
|
|
105
167
|
messageId: z.ZodString;
|
|
@@ -143,6 +205,46 @@ export declare const TaskSchema: z.ZodObject<{
|
|
|
143
205
|
updatedAt: z.ZodNumber;
|
|
144
206
|
claimedAt: z.ZodOptional<z.ZodNumber>;
|
|
145
207
|
}, z.core.$strip>;
|
|
208
|
+
declare const RuntimeStateMemberSchema: z.ZodObject<{
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
211
|
+
tmuxPaneId: z.ZodOptional<z.ZodString>;
|
|
212
|
+
tmuxGridPaneId: z.ZodOptional<z.ZodString>;
|
|
213
|
+
agentType: z.ZodEnum<{
|
|
214
|
+
leader: "leader";
|
|
215
|
+
"general-purpose": "general-purpose";
|
|
216
|
+
}>;
|
|
217
|
+
subagent_type: z.ZodOptional<z.ZodString>;
|
|
218
|
+
category: z.ZodOptional<z.ZodString>;
|
|
219
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
220
|
+
providerID: z.ZodString;
|
|
221
|
+
modelID: z.ZodString;
|
|
222
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
223
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
224
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
225
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
thinking: z.ZodOptional<z.ZodObject<{
|
|
228
|
+
type: z.ZodEnum<{
|
|
229
|
+
enabled: "enabled";
|
|
230
|
+
disabled: "disabled";
|
|
231
|
+
}>;
|
|
232
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
}, z.core.$strict>>;
|
|
235
|
+
status: z.ZodEnum<{
|
|
236
|
+
pending: "pending";
|
|
237
|
+
completed: "completed";
|
|
238
|
+
running: "running";
|
|
239
|
+
idle: "idle";
|
|
240
|
+
shutdown_approved: "shutdown_approved";
|
|
241
|
+
errored: "errored";
|
|
242
|
+
}>;
|
|
243
|
+
color: z.ZodOptional<z.ZodString>;
|
|
244
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
245
|
+
lastInjectedTurnMarker: z.ZodOptional<z.ZodString>;
|
|
246
|
+
pendingInjectedMessageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
247
|
+
}, z.core.$strict>;
|
|
146
248
|
export declare const RuntimeStateSchema: z.ZodObject<{
|
|
147
249
|
version: z.ZodLiteral<1>;
|
|
148
250
|
teamRunId: z.ZodString;
|
|
@@ -162,14 +264,39 @@ export declare const RuntimeStateSchema: z.ZodObject<{
|
|
|
162
264
|
orphaned: "orphaned";
|
|
163
265
|
}>;
|
|
164
266
|
leadSessionId: z.ZodOptional<z.ZodString>;
|
|
267
|
+
tmuxLayout: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
ownedSession: z.ZodBoolean;
|
|
269
|
+
targetSessionId: z.ZodString;
|
|
270
|
+
focusWindowId: z.ZodOptional<z.ZodString>;
|
|
271
|
+
gridWindowId: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strict>>;
|
|
165
273
|
members: z.ZodArray<z.ZodObject<{
|
|
166
274
|
name: z.ZodString;
|
|
167
275
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
168
276
|
tmuxPaneId: z.ZodOptional<z.ZodString>;
|
|
277
|
+
tmuxGridPaneId: z.ZodOptional<z.ZodString>;
|
|
169
278
|
agentType: z.ZodEnum<{
|
|
170
279
|
leader: "leader";
|
|
171
280
|
"general-purpose": "general-purpose";
|
|
172
281
|
}>;
|
|
282
|
+
subagent_type: z.ZodOptional<z.ZodString>;
|
|
283
|
+
category: z.ZodOptional<z.ZodString>;
|
|
284
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
285
|
+
providerID: z.ZodString;
|
|
286
|
+
modelID: z.ZodString;
|
|
287
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
288
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
289
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
thinking: z.ZodOptional<z.ZodObject<{
|
|
293
|
+
type: z.ZodEnum<{
|
|
294
|
+
enabled: "enabled";
|
|
295
|
+
disabled: "disabled";
|
|
296
|
+
}>;
|
|
297
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
}, z.core.$strip>>;
|
|
299
|
+
}, z.core.$strict>>;
|
|
173
300
|
status: z.ZodEnum<{
|
|
174
301
|
pending: "pending";
|
|
175
302
|
completed: "completed";
|
|
@@ -185,9 +312,11 @@ export declare const RuntimeStateSchema: z.ZodObject<{
|
|
|
185
312
|
}, z.core.$strict>>;
|
|
186
313
|
shutdownRequests: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
187
314
|
memberId: z.ZodString;
|
|
315
|
+
requesterName: z.ZodString;
|
|
188
316
|
requestedAt: z.ZodNumber;
|
|
189
317
|
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
190
318
|
rejectedReason: z.ZodOptional<z.ZodString>;
|
|
319
|
+
rejectedAt: z.ZodOptional<z.ZodNumber>;
|
|
191
320
|
}, z.core.$strict>>>;
|
|
192
321
|
bounds: z.ZodObject<{
|
|
193
322
|
maxMembers: z.ZodDefault<z.ZodNumber>;
|
|
@@ -201,10 +330,13 @@ export declare const AGENT_ELIGIBILITY_REGISTRY: Readonly<Record<string, {
|
|
|
201
330
|
verdict: "eligible" | "conditional" | "hard-reject";
|
|
202
331
|
rejectionMessage?: string;
|
|
203
332
|
}>>;
|
|
333
|
+
export declare function parseMember(input: unknown): Member;
|
|
204
334
|
export type TeamSpec = z.infer<typeof TeamSpecSchema>;
|
|
205
335
|
export type Member = z.infer<typeof MemberSchema>;
|
|
206
336
|
export type CategoryMember = z.infer<typeof CategoryMemberSchema>;
|
|
207
337
|
export type SubagentMember = z.infer<typeof SubagentMemberSchema>;
|
|
208
338
|
export type Message = z.infer<typeof MessageSchema>;
|
|
209
339
|
export type Task = z.infer<typeof TaskSchema>;
|
|
340
|
+
export type RuntimeStateMember = z.infer<typeof RuntimeStateMemberSchema>;
|
|
210
341
|
export type RuntimeState = z.infer<typeof RuntimeStateSchema>;
|
|
342
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const ATTACHABLE_SESSION_STATUSES: readonly ["idle", "running"];
|
|
2
|
+
export type AttachableSessionStatus = (typeof ATTACHABLE_SESSION_STATUSES)[number];
|
|
3
|
+
export declare function isAttachableSessionStatus(status: string | undefined): status is AttachableSessionStatus;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TmuxConfig } from "../../config/schema";
|
|
2
|
+
import type { TrackedSession } from "./types";
|
|
3
|
+
export declare function cleanupTmuxSessions(params: {
|
|
4
|
+
tmuxConfig: TmuxConfig;
|
|
5
|
+
directory: string;
|
|
6
|
+
serverUrl: string;
|
|
7
|
+
sourcePaneId: string | undefined;
|
|
8
|
+
sessions: Map<string, TrackedSession>;
|
|
9
|
+
stopPolling: () => void;
|
|
10
|
+
}): Promise<void>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { TmuxConfig } from "../../config/schema";
|
|
3
|
+
import type { WindowState } from "./types";
|
|
4
|
+
import * as sharedModule from "../../shared";
|
|
5
|
+
type OpencodeClient = PluginInput["client"];
|
|
3
6
|
interface SessionCreatedEvent {
|
|
4
7
|
type: string;
|
|
5
8
|
properties?: {
|
|
@@ -13,14 +16,24 @@ interface SessionCreatedEvent {
|
|
|
13
16
|
export interface TmuxUtilDeps {
|
|
14
17
|
isInsideTmux: () => boolean;
|
|
15
18
|
getCurrentPaneId: () => string | undefined;
|
|
19
|
+
queryWindowState: (paneId: string) => Promise<WindowState | null>;
|
|
20
|
+
waitForSessionReady: (params: {
|
|
21
|
+
client: OpencodeClient;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
}) => Promise<boolean>;
|
|
24
|
+
log: typeof sharedModule.log;
|
|
16
25
|
}
|
|
17
26
|
export declare class TmuxSessionManager {
|
|
18
27
|
private client;
|
|
19
28
|
private tmuxConfig;
|
|
29
|
+
private projectDirectory;
|
|
20
30
|
private serverUrl;
|
|
21
31
|
private sourcePaneId;
|
|
22
32
|
private sessions;
|
|
23
33
|
private pendingSessions;
|
|
34
|
+
private failedReadinessSessions;
|
|
35
|
+
private closedByPolling;
|
|
36
|
+
private failedReadinessSweepInterval?;
|
|
24
37
|
private spawnQueue;
|
|
25
38
|
private deferredSessions;
|
|
26
39
|
private deferredQueue;
|
|
@@ -34,7 +47,7 @@ export declare class TmuxSessionManager {
|
|
|
34
47
|
private isolatedContainerNullStateCount;
|
|
35
48
|
private staleSweepCompleted;
|
|
36
49
|
private staleSweepInProgress;
|
|
37
|
-
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig, deps?: TmuxUtilDeps);
|
|
50
|
+
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig, deps?: Partial<TmuxUtilDeps>);
|
|
38
51
|
private isEnabled;
|
|
39
52
|
private isIsolated;
|
|
40
53
|
private getEffectiveSourcePaneId;
|
|
@@ -42,11 +55,14 @@ export declare class TmuxSessionManager {
|
|
|
42
55
|
private getCapacityConfig;
|
|
43
56
|
private getSessionMappings;
|
|
44
57
|
getTrackedPaneId(sessionId: string): string | undefined;
|
|
58
|
+
getServerUrl(): string;
|
|
45
59
|
private removeTrackedSession;
|
|
46
60
|
private reassignIsolatedContainerAnchor;
|
|
47
61
|
private cleanupIsolatedContainerAfterSessionDeletion;
|
|
48
62
|
private markSessionClosePending;
|
|
49
63
|
private queryWindowStateSafely;
|
|
64
|
+
private windowStateContainsPane;
|
|
65
|
+
private finalizeForceRemoveCandidate;
|
|
50
66
|
private closeTrackedSessionPane;
|
|
51
67
|
private finalizeTrackedSessionClose;
|
|
52
68
|
private closeTrackedSession;
|
|
@@ -55,15 +71,28 @@ export declare class TmuxSessionManager {
|
|
|
55
71
|
private removeDeferredSession;
|
|
56
72
|
private startDeferredAttachLoop;
|
|
57
73
|
private stopDeferredAttachLoop;
|
|
74
|
+
private beginPendingSession;
|
|
75
|
+
private ensureSessionReadyBeforeSpawn;
|
|
76
|
+
private getSessionStatusType;
|
|
77
|
+
private rememberFailedReadinessSession;
|
|
78
|
+
private clearFailedReadinessSession;
|
|
79
|
+
private startFailedReadinessSweep;
|
|
80
|
+
private stopFailedReadinessSweep;
|
|
81
|
+
private isFailedReadinessSessionExpired;
|
|
82
|
+
private sweepExpiredFailedReadinessSessions;
|
|
83
|
+
private getFailedReadinessSession;
|
|
84
|
+
private spawnPendingSession;
|
|
85
|
+
private getEventSessionId;
|
|
86
|
+
private retryFailedReadinessSession;
|
|
58
87
|
private tryAttachDeferredSession;
|
|
59
|
-
private logSessionReadinessInBackground;
|
|
60
|
-
private waitForSessionReady;
|
|
61
88
|
onSessionCreated(event: SessionCreatedEvent): Promise<void>;
|
|
62
89
|
private enqueueSpawn;
|
|
63
90
|
onSessionDeleted(event: {
|
|
64
91
|
sessionID: string;
|
|
65
92
|
}): Promise<void>;
|
|
66
93
|
private closeSessionById;
|
|
94
|
+
private closeSessionFromPolling;
|
|
95
|
+
private shouldSkipRespawnAfterPollingClose;
|
|
67
96
|
onEvent(event: {
|
|
68
97
|
type: string;
|
|
69
98
|
properties?: Record<string, unknown>;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import type { WindowState } from "./types";
|
|
2
|
+
import { getTmuxPath } from "../../tools/interactive-bash/tmux-path-resolver";
|
|
3
|
+
import { log } from "../../shared";
|
|
4
|
+
import type { TmuxCommandResult } from "../../shared/tmux";
|
|
5
|
+
type QueryWindowStateDeps = {
|
|
6
|
+
getTmuxPath: typeof getTmuxPath;
|
|
7
|
+
runTmuxCommand: (tmuxPath: string, args: string[]) => Promise<TmuxCommandResult>;
|
|
8
|
+
log: typeof log;
|
|
9
|
+
};
|
|
10
|
+
export declare function queryWindowStateWithDeps(sourcePaneId: string, deps: QueryWindowStateDeps): Promise<WindowState | null>;
|
|
2
11
|
export declare function queryWindowState(sourcePaneId: string): Promise<WindowState | null>;
|
|
12
|
+
export {};
|
|
@@ -12,6 +12,7 @@ export interface SessionPollingController {
|
|
|
12
12
|
export declare function createSessionPollingController(params: {
|
|
13
13
|
client: OpencodeClient;
|
|
14
14
|
tmuxConfig: TmuxConfig;
|
|
15
|
+
directory: string;
|
|
15
16
|
serverUrl: string;
|
|
16
17
|
sourcePaneId: string | undefined;
|
|
17
18
|
sessions: Map<string, TrackedSession>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { TmuxConfig } from "../../config/schema";
|
|
3
|
+
import type { CapacityConfig, TrackedSession } from "./types";
|
|
4
|
+
import { type SessionMapping } from "./decision-engine";
|
|
5
|
+
import type { SessionCreatedEvent } from "./session-created-event";
|
|
6
|
+
type OpencodeClient = PluginInput["client"];
|
|
7
|
+
export interface SessionCreatedHandlerDeps {
|
|
8
|
+
client: OpencodeClient;
|
|
9
|
+
tmuxConfig: TmuxConfig;
|
|
10
|
+
directory: string;
|
|
11
|
+
serverUrl: string;
|
|
12
|
+
sourcePaneId: string | undefined;
|
|
13
|
+
sessions: Map<string, TrackedSession>;
|
|
14
|
+
pendingSessions: Set<string>;
|
|
15
|
+
isInsideTmux: () => boolean;
|
|
16
|
+
isEnabled: () => boolean;
|
|
17
|
+
getCapacityConfig: () => CapacityConfig;
|
|
18
|
+
getSessionMappings: () => SessionMapping[];
|
|
19
|
+
waitForSessionReady: (sessionId: string) => Promise<boolean>;
|
|
20
|
+
startPolling: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function handleSessionCreated(deps: SessionCreatedHandlerDeps, event: SessionCreatedEvent): Promise<void>;
|
|
23
|
+
export {};
|