oh-my-opencode-slim 1.0.1 → 1.0.3
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 +23 -13
- package/dist/cli/index.js +10 -3
- 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 +2 -2
- package/dist/config/schema.d.ts +12 -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 +40 -0
- package/dist/index.js +970 -149
- package/dist/multiplexer/session-manager.d.ts +4 -0
- package/dist/tools/council.d.ts +2 -2
- package/dist/utils/agent-variant.d.ts +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/session-manager.d.ts +55 -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 +27 -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
|
*
|
|
@@ -36,6 +36,8 @@ export declare function resolveAgentVariant(config: PluginConfig | undefined, ag
|
|
|
36
36
|
* - displayName aliases (e.g. "advisor" -> "oracle")
|
|
37
37
|
*/
|
|
38
38
|
export declare function resolveRuntimeAgentName(config: PluginConfig | undefined, agentName: string): string;
|
|
39
|
+
export type DisplayNameMentionRewriter = (text: string) => string;
|
|
40
|
+
export declare function createDisplayNameMentionRewriter(config: PluginConfig | undefined): DisplayNameMentionRewriter;
|
|
39
41
|
/**
|
|
40
42
|
* Rewrites user-facing display-name mentions (e.g. @advisor) into internal
|
|
41
43
|
* agent mentions (e.g. @oracle) for runtime routing.
|
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';
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ declare function getLogDir(): string;
|
|
|
2
2
|
export declare function initLogger(sessionId: string): void;
|
|
3
3
|
/** @internal Reset logger state for testing */
|
|
4
4
|
export declare function resetLogger(): void;
|
|
5
|
+
/** @internal Wait for queued log writes in tests. */
|
|
6
|
+
export declare function flushLoggerForTesting(): Promise<void>;
|
|
5
7
|
export { getLogDir };
|
|
6
8
|
export declare function log(message: string, data?: unknown): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AgentName } from '../config';
|
|
2
|
+
export interface ContextFile {
|
|
3
|
+
path: string;
|
|
4
|
+
lineCount: number;
|
|
5
|
+
lineNumbers?: number[];
|
|
6
|
+
lastReadAt: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RememberedTaskSession {
|
|
9
|
+
alias: string;
|
|
10
|
+
taskId: string;
|
|
11
|
+
agentType: AgentName;
|
|
12
|
+
label: string;
|
|
13
|
+
contextFiles: ContextFile[];
|
|
14
|
+
createdAt: number;
|
|
15
|
+
lastUsedAt: number;
|
|
16
|
+
}
|
|
17
|
+
interface SessionManagerOptions {
|
|
18
|
+
readContextMinLines?: number;
|
|
19
|
+
readContextMaxFiles?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function deriveTaskSessionLabel(input: {
|
|
22
|
+
description?: string;
|
|
23
|
+
prompt?: string;
|
|
24
|
+
agentType: AgentName;
|
|
25
|
+
}): string;
|
|
26
|
+
export declare class SessionManager {
|
|
27
|
+
private readonly maxSessionsPerAgent;
|
|
28
|
+
private readonly readContextMinLines;
|
|
29
|
+
private readonly readContextMaxFiles;
|
|
30
|
+
private readonly sessionsByParent;
|
|
31
|
+
private readonly nextAliasIndexByParent;
|
|
32
|
+
private orderCounter;
|
|
33
|
+
constructor(maxSessionsPerAgent: number, options?: SessionManagerOptions);
|
|
34
|
+
remember(input: {
|
|
35
|
+
parentSessionId: string;
|
|
36
|
+
taskId: string;
|
|
37
|
+
agentType: AgentName;
|
|
38
|
+
label: string;
|
|
39
|
+
}): RememberedTaskSession;
|
|
40
|
+
markUsed(parentSessionId: string, agentType: AgentName, key: string): void;
|
|
41
|
+
resolve(parentSessionId: string, agentType: AgentName, key: string): RememberedTaskSession | undefined;
|
|
42
|
+
drop(parentSessionId: string, agentType: AgentName, key: string): void;
|
|
43
|
+
dropTask(taskId: string): void;
|
|
44
|
+
taskIds(): Set<string>;
|
|
45
|
+
addContext(taskId: string, files: ContextFile[]): void;
|
|
46
|
+
clearParent(parentSessionId: string): void;
|
|
47
|
+
formatForPrompt(parentSessionId: string): string | undefined;
|
|
48
|
+
private getAgentGroup;
|
|
49
|
+
private setAgentGroup;
|
|
50
|
+
private nextAlias;
|
|
51
|
+
private trimGroup;
|
|
52
|
+
private trimContextFiles;
|
|
53
|
+
private nextOrder;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
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,29 @@
|
|
|
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
|
+
"readContextMinLines": {
|
|
503
|
+
"default": 10,
|
|
504
|
+
"type": "integer",
|
|
505
|
+
"minimum": 0,
|
|
506
|
+
"maximum": 1000
|
|
507
|
+
},
|
|
508
|
+
"readContextMaxFiles": {
|
|
509
|
+
"default": 8,
|
|
510
|
+
"type": "integer",
|
|
511
|
+
"minimum": 0,
|
|
512
|
+
"maximum": 50
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
},
|
|
489
516
|
"todoContinuation": {
|
|
490
517
|
"type": "object",
|
|
491
518
|
"properties": {
|
package/package.json
CHANGED