oh-my-opencode-slim 1.0.0 → 1.0.2
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.md +39 -23
- package/dist/cli/index.js +11 -4
- package/dist/cli/install.d.ts +1 -1
- package/dist/cli/providers.d.ts +4 -4
- package/dist/config/constants.d.ts +1 -1
- package/dist/config/council-schema.d.ts +3 -2
- package/dist/config/schema.d.ts +9 -0
- package/dist/council/council-manager.d.ts +3 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +1 -1
- package/dist/hooks/task-session-manager/index.d.ts +36 -0
- package/dist/index.js +863 -75
- package/dist/multiplexer/session-manager.d.ts +4 -0
- package/dist/tools/council.d.ts +2 -2
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/preset-manager.d.ts +27 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/session-manager.d.ts +38 -0
- package/dist/utils/session.d.ts +4 -4
- package/dist/utils/system-collapse.d.ts +6 -0
- package/dist/utils/task.d.ts +4 -0
- package/oh-my-opencode-slim.schema.json +15 -0
- package/package.json +1 -1
|
@@ -27,6 +27,8 @@ export declare class MultiplexerSessionManager {
|
|
|
27
27
|
private directory;
|
|
28
28
|
private multiplexer;
|
|
29
29
|
private sessions;
|
|
30
|
+
private knownSessions;
|
|
31
|
+
private spawningSessions;
|
|
30
32
|
private pollInterval?;
|
|
31
33
|
private enabled;
|
|
32
34
|
constructor(ctx: PluginInput, config: MultiplexerConfig);
|
|
@@ -37,6 +39,8 @@ export declare class MultiplexerSessionManager {
|
|
|
37
39
|
private stopPolling;
|
|
38
40
|
private pollSessions;
|
|
39
41
|
private closeSession;
|
|
42
|
+
private respawnIfKnown;
|
|
43
|
+
private isTrackedOrSpawning;
|
|
40
44
|
cleanup(): Promise<void>;
|
|
41
45
|
}
|
|
42
46
|
/**
|
package/dist/tools/council.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type PluginInput, type ToolDefinition } from
|
|
2
|
-
import type { CouncilManager } from
|
|
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
|
*
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { ast_grep_replace, ast_grep_search } from './ast-grep';
|
|
2
2
|
export { createCouncilTool } from './council';
|
|
3
|
+
export type { PresetManager } from './preset-manager';
|
|
4
|
+
export { createPresetManager } from './preset-manager';
|
|
3
5
|
export { createWebfetchTool } from './smartfetch';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { PluginConfig } from '../config';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a preset manager for the /preset slash command.
|
|
5
|
+
*
|
|
6
|
+
* Uses the OpenCode SDK's client.config.update() to change agent models
|
|
7
|
+
* and temperatures without restarting. The server invalidates its agent
|
|
8
|
+
* cache and re-reads config on the next prompt.
|
|
9
|
+
*
|
|
10
|
+
* Note: activePreset is tracked in-memory only and resets on plugin reload.
|
|
11
|
+
* If the user manually edits config or another mechanism changes agents,
|
|
12
|
+
* this tracker may become stale until the next /preset call.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createPresetManager(ctx: PluginInput, config: PluginConfig): {
|
|
15
|
+
handleCommandExecuteBefore: (input: {
|
|
16
|
+
command: string;
|
|
17
|
+
sessionID: string;
|
|
18
|
+
arguments: string;
|
|
19
|
+
}, output: {
|
|
20
|
+
parts: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
text?: string;
|
|
23
|
+
}>;
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
registerCommand: (opencodeConfig: Record<string, unknown>) => void;
|
|
26
|
+
};
|
|
27
|
+
export type PresetManager = ReturnType<typeof createPresetManager>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export * from './internal-initiator';
|
|
|
4
4
|
export { getLogDir, initLogger, log, resetLogger } from './logger';
|
|
5
5
|
export * from './polling';
|
|
6
6
|
export * from './session';
|
|
7
|
+
export * from './session-manager';
|
|
8
|
+
export * from './task';
|
|
7
9
|
export { extractZip } from './zip-extractor';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentName } from '../config';
|
|
2
|
+
export interface RememberedTaskSession {
|
|
3
|
+
alias: string;
|
|
4
|
+
taskId: string;
|
|
5
|
+
agentType: AgentName;
|
|
6
|
+
label: string;
|
|
7
|
+
createdAt: number;
|
|
8
|
+
lastUsedAt: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function deriveTaskSessionLabel(input: {
|
|
11
|
+
description?: string;
|
|
12
|
+
prompt?: string;
|
|
13
|
+
agentType: AgentName;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare class SessionManager {
|
|
16
|
+
private readonly maxSessionsPerAgent;
|
|
17
|
+
private readonly sessionsByParent;
|
|
18
|
+
private readonly nextAliasIndexByParent;
|
|
19
|
+
private orderCounter;
|
|
20
|
+
constructor(maxSessionsPerAgent: number);
|
|
21
|
+
remember(input: {
|
|
22
|
+
parentSessionId: string;
|
|
23
|
+
taskId: string;
|
|
24
|
+
agentType: AgentName;
|
|
25
|
+
label: string;
|
|
26
|
+
}): RememberedTaskSession;
|
|
27
|
+
markUsed(parentSessionId: string, agentType: AgentName, key: string): void;
|
|
28
|
+
resolve(parentSessionId: string, agentType: AgentName, key: string): RememberedTaskSession | undefined;
|
|
29
|
+
drop(parentSessionId: string, agentType: AgentName, key: string): void;
|
|
30
|
+
dropTask(taskId: string): void;
|
|
31
|
+
clearParent(parentSessionId: string): void;
|
|
32
|
+
formatForPrompt(parentSessionId: string): string | undefined;
|
|
33
|
+
private getAgentGroup;
|
|
34
|
+
private setAgentGroup;
|
|
35
|
+
private nextAlias;
|
|
36
|
+
private trimGroup;
|
|
37
|
+
private nextOrder;
|
|
38
|
+
}
|
package/dist/utils/session.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared session utilities for council and background managers.
|
|
3
3
|
*/
|
|
4
|
-
import type { PluginInput } from
|
|
5
|
-
type OpencodeClient = PluginInput[
|
|
4
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
5
|
+
type OpencodeClient = PluginInput["client"];
|
|
6
6
|
/**
|
|
7
7
|
* Extract the short model label from a "provider/model" string.
|
|
8
8
|
* E.g. "openai/gpt-5.4-mini" → "gpt-5.4-mini"
|
|
@@ -21,7 +21,7 @@ export type PromptBody = {
|
|
|
21
21
|
[key: string]: boolean;
|
|
22
22
|
};
|
|
23
23
|
parts: Array<{
|
|
24
|
-
type:
|
|
24
|
+
type: "text";
|
|
25
25
|
text: string;
|
|
26
26
|
}>;
|
|
27
27
|
variant?: string;
|
|
@@ -43,7 +43,7 @@ export declare function parseModelReference(model: string): {
|
|
|
43
43
|
* @param timeoutMs - Timeout in milliseconds (0 = no timeout)
|
|
44
44
|
* @throws Error if timeout is exceeded
|
|
45
45
|
*/
|
|
46
|
-
export declare function promptWithTimeout(client: OpencodeClient, args: Parameters<OpencodeClient[
|
|
46
|
+
export declare function promptWithTimeout(client: OpencodeClient, args: Parameters<OpencodeClient["session"]["prompt"]>[0], timeoutMs: number): Promise<void>;
|
|
47
47
|
/**
|
|
48
48
|
* Result of extracting session content.
|
|
49
49
|
* `empty` is true when the assistant produced zero text content —
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapse a system message array into a single element by joining all
|
|
3
|
+
* entries with double-newline separators. Mutates the array in-place so
|
|
4
|
+
* that callers holding a reference to the original array see the change.
|
|
5
|
+
*/
|
|
6
|
+
export declare function collapseSystemInPlace(system: string[]): void;
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"description": "Show the startup activation toast when OpenCode starts. Defaults to true.",
|
|
24
24
|
"type": "boolean"
|
|
25
25
|
},
|
|
26
|
+
"autoUpdate": {
|
|
27
|
+
"description": "Disable automatic installation of plugin updates when false. Defaults to true.",
|
|
28
|
+
"type": "boolean"
|
|
29
|
+
},
|
|
26
30
|
"manualPlan": {
|
|
27
31
|
"type": "object",
|
|
28
32
|
"properties": {
|
|
@@ -486,6 +490,17 @@
|
|
|
486
490
|
}
|
|
487
491
|
}
|
|
488
492
|
},
|
|
493
|
+
"sessionManager": {
|
|
494
|
+
"type": "object",
|
|
495
|
+
"properties": {
|
|
496
|
+
"maxSessionsPerAgent": {
|
|
497
|
+
"default": 2,
|
|
498
|
+
"type": "integer",
|
|
499
|
+
"minimum": 1,
|
|
500
|
+
"maximum": 10
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
489
504
|
"todoContinuation": {
|
|
490
505
|
"type": "object",
|
|
491
506
|
"properties": {
|
package/package.json
CHANGED