oh-my-opencode 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/atlas.d.ts +1 -1
- package/dist/agents/utils.d.ts +3 -2
- package/dist/cli/config-manager.d.ts +77 -14
- package/dist/cli/index.js +340 -122
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +59 -0
- package/dist/features/background-agent/manager.d.ts +13 -2
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +1 -1
- package/dist/features/builtin-skills/skills.d.ts +5 -1
- package/dist/features/builtin-skills/skills.test.d.ts +1 -0
- package/dist/features/opencode-skill-loader/skill-content.d.ts +3 -2
- package/dist/features/tmux-subagent/action-executor.d.ts +22 -0
- package/dist/features/tmux-subagent/decision-engine.d.ts +38 -0
- package/dist/features/tmux-subagent/decision-engine.test.d.ts +1 -0
- package/dist/features/tmux-subagent/index.d.ts +5 -0
- package/dist/features/tmux-subagent/manager.d.ts +54 -0
- package/dist/features/tmux-subagent/manager.test.d.ts +1 -0
- package/dist/features/tmux-subagent/pane-state-querier.d.ts +2 -0
- package/dist/features/tmux-subagent/types.d.ts +51 -0
- package/dist/hooks/category-skill-reminder/index.d.ts +22 -0
- package/dist/hooks/category-skill-reminder/index.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +2 -0
- package/dist/hooks/sisyphus-junior-notepad/index.d.ts +12 -0
- package/dist/index.js +2905 -1009
- package/dist/shared/connected-providers-cache.d.ts +52 -0
- package/dist/shared/data-path.d.ts +16 -0
- package/dist/shared/index.d.ts +3 -1
- package/dist/shared/model-availability.d.ts +4 -5
- package/dist/shared/session-utils.d.ts +2 -0
- package/dist/shared/tmux/constants.d.ts +5 -0
- package/dist/shared/tmux/index.d.ts +3 -0
- package/dist/shared/tmux/tmux-utils.d.ts +17 -0
- package/dist/shared/tmux/tmux-utils.test.d.ts +1 -0
- package/dist/shared/tmux/types.d.ts +4 -0
- package/dist/tools/call-omo-agent/constants.d.ts +1 -1
- package/dist/tools/delegate-task/tools.d.ts +8 -1
- package/dist/tools/delegate-task/types.d.ts +2 -1
- package/dist/tools/index.d.ts +1 -2
- package/dist/tools/slashcommand/tools.test.d.ts +1 -0
- package/package.json +8 -8
- package/dist/hooks/background-compaction/index.d.ts +0 -19
- package/dist/shared/config-path.d.ts +0 -13
package/dist/config/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, RalphLoopConfigSchema, } from "./schema";
|
|
2
|
-
export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, RalphLoopConfig, } from "./schema";
|
|
1
|
+
export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, RalphLoopConfigSchema, TmuxConfigSchema, TmuxLayoutSchema, } from "./schema";
|
|
2
|
+
export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, RalphLoopConfig, TmuxConfig, TmuxLayout, } from "./schema";
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const BuiltinAgentNameSchema: z.ZodEnum<{
|
|
|
12
12
|
}>;
|
|
13
13
|
export declare const BuiltinSkillNameSchema: z.ZodEnum<{
|
|
14
14
|
playwright: "playwright";
|
|
15
|
+
"agent-browser": "agent-browser";
|
|
15
16
|
"frontend-ui-ux": "frontend-ui-ux";
|
|
16
17
|
"git-master": "git-master";
|
|
17
18
|
}>;
|
|
@@ -65,12 +66,14 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
65
66
|
"interactive-bash-session": "interactive-bash-session";
|
|
66
67
|
"thinking-block-validator": "thinking-block-validator";
|
|
67
68
|
"ralph-loop": "ralph-loop";
|
|
69
|
+
"category-skill-reminder": "category-skill-reminder";
|
|
68
70
|
"compaction-context-injector": "compaction-context-injector";
|
|
69
71
|
"claude-code-hooks": "claude-code-hooks";
|
|
70
72
|
"auto-slash-command": "auto-slash-command";
|
|
71
73
|
"edit-error-recovery": "edit-error-recovery";
|
|
72
74
|
"delegate-task-retry": "delegate-task-retry";
|
|
73
75
|
"prometheus-md-only": "prometheus-md-only";
|
|
76
|
+
"sisyphus-junior-notepad": "sisyphus-junior-notepad";
|
|
74
77
|
"start-work": "start-work";
|
|
75
78
|
}>;
|
|
76
79
|
export declare const BuiltinCommandNameSchema: z.ZodEnum<{
|
|
@@ -994,6 +997,36 @@ export declare const GitMasterConfigSchema: z.ZodObject<{
|
|
|
994
997
|
commit_footer: z.ZodDefault<z.ZodBoolean>;
|
|
995
998
|
include_co_authored_by: z.ZodDefault<z.ZodBoolean>;
|
|
996
999
|
}, z.core.$strip>;
|
|
1000
|
+
export declare const BrowserAutomationProviderSchema: z.ZodEnum<{
|
|
1001
|
+
playwright: "playwright";
|
|
1002
|
+
"agent-browser": "agent-browser";
|
|
1003
|
+
}>;
|
|
1004
|
+
export declare const BrowserAutomationConfigSchema: z.ZodObject<{
|
|
1005
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
1006
|
+
playwright: "playwright";
|
|
1007
|
+
"agent-browser": "agent-browser";
|
|
1008
|
+
}>>;
|
|
1009
|
+
}, z.core.$strip>;
|
|
1010
|
+
export declare const TmuxLayoutSchema: z.ZodEnum<{
|
|
1011
|
+
"main-horizontal": "main-horizontal";
|
|
1012
|
+
"main-vertical": "main-vertical";
|
|
1013
|
+
tiled: "tiled";
|
|
1014
|
+
"even-horizontal": "even-horizontal";
|
|
1015
|
+
"even-vertical": "even-vertical";
|
|
1016
|
+
}>;
|
|
1017
|
+
export declare const TmuxConfigSchema: z.ZodObject<{
|
|
1018
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1019
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
1020
|
+
"main-horizontal": "main-horizontal";
|
|
1021
|
+
"main-vertical": "main-vertical";
|
|
1022
|
+
tiled: "tiled";
|
|
1023
|
+
"even-horizontal": "even-horizontal";
|
|
1024
|
+
"even-vertical": "even-vertical";
|
|
1025
|
+
}>>;
|
|
1026
|
+
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
1027
|
+
main_pane_min_width: z.ZodDefault<z.ZodNumber>;
|
|
1028
|
+
agent_pane_min_width: z.ZodDefault<z.ZodNumber>;
|
|
1029
|
+
}, z.core.$strip>;
|
|
997
1030
|
export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
998
1031
|
$schema: z.ZodOptional<z.ZodString>;
|
|
999
1032
|
disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1010,6 +1043,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1010
1043
|
}>>>;
|
|
1011
1044
|
disabled_skills: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1012
1045
|
playwright: "playwright";
|
|
1046
|
+
"agent-browser": "agent-browser";
|
|
1013
1047
|
"frontend-ui-ux": "frontend-ui-ux";
|
|
1014
1048
|
"git-master": "git-master";
|
|
1015
1049
|
}>>>;
|
|
@@ -1037,12 +1071,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1037
1071
|
"interactive-bash-session": "interactive-bash-session";
|
|
1038
1072
|
"thinking-block-validator": "thinking-block-validator";
|
|
1039
1073
|
"ralph-loop": "ralph-loop";
|
|
1074
|
+
"category-skill-reminder": "category-skill-reminder";
|
|
1040
1075
|
"compaction-context-injector": "compaction-context-injector";
|
|
1041
1076
|
"claude-code-hooks": "claude-code-hooks";
|
|
1042
1077
|
"auto-slash-command": "auto-slash-command";
|
|
1043
1078
|
"edit-error-recovery": "edit-error-recovery";
|
|
1044
1079
|
"delegate-task-retry": "delegate-task-retry";
|
|
1045
1080
|
"prometheus-md-only": "prometheus-md-only";
|
|
1081
|
+
"sisyphus-junior-notepad": "sisyphus-junior-notepad";
|
|
1046
1082
|
"start-work": "start-work";
|
|
1047
1083
|
}>>>;
|
|
1048
1084
|
disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
@@ -1820,6 +1856,25 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1820
1856
|
commit_footer: z.ZodDefault<z.ZodBoolean>;
|
|
1821
1857
|
include_co_authored_by: z.ZodDefault<z.ZodBoolean>;
|
|
1822
1858
|
}, z.core.$strip>>;
|
|
1859
|
+
browser_automation_engine: z.ZodOptional<z.ZodObject<{
|
|
1860
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
1861
|
+
playwright: "playwright";
|
|
1862
|
+
"agent-browser": "agent-browser";
|
|
1863
|
+
}>>;
|
|
1864
|
+
}, z.core.$strip>>;
|
|
1865
|
+
tmux: z.ZodOptional<z.ZodObject<{
|
|
1866
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1867
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
1868
|
+
"main-horizontal": "main-horizontal";
|
|
1869
|
+
"main-vertical": "main-vertical";
|
|
1870
|
+
tiled: "tiled";
|
|
1871
|
+
"even-horizontal": "even-horizontal";
|
|
1872
|
+
"even-vertical": "even-vertical";
|
|
1873
|
+
}>>;
|
|
1874
|
+
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
1875
|
+
main_pane_min_width: z.ZodDefault<z.ZodNumber>;
|
|
1876
|
+
agent_pane_min_width: z.ZodDefault<z.ZodNumber>;
|
|
1877
|
+
}, z.core.$strip>>;
|
|
1823
1878
|
}, z.core.$strip>;
|
|
1824
1879
|
export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>;
|
|
1825
1880
|
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
|
|
@@ -1841,4 +1896,8 @@ export type CategoryConfig = z.infer<typeof CategoryConfigSchema>;
|
|
|
1841
1896
|
export type CategoriesConfig = z.infer<typeof CategoriesConfigSchema>;
|
|
1842
1897
|
export type BuiltinCategoryName = z.infer<typeof BuiltinCategoryNameSchema>;
|
|
1843
1898
|
export type GitMasterConfig = z.infer<typeof GitMasterConfigSchema>;
|
|
1899
|
+
export type BrowserAutomationProvider = z.infer<typeof BrowserAutomationProviderSchema>;
|
|
1900
|
+
export type BrowserAutomationConfig = z.infer<typeof BrowserAutomationConfigSchema>;
|
|
1901
|
+
export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
|
|
1902
|
+
export type TmuxLayout = z.infer<typeof TmuxLayoutSchema>;
|
|
1844
1903
|
export { AnyMcpNameSchema, type AnyMcpName, McpNameSchema, type McpName } from "../mcp/types";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
3
|
-
import type { BackgroundTaskConfig } from "../../config/schema";
|
|
3
|
+
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
|
|
4
4
|
interface EventProperties {
|
|
5
5
|
sessionID?: string;
|
|
6
6
|
info?: {
|
|
@@ -12,6 +12,12 @@ interface Event {
|
|
|
12
12
|
type: string;
|
|
13
13
|
properties?: EventProperties;
|
|
14
14
|
}
|
|
15
|
+
export interface SubagentSessionCreatedEvent {
|
|
16
|
+
sessionID: string;
|
|
17
|
+
parentID: string;
|
|
18
|
+
title: string;
|
|
19
|
+
}
|
|
20
|
+
export type OnSubagentSessionCreated = (event: SubagentSessionCreatedEvent) => Promise<void>;
|
|
15
21
|
export declare class BackgroundManager {
|
|
16
22
|
private static cleanupManagers;
|
|
17
23
|
private static cleanupRegistered;
|
|
@@ -25,9 +31,14 @@ export declare class BackgroundManager {
|
|
|
25
31
|
private concurrencyManager;
|
|
26
32
|
private shutdownTriggered;
|
|
27
33
|
private config?;
|
|
34
|
+
private tmuxEnabled;
|
|
35
|
+
private onSubagentSessionCreated?;
|
|
28
36
|
private queuesByKey;
|
|
29
37
|
private processingKeys;
|
|
30
|
-
constructor(ctx: PluginInput, config?: BackgroundTaskConfig
|
|
38
|
+
constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
|
|
39
|
+
tmuxConfig?: TmuxConfig;
|
|
40
|
+
onSubagentSessionCreated?: OnSubagentSessionCreated;
|
|
41
|
+
});
|
|
31
42
|
launch(input: LaunchInput): Promise<BackgroundTask>;
|
|
32
43
|
private processKey;
|
|
33
44
|
private startTask;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const RALPH_LOOP_TEMPLATE = "You are starting a Ralph Loop - a self-referential development loop that runs until task completion.\n\n## How Ralph Loop Works\n\n1. You will work on the task continuously\n2. When you believe the task is FULLY complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. If you don't output the promise, the loop will automatically inject another prompt to continue\n4. Maximum iterations: Configurable (default 100)\n\n## Rules\n\n- Focus on completing the task fully, not partially\n- Don't output the completion promise until the task is truly done\n- Each iteration should make meaningful progress toward the goal\n- If stuck, try different approaches\n- Use todos to track your progress\n\n## Exit Conditions\n\n1. **Completion**: Output
|
|
1
|
+
export declare const RALPH_LOOP_TEMPLATE = "You are starting a Ralph Loop - a self-referential development loop that runs until task completion.\n\n## How Ralph Loop Works\n\n1. You will work on the task continuously\n2. When you believe the task is FULLY complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. If you don't output the promise, the loop will automatically inject another prompt to continue\n4. Maximum iterations: Configurable (default 100)\n\n## Rules\n\n- Focus on completing the task fully, not partially\n- Don't output the completion promise until the task is truly done\n- Each iteration should make meaningful progress toward the goal\n- If stuck, try different approaches\n- Use todos to track your progress\n\n## Exit Conditions\n\n1. **Completion**: Output your completion promise tag when fully complete\n2. **Max Iterations**: Loop stops automatically at limit\n3. **Cancel**: User runs `/cancel-ralph` command\n\n## Your Task\n\nParse the arguments below and begin working on the task. The format is:\n`\"task description\" [--completion-promise=TEXT] [--max-iterations=N]`\n\nDefault completion promise is \"DONE\" and default max iterations is 100.";
|
|
2
2
|
export declare const CANCEL_RALPH_TEMPLATE = "Cancel the currently active Ralph Loop.\n\nThis will:\n1. Stop the loop from continuing\n2. Clear the loop state file\n3. Allow the session to end normally\n\nCheck if a loop is active and cancel it. Inform the user of the result.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const START_WORK_TEMPLATE = "You are starting a Sisyphus work session.\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Prometheus-generated plan files at `.sisyphus/plans/`\n\n2. **Check for active boulder state**: Read `.sisyphus/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.sisyphus/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Create/Update boulder.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\"\n }\n ```\n\n5. **Read the plan file** and start executing tasks according to
|
|
1
|
+
export declare const START_WORK_TEMPLATE = "You are starting a Sisyphus work session.\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Prometheus-generated plan files at `.sisyphus/plans/`\n\n2. **Check for active boulder state**: Read `.sisyphus/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.sisyphus/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Create/Update boulder.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\"\n }\n ```\n\n5. **Read the plan file** and start executing tasks according to atlas workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update boulder.json BEFORE starting work\n- Read the FULL plan file before delegating any tasks\n- Follow atlas delegation protocols (7-section format)";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export { createBuiltinSkills } from "./skills";
|
|
2
|
+
export { createBuiltinSkills, type CreateBuiltinSkillsOptions } from "./skills";
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "./types";
|
|
2
|
-
|
|
2
|
+
import type { BrowserAutomationProvider } from "../../config/schema";
|
|
3
|
+
export interface CreateBuiltinSkillsOptions {
|
|
4
|
+
browserProvider?: BrowserAutomationProvider;
|
|
5
|
+
}
|
|
6
|
+
export declare function createBuiltinSkills(options?: CreateBuiltinSkillsOptions): BuiltinSkill[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { LoadedSkill } from "./types";
|
|
2
|
-
import type { GitMasterConfig } from "../../config/schema";
|
|
2
|
+
import type { GitMasterConfig, BrowserAutomationProvider } from "../../config/schema";
|
|
3
3
|
export interface SkillResolutionOptions {
|
|
4
4
|
gitMasterConfig?: GitMasterConfig;
|
|
5
|
+
browserProvider?: BrowserAutomationProvider;
|
|
5
6
|
}
|
|
6
7
|
declare function clearSkillCache(): void;
|
|
7
|
-
declare function getAllSkills(): Promise<LoadedSkill[]>;
|
|
8
|
+
declare function getAllSkills(options?: SkillResolutionOptions): Promise<LoadedSkill[]>;
|
|
8
9
|
declare function extractSkillTemplate(skill: LoadedSkill): Promise<string>;
|
|
9
10
|
export { clearSkillCache, getAllSkills, extractSkillTemplate };
|
|
10
11
|
export declare function injectGitMasterConfig(template: string, config?: GitMasterConfig): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TmuxConfig } from "../../config/schema";
|
|
2
|
+
import type { PaneAction, WindowState } from "./types";
|
|
3
|
+
export interface ActionResult {
|
|
4
|
+
success: boolean;
|
|
5
|
+
paneId?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExecuteActionsResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
spawnedPaneId?: string;
|
|
11
|
+
results: Array<{
|
|
12
|
+
action: PaneAction;
|
|
13
|
+
result: ActionResult;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export interface ExecuteContext {
|
|
17
|
+
config: TmuxConfig;
|
|
18
|
+
serverUrl: string;
|
|
19
|
+
windowState: WindowState;
|
|
20
|
+
}
|
|
21
|
+
export declare function executeAction(action: PaneAction, ctx: ExecuteContext): Promise<ActionResult>;
|
|
22
|
+
export declare function executeActions(actions: PaneAction[], ctx: ExecuteContext): Promise<ExecuteActionsResult>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { WindowState, PaneAction, SpawnDecision, CapacityConfig, TmuxPaneInfo, SplitDirection } from "./types";
|
|
2
|
+
export interface SessionMapping {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
paneId: string;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface GridCapacity {
|
|
8
|
+
cols: number;
|
|
9
|
+
rows: number;
|
|
10
|
+
total: number;
|
|
11
|
+
}
|
|
12
|
+
export interface GridSlot {
|
|
13
|
+
row: number;
|
|
14
|
+
col: number;
|
|
15
|
+
}
|
|
16
|
+
export interface GridPlan {
|
|
17
|
+
cols: number;
|
|
18
|
+
rows: number;
|
|
19
|
+
slotWidth: number;
|
|
20
|
+
slotHeight: number;
|
|
21
|
+
}
|
|
22
|
+
export interface SpawnTarget {
|
|
23
|
+
targetPaneId: string;
|
|
24
|
+
splitDirection: SplitDirection;
|
|
25
|
+
}
|
|
26
|
+
export declare function getColumnCount(paneCount: number): number;
|
|
27
|
+
export declare function getColumnWidth(agentAreaWidth: number, paneCount: number): number;
|
|
28
|
+
export declare function isSplittableAtCount(agentAreaWidth: number, paneCount: number): boolean;
|
|
29
|
+
export declare function findMinimalEvictions(agentAreaWidth: number, currentCount: number): number | null;
|
|
30
|
+
export declare function canSplitPane(pane: TmuxPaneInfo, direction: SplitDirection): boolean;
|
|
31
|
+
export declare function canSplitPaneAnyDirection(pane: TmuxPaneInfo): boolean;
|
|
32
|
+
export declare function getBestSplitDirection(pane: TmuxPaneInfo): SplitDirection | null;
|
|
33
|
+
export declare function calculateCapacity(windowWidth: number, windowHeight: number): GridCapacity;
|
|
34
|
+
export declare function computeGridPlan(windowWidth: number, windowHeight: number, paneCount: number): GridPlan;
|
|
35
|
+
export declare function mapPaneToSlot(pane: TmuxPaneInfo, plan: GridPlan, mainPaneWidth: number): GridSlot;
|
|
36
|
+
export declare function findSpawnTarget(state: WindowState): SpawnTarget | null;
|
|
37
|
+
export declare function decideSpawnActions(state: WindowState, sessionId: string, description: string, _config: CapacityConfig, sessionMappings: SessionMapping[]): SpawnDecision;
|
|
38
|
+
export declare function decideCloseAction(state: WindowState, sessionId: string, sessionMappings: SessionMapping[]): PaneAction | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { TmuxConfig } from "../../config/schema";
|
|
3
|
+
interface SessionCreatedEvent {
|
|
4
|
+
type: string;
|
|
5
|
+
properties?: {
|
|
6
|
+
info?: {
|
|
7
|
+
id?: string;
|
|
8
|
+
parentID?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* State-first Tmux Session Manager
|
|
15
|
+
*
|
|
16
|
+
* Architecture:
|
|
17
|
+
* 1. QUERY: Get actual tmux pane state (source of truth)
|
|
18
|
+
* 2. DECIDE: Pure function determines actions based on state
|
|
19
|
+
* 3. EXECUTE: Execute actions with verification
|
|
20
|
+
* 4. UPDATE: Update internal cache only after tmux confirms success
|
|
21
|
+
*
|
|
22
|
+
* The internal `sessions` Map is just a cache for sessionId<->paneId mapping.
|
|
23
|
+
* The REAL source of truth is always queried from tmux.
|
|
24
|
+
*/
|
|
25
|
+
export declare class TmuxSessionManager {
|
|
26
|
+
private client;
|
|
27
|
+
private tmuxConfig;
|
|
28
|
+
private serverUrl;
|
|
29
|
+
private sourcePaneId;
|
|
30
|
+
private sessions;
|
|
31
|
+
private pendingSessions;
|
|
32
|
+
private pollInterval?;
|
|
33
|
+
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig);
|
|
34
|
+
private isEnabled;
|
|
35
|
+
private getCapacityConfig;
|
|
36
|
+
private getSessionMappings;
|
|
37
|
+
private waitForSessionReady;
|
|
38
|
+
onSessionCreated(event: SessionCreatedEvent): Promise<void>;
|
|
39
|
+
onSessionDeleted(event: {
|
|
40
|
+
sessionID: string;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
private startPolling;
|
|
43
|
+
private stopPolling;
|
|
44
|
+
private pollSessions;
|
|
45
|
+
private closeSessionById;
|
|
46
|
+
createEventHandler(): (input: {
|
|
47
|
+
event: {
|
|
48
|
+
type: string;
|
|
49
|
+
properties?: unknown;
|
|
50
|
+
};
|
|
51
|
+
}) => Promise<void>;
|
|
52
|
+
cleanup(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface TrackedSession {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
paneId: string;
|
|
4
|
+
description: string;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
lastSeenAt: Date;
|
|
7
|
+
}
|
|
8
|
+
export declare const MIN_PANE_WIDTH = 52;
|
|
9
|
+
export declare const MIN_PANE_HEIGHT = 11;
|
|
10
|
+
export interface TmuxPaneInfo {
|
|
11
|
+
paneId: string;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
title: string;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface WindowState {
|
|
20
|
+
windowWidth: number;
|
|
21
|
+
windowHeight: number;
|
|
22
|
+
mainPane: TmuxPaneInfo | null;
|
|
23
|
+
agentPanes: TmuxPaneInfo[];
|
|
24
|
+
}
|
|
25
|
+
export type SplitDirection = "-h" | "-v";
|
|
26
|
+
export type PaneAction = {
|
|
27
|
+
type: "close";
|
|
28
|
+
paneId: string;
|
|
29
|
+
sessionId: string;
|
|
30
|
+
} | {
|
|
31
|
+
type: "spawn";
|
|
32
|
+
sessionId: string;
|
|
33
|
+
description: string;
|
|
34
|
+
targetPaneId: string;
|
|
35
|
+
splitDirection: SplitDirection;
|
|
36
|
+
} | {
|
|
37
|
+
type: "replace";
|
|
38
|
+
paneId: string;
|
|
39
|
+
oldSessionId: string;
|
|
40
|
+
newSessionId: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
export interface SpawnDecision {
|
|
44
|
+
canSpawn: boolean;
|
|
45
|
+
actions: PaneAction[];
|
|
46
|
+
reason?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CapacityConfig {
|
|
49
|
+
mainPaneMinWidth: number;
|
|
50
|
+
agentPaneWidth: number;
|
|
51
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface ToolExecuteInput {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
agent?: string;
|
|
7
|
+
}
|
|
8
|
+
interface ToolExecuteOutput {
|
|
9
|
+
title: string;
|
|
10
|
+
output: string;
|
|
11
|
+
metadata: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare function createCategorySkillReminderHook(_ctx: PluginInput): {
|
|
14
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
|
15
|
+
event: ({ event }: {
|
|
16
|
+
event: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties?: unknown;
|
|
19
|
+
};
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -19,10 +19,12 @@ export { createKeywordDetectorHook } from "./keyword-detector";
|
|
|
19
19
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
20
20
|
export { createInteractiveBashSessionHook } from "./interactive-bash-session";
|
|
21
21
|
export { createThinkingBlockValidatorHook } from "./thinking-block-validator";
|
|
22
|
+
export { createCategorySkillReminderHook } from "./category-skill-reminder";
|
|
22
23
|
export { createRalphLoopHook, type RalphLoopHook } from "./ralph-loop";
|
|
23
24
|
export { createAutoSlashCommandHook } from "./auto-slash-command";
|
|
24
25
|
export { createEditErrorRecoveryHook } from "./edit-error-recovery";
|
|
25
26
|
export { createPrometheusMdOnlyHook } from "./prometheus-md-only";
|
|
27
|
+
export { createSisyphusJuniorNotepadHook } from "./sisyphus-junior-notepad";
|
|
26
28
|
export { createTaskResumeInfoHook } from "./task-resume-info";
|
|
27
29
|
export { createStartWorkHook } from "./start-work";
|
|
28
30
|
export { createAtlasHook } from "./atlas";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "sisyphus-junior-notepad";
|
|
2
|
+
export declare const NOTEPAD_DIRECTIVE = "\n<Work_Context>\n## Notepad Location (for recording learnings)\nNOTEPAD PATH: .sisyphus/notepads/{plan-name}/\n- learnings.md: Record patterns, conventions, successful approaches\n- issues.md: Record problems, blockers, gotchas encountered\n- decisions.md: Record architectural choices and rationales\n- problems.md: Record unresolved issues, technical debt\n\nYou SHOULD append findings to notepad files after completing work.\nIMPORTANT: Always APPEND to notepad files - never overwrite or use Edit tool.\n\n## Plan Location (READ ONLY)\nPLAN PATH: .sisyphus/plans/{plan-name}.md\n\nCRITICAL RULE: NEVER MODIFY THE PLAN FILE\n\nThe plan file (.sisyphus/plans/*.md) is SACRED and READ-ONLY.\n- You may READ the plan to understand tasks\n- You may READ checkbox items to know what to do\n- You MUST NOT edit, modify, or update the plan file\n- You MUST NOT mark checkboxes as complete in the plan\n- Only the Orchestrator manages the plan file\n\nVIOLATION = IMMEDIATE FAILURE. The Orchestrator tracks plan state.\n</Work_Context>\n";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export * from "./constants";
|
|
3
|
+
export declare function createSisyphusJuniorNotepadHook(ctx: PluginInput): {
|
|
4
|
+
"tool.execute.before": (input: {
|
|
5
|
+
tool: string;
|
|
6
|
+
sessionID: string;
|
|
7
|
+
callID: string;
|
|
8
|
+
}, output: {
|
|
9
|
+
args: Record<string, unknown>;
|
|
10
|
+
message?: string;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
};
|