Browse Source

rename fork tool folder

Alvin Unreal 3 months ago
parent
commit
fdd27c72e0

+ 1 - 1
README.md

@@ -490,7 +490,7 @@ Use this section as a map: start with installation, then jump to features, confi
 | **[Session Management](docs/session-management.md)** | Reuse recent child-agent sessions with short aliases instead of starting over |
 | **[Todo Continuation](docs/todo-continuation.md)** | Auto-continue orchestrator sessions with cooldowns and safety checks |
 | **[Preset Switching](docs/preset-switching.md)** | Switch agent model presets at runtime with `/preset` |
-| **[Fork](docs/fork.md)** | Fork the current orchestrator context with `/fork-session`, do the requested work, and return a summary to the main session |
+| **[Fork](docs/fork.md)** | Fork the current orchestrator context with `/fork`, do the requested work, and return a summary to the main session |
 | **[Codemap](docs/codemap.md)** | Generate hierarchical codemaps to understand large codebases faster |
 | **[Interview](docs/interview.md)** | Turn rough ideas into a structured markdown spec through a browser-based Q&A flow |
 | **[Divoom Display](docs/divoom.md)** | Mirror orchestrator and specialist-agent activity to a Divoom MiniToo Bluetooth display |

+ 7 - 8
docs/fork.md

@@ -1,14 +1,13 @@
 # Fork
 
-`/fork-session` starts a boomerang-style fork of the current orchestrator
-session. The fork receives the best compact context the parent can provide, does
-the requested work, then returns a compact completion summary to the original
-session.
+`/fork` starts a boomerang-style fork of the current orchestrator session. The
+fork receives the best compact context the parent can provide, does the requested
+work, then returns a compact completion summary to the original session.
 
 ## Usage
 
 ```text
-/fork-session <what the forked orchestrator should do>
+/fork <what the forked orchestrator should do>
 ```
 
 The command asks the current orchestrator to call `fork_session` with a compact
@@ -35,9 +34,9 @@ real child session. Existing session-depth and pane cleanup handling apply.
 The user prompt controls scope. Keep it direct:
 
 ```text
-/fork-session finish the docs and run the relevant checks
-/fork-session investigate the flaky auth test and report what changed
-/fork-session implement the small UI polish we discussed
+/fork finish the docs and run the relevant checks
+/fork investigate the flaky auth test and report what changed
+/fork implement the small UI polish we discussed
 ```
 
 The fork prompt should stay compact: pass what the fork needs to act without

+ 1 - 1
docs/tools.md

@@ -40,7 +40,7 @@ Fork the current orchestrator context into a boomerang-style worker session.
 
 | Command / Tool | Description |
 |----------------|-------------|
-| `/fork-session <goal>` | Ask the current orchestrator to pass compact context into a forked worker session |
+| `/fork <goal>` | Ask the current orchestrator to pass compact context into a forked worker session |
 | `fork_session` | Runs a child fork worker session and returns its summary to the caller |
 | `read_session` | Reads transcript details from the source session when the fork prompt is missing specifics |
 

+ 1 - 1
src/codemap.md

@@ -34,7 +34,7 @@
 
 - Connects directly to `@opencode-ai/plugin`: returns the plugin object, mutates runtime agent configuration, handles event hooks, and routes RPC via `ctx.client`/`ctx.client.session`.
 - Integrates with host multiplexer backends through `src/multiplexer`, and with session lifecycle constraints through `SubagentDepthTracker`.
-- Hooks/handoff integration points now include:
+- Hooks/fork integration points now include:
   - `createTaskSessionManagerHook` for resumable Task sessions,
   - `createTodoContinuationHook`, `createPhaseReminderHook`, `createFilterAvailableSkillsHook`, and `createPostFileToolNudgeHook` for chat/tool behavior,
   - `createInterviewManager` / `createPresetManager` command handlers.

+ 4 - 4
src/tools/handoff/command.test.ts → src/tools/fork/command.test.ts

@@ -10,7 +10,7 @@ function createContext() {
 }
 
 describe('createForkCommandManager', () => {
-  test('registers the /fork-session command', () => {
+  test('registers the /fork command', () => {
     const manager = createForkCommandManager(
       createContext(),
       createForkState(),
@@ -20,9 +20,9 @@ describe('createForkCommandManager', () => {
     manager.registerCommand(config);
 
     const commands = config.command as Record<string, { template: string }>;
-    expect(commands['fork-session']).toBeDefined();
-    expect(commands['fork-session'].template).toContain('fork_session');
-    expect(commands['fork-session'].template).toContain('$ARGUMENTS');
+    expect(commands.fork).toBeDefined();
+    expect(commands.fork.template).toContain('fork_session');
+    expect(commands.fork.template).toContain('$ARGUMENTS');
   });
 
   test('marks child sessions of fork workers with the same source', () => {

+ 4 - 5
src/tools/handoff/command.ts → src/tools/fork/command.ts

@@ -1,13 +1,13 @@
 /**
  * Command registration manager for fork functionality.
  *
- * Manages the /fork-session slash command registration and template.
+ * Manages the /fork slash command registration and template.
  */
 
 import type { PluginInput } from '@opencode-ai/plugin';
 import type { ForkState } from './state';
 
-const COMMAND_NAME = 'fork-session';
+const COMMAND_NAME = 'fork';
 
 /**
  * Compact command template that lets the user request drive fork behavior.
@@ -24,8 +24,7 @@ Call fork_session with the worker prompt and clearly relevant files:
 /**
  * Creates a fork command manager.
  *
- * Handles registration of the /fork-session command and fork session state
- * events.
+ * Handles registration of the /fork command and fork session state events.
  */
 export function createForkCommandManager(
   _ctx: PluginInput,
@@ -33,7 +32,7 @@ export function createForkCommandManager(
   _processedSessions?: Set<string>,
 ) {
   /**
-   * Register the /fork-session command in the OpenCode config.
+   * Register the /fork command in the OpenCode config.
    */
   function registerCommand(opencodeConfig: Record<string, unknown>): void {
     const configCommand = opencodeConfig.command as

+ 0 - 0
src/tools/handoff/files.test.ts → src/tools/fork/files.test.ts


+ 0 - 0
src/tools/handoff/files.ts → src/tools/fork/files.ts


+ 0 - 0
src/tools/handoff/index.ts → src/tools/fork/index.ts


+ 0 - 0
src/tools/handoff/state.ts → src/tools/fork/state.ts


+ 0 - 0
src/tools/handoff/tools.test.ts → src/tools/fork/tools.test.ts


+ 0 - 0
src/tools/handoff/tools.ts → src/tools/fork/tools.ts


+ 0 - 0
src/tools/handoff/vendor.test.ts → src/tools/fork/vendor.test.ts


+ 0 - 0
src/tools/handoff/vendor.ts → src/tools/fork/vendor.ts


+ 2 - 2
src/tools/index.ts

@@ -1,13 +1,13 @@
 // AST-grep tools
 export { ast_grep_replace, ast_grep_search } from './ast-grep';
 export { createCouncilTool } from './council';
-export type { ForkCommandManager } from './handoff';
+export type { ForkCommandManager } from './fork';
 export {
   createForkCommandManager,
   createForkSessionTool,
   createForkState,
   createReadSessionTool,
-} from './handoff';
+} from './fork';
 export type { PresetManager } from './preset-manager';
 export { createPresetManager } from './preset-manager';
 export { createWebfetchTool } from './smartfetch';