@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,16 @@
|
|
|
1
|
+
import type { TmuxConfig } from "../../config/schema";
|
|
2
|
+
import type { TrackedSession } from "./types";
|
|
3
|
+
import { type SessionMapping } from "./decision-engine";
|
|
4
|
+
export interface SessionDeletedHandlerDeps {
|
|
5
|
+
tmuxConfig: TmuxConfig;
|
|
6
|
+
directory: string;
|
|
7
|
+
serverUrl: string;
|
|
8
|
+
sourcePaneId: string | undefined;
|
|
9
|
+
sessions: Map<string, TrackedSession>;
|
|
10
|
+
isEnabled: () => boolean;
|
|
11
|
+
getSessionMappings: () => SessionMapping[];
|
|
12
|
+
stopPolling: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function handleSessionDeleted(deps: SessionDeletedHandlerDeps, event: {
|
|
15
|
+
sessionID: string;
|
|
16
|
+
}): Promise<void>;
|
|
@@ -15,5 +15,5 @@ export declare function createAtlasHook(ctx: PluginInput, options?: AtlasHookOpt
|
|
|
15
15
|
args: Record<string, unknown>;
|
|
16
16
|
message?: string;
|
|
17
17
|
}) => Promise<void>;
|
|
18
|
-
"tool.execute.after": (toolInput: import("./types").ToolExecuteAfterInput, toolOutput: import("./types").ToolExecuteAfterOutput) => Promise<void>;
|
|
18
|
+
"tool.execute.after": (toolInput: import("./types").ToolExecuteAfterInput, toolOutput: import("./types").ToolExecuteAfterOutput | undefined) => Promise<void>;
|
|
19
19
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export type BoulderContinuationResult = "injected" | "skipped_background_tasks" | "skipped_agent_unavailable" | "failed";
|
|
2
|
+
import type { BackgroundTaskStatusProvider, SessionState } from "./types";
|
|
3
|
+
export type BoulderContinuationResult = "injected" | "skipped_active_session" | "skipped_background_tasks" | "skipped_agent_unavailable" | "failed";
|
|
5
4
|
export declare function injectBoulderContinuation(input: {
|
|
6
5
|
ctx: PluginInput;
|
|
7
6
|
sessionID: string;
|
|
@@ -12,6 +11,6 @@ export declare function injectBoulderContinuation(input: {
|
|
|
12
11
|
worktreePath?: string;
|
|
13
12
|
preferredTaskSessionId?: string;
|
|
14
13
|
preferredTaskTitle?: string;
|
|
15
|
-
backgroundManager?:
|
|
14
|
+
backgroundManager?: BackgroundTaskStatusProvider;
|
|
16
15
|
sessionState: SessionState;
|
|
17
16
|
}): Promise<BoulderContinuationResult>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import { findNearestMessageWithFields, findNearestMessageWithFieldsFromSDK } from "../../features/hook-message-injector";
|
|
3
|
+
import { getMessageDir, isSqliteBackend } from "../../shared";
|
|
2
4
|
import type { ModelInfo } from "./types";
|
|
3
5
|
type PromptContext = {
|
|
4
6
|
model?: ModelInfo;
|
|
5
7
|
tools?: Record<string, boolean>;
|
|
6
8
|
};
|
|
7
|
-
|
|
9
|
+
type RecentPromptContextDeps = {
|
|
10
|
+
isSqliteBackend: typeof isSqliteBackend;
|
|
11
|
+
getMessageDir: typeof getMessageDir;
|
|
12
|
+
findNearestMessageWithFields: typeof findNearestMessageWithFields;
|
|
13
|
+
findNearestMessageWithFieldsFromSDK: typeof findNearestMessageWithFieldsFromSDK;
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveRecentPromptContextForSession(ctx: PluginInput, sessionID: string, deps?: RecentPromptContextDeps): Promise<PromptContext>;
|
|
8
16
|
export declare function resolveRecentModelForSession(ctx: PluginInput, sessionID: string): Promise<ModelInfo | undefined>;
|
|
9
17
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const DIRECT_WORK_REMINDER: string;
|
|
2
2
|
export declare const BOULDER_CONTINUATION_PROMPT: string;
|
|
3
|
+
export declare const BOULDER_COMPLETE_PROMPT = "<system-reminder>\nBOULDER COMPLETE: plan \"{PLAN_NAME}\" is fully checked.\n\nTotal elapsed: {ELAPSED_HUMAN}\n\nPer-task breakdown:\n{TASK_BREAKDOWN}\n\nPer your <boulder_completion_response> instructions, print the final ORCHESTRATION COMPLETE summary in your next turn. This nudge fires at most once.\n</system-reminder>";
|
|
3
4
|
export declare const VERIFICATION_REMINDER = "**THE SUBAGENT JUST CLAIMED THIS TASK IS DONE. THEY ARE PROBABLY LYING.**\n\nSubagents say \"done\" when code has errors, tests pass trivially, logic is wrong,\nor they quietly added features nobody asked for. This happens EVERY TIME.\nAssume the work is broken until YOU prove otherwise.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (before running anything)**\n\nDo NOT run tests yet. Read the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat -- ':!node_modules'\")` - see exactly which files changed. Any file outside expected scope = scope creep.\n2. `Read` EVERY changed file - no exceptions, no skimming.\n3. For EACH file, critically ask:\n - Does this code ACTUALLY do what the task required? (Re-read the task, compare line by line)\n - Any stubs, TODOs, placeholders, hardcoded values? (`Grep` for TODO, FIXME, HACK, xxx)\n - Logic errors? Trace the happy path AND the error path in your head.\n - Anti-patterns? (`Grep` for `as any`, `@ts-ignore`, empty catch, console.log in changed files)\n - Scope creep? Did the subagent touch things or add features NOT in the task spec?\n4. Cross-check every claim:\n - Said \"Updated X\" - READ X. Actually updated, or just superficially touched?\n - Said \"Added tests\" - READ the tests. Do they test REAL behavior or just `expect(true).toBe(true)`?\n - Said \"Follows patterns\" - OPEN a reference file. Does it ACTUALLY match?\n\n**If you cannot explain what every changed line does, you have NOT reviewed it.**\n\n**PHASE 2: RUN AUTOMATED CHECKS (targeted, then broad)**\n\nNow that you understand the code, verify mechanically:\n1. `lsp_diagnostics` on EACH changed file - ZERO new errors\n2. Run tests for changed modules FIRST, then full suite\n3. Build/typecheck - exit 0\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. The code has bugs that tests don't cover. Fix the code.\n\n**PHASE 3: HANDS-ON QA - ACTUALLY RUN IT (MANDATORY for user-facing changes)**\n\nTests and linters CANNOT catch: visual bugs, wrong CLI output, broken user flows, API response shape issues.\n\n**If this task produced anything a user would SEE or INTERACT with, you MUST launch it and verify yourself.**\n\n- **Frontend/UI**: `/playwright` skill - load the page, click through the flow, check console. Verify: page loads, interactions work, console clean, responsive.\n- **TUI/CLI**: `interactive_bash` - run the command, try good input, try bad input, try --help. Verify: command runs, output correct, error messages helpful, edge inputs handled.\n- **API/Backend**: `Bash` with curl - hit the endpoint, check response body, send malformed input. Verify: returns 200, body correct, error cases return proper errors.\n- **Config/Build**: Actually start the service or import the config. Verify: loads without error, backward compatible.\n\nThis is NOT optional \"if applicable\". If the deliverable is user-facing and you did not run it, you are shipping untested work.\n\n**PHASE 4: GATE DECISION - Should you proceed to the next task?**\n\nAnswer honestly:\n1. Can I explain what EVERY changed line does? (If no - back to Phase 1)\n2. Did I SEE it work with my own eyes? (If user-facing and no - back to Phase 3)\n3. Am I confident nothing existing is broken? (If no - run broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO. Investigate until CERTAIN.\n\n- **All 3 YES** - Proceed: mark task complete, move to next.\n- **Any NO** - Reject: resume session with `session_id`, fix the specific issue.\n- **Unsure** - Reject: \"unsure\" = \"no\". Investigate until you have a definitive answer.\n\n**DO NOT proceed to the next task until all 4 phases are complete and the gate passes.**";
|
|
4
5
|
export declare const VERIFICATION_REMINDER_GEMINI = "**THE SUBAGENT HAS FINISHED. THEIR WORK IS EXTREMELY SUSPICIOUS.**\n\nThe subagent CLAIMS this task is done. Based on thousands of executions, subagent claims are FALSE more often than true.\nThey ROUTINELY:\n- Ship code with syntax errors they didn't bother to check\n- Create stub implementations with TODOs and call it \"done\"\n- Write tests that pass trivially (testing nothing meaningful)\n- Implement logic that does NOT match what was requested\n- Add features nobody asked for and call it \"improvement\"\n- Report \"all tests pass\" when they didn't run any tests\n\n**This is NOT a theoretical warning. This WILL happen on this task. Assume the work is BROKEN.**\n\n**YOU MUST VERIFY WITH ACTUAL TOOL CALLS. NOT REASONING. TOOL CALLS.**\nThinking \"it looks correct\" is NOT verification. Running `lsp_diagnostics` IS.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (DO NOT SKIP - DO NOT RUN TESTS YET)**\n\nRead the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat -- ':!node_modules'\")` - see exactly which files changed.\n2. `Read` EVERY changed file - no exceptions, no skimming.\n3. For EACH file:\n - Does this code ACTUALLY do what the task required? RE-READ the task spec.\n - Any stubs, TODOs, placeholders? `Grep` for TODO, FIXME, HACK, xxx\n - Anti-patterns? `Grep` for `as any`, `@ts-ignore`, empty catch\n - Scope creep? Did the subagent add things NOT in the task spec?\n4. Cross-check EVERY claim against actual code.\n\n**If you cannot explain what every changed line does, GO BACK AND READ AGAIN.**\n\n**PHASE 2: RUN AUTOMATED CHECKS**\n\n1. `lsp_diagnostics` on EACH changed file - ZERO new errors. ACTUALLY RUN THIS.\n2. Run tests for changed modules, then full suite. ACTUALLY RUN THESE.\n3. Build/typecheck - exit 0.\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. Fix the code.\n\n**PHASE 3: HANDS-ON QA (MANDATORY for user-facing changes)**\n\n- **Frontend/UI**: `/playwright`\n- **TUI/CLI**: `interactive_bash`\n- **API/Backend**: `Bash` with curl\n\n**If user-facing and you did not run it, you are shipping UNTESTED BROKEN work.**\n\n**PHASE 4: GATE DECISION**\n\n1. Can I explain what EVERY changed line does? (If no \u2192 Phase 1)\n2. Did I SEE it work via tool calls? (If user-facing and no \u2192 Phase 3)\n3. Am I confident nothing is broken? (If no \u2192 broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO.\n\n**DO NOT proceed to the next task until all 4 phases are complete.**";
|
|
5
6
|
export declare const ORCHESTRATOR_DELEGATION_REQUIRED: string;
|
|
@@ -5,6 +5,8 @@ export declare function createToolExecuteAfterHandler(input: {
|
|
|
5
5
|
ctx: PluginInput;
|
|
6
6
|
pendingFilePaths: Map<string, string>;
|
|
7
7
|
pendingTaskRefs: Map<string, PendingTaskRef>;
|
|
8
|
+
pendingPlanSnapshots?: Map<string, string>;
|
|
8
9
|
autoCommit: boolean;
|
|
9
10
|
getState: (sessionID: string) => SessionState;
|
|
10
|
-
|
|
11
|
+
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>;
|
|
12
|
+
}): (toolInput: ToolExecuteAfterInput, toolOutput: ToolExecuteAfterOutput | undefined) => Promise<void>;
|
|
@@ -4,6 +4,8 @@ export declare function createToolExecuteBeforeHandler(input: {
|
|
|
4
4
|
ctx: PluginInput;
|
|
5
5
|
pendingFilePaths: Map<string, string>;
|
|
6
6
|
pendingTaskRefs: Map<string, PendingTaskRef>;
|
|
7
|
+
pendingPlanSnapshots?: Map<string, string>;
|
|
8
|
+
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>;
|
|
7
9
|
}): (toolInput: {
|
|
8
10
|
tool: string;
|
|
9
11
|
sessionID?: string;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import type { AgentOverrides } from "../../config";
|
|
2
|
-
import type { BackgroundManager } from "../../features/background-agent";
|
|
3
2
|
import type { TopLevelTaskRef } from "../../features/boulder-state";
|
|
4
3
|
export type ModelInfo = {
|
|
5
4
|
providerID: string;
|
|
6
5
|
modelID: string;
|
|
7
6
|
variant?: string;
|
|
8
7
|
};
|
|
8
|
+
export interface BackgroundTaskStatusProvider {
|
|
9
|
+
getTasksByParentSession: (sessionID: string) => Array<{
|
|
10
|
+
status: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
9
13
|
export interface AtlasHookOptions {
|
|
10
14
|
directory: string;
|
|
11
|
-
backgroundManager?:
|
|
15
|
+
backgroundManager?: BackgroundTaskStatusProvider;
|
|
12
16
|
isContinuationStopped?: (sessionID: string) => boolean;
|
|
17
|
+
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>;
|
|
13
18
|
agentOverrides?: AgentOverrides;
|
|
19
|
+
idleSettleMs?: number;
|
|
14
20
|
/** Enable auto-commit after each atomic task completion (default: true) */
|
|
15
21
|
autoCommit?: boolean;
|
|
16
22
|
}
|
|
@@ -38,6 +44,7 @@ export type PendingTaskRef = {
|
|
|
38
44
|
};
|
|
39
45
|
export interface SessionState {
|
|
40
46
|
lastEventWasAbortError?: boolean;
|
|
47
|
+
skipNextIdleAfterRuntimeErrorRetry?: boolean;
|
|
41
48
|
lastContinuationInjectedAt?: number;
|
|
42
49
|
isInjectingContinuation?: boolean;
|
|
43
50
|
promptFailureCount: number;
|
|
@@ -46,4 +53,5 @@ export interface SessionState {
|
|
|
46
53
|
waitingForFinalWaveApproval?: boolean;
|
|
47
54
|
pendingFinalWaveTaskCount?: number;
|
|
48
55
|
approvedFinalWaveTaskCount?: number;
|
|
56
|
+
boulderCompletionNudgedAt?: Record<string, number>;
|
|
49
57
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CompactionContextClient } from "./types";
|
|
2
2
|
import type { TailMonitorState } from "./tail-monitor";
|
|
3
3
|
export declare function createRecoveryLogic(ctx: CompactionContextClient | undefined, getTailState: (sessionID: string) => TailMonitorState): {
|
|
4
|
-
recoverCheckpointedAgentConfig: (sessionID: string, reason: "session.compacted" | "no-text-tail") => Promise<boolean>;
|
|
4
|
+
recoverCheckpointedAgentConfig: (sessionID: string, reason: "compaction.autocontinue" | "session.compacted" | "no-text-tail") => Promise<boolean>;
|
|
5
5
|
maybeWarnAboutNoTextTail: (sessionID: string) => Promise<void>;
|
|
6
6
|
};
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
type ToolExecuteBeforeInput = {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
};
|
|
7
|
+
type ToolExecuteBeforeOutput = {
|
|
8
|
+
args: Record<string, unknown>;
|
|
9
|
+
};
|
|
2
10
|
export interface CompactionTodoPreserver {
|
|
3
11
|
capture: (sessionID: string) => Promise<void>;
|
|
12
|
+
restore: (sessionID: string) => Promise<void>;
|
|
4
13
|
event: (input: {
|
|
5
14
|
event: {
|
|
6
15
|
type: string;
|
|
7
16
|
properties?: unknown;
|
|
8
17
|
};
|
|
9
18
|
}) => Promise<void>;
|
|
19
|
+
"tool.execute.before": (input: ToolExecuteBeforeInput, output: ToolExecuteBeforeOutput) => Promise<void>;
|
|
10
20
|
}
|
|
11
21
|
export declare function createCompactionTodoPreserverHook(ctx: PluginInput): CompactionTodoPreserver;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type ToolExecuteInput = {
|
|
2
|
+
tool: string;
|
|
3
|
+
sessionID: string;
|
|
4
|
+
callID: string;
|
|
5
|
+
};
|
|
6
|
+
type ToolBeforeOutput = {
|
|
7
|
+
args: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
type ToolAfterOutput = {
|
|
10
|
+
title: string;
|
|
11
|
+
output: string;
|
|
12
|
+
metadata: unknown;
|
|
13
|
+
};
|
|
14
|
+
export declare function createFsyncSkipWarningHook(): {
|
|
15
|
+
"tool.execute.before": (input: ToolExecuteInput, _output: ToolBeforeOutput) => Promise<void>;
|
|
16
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { createKeywordDetectorHook } from "./keyword-detector";
|
|
|
23
23
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
24
24
|
export { createInteractiveBashSessionHook } from "./interactive-bash-session";
|
|
25
25
|
export { createThinkingBlockValidatorHook } from "./thinking-block-validator";
|
|
26
|
+
export { createTeamMailboxInjector } from "./team-mailbox-injector";
|
|
27
|
+
export { createTeamModeStatusInjector } from "./team-mode-status-injector";
|
|
26
28
|
export { createToolPairValidatorHook } from "./tool-pair-validator";
|
|
27
29
|
export { createCategorySkillReminderHook } from "./category-skill-reminder";
|
|
28
30
|
export { createRalphLoopHook, type RalphLoopHook } from "./ralph-loop";
|
|
@@ -35,6 +37,7 @@ export { createSisyphusJuniorNotepadHook } from "./sisyphus-junior-notepad";
|
|
|
35
37
|
export { createTaskResumeInfoHook } from "./task-resume-info";
|
|
36
38
|
export { createStartWorkHook } from "./start-work";
|
|
37
39
|
export { createAtlasHook } from "./atlas";
|
|
40
|
+
export { createTeamToolGating } from "./team-tool-gating";
|
|
38
41
|
export { createDelegateTaskRetryHook } from "./delegate-task-retry";
|
|
39
42
|
export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
|
|
40
43
|
export { createStopContinuationGuardHook, type StopContinuationGuard } from "./stop-continuation-guard";
|
|
@@ -52,3 +55,4 @@ export { createReadImageResizerHook } from "./read-image-resizer";
|
|
|
52
55
|
export { createTodoDescriptionOverrideHook } from "./todo-description-override";
|
|
53
56
|
export { createWebFetchRedirectGuardHook } from "./webfetch-redirect-guard";
|
|
54
57
|
export { createLegacyPluginToastHook } from "./legacy-plugin-toast";
|
|
58
|
+
export { createFsyncSkipWarningHook } from "./fsync-skip-warning";
|
|
@@ -3,7 +3,13 @@ export declare const INLINE_CODE_PATTERN: RegExp;
|
|
|
3
3
|
export { isPlannerAgent, isNonOmoAgent, getUltraworkMessage } from "./ultrawork";
|
|
4
4
|
export { SEARCH_PATTERN, SEARCH_MESSAGE } from "./search";
|
|
5
5
|
export { ANALYZE_PATTERN, ANALYZE_MESSAGE } from "./analyze";
|
|
6
|
+
export { TEAM_PATTERN, TEAM_MESSAGE } from "./team";
|
|
7
|
+
export { HYPERPLAN_PATTERN, HYPERPLAN_MESSAGE } from "./hyperplan";
|
|
8
|
+
import type { KeywordType } from "../../config/schema/keyword-detector";
|
|
9
|
+
export declare const HYPERPLAN_ULTRAWORK_PATTERN: RegExp;
|
|
10
|
+
export declare function getHyperplanUltraworkMessage(agentName?: string, modelID?: string): string;
|
|
6
11
|
export type KeywordDetector = {
|
|
12
|
+
type: KeywordType;
|
|
7
13
|
pattern: RegExp;
|
|
8
14
|
message: string | ((agentName?: string, modelID?: string) => string);
|
|
9
15
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { KeywordType } from "../../config/schema/keyword-detector";
|
|
1
2
|
export interface DetectedKeyword {
|
|
2
|
-
type:
|
|
3
|
+
type: KeywordType;
|
|
3
4
|
message: string;
|
|
4
5
|
}
|
|
5
6
|
export declare function removeCodeBlocks(text: string): string;
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function looksLikeSlashCommand(text: string): boolean;
|
|
8
|
+
export declare function detectKeywords(text: string, agentName?: string, modelID?: string, disabledKeywords?: ReadonlyArray<KeywordType>): string[];
|
|
9
|
+
export declare function detectKeywordsWithType(text: string, agentName?: string, modelID?: string, disabledKeywords?: ReadonlyArray<KeywordType>): DetectedKeyword[];
|
|
8
10
|
export declare function extractPromptText(parts: Array<{
|
|
9
11
|
type: string;
|
|
10
12
|
text?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { KeywordDetectorConfig } from "../../config/schema/keyword-detector";
|
|
2
3
|
import type { ContextCollector } from "../../features/context-injector";
|
|
3
4
|
import type { RalphLoopHook } from "../ralph-loop";
|
|
4
|
-
export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector, _ralphLoop?: Pick<RalphLoopHook, "startLoop"
|
|
5
|
+
export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector, _ralphLoop?: Pick<RalphLoopHook, "startLoop">, config?: KeywordDetectorConfig): {
|
|
5
6
|
"chat.message": (input: {
|
|
6
7
|
sessionID: string;
|
|
7
8
|
agent?: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hyperplan keyword detector.
|
|
3
|
+
*
|
|
4
|
+
* Triggers when the user wants adversarial multi-agent planning via team-mode.
|
|
5
|
+
*
|
|
6
|
+
* Triggers (case-insensitive, word-bounded):
|
|
7
|
+
* - English: hyperplan, hpp
|
|
8
|
+
*
|
|
9
|
+
* The detector injects a thin wrapper that loads the `hyperplan` skill, which
|
|
10
|
+
* carries the full orchestration instructions for the 5-member adversarial team.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HYPERPLAN_PATTERN: RegExp;
|
|
13
|
+
export declare const HYPERPLAN_MESSAGE = "<hyperplan-mode>\n**MANDATORY**: Say \"HYPERPLAN MODE ENABLED!\" as your first response, exactly once.\n\nThe user invoked **hyperplan mode** \u2014 adversarial multi-agent planning via team-mode.\n\nLOAD THE HYPERPLAN SKILL IMMEDIATELY:\n\n```\nskill(name=\"hyperplan\")\n```\n\nAfter loading, follow the skill's full workflow EXACTLY:\n1. Acknowledge and capture the planning request\n2. Spawn the adversarial team via `team_create` with category members `unspecified-low`, `unspecified-high`, `ultrabrain`, and `artistry`; include `deep` only if the category is enabled\n3. Round 1 \u2014 Independent analysis (each member produces findings)\n4. Round 2 \u2014 Cross-attack (each member ruthlessly attacks the other 4's findings)\n5. Round 3 \u2014 Defend, refine, or concede\n6. Distill defensible insights into a structured bundle (Lead does NOT write the plan)\n7. MANDATORY: hand the bundle to the `plan` agent via `task(subagent_type=\"plan\", ...)` \u2014 the plan agent owns sequencing, parallelization, and verification gates\n8. Present the plan agent's output verbatim with provenance line, then clean up the team\n\nDo NOT improvise. Do NOT skip rounds. Do NOT write the plan yourself in step 6 \u2014 the handoff to the plan agent in step 7 is non-negotiable. Be the lead orchestrator and let the adversarial members do the cross-critique.\n\nIf team-mode is unavailable (`team_*` tools missing), instruct the user to set `team_mode.enabled: true` in `~/.config/opencode/oh-my-opencode.jsonc` and restart opencode.\n</hyperplan-mode>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HYPERPLAN_PATTERN, HYPERPLAN_MESSAGE } from "./default";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team mode keyword detector.
|
|
3
|
+
*
|
|
4
|
+
* Triggers when the user explicitly invokes team-mode work:
|
|
5
|
+
* - English: team mode, team-mode, team_mode, teammode (case-insensitive)
|
|
6
|
+
* - Korean: 팀 모드, 팀모드, 팀으로
|
|
7
|
+
*
|
|
8
|
+
* The Korean variants use a negative lookbehind on Hangul syllables (가-힣)
|
|
9
|
+
* to prevent false positives like "스팀으로" matching "팀으로", or
|
|
10
|
+
* "스팀모드" matching "팀모드".
|
|
11
|
+
*/
|
|
12
|
+
export declare const TEAM_PATTERN: RegExp;
|
|
13
|
+
export declare const TEAM_MESSAGE = "[team-mode]\nTeam mode reference detected. If user wants team-mode work, MUST orchestrate via team_* tools (team_create -> team_task_create + team_send_message). NEVER substitute with delegate_task - it is not equivalent. If team_* tools are unavailable (team_mode disabled in config), instruct user to set team_mode.enabled=true and restart opencode.";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TEAM_PATTERN, TEAM_MESSAGE } from "./default";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export type ContinuationPromptResult = {
|
|
3
|
+
status: "dispatched";
|
|
4
|
+
} | {
|
|
5
|
+
status: "rejected";
|
|
6
|
+
error: Error;
|
|
7
|
+
};
|
|
2
8
|
export declare function injectContinuationPrompt(ctx: PluginInput, options: {
|
|
3
9
|
sessionID: string;
|
|
4
10
|
prompt: string;
|
|
5
11
|
directory: string;
|
|
6
12
|
apiTimeoutMs: number;
|
|
7
13
|
inheritFromSessionID?: string;
|
|
8
|
-
}): Promise<
|
|
14
|
+
}): Promise<ContinuationPromptResult>;
|
|
@@ -8,5 +8,13 @@ type ContinuationOptions = {
|
|
|
8
8
|
setSessionID: (sessionID: string) => RalphLoopState | null;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ContinuationResult = {
|
|
12
|
+
status: "dispatched";
|
|
13
|
+
} | {
|
|
14
|
+
status: "session_creation_rejected";
|
|
15
|
+
} | {
|
|
16
|
+
status: "dispatch_rejected";
|
|
17
|
+
error: unknown;
|
|
18
|
+
};
|
|
19
|
+
export declare function continueIteration(ctx: PluginInput, state: RalphLoopState, options: ContinuationOptions): Promise<ContinuationResult>;
|
|
12
20
|
export {};
|
|
@@ -20,4 +20,5 @@ export declare function createLoopStateController(options: {
|
|
|
20
20
|
markVerificationPending(sessionID: string): RalphLoopState | null;
|
|
21
21
|
setVerificationSessionID(sessionID: string, verificationSessionID: string): RalphLoopState | null;
|
|
22
22
|
restartAfterFailedVerification(sessionID: string, messageCountAtStart?: number): RalphLoopState | null;
|
|
23
|
+
clearVerificationState(sessionID: string, messageCountAtStart?: number): RalphLoopState | null;
|
|
23
24
|
};
|
|
@@ -2,6 +2,9 @@ import type { PluginInput } from "@opencode-ai/plugin";
|
|
|
2
2
|
import type { RalphLoopState } from "./types";
|
|
3
3
|
type LoopStateController = {
|
|
4
4
|
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
5
|
+
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
6
|
+
incrementIteration: () => RalphLoopState | null;
|
|
7
|
+
clear: () => boolean;
|
|
5
8
|
setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
|
|
6
9
|
};
|
|
7
10
|
export declare function handlePendingVerification(ctx: PluginInput, input: {
|
|
@@ -8,10 +8,12 @@ type LoopStateController = {
|
|
|
8
8
|
markVerificationPending: (sessionID: string) => RalphLoopState | null;
|
|
9
9
|
setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
|
|
10
10
|
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
11
|
+
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
11
12
|
};
|
|
12
13
|
type RalphLoopEventHandlerOptions = {
|
|
13
14
|
directory: string;
|
|
14
15
|
apiTimeoutMs: number;
|
|
16
|
+
idleSettleMs: number;
|
|
15
17
|
getTranscriptPath: (sessionID: string) => string | undefined;
|
|
16
18
|
checkSessionExists?: RalphLoopOptions["checkSessionExists"];
|
|
17
19
|
backgroundManager?: RalphLoopOptions["backgroundManager"];
|
|
@@ -19,6 +19,7 @@ export interface RalphLoopOptions {
|
|
|
19
19
|
config?: RalphLoopConfig;
|
|
20
20
|
getTranscriptPath?: (sessionId: string) => string;
|
|
21
21
|
apiTimeout?: number;
|
|
22
|
+
idleSettleMs?: number;
|
|
22
23
|
checkSessionExists?: (sessionId: string) => Promise<boolean>;
|
|
23
24
|
backgroundManager?: {
|
|
24
25
|
getTasksByParentSession: (sessionId: string) => Array<{
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { RalphLoopState } from "./types";
|
|
3
3
|
type LoopStateController = {
|
|
4
|
-
|
|
4
|
+
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
5
|
+
incrementIteration: () => RalphLoopState | null;
|
|
6
|
+
clear: () => boolean;
|
|
5
7
|
};
|
|
6
8
|
export declare function handleFailedVerification(ctx: PluginInput, input: {
|
|
7
9
|
state: RalphLoopState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { createOpencodeClient } from "@opencode-ai/sdk";
|
|
2
|
-
import type { MessageData } from "./types";
|
|
2
|
+
import type { MessageData, ResumeConfig } from "./types";
|
|
3
3
|
type Client = ReturnType<typeof createOpencodeClient>;
|
|
4
|
-
export declare function recoverToolResultMissing(client: Client, sessionID: string, failedAssistantMsg: MessageData): Promise<boolean>;
|
|
4
|
+
export declare function recoverToolResultMissing(client: Client, sessionID: string, failedAssistantMsg: MessageData, resumeConfig?: ResumeConfig): Promise<boolean>;
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DEFAULT_SESSION_IDLE_SETTLE_MS = 150;
|
|
2
|
+
export declare function settleAfterSessionIdle(ms?: number): Promise<void>;
|
|
3
|
+
type SessionStatusClient = {
|
|
4
|
+
session?: {
|
|
5
|
+
status?: () => Promise<unknown>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare function isActiveSessionStatusType(statusType: string): boolean;
|
|
9
|
+
export declare function isSessionActive(client: SessionStatusClient, sessionID: string): Promise<boolean>;
|
|
10
|
+
export declare function shouldPromptAfterSessionIdle(client: SessionStatusClient, sessionID: string, settleMs?: number): Promise<boolean>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TeamModeConfig } from "../../config/schema/team-mode";
|
|
2
|
+
import type { PluginContext } from "../../plugin/types";
|
|
3
|
+
import type { ExecutorContext } from "../../tools/delegate-task/executor-types";
|
|
4
|
+
type HookContext = ExecutorContext | PluginContext | Record<string, never>;
|
|
5
|
+
type TransformPart = {
|
|
6
|
+
type: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
synthetic?: boolean;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
type TransformMessageInfo = {
|
|
12
|
+
role: string;
|
|
13
|
+
sessionID?: string;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
type MessageWithParts = {
|
|
17
|
+
info: TransformMessageInfo;
|
|
18
|
+
parts: TransformPart[];
|
|
19
|
+
};
|
|
20
|
+
type TeamMailboxInjectorInput = {
|
|
21
|
+
sessionID?: string;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
type TeamMailboxInjectorOutput = {
|
|
25
|
+
messages: MessageWithParts[];
|
|
26
|
+
};
|
|
27
|
+
export type TeamMailboxInjectorHook = {
|
|
28
|
+
"experimental.chat.messages.transform"?: (input: TeamMailboxInjectorInput, output: TeamMailboxInjectorOutput) => Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
export declare function createTeamMailboxInjector(_ctx: HookContext, config: TeamModeConfig): TeamMailboxInjectorHook;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TeamModeConfig } from "../../config/schema/team-mode";
|
|
2
|
+
type TransformPart = {
|
|
3
|
+
type: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
synthetic?: boolean;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
type TransformMessageInfo = {
|
|
9
|
+
role: string;
|
|
10
|
+
sessionID?: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
type MessageWithParts = {
|
|
14
|
+
info: TransformMessageInfo;
|
|
15
|
+
parts: TransformPart[];
|
|
16
|
+
};
|
|
17
|
+
type TeamModeStatusInjectorInput = {
|
|
18
|
+
sessionID?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
type TeamModeStatusInjectorOutput = {
|
|
22
|
+
messages: MessageWithParts[];
|
|
23
|
+
};
|
|
24
|
+
export type TeamModeStatusInjectorHook = {
|
|
25
|
+
"experimental.chat.messages.transform"?: (input: TeamModeStatusInjectorInput, output: TeamModeStatusInjectorOutput) => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
export declare function createTeamModeStatusInjector(config: TeamModeConfig): TeamModeStatusInjectorHook;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createTeamModeStatusInjector } from "./hook";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TeamModeConfig } from "../../config/schema/team-mode";
|
|
2
|
+
type PromptAsyncInput = {
|
|
3
|
+
path: {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
body: {
|
|
7
|
+
parts: Array<{
|
|
8
|
+
type: "text";
|
|
9
|
+
text: string;
|
|
10
|
+
}>;
|
|
11
|
+
agent?: string;
|
|
12
|
+
model?: {
|
|
13
|
+
providerID: string;
|
|
14
|
+
modelID: string;
|
|
15
|
+
};
|
|
16
|
+
variant?: string;
|
|
17
|
+
};
|
|
18
|
+
query: {
|
|
19
|
+
directory: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type TeamIdleWakeHintContext = {
|
|
23
|
+
directory: string;
|
|
24
|
+
client: {
|
|
25
|
+
session: {
|
|
26
|
+
promptAsync?: (input: PromptAsyncInput) => Promise<unknown>;
|
|
27
|
+
status?: () => Promise<unknown>;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type HookInput = {
|
|
32
|
+
event: {
|
|
33
|
+
type: string;
|
|
34
|
+
properties?: unknown;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type HookImpl = (input: HookInput) => Promise<void>;
|
|
38
|
+
type TeamIdleWakeHintOptions = {
|
|
39
|
+
idleSettleMs?: number;
|
|
40
|
+
};
|
|
41
|
+
export declare function createTeamIdleWakeHint(ctx: TeamIdleWakeHintContext, config: TeamModeConfig, options?: TeamIdleWakeHintOptions): HookImpl;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TeamModeConfig } from "../../config/schema/team-mode";
|
|
2
|
+
import type { BackgroundManager } from "../../features/background-agent/manager";
|
|
3
|
+
import type { TmuxSessionManager } from "../../features/tmux-subagent/manager";
|
|
4
|
+
type HookInput = {
|
|
5
|
+
event: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties?: unknown;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type HookImpl = (input: HookInput) => Promise<void>;
|
|
11
|
+
export declare function createTeamLeadOrphanHandler(config: TeamModeConfig, tmuxMgr?: TmuxSessionManager, bgMgr?: BackgroundManager): HookImpl;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TeamModeConfig } from "../../config/schema/team-mode";
|
|
2
|
+
type HookInput = {
|
|
3
|
+
event: {
|
|
4
|
+
type: string;
|
|
5
|
+
properties?: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type HookImpl = (input: HookInput) => Promise<void>;
|
|
9
|
+
export declare function createTeamMemberErrorHandler(config: TeamModeConfig): HookImpl;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TeamModeConfig } from "../../config/schema/team-mode";
|
|
2
|
+
type HookInput = {
|
|
3
|
+
event: {
|
|
4
|
+
type: string;
|
|
5
|
+
properties?: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type HookImpl = (input: HookInput) => Promise<void>;
|
|
9
|
+
export declare function createTeamMemberStatusHandler(config: TeamModeConfig): HookImpl;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createTeamToolGating } from "./hook";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TODOWRITE_DESCRIPTION = "Use this tool to create and manage a structured task list for tracking progress on multi-step work.\n\n## Todo Format (MANDATORY)\n\nEach todo title MUST encode four elements: WHERE, WHY, HOW, and EXPECTED RESULT.\n\nFormat: \"[WHERE] [HOW] to [WHY] - expect [RESULT]\"\n\nGOOD:\n- \"src/utils/validation.ts: Add validateEmail() for input sanitization - returns boolean\"\n- \"UserService.create(): Call validateEmail() before DB insert - rejects invalid emails with 400\"\n- \"validation.test.ts: Add test for missing @ sign - expect validateEmail('foo') to return false\"\n\nBAD:\n- \"Implement email validation\" (where? how? what result?)\n- \"Add dark mode\" (feature, not a todo)\n- \"Fix auth\" (what file? what changes? what's expected?)\n\n## Granularity Rules\n\nEach todo MUST be a single atomic action completable in 1-3 tool calls. If it needs more, split it.\n\n**Size test**: Can you complete this todo by editing one file or running one command? If not, it's too big.\n\n## Task Management\n- One in_progress at a time. Complete it before starting the next.\n- Mark completed immediately after finishing each item.\n- Skip this tool for single trivial tasks (one-step, obvious action).";
|
|
1
|
+
export declare const TODOWRITE_DESCRIPTION = "Use this tool to create and manage a structured task list for tracking progress on multi-step work.\n\n## OpenCode Schema Contract\n\nThe upstream OpenCode `todowrite` schema expects each todo item to include:\n\n- `content`: string\n- `status`: string, one of `pending`, `in_progress`, `completed`, `cancelled`\n- `priority`: string, one of `high`, `medium`, `low`\n\n`priority` is a string field. Never send numeric priorities such as `0`, `1`, `2`, or labels such as `P0`, `P1`, `P2`.\n\n## Todo Format (MANDATORY)\n\nEach todo title MUST encode four elements: WHERE, WHY, HOW, and EXPECTED RESULT.\n\nFormat: \"[WHERE] [HOW] to [WHY] - expect [RESULT]\"\n\nGOOD:\n- \"src/utils/validation.ts: Add validateEmail() for input sanitization - returns boolean\"\n- \"UserService.create(): Call validateEmail() before DB insert - rejects invalid emails with 400\"\n- \"validation.test.ts: Add test for missing @ sign - expect validateEmail('foo') to return false\"\n\nBAD:\n- \"Implement email validation\" (where? how? what result?)\n- \"Add dark mode\" (feature, not a todo)\n- \"Fix auth\" (what file? what changes? what's expected?)\n\n## Granularity Rules\n\nEach todo MUST be a single atomic action completable in 1-3 tool calls. If it needs more, split it.\n\n**Size test**: Can you complete this todo by editing one file or running one command? If not, it's too big.\n\n## Task Management\n- One in_progress at a time. Complete it before starting the next.\n- Mark completed immediately after finishing each item.\n- Skip this tool for single trivial tasks (one-step, obvious action).";
|
|
@@ -55,12 +55,14 @@ type BabysitterContext = {
|
|
|
55
55
|
directory?: string;
|
|
56
56
|
};
|
|
57
57
|
}) => Promise<unknown>;
|
|
58
|
+
status?: () => Promise<unknown>;
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
61
|
};
|
|
61
62
|
type BabysitterOptions = {
|
|
62
63
|
backgroundManager: Pick<BackgroundManager, "getTasksByParentSession">;
|
|
63
64
|
config?: BabysittingConfig;
|
|
65
|
+
idleSettleMs?: number;
|
|
64
66
|
};
|
|
65
67
|
export declare function createUnstableAgentBabysitterHook(ctx: BabysitterContext, options: BabysitterOptions): {
|
|
66
68
|
event: ({ event }: {
|
|
@@ -6,10 +6,15 @@ export type GuardArgs = {
|
|
|
6
6
|
overwrite?: boolean | string;
|
|
7
7
|
};
|
|
8
8
|
export declare const MAX_TRACKED_PATHS_PER_SESSION = 1024;
|
|
9
|
+
type WriteExistingFileGuardOptions = {
|
|
10
|
+
maxTrackedSessions?: number;
|
|
11
|
+
maxTrackedPathsPerSession?: number;
|
|
12
|
+
};
|
|
9
13
|
export declare function asRecord(value: unknown): Record<string, unknown> | undefined;
|
|
10
14
|
export declare function getPathFromArgs(args: GuardArgs | undefined): string | undefined;
|
|
11
15
|
export declare function resolveInputPath(ctx: PluginInput, inputPath: string): string;
|
|
12
16
|
export declare function isPathInsideDirectory(pathToCheck: string, directory: string): boolean;
|
|
13
17
|
export declare function toCanonicalPath(absolutePath: string): string;
|
|
14
18
|
export declare function isOverwriteEnabled(value: boolean | string | undefined): boolean;
|
|
15
|
-
export declare function createWriteExistingFileGuardHook(ctx: PluginInput): Hooks;
|
|
19
|
+
export declare function createWriteExistingFileGuardHook(ctx: PluginInput, options?: WriteExistingFileGuardOptions): Hooks;
|
|
20
|
+
export {};
|