oh-my-opencode-slim 1.0.6 → 1.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.
Files changed (56) hide show
  1. package/README.md +30 -17
  2. package/dist/cli/config-io.d.ts +1 -0
  3. package/dist/cli/divoom.d.ts +23 -0
  4. package/dist/cli/doctor.d.ts +38 -0
  5. package/dist/cli/index.js +469 -58
  6. package/dist/cli/providers.d.ts +3 -0
  7. package/dist/config/council-schema.d.ts +2 -2
  8. package/dist/config/index.d.ts +1 -1
  9. package/dist/config/loader.d.ts +46 -1
  10. package/dist/config/schema.d.ts +23 -0
  11. package/dist/divoom/council.gif +0 -0
  12. package/dist/divoom/designer.gif +0 -0
  13. package/dist/divoom/explorer.gif +0 -0
  14. package/dist/divoom/fixer.gif +0 -0
  15. package/dist/divoom/input.gif +0 -0
  16. package/dist/divoom/intro.gif +0 -0
  17. package/dist/divoom/librarian.gif +0 -0
  18. package/dist/divoom/manager.d.ts +57 -0
  19. package/dist/divoom/oracle.gif +0 -0
  20. package/dist/divoom/orchestrator.gif +0 -0
  21. package/dist/index.js +1304 -291
  22. package/dist/integrations/divoom/index.d.ts +3 -0
  23. package/dist/integrations/divoom/status-manager.d.ts +31 -0
  24. package/dist/integrations/divoom/swift-helper-source.d.ts +1 -0
  25. package/dist/integrations/divoom/swift-transport.d.ts +26 -0
  26. package/dist/integrations/divoom/types.d.ts +41 -0
  27. package/dist/multiplexer/tmux/index.d.ts +5 -0
  28. package/dist/tools/council.d.ts +2 -2
  29. package/dist/tools/fork/command.d.ts +28 -0
  30. package/dist/tools/fork/files.d.ts +33 -0
  31. package/dist/tools/fork/index.d.ts +10 -0
  32. package/dist/tools/fork/state.d.ts +7 -0
  33. package/dist/tools/fork/tools.d.ts +23 -0
  34. package/dist/tools/fork/vendor.d.ts +28 -0
  35. package/dist/tools/handoff/command.d.ts +29 -0
  36. package/dist/tools/handoff/files.d.ts +33 -0
  37. package/dist/tools/handoff/index.d.ts +10 -0
  38. package/dist/tools/handoff/state.d.ts +7 -0
  39. package/dist/tools/handoff/tools.d.ts +23 -0
  40. package/dist/tools/handoff/vendor.d.ts +28 -0
  41. package/dist/tools/index.d.ts +2 -0
  42. package/dist/tools/subtask/command.d.ts +30 -0
  43. package/dist/tools/subtask/files.d.ts +34 -0
  44. package/dist/tools/subtask/index.d.ts +11 -0
  45. package/dist/tools/subtask/state.d.ts +7 -0
  46. package/dist/tools/subtask/tools.d.ts +23 -0
  47. package/dist/tools/subtask/vendor.d.ts +27 -0
  48. package/dist/tui.d.ts +1 -0
  49. package/dist/tui.js +679 -11
  50. package/dist/utils/session.d.ts +11 -4
  51. package/oh-my-opencode-slim.schema.json +59 -0
  52. package/package.json +3 -2
  53. package/src/skills/clonedeps/README.md +23 -0
  54. package/src/skills/clonedeps/SKILL.md +237 -0
  55. package/src/skills/clonedeps/codemap.md +41 -0
  56. package/src/skills/codemap.md +8 -5
@@ -0,0 +1,3 @@
1
+ export * from './status-manager';
2
+ export * from './swift-transport';
3
+ export * from './types';
@@ -0,0 +1,31 @@
1
+ import type { DivoomEvent, DivoomStatus, DivoomStatusManagerOptions, DivoomStatusUpdate, DivoomTransport } from './types';
2
+ export declare class DryRunDivoomTransport implements DivoomTransport {
3
+ sendStatus(update: DivoomStatusUpdate): Promise<void>;
4
+ }
5
+ export declare class DivoomStatusManager {
6
+ private readonly enabled;
7
+ private readonly debounceMs;
8
+ private readonly transport;
9
+ private readonly now;
10
+ private readonly schedule;
11
+ private readonly clearSchedule;
12
+ private readonly sessions;
13
+ private currentStatus;
14
+ private pendingStatus;
15
+ private pendingReason;
16
+ private pendingTimer;
17
+ private quiescentIdleTimer;
18
+ private readonly beforeExitHandler?;
19
+ constructor(options?: DivoomStatusManagerOptions);
20
+ handleEvent(input: {
21
+ event: DivoomEvent;
22
+ }): Promise<void>;
23
+ dispose(): Promise<void>;
24
+ getStatus(): DivoomStatus;
25
+ private deriveStatus;
26
+ private requestStatus;
27
+ private flushPendingStatus;
28
+ private scheduleQuiescentIdle;
29
+ private clearQuiescentIdle;
30
+ }
31
+ export declare function createDivoomStatusManager(options?: DivoomStatusManagerOptions): DivoomStatusManager;
@@ -0,0 +1 @@
1
+ export declare const DIVOOM_SWIFT_HELPER_SOURCE: string;
@@ -0,0 +1,26 @@
1
+ import type { DivoomConfig } from '../../config';
2
+ import type { CommandRunner, DivoomStatusUpdate, DivoomTransport } from './types';
3
+ export type SwiftDivoomTransportOptions = {
4
+ config: DivoomConfig;
5
+ storageDir?: string;
6
+ runner?: CommandRunner;
7
+ platform?: NodeJS.Platform;
8
+ };
9
+ export declare class SwiftDivoomTransport implements DivoomTransport {
10
+ private readonly deviceAddress;
11
+ private readonly faces;
12
+ private readonly storageDir;
13
+ private readonly runner;
14
+ private readonly platform;
15
+ private helperPath;
16
+ private preparePromise;
17
+ constructor(options: SwiftDivoomTransportOptions);
18
+ sendStatus(update: DivoomStatusUpdate): Promise<void>;
19
+ private prepareHelper;
20
+ private compileHelper;
21
+ }
22
+ export declare function createDivoomTransport(options: {
23
+ config?: DivoomConfig;
24
+ storageDir?: string;
25
+ runner?: CommandRunner;
26
+ }): DivoomTransport | undefined;
@@ -0,0 +1,41 @@
1
+ import type { DivoomConfig } from '../../config';
2
+ export type DivoomStatus = 'idle' | 'working' | 'alerting';
3
+ export type DivoomEvent = {
4
+ type: string;
5
+ properties?: {
6
+ info?: {
7
+ id?: string;
8
+ parentID?: string;
9
+ title?: string;
10
+ agent?: string;
11
+ sessionID?: string;
12
+ };
13
+ sessionID?: string;
14
+ status?: {
15
+ type: string;
16
+ };
17
+ };
18
+ };
19
+ export type DivoomStatusUpdate = {
20
+ status: DivoomStatus;
21
+ reason: string;
22
+ timestamp: number;
23
+ };
24
+ export interface DivoomTransport {
25
+ sendStatus(update: DivoomStatusUpdate): Promise<void>;
26
+ dispose?(): Promise<void> | void;
27
+ }
28
+ export type DivoomStatusManagerOptions = {
29
+ config?: DivoomConfig;
30
+ transport?: DivoomTransport;
31
+ storageDir?: string;
32
+ registerBeforeExit?: boolean;
33
+ now?: () => number;
34
+ schedule?: (callback: () => void, delayMs: number) => unknown;
35
+ clearSchedule?: (timer: unknown) => void;
36
+ };
37
+ export type DivoomStatusFaceMap = Record<DivoomStatus, number>;
38
+ export type CommandRunner = (command: string, args: string[]) => Promise<{
39
+ stdout: string;
40
+ stderr: string;
41
+ }>;
@@ -10,12 +10,17 @@ export declare class TmuxMultiplexer implements Multiplexer {
10
10
  private storedLayout;
11
11
  private storedMainPaneSize;
12
12
  private targetPane;
13
+ private layoutTimer?;
14
+ private layoutGeneration;
13
15
  constructor(layout?: MultiplexerLayout, mainPaneSize?: number);
14
16
  isAvailable(): Promise<boolean>;
15
17
  isInsideSession(): boolean;
16
18
  spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
17
19
  closePane(paneId: string): Promise<boolean>;
18
20
  applyLayout(layout: MultiplexerLayout, mainPaneSize: number): Promise<void>;
21
+ private scheduleLayout;
22
+ private applyLayoutNow;
23
+ private runTmux;
19
24
  private getBinary;
20
25
  private targetArgs;
21
26
  private findBinary;
@@ -1,5 +1,5 @@
1
- import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
- import type { CouncilManager } from "../council/council-manager";
1
+ import { type PluginInput, type ToolDefinition } from '@opencode-ai/plugin';
2
+ import type { CouncilManager } from '../council/council-manager';
3
3
  /**
4
4
  * Creates the council_session tool for multi-LLM orchestration.
5
5
  *
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Command registration manager for fork functionality.
3
+ *
4
+ * Manages the /fork slash command registration and template.
5
+ */
6
+ import type { PluginInput } from '@opencode-ai/plugin';
7
+ import type { ForkState } from './state';
8
+ /**
9
+ * Creates a fork command manager.
10
+ *
11
+ * Handles registration of the /fork command and fork session state events.
12
+ */
13
+ export declare function createForkCommandManager(_ctx: PluginInput, state: ForkState, _processedSessions?: Set<string>): {
14
+ registerCommand: (opencodeConfig: Record<string, unknown>) => void;
15
+ handleEvent(input: {
16
+ event: {
17
+ type: string;
18
+ properties?: {
19
+ info?: {
20
+ id?: string;
21
+ parentID?: string;
22
+ };
23
+ sessionID?: string;
24
+ };
25
+ };
26
+ }): void;
27
+ };
28
+ export type ForkCommandManager = ReturnType<typeof createForkCommandManager>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * File reference parsing and synthetic file parts for fork sessions.
3
+ *
4
+ * Handles extraction of @file references from fork prompts and
5
+ * building synthetic text parts that match OpenCode's Read tool output
6
+ * format.
7
+ */
8
+ import type { TextPartInput } from '@opencode-ai/sdk';
9
+ /**
10
+ * File reference regex matching OpenCode's internal pattern.
11
+ * Matches @file references like @src/plugin.ts
12
+ */
13
+ export declare const FILE_REGEX: RegExp;
14
+ /**
15
+ * Parse @file references from text.
16
+ *
17
+ * @param text - Text to search for @file references
18
+ * @returns Set of file paths referenced in the text
19
+ */
20
+ export declare function parseFileReferences(text: string): Set<string>;
21
+ /**
22
+ * Build synthetic text parts matching OpenCode's Read tool output.
23
+ *
24
+ * Creates two synthetic text parts for each file:
25
+ * 1. Header describing the Read tool call
26
+ * 2. Formatted file content with line numbers
27
+ *
28
+ * @param directory - Project directory to resolve relative paths against
29
+ * @param refs - Set of file path references to check
30
+ * @returns Array of synthetic text parts (non-existent and binary files are
31
+ * skipped)
32
+ */
33
+ export declare function buildSyntheticFileParts(directory: string, refs: Set<string>): Promise<TextPartInput[]>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Fork functionality for orchestrator worker sessions.
3
+ *
4
+ * Provides tools and commands for forking current context into child workers.
5
+ */
6
+ export { createForkCommandManager, type ForkCommandManager, } from './command';
7
+ export { buildSyntheticFileParts, FILE_REGEX, parseFileReferences, } from './files';
8
+ export { createForkState, type ForkState } from './state';
9
+ export { createForkSessionTool, createReadSessionTool, type OpencodeClient, } from './tools';
10
+ export { DEFAULT_READ_LIMIT, formatFileContent, isBinaryFile, MAX_BYTES, MAX_LINE_LENGTH, } from './vendor';
@@ -0,0 +1,7 @@
1
+ export interface ForkState {
2
+ markSession(sessionID: string, sourceSessionID: string): void;
3
+ unmarkSession(sessionID: string): void;
4
+ isForkSession(sessionID: string): boolean;
5
+ sourceFor(sessionID: string): string | undefined;
6
+ }
7
+ export declare function createForkState(): ForkState;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Tool definitions for fork functionality.
3
+ *
4
+ * Factory functions that create tool definitions with injected dependencies:
5
+ * - createForkSessionTool: Create a fork worker session
6
+ * - createReadSessionTool: Read conversation transcript from a session
7
+ */
8
+ import type { PluginInput, ToolDefinition } from '@opencode-ai/plugin';
9
+ import type { SubagentDepthTracker } from '../../utils/subagent-depth';
10
+ import type { ForkState } from './state';
11
+ export type OpencodeClient = PluginInput['client'];
12
+ /**
13
+ * Create the fork_session tool.
14
+ *
15
+ * Takes the OpenCode client as a dependency for TUI and session operations.
16
+ */
17
+ export declare function createForkSessionTool(ctx: PluginInput, state: ForkState, depthTracker?: SubagentDepthTracker): ToolDefinition;
18
+ /**
19
+ * Create the read_session tool.
20
+ *
21
+ * Takes the OpenCode client as a dependency for session.messages() calls.
22
+ */
23
+ export declare function createReadSessionTool(client: OpencodeClient, state: ForkState): ToolDefinition;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Vendored read-format helpers from OpenCode.
3
+ *
4
+ * Source: https://github.com/sst/opencode
5
+ * File: packages/opencode/src/tool/read.ts
6
+ *
7
+ * These functions and constants are copied to ensure synthetic file parts
8
+ * match OpenCode's Read tool output exactly.
9
+ */
10
+ /**
11
+ * Constants from OpenCode's ReadTool
12
+ */
13
+ export declare const DEFAULT_READ_LIMIT = 2000;
14
+ export declare const MAX_LINE_LENGTH = 2000;
15
+ export declare const MAX_BYTES: number;
16
+ /**
17
+ * Check if a file is binary (copied from OpenCode's ReadTool)
18
+ */
19
+ export declare function isBinaryFile(filepath: string): Promise<boolean>;
20
+ /**
21
+ * Format file content matching OpenCode's Read tool output format.
22
+ *
23
+ * @param _filepath - Absolute path to the file (unused in output, kept for
24
+ * signature compatibility)
25
+ * @param content - File content as string
26
+ * @returns Formatted output with line numbers in <file> tags
27
+ */
28
+ export declare function formatFileContent(_filepath: string, content: string): string;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Command registration manager for fork functionality.
3
+ *
4
+ * Manages the /fork-session slash command registration and template.
5
+ */
6
+ import type { PluginInput } from '@opencode-ai/plugin';
7
+ import type { ForkState } from './state';
8
+ /**
9
+ * Creates a fork command manager.
10
+ *
11
+ * Handles registration of the /fork-session command and fork session state
12
+ * events.
13
+ */
14
+ export declare function createForkCommandManager(_ctx: PluginInput, state: ForkState, _processedSessions?: Set<string>): {
15
+ registerCommand: (opencodeConfig: Record<string, unknown>) => void;
16
+ handleEvent(input: {
17
+ event: {
18
+ type: string;
19
+ properties?: {
20
+ info?: {
21
+ id?: string;
22
+ parentID?: string;
23
+ };
24
+ sessionID?: string;
25
+ };
26
+ };
27
+ }): void;
28
+ };
29
+ export type ForkCommandManager = ReturnType<typeof createForkCommandManager>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * File reference parsing and synthetic file parts for fork sessions.
3
+ *
4
+ * Handles extraction of @file references from fork prompts and
5
+ * building synthetic text parts that match OpenCode's Read tool output
6
+ * format.
7
+ */
8
+ import type { TextPartInput } from '@opencode-ai/sdk';
9
+ /**
10
+ * File reference regex matching OpenCode's internal pattern.
11
+ * Matches @file references like @src/plugin.ts
12
+ */
13
+ export declare const FILE_REGEX: RegExp;
14
+ /**
15
+ * Parse @file references from text.
16
+ *
17
+ * @param text - Text to search for @file references
18
+ * @returns Set of file paths referenced in the text
19
+ */
20
+ export declare function parseFileReferences(text: string): Set<string>;
21
+ /**
22
+ * Build synthetic text parts matching OpenCode's Read tool output.
23
+ *
24
+ * Creates two synthetic text parts for each file:
25
+ * 1. Header describing the Read tool call
26
+ * 2. Formatted file content with line numbers
27
+ *
28
+ * @param directory - Project directory to resolve relative paths against
29
+ * @param refs - Set of file path references to check
30
+ * @returns Array of synthetic text parts (non-existent and binary files are
31
+ * skipped)
32
+ */
33
+ export declare function buildSyntheticFileParts(directory: string, refs: Set<string>): Promise<TextPartInput[]>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Fork functionality for orchestrator worker sessions.
3
+ *
4
+ * Provides tools and commands for forking current context into child workers.
5
+ */
6
+ export { createForkCommandManager, type ForkCommandManager, } from './command';
7
+ export { buildSyntheticFileParts, FILE_REGEX, parseFileReferences, } from './files';
8
+ export { createForkState, type ForkState } from './state';
9
+ export { createForkSessionTool, createReadSessionTool, type OpencodeClient, } from './tools';
10
+ export { DEFAULT_READ_LIMIT, formatFileContent, isBinaryFile, MAX_BYTES, MAX_LINE_LENGTH, } from './vendor';
@@ -0,0 +1,7 @@
1
+ export interface ForkState {
2
+ markSession(sessionID: string, sourceSessionID: string): void;
3
+ unmarkSession(sessionID: string): void;
4
+ isForkSession(sessionID: string): boolean;
5
+ sourceFor(sessionID: string): string | undefined;
6
+ }
7
+ export declare function createForkState(): ForkState;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Tool definitions for fork functionality.
3
+ *
4
+ * Factory functions that create tool definitions with injected dependencies:
5
+ * - createForkSessionTool: Create a fork worker session
6
+ * - createReadSessionTool: Read conversation transcript from a session
7
+ */
8
+ import type { PluginInput, ToolDefinition } from '@opencode-ai/plugin';
9
+ import type { SubagentDepthTracker } from '../../utils/subagent-depth';
10
+ import type { ForkState } from './state';
11
+ export type OpencodeClient = PluginInput['client'];
12
+ /**
13
+ * Create the fork_session tool.
14
+ *
15
+ * Takes the OpenCode client as a dependency for TUI and session operations.
16
+ */
17
+ export declare function createForkSessionTool(ctx: PluginInput, state: ForkState, depthTracker?: SubagentDepthTracker): ToolDefinition;
18
+ /**
19
+ * Create the read_session tool.
20
+ *
21
+ * Takes the OpenCode client as a dependency for session.messages() calls.
22
+ */
23
+ export declare function createReadSessionTool(client: OpencodeClient, state: ForkState): ToolDefinition;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Vendored read-format helpers from OpenCode.
3
+ *
4
+ * Source: https://github.com/sst/opencode
5
+ * File: packages/opencode/src/tool/read.ts
6
+ *
7
+ * These functions and constants are copied to ensure synthetic file parts
8
+ * match OpenCode's Read tool output exactly.
9
+ */
10
+ /**
11
+ * Constants from OpenCode's ReadTool
12
+ */
13
+ export declare const DEFAULT_READ_LIMIT = 2000;
14
+ export declare const MAX_LINE_LENGTH = 2000;
15
+ export declare const MAX_BYTES: number;
16
+ /**
17
+ * Check if a file is binary (copied from OpenCode's ReadTool)
18
+ */
19
+ export declare function isBinaryFile(filepath: string): Promise<boolean>;
20
+ /**
21
+ * Format file content matching OpenCode's Read tool output format.
22
+ *
23
+ * @param _filepath - Absolute path to the file (unused in output, kept for
24
+ * signature compatibility)
25
+ * @param content - File content as string
26
+ * @returns Formatted output with line numbers in <file> tags
27
+ */
28
+ export declare function formatFileContent(_filepath: string, content: string): string;
@@ -3,3 +3,5 @@ export { createCouncilTool } from './council';
3
3
  export type { PresetManager } from './preset-manager';
4
4
  export { createPresetManager } from './preset-manager';
5
5
  export { createWebfetchTool } from './smartfetch';
6
+ export type { SubtaskCommandManager } from './subtask';
7
+ export { createReadSessionTool, createSubtaskCommandManager, createSubtaskState, createSubtaskTool, } from './subtask';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Command registration manager for subtask functionality.
3
+ *
4
+ * Manages the /subtask slash command registration and the SUBTASK_COMMAND
5
+ * template that guides the AI in generating subtask prompts.
6
+ */
7
+ import type { PluginInput } from '@opencode-ai/plugin';
8
+ import type { SubtaskState } from './state';
9
+ /**
10
+ * Creates a subtask command manager.
11
+ *
12
+ * Handles registration of the /subtask command and processing of chat
13
+ * messages to inject synthetic file parts for subtask sessions.
14
+ */
15
+ export declare function createSubtaskCommandManager(_ctx: PluginInput, state: SubtaskState): {
16
+ registerCommand: (opencodeConfig: Record<string, unknown>) => void;
17
+ handleEvent(input: {
18
+ event: {
19
+ type: string;
20
+ properties?: {
21
+ info?: {
22
+ id?: string;
23
+ parentID?: string;
24
+ };
25
+ sessionID?: string;
26
+ };
27
+ };
28
+ }): void;
29
+ };
30
+ export type SubtaskCommandManager = ReturnType<typeof createSubtaskCommandManager>;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * File reference parsing and synthetic file parts for subtask sessions.
3
+ *
4
+ * Handles extraction of @file references from subtask prompts and
5
+ * building synthetic text parts that match OpenCode's Read tool output
6
+ * format.
7
+ */
8
+ import type { TextPartInput } from '@opencode-ai/sdk';
9
+ /**
10
+ * File reference regex matching OpenCode's internal pattern.
11
+ * Matches @file references like @src/plugin.ts
12
+ */
13
+ export declare const FILE_REGEX: RegExp;
14
+ export declare function cleanFileReference(ref: string): string;
15
+ /**
16
+ * Parse @file references from text.
17
+ *
18
+ * @param text - Text to search for @file references
19
+ * @returns Set of file paths referenced in the text
20
+ */
21
+ export declare function parseFileReferences(text: string): Set<string>;
22
+ /**
23
+ * Build synthetic text parts matching OpenCode's Read tool output.
24
+ *
25
+ * Creates two synthetic text parts for each file:
26
+ * 1. Header describing the Read tool call
27
+ * 2. Formatted file content with line numbers
28
+ *
29
+ * @param directory - Project directory to resolve relative paths against
30
+ * @param refs - Set of file path references to check
31
+ * @returns Array of synthetic text parts (non-existent and binary files are
32
+ * skipped)
33
+ */
34
+ export declare function buildSyntheticFileParts(directory: string, refs: Set<string>): Promise<TextPartInput[]>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Subtask functionality for session continuation.
3
+ *
4
+ * Provides tools and commands for creating subtask prompts that allow
5
+ * work to continue seamlessly in new sessions with preloaded context.
6
+ */
7
+ export { createSubtaskCommandManager, type SubtaskCommandManager, } from './command';
8
+ export { buildSyntheticFileParts, FILE_REGEX, parseFileReferences, } from './files';
9
+ export { createSubtaskState, type SubtaskState } from './state';
10
+ export { createReadSessionTool, createSubtaskTool, type OpencodeClient, } from './tools';
11
+ export { DEFAULT_READ_LIMIT, formatFileContent, isBinaryFile, MAX_BYTES, MAX_LINE_LENGTH, } from './vendor';
@@ -0,0 +1,7 @@
1
+ export interface SubtaskState {
2
+ markSession(sessionID: string, sourceSessionID: string): void;
3
+ unmarkSession(sessionID: string): void;
4
+ isSubtaskSession(sessionID: string): boolean;
5
+ sourceFor(sessionID: string): string | undefined;
6
+ }
7
+ export declare function createSubtaskState(): SubtaskState;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Tool definitions for subtask functionality.
3
+ *
4
+ * Factory functions that create tool definitions with injected dependencies:
5
+ * - createSubtaskTool: Create a new session with subtask prompt
6
+ * - createReadSessionTool: Read conversation transcript from a session
7
+ */
8
+ import type { PluginInput, ToolDefinition } from '@opencode-ai/plugin';
9
+ import type { SubagentDepthTracker } from '../../utils/subagent-depth';
10
+ import type { SubtaskState } from './state';
11
+ export type OpencodeClient = PluginInput['client'];
12
+ /**
13
+ * Create the subtask tool.
14
+ *
15
+ * Takes the OpenCode client as a dependency for TUI and session operations.
16
+ */
17
+ export declare function createSubtaskTool(ctx: PluginInput, state: SubtaskState, depthTracker?: SubagentDepthTracker): ToolDefinition;
18
+ /**
19
+ * Create the read_session tool.
20
+ *
21
+ * Takes the OpenCode client as a dependency for session.messages() calls.
22
+ */
23
+ export declare function createReadSessionTool(client: OpencodeClient, state: SubtaskState): ToolDefinition;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Vendored read-format helpers from OpenCode.
3
+ *
4
+ * Source: https://github.com/sst/opencode
5
+ * File: packages/opencode/src/tool/read.ts
6
+ *
7
+ * These functions and constants are copied to ensure synthetic file parts
8
+ * match OpenCode's Read tool output exactly.
9
+ */
10
+ /**
11
+ * Constants from OpenCode's ReadTool
12
+ */
13
+ export declare const DEFAULT_READ_LIMIT = 2000;
14
+ export declare const MAX_LINE_LENGTH = 2000;
15
+ export declare const MAX_BYTES: number;
16
+ /**
17
+ * Check if a file is binary (copied from OpenCode's ReadTool)
18
+ */
19
+ export declare function isBinaryFile(filepath: string): Promise<boolean>;
20
+ /**
21
+ * Format file content matching OpenCode's Read tool output format.
22
+ *
23
+ * @param _filepath - Absolute path to the file (used as `<path>` in the output)
24
+ * @param content - File content as string
25
+ * @returns Formatted output with line numbers in <file> tags
26
+ */
27
+ export declare function formatFileContent(_filepath: string, content: string): string;
package/dist/tui.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { TuiPluginModule } from '@opencode-ai/plugin/tui';
2
2
  import { type TuiSnapshot } from './tui-state';
3
3
  export declare function formatSidebarModelName(model: string): string;
4
4
  export declare function getSidebarAgentNames(snapshot: TuiSnapshot): string[];
5
+ export declare function readConfigInvalid(directory: string): boolean;
5
6
  declare const plugin: TuiPluginModule & {
6
7
  id: string;
7
8
  };