oh-my-opencode-slim 2.1.0 → 2.2.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/README.ja-JP.md +31 -30
- package/README.ko-KR.md +31 -30
- package/README.md +57 -33
- package/README.zh-CN.md +29 -28
- package/dist/agents/index.d.ts +0 -4
- package/dist/cli/index.js +90 -16
- package/dist/cli/providers.d.ts +7 -7
- package/dist/companion/manager.d.ts +3 -0
- package/dist/config/constants.d.ts +12 -1
- package/dist/config/council-schema.d.ts +37 -12
- package/dist/config/schema.d.ts +691 -6
- package/dist/config/strip-orchestrator-model.d.ts +9 -0
- package/dist/council/council-manager.d.ts +7 -3
- package/dist/hooks/command-hook-utils.d.ts +5 -0
- package/dist/hooks/foreground-fallback/index.d.ts +53 -7
- package/dist/hooks/image-hook.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/phase-reminder/index.d.ts +3 -1
- package/dist/hooks/post-file-tool-nudge/index.d.ts +15 -9
- package/dist/hooks/session-lifecycle.d.ts +11 -0
- package/dist/hooks/task-session-manager/index.d.ts +14 -2
- package/dist/index.js +2804 -801
- package/dist/interview/document.d.ts +2 -1
- package/dist/interview/service.d.ts +2 -0
- package/dist/interview/ui.d.ts +0 -1
- package/dist/multiplexer/cmux/close-policy.d.ts +20 -0
- package/dist/multiplexer/cmux/index.d.ts +102 -0
- package/dist/multiplexer/cmux/session-lifecycle.d.ts +92 -0
- package/dist/multiplexer/cmux/session-state.d.ts +45 -0
- package/dist/multiplexer/factory.d.ts +0 -9
- package/dist/multiplexer/herdr/index.d.ts +7 -3
- package/dist/multiplexer/index.d.ts +3 -1
- package/dist/multiplexer/session-manager.d.ts +14 -6
- package/dist/multiplexer/shared.d.ts +31 -0
- package/dist/multiplexer/tmux/index.d.ts +0 -1
- package/dist/multiplexer/types.d.ts +5 -2
- package/dist/multiplexer/zellij/index.d.ts +0 -1
- package/dist/tools/cancel-task.d.ts +2 -2
- package/dist/tools/smartfetch/utils.d.ts +3 -1
- package/dist/tui-state.d.ts +5 -5
- package/dist/tui.d.ts +1 -0
- package/dist/tui.js +130 -29
- package/dist/utils/background-job-board.d.ts +5 -1
- package/dist/utils/background-job-coordinator.d.ts +72 -0
- package/dist/utils/background-job-store.d.ts +46 -0
- package/dist/utils/councillor-models.d.ts +20 -0
- package/dist/utils/escape-html.d.ts +1 -0
- package/dist/utils/frontmatter.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/internal-initiator.d.ts +6 -1
- package/dist/utils/logger.d.ts +0 -2
- package/dist/utils/session.d.ts +1 -1
- package/oh-my-opencode-slim.schema.json +728 -1
- package/package.json +1 -1
- package/src/skills/clonedeps/SKILL.md +32 -29
- package/src/skills/codemap.md +7 -3
- package/src/skills/deepwork/SKILL.md +17 -6
- package/src/skills/oh-my-opencode-slim/SKILL.md +3 -3
- package/src/skills/release-smoke-test/SKILL.md +2 -2
- package/src/skills/verification-planning/SKILL.md +103 -0
- package/src/skills/worktrees/SKILL.md +14 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseFrontmatter as sharedParseFrontmatter } from '../utils/frontmatter';
|
|
1
2
|
import type { InterviewAnswer, InterviewQuestion, InterviewRecord, SpecBlock } from './types';
|
|
2
3
|
export declare const DEFAULT_OUTPUT_FOLDER = "interview";
|
|
3
4
|
export declare function normalizeOutputFolder(outputFolder: string): string;
|
|
@@ -20,7 +21,7 @@ export declare function buildInterviewDocument(idea: string, summary: string, hi
|
|
|
20
21
|
tags?: string[];
|
|
21
22
|
}): string;
|
|
22
23
|
/** Parse frontmatter from a .md file. Returns null if no frontmatter. */
|
|
23
|
-
export declare
|
|
24
|
+
export declare const parseFrontmatter: typeof sharedParseFrontmatter;
|
|
24
25
|
export declare function ensureInterviewFile(record: InterviewRecord): Promise<void>;
|
|
25
26
|
export declare function readInterviewDocument(record: InterviewRecord): Promise<string>;
|
|
26
27
|
export declare function rewriteInterviewDocument(record: InterviewRecord, summary: string): Promise<string>;
|
package/dist/interview/ui.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ interface DashboardInterviewItem extends InterviewListItem {
|
|
|
6
6
|
sessionID?: string;
|
|
7
7
|
directory?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function escapeHtml(value: string): string;
|
|
10
9
|
export declare function renderDashboardPage(interviews: DashboardInterviewItem[], files: InterviewFileItem[], outputFolder: string): string;
|
|
11
10
|
export declare function renderInterviewPage(interviewId: string, resumeSlug: string): string;
|
|
12
11
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type CmuxCloseReason = 'idle' | 'deleted' | 'cleanup';
|
|
2
|
+
export interface CmuxCloseIntent {
|
|
3
|
+
reason: CmuxCloseReason;
|
|
4
|
+
expectedActivityVersion: number;
|
|
5
|
+
attempts: number;
|
|
6
|
+
deadline: number;
|
|
7
|
+
phase: 'pending' | 'cooldown';
|
|
8
|
+
nextAttemptAt: number;
|
|
9
|
+
cooldowns: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class CmuxClosePolicy {
|
|
12
|
+
private readonly budgetMs;
|
|
13
|
+
private readonly maxAttempts;
|
|
14
|
+
constructor(budgetMs?: number, maxAttempts?: number);
|
|
15
|
+
request(reason: CmuxCloseReason, version: number, now: number, current?: CmuxCloseIntent): CmuxCloseIntent;
|
|
16
|
+
activity(intent?: CmuxCloseIntent): CmuxCloseIntent | undefined;
|
|
17
|
+
failed(intent: CmuxCloseIntent, now: number): CmuxCloseIntent;
|
|
18
|
+
resume(intent: CmuxCloseIntent, now: number): CmuxCloseIntent;
|
|
19
|
+
complete(): undefined;
|
|
20
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { MultiplexerLayout } from '../../config/schema';
|
|
2
|
+
import { crossSpawn } from '../../utils/compat';
|
|
3
|
+
import type { Multiplexer, PaneResult } from '../types';
|
|
4
|
+
export interface CmuxReadinessOptions {
|
|
5
|
+
checkSessionReady?: (url: URL, sessionId: string, signal: AbortSignal) => Promise<boolean>;
|
|
6
|
+
delay?: (milliseconds: number) => Promise<void>;
|
|
7
|
+
readinessAttemptTimeoutMs?: number;
|
|
8
|
+
opencodeBinary?: string;
|
|
9
|
+
pathExists?: (path: string) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CommandResult {
|
|
12
|
+
exitCode: number;
|
|
13
|
+
stdout: string;
|
|
14
|
+
stderr: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CommandRunner {
|
|
17
|
+
run(argv: string[]): Promise<CommandResult>;
|
|
18
|
+
}
|
|
19
|
+
export interface CmuxIdentity {
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
paneId: string;
|
|
22
|
+
surfaceId: string;
|
|
23
|
+
socketPath: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CmuxClient {
|
|
26
|
+
version(): Promise<string | null>;
|
|
27
|
+
getVersionError?(): 'unavailable' | 'hard';
|
|
28
|
+
identify(): Promise<CmuxIdentity | null>;
|
|
29
|
+
getIdentifyError?(): 'unavailable' | 'hard';
|
|
30
|
+
createSurface(input: {
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
targetSurfaceId: string;
|
|
33
|
+
direction: 'right' | 'down';
|
|
34
|
+
focus: false;
|
|
35
|
+
}, socketPath?: string): Promise<{
|
|
36
|
+
paneId: string;
|
|
37
|
+
surfaceId: string;
|
|
38
|
+
} | null>;
|
|
39
|
+
getCreateError?(): 'not_found' | 'unavailable' | 'invalid_state' | 'hard';
|
|
40
|
+
respawnSurface(workspaceId: string, surfaceId: string, command: string, socketPath?: string): Promise<boolean>;
|
|
41
|
+
closeSurface(workspaceId: string, surfaceId: string, socketPath?: string): Promise<'closed' | 'not_found' | 'failed'>;
|
|
42
|
+
equalizeSplits(params: {
|
|
43
|
+
workspace_id: string;
|
|
44
|
+
orientation: 'vertical';
|
|
45
|
+
}, socketPath?: string): Promise<boolean>;
|
|
46
|
+
}
|
|
47
|
+
export declare class CmuxMultiplexer implements Multiplexer {
|
|
48
|
+
private readonly client;
|
|
49
|
+
readonly type: "cmux";
|
|
50
|
+
private versionAvailable;
|
|
51
|
+
private availabilityError;
|
|
52
|
+
private readonly checkSessionReady;
|
|
53
|
+
private readonly delay;
|
|
54
|
+
private readonly readinessAttemptTimeoutMs;
|
|
55
|
+
private readonly opencodeBinary;
|
|
56
|
+
constructor(client?: CmuxClient, options?: CmuxReadinessOptions);
|
|
57
|
+
isAvailable(): Promise<boolean>;
|
|
58
|
+
isInsideSession(): boolean;
|
|
59
|
+
spawnPane(sessionId: string, _description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
60
|
+
closePane(paneId: string): Promise<boolean>;
|
|
61
|
+
applyLayout(_layout: MultiplexerLayout, _mainPaneSize: number): Promise<void>;
|
|
62
|
+
private cleanupPane;
|
|
63
|
+
private waitForSession;
|
|
64
|
+
private equalize;
|
|
65
|
+
}
|
|
66
|
+
export declare class SpawnCommandRunner implements CommandRunner {
|
|
67
|
+
private readonly timeoutMs;
|
|
68
|
+
private readonly spawn;
|
|
69
|
+
constructor(timeoutMs?: number, spawn?: typeof crossSpawn);
|
|
70
|
+
run(argv: string[]): Promise<CommandResult>;
|
|
71
|
+
}
|
|
72
|
+
export declare class CliCmuxClient implements CmuxClient {
|
|
73
|
+
private readonly runner;
|
|
74
|
+
private binary;
|
|
75
|
+
private versionError;
|
|
76
|
+
private identifyError;
|
|
77
|
+
private lastRunThrew;
|
|
78
|
+
private createError;
|
|
79
|
+
constructor(runner?: CommandRunner, binary?: string);
|
|
80
|
+
version(): Promise<string | null>;
|
|
81
|
+
getVersionError(): 'unavailable' | 'hard';
|
|
82
|
+
identify(): Promise<CmuxIdentity | null>;
|
|
83
|
+
getIdentifyError(): 'unavailable' | 'hard';
|
|
84
|
+
createSurface(input: {
|
|
85
|
+
workspaceId: string;
|
|
86
|
+
targetSurfaceId: string;
|
|
87
|
+
direction: 'right' | 'down';
|
|
88
|
+
focus: false;
|
|
89
|
+
}, socketPath?: string): Promise<{
|
|
90
|
+
paneId: string;
|
|
91
|
+
surfaceId: string;
|
|
92
|
+
} | null>;
|
|
93
|
+
getCreateError(): 'not_found' | 'unavailable' | 'invalid_state' | 'hard';
|
|
94
|
+
respawnSurface(workspaceId: string, surfaceId: string, command: string, socketPath?: string): Promise<boolean>;
|
|
95
|
+
closeSurface(workspaceId: string, surfaceId: string, socketPath?: string): Promise<'closed' | 'not_found' | 'failed'>;
|
|
96
|
+
equalizeSplits(params: {
|
|
97
|
+
workspace_id: string;
|
|
98
|
+
orientation: 'vertical';
|
|
99
|
+
}, socketPath?: string): Promise<boolean>;
|
|
100
|
+
private run;
|
|
101
|
+
}
|
|
102
|
+
export declare function resetCmuxStateForTests(): void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Multiplexer } from '../types';
|
|
2
|
+
export interface CmuxSessionEvent {
|
|
3
|
+
type: string;
|
|
4
|
+
properties?: {
|
|
5
|
+
info?: {
|
|
6
|
+
id?: string;
|
|
7
|
+
parentID?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
directory?: string;
|
|
10
|
+
sessionID?: string;
|
|
11
|
+
};
|
|
12
|
+
part?: {
|
|
13
|
+
sessionID?: string;
|
|
14
|
+
};
|
|
15
|
+
sessionID?: string;
|
|
16
|
+
status?: {
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface BackgroundJobs {
|
|
22
|
+
deferIfRunning(session: string): boolean;
|
|
23
|
+
clearDeferredClose(session: string): void;
|
|
24
|
+
}
|
|
25
|
+
export interface CmuxSessionLifecycleOptions {
|
|
26
|
+
now?: () => number;
|
|
27
|
+
delay?: (milliseconds: number) => Promise<void>;
|
|
28
|
+
deferredRetryMs?: number;
|
|
29
|
+
deferredTtlMs?: number;
|
|
30
|
+
missingGraceMs?: number;
|
|
31
|
+
closeRetryMs?: number;
|
|
32
|
+
closeRetryTtlMs?: number;
|
|
33
|
+
closeRetryMaxAttempts?: number;
|
|
34
|
+
orphanCooldownMs?: number;
|
|
35
|
+
shutdownTimeoutMs?: number;
|
|
36
|
+
isServerRunning?: (url: string) => Promise<boolean>;
|
|
37
|
+
fetchStatuses?: () => Promise<Record<string, {
|
|
38
|
+
type: string;
|
|
39
|
+
}>>;
|
|
40
|
+
}
|
|
41
|
+
export declare class CmuxSessionLifecycle {
|
|
42
|
+
private readonly owner;
|
|
43
|
+
private readonly multiplexer;
|
|
44
|
+
private readonly resolveServerUrl;
|
|
45
|
+
private readonly defaultDirectory;
|
|
46
|
+
private readonly backgroundJobs?;
|
|
47
|
+
private readonly store;
|
|
48
|
+
private readonly policy;
|
|
49
|
+
private readonly now;
|
|
50
|
+
private readonly delay;
|
|
51
|
+
private readonly injectedDelay;
|
|
52
|
+
private readonly deferredRetryMs;
|
|
53
|
+
private readonly deferredTtlMs;
|
|
54
|
+
private readonly missingGraceMs;
|
|
55
|
+
private readonly closeRetryMs;
|
|
56
|
+
private readonly shutdownTimeoutMs;
|
|
57
|
+
private readonly serverCheck;
|
|
58
|
+
private readonly fetchStatuses;
|
|
59
|
+
private pollTimer?;
|
|
60
|
+
private polling;
|
|
61
|
+
private cleanupPromise?;
|
|
62
|
+
private disposed;
|
|
63
|
+
private spawnGeneration;
|
|
64
|
+
constructor(owner: string, multiplexer: Multiplexer, resolveServerUrl: () => string | null, defaultDirectory: string, backgroundJobs?: BackgroundJobs | undefined, options?: CmuxSessionLifecycleOptions);
|
|
65
|
+
onSessionCreated(event: CmuxSessionEvent): Promise<void>;
|
|
66
|
+
onSessionStatus(event: CmuxSessionEvent): Promise<void>;
|
|
67
|
+
onSessionDeleted(event: CmuxSessionEvent): Promise<void>;
|
|
68
|
+
closeSessionFromCoordinator(session: string): Promise<void>;
|
|
69
|
+
cleanup(): Promise<void>;
|
|
70
|
+
/** Runs one status pass; exposed for deterministic lifecycle tests. */
|
|
71
|
+
pollOnce(): Promise<void>;
|
|
72
|
+
private spawn;
|
|
73
|
+
private spawnOperation;
|
|
74
|
+
private deferSpawn;
|
|
75
|
+
private cancelDeferred;
|
|
76
|
+
private activity;
|
|
77
|
+
private requestClose;
|
|
78
|
+
private attemptClose;
|
|
79
|
+
private scheduleCooldown;
|
|
80
|
+
private poll;
|
|
81
|
+
private startPolling;
|
|
82
|
+
private updatePolling;
|
|
83
|
+
private runCleanup;
|
|
84
|
+
private attemptCloseWithoutTimer;
|
|
85
|
+
private adoptAndClose;
|
|
86
|
+
private closeLatePane;
|
|
87
|
+
private trackStalePane;
|
|
88
|
+
private eventSession;
|
|
89
|
+
private timer;
|
|
90
|
+
private loadStatuses;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PaneResult } from '../types';
|
|
2
|
+
import type { CmuxCloseIntent } from './close-policy';
|
|
3
|
+
export type CmuxSpawnState = 'known' | 'spawning' | 'attached' | 'failed';
|
|
4
|
+
export type CmuxLifecycleState = 'active' | 'deleted' | 'orphaned';
|
|
5
|
+
export interface CmuxDeferredSpawn {
|
|
6
|
+
deadline: number;
|
|
7
|
+
generation: number;
|
|
8
|
+
timer?: {
|
|
9
|
+
cancel(): void;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface CmuxSessionRecord {
|
|
13
|
+
session: string;
|
|
14
|
+
owner: string;
|
|
15
|
+
parent: string;
|
|
16
|
+
title: string;
|
|
17
|
+
directory: string;
|
|
18
|
+
paneId?: string;
|
|
19
|
+
spawnState: CmuxSpawnState;
|
|
20
|
+
lifecycle: CmuxLifecycleState;
|
|
21
|
+
attachedAt?: number;
|
|
22
|
+
lastActivityAt: number;
|
|
23
|
+
activityVersion: number;
|
|
24
|
+
idleConsecutive: number;
|
|
25
|
+
statusMissingSince?: number;
|
|
26
|
+
deferredSpawn?: CmuxDeferredSpawn;
|
|
27
|
+
closeIntent?: CmuxCloseIntent;
|
|
28
|
+
closeTimer?: {
|
|
29
|
+
cancel(): void;
|
|
30
|
+
};
|
|
31
|
+
spawnPromise?: Promise<PaneResult>;
|
|
32
|
+
}
|
|
33
|
+
export declare class CmuxSessionStore {
|
|
34
|
+
claimCreated(record: CmuxSessionRecord): boolean;
|
|
35
|
+
get(session: string): CmuxSessionRecord | undefined;
|
|
36
|
+
ownedBy(owner: string): CmuxSessionRecord[];
|
|
37
|
+
claimOrphans(owner: string, directory: string): CmuxSessionRecord[];
|
|
38
|
+
markAttached(session: string, paneId: string, now: number): void;
|
|
39
|
+
markActivity(session: string, now: number): void;
|
|
40
|
+
markDeleted(session: string): void;
|
|
41
|
+
markOrphaned(session: string): void;
|
|
42
|
+
removeAfterConfirmedClose(session: string): boolean;
|
|
43
|
+
removeWithoutPane(session: string): boolean;
|
|
44
|
+
resetForTests(): void;
|
|
45
|
+
}
|
|
@@ -11,15 +11,6 @@ import type { Multiplexer } from './types';
|
|
|
11
11
|
* be captured fresh for each plugin context.
|
|
12
12
|
*/
|
|
13
13
|
export declare function getMultiplexer(config: MultiplexerConfig): Multiplexer | null;
|
|
14
|
-
/**
|
|
15
|
-
* Clear the multiplexer cache (useful for testing)
|
|
16
|
-
*/
|
|
17
|
-
export declare function clearMultiplexerCache(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Get the effective multiplexer type for auto mode
|
|
20
|
-
* Returns the actual type that would be used (tmux/zellij/herdr/none)
|
|
21
|
-
*/
|
|
22
|
-
export declare function getAutoMultiplexerType(): 'tmux' | 'zellij' | 'herdr' | 'none';
|
|
23
14
|
/**
|
|
24
15
|
* Start background availability check for a multiplexer
|
|
25
16
|
*/
|
|
@@ -18,14 +18,18 @@ export declare class HerdrMultiplexer implements Multiplexer {
|
|
|
18
18
|
private binaryPath;
|
|
19
19
|
private hasChecked;
|
|
20
20
|
private readonly parentPaneId;
|
|
21
|
-
private
|
|
21
|
+
private layout;
|
|
22
|
+
private paneDirection;
|
|
23
|
+
private agentAreaPaneId;
|
|
24
|
+
private spawnMutex;
|
|
22
25
|
constructor(layout?: MultiplexerLayout, mainPaneSize?: number);
|
|
23
26
|
isAvailable(): Promise<boolean>;
|
|
24
27
|
isInsideSession(): boolean;
|
|
25
28
|
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
29
|
+
private doSpawn;
|
|
26
30
|
closePane(paneId: string): Promise<boolean>;
|
|
27
|
-
applyLayout(
|
|
31
|
+
applyLayout(layout: MultiplexerLayout, _mainPaneSize: number): Promise<void>;
|
|
32
|
+
private runSplit;
|
|
28
33
|
private targetPaneArg;
|
|
29
34
|
private getBinary;
|
|
30
|
-
private findBinary;
|
|
31
35
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Multiplexer module exports
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
4
|
+
export type { CmuxClient, CommandRunner } from './cmux';
|
|
5
|
+
export { CliCmuxClient, CmuxMultiplexer } from './cmux';
|
|
6
|
+
export { getMultiplexer, startAvailabilityCheck, } from './factory';
|
|
5
7
|
export { HerdrMultiplexer } from './herdr';
|
|
6
8
|
export { MultiplexerSessionManager, TmuxSessionManager, } from './session-manager';
|
|
7
9
|
export { TmuxMultiplexer } from './tmux';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
2
|
import type { MultiplexerConfig } from '../config/schema';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BackgroundJobStore } from '../utils/background-job-store';
|
|
4
|
+
import { type CmuxSessionLifecycleOptions } from './cmux/session-lifecycle';
|
|
5
|
+
type BackgroundJobReader = Pick<BackgroundJobStore, 'getState' | 'deferIfRunning' | 'clearDeferredClose'>;
|
|
4
6
|
interface SessionEvent {
|
|
5
7
|
type: string;
|
|
6
8
|
properties?: {
|
|
@@ -9,6 +11,10 @@ interface SessionEvent {
|
|
|
9
11
|
parentID?: string;
|
|
10
12
|
title?: string;
|
|
11
13
|
directory?: string;
|
|
14
|
+
sessionID?: string;
|
|
15
|
+
};
|
|
16
|
+
part?: {
|
|
17
|
+
sessionID?: string;
|
|
12
18
|
};
|
|
13
19
|
sessionID?: string;
|
|
14
20
|
status?: {
|
|
@@ -17,6 +23,7 @@ interface SessionEvent {
|
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
export declare function resetMultiplexerSessionManagerState(): void;
|
|
26
|
+
export type MultiplexerSessionManagerOptions = CmuxSessionLifecycleOptions;
|
|
20
27
|
/**
|
|
21
28
|
* Tracks child sessions and spawns/closes multiplexer panes for them.
|
|
22
29
|
*
|
|
@@ -26,17 +33,17 @@ export declare function resetMultiplexerSessionManagerState(): void;
|
|
|
26
33
|
export declare class MultiplexerSessionManager {
|
|
27
34
|
private readonly backgroundJobBoard?;
|
|
28
35
|
private instanceId;
|
|
29
|
-
private
|
|
36
|
+
private readonly resolveServerUrl;
|
|
30
37
|
private directory;
|
|
31
38
|
private multiplexer;
|
|
32
39
|
private sessions;
|
|
33
40
|
private knownSessions;
|
|
34
41
|
private spawningSessions;
|
|
35
42
|
private closingSessions;
|
|
36
|
-
private deferredIdleCloses;
|
|
37
43
|
private pollInterval?;
|
|
38
44
|
private enabled;
|
|
39
|
-
|
|
45
|
+
private cmuxLifecycle?;
|
|
46
|
+
constructor(ctx: PluginInput, config: MultiplexerConfig, backgroundJobBoard?: BackgroundJobReader | undefined, options?: MultiplexerSessionManagerOptions);
|
|
40
47
|
onSessionCreated(event: SessionEvent): Promise<void>;
|
|
41
48
|
onSessionStatus(event: SessionEvent): Promise<void>;
|
|
42
49
|
onSessionDeleted(event: SessionEvent): Promise<void>;
|
|
@@ -50,9 +57,10 @@ export declare class MultiplexerSessionManager {
|
|
|
50
57
|
private updatePolling;
|
|
51
58
|
private getSessionId;
|
|
52
59
|
private backgroundJobState;
|
|
53
|
-
private
|
|
54
|
-
|
|
60
|
+
private shouldCloseNow;
|
|
61
|
+
closeSessionFromCoordinator(sessionId: string): Promise<void>;
|
|
55
62
|
cleanup(): Promise<void>;
|
|
63
|
+
cleanupOnInstanceDisposed(): Promise<void>;
|
|
56
64
|
}
|
|
57
65
|
/**
|
|
58
66
|
* @deprecated Use MultiplexerSessionManager instead
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared multiplexer infrastructure
|
|
3
|
+
*
|
|
4
|
+
* Functions used across tmux, zellij, and herdr backend adapters.
|
|
5
|
+
* Extracted to eliminate copy-paste duplication and prevent drift.
|
|
6
|
+
*/
|
|
7
|
+
export declare function quoteShellArg(value: string): string;
|
|
8
|
+
/** Normalize Windows backslashes to / so sh -lc (MSYS2/Git Bash) doesn't treat them as escape chars. */
|
|
9
|
+
export declare function normalizePathForShell(directory: string): string;
|
|
10
|
+
export declare function buildOpencodeAttachCommand(sessionId: string, serverUrl: string, directory: string, executable?: string): string;
|
|
11
|
+
export declare function resolveHostOpencodeBinary(options?: {
|
|
12
|
+
override?: string;
|
|
13
|
+
envOverride?: string;
|
|
14
|
+
execPath?: string;
|
|
15
|
+
argv0?: string;
|
|
16
|
+
pathExists?: (path: string) => boolean;
|
|
17
|
+
}): string | null;
|
|
18
|
+
export declare function findBinary(binaryName: string, options?: {
|
|
19
|
+
verify?: boolean;
|
|
20
|
+
}): Promise<string | null>;
|
|
21
|
+
export interface GracefulClosePaneOptions {
|
|
22
|
+
/** Backend-specific Ctrl+C command args (binary prepended by caller). */
|
|
23
|
+
ctrlC: string[];
|
|
24
|
+
/** Backend-specific close/kill command args (binary prepended by caller). */
|
|
25
|
+
close: string[];
|
|
26
|
+
/** Accept exit code 1 as success (zellij/herdr treat "already closed" as 1). */
|
|
27
|
+
acceptExitCode1?: boolean;
|
|
28
|
+
/** Return true for empty/unknown paneId instead of false (zellij/herdr behavior). */
|
|
29
|
+
emptyPaneReturnsTrue?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function gracefulClosePane(binary: string | null, paneId: string, options: GracefulClosePaneOptions): Promise<boolean>;
|
|
@@ -8,13 +8,16 @@ import type { MultiplexerConfig, MultiplexerLayout } from '../config/schema';
|
|
|
8
8
|
export interface PaneResult {
|
|
9
9
|
success: boolean;
|
|
10
10
|
paneId?: string;
|
|
11
|
+
orphanPaneId?: string;
|
|
12
|
+
error?: 'unavailable' | 'not_found' | 'invalid_state' | 'hard';
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Core multiplexer interface
|
|
14
|
-
* Implementations: TmuxMultiplexer, ZellijMultiplexer, HerdrMultiplexer
|
|
16
|
+
* Implementations: TmuxMultiplexer, ZellijMultiplexer, HerdrMultiplexer,
|
|
17
|
+
* CmuxMultiplexer
|
|
15
18
|
*/
|
|
16
19
|
export interface Multiplexer {
|
|
17
|
-
readonly type: 'tmux' | 'zellij' | 'herdr';
|
|
20
|
+
readonly type: 'tmux' | 'zellij' | 'herdr' | 'cmux';
|
|
18
21
|
/**
|
|
19
22
|
* Check if the multiplexer binary is available on the system
|
|
20
23
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type PluginInput, type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BackgroundJobStore } from '../utils/background-job-store';
|
|
3
3
|
interface CancelTaskToolOptions {
|
|
4
4
|
client: PluginInput['client'];
|
|
5
|
-
backgroundJobBoard:
|
|
5
|
+
backgroundJobBoard: BackgroundJobStore;
|
|
6
6
|
shouldManageSession: (sessionID: string) => boolean;
|
|
7
7
|
abortTimeoutMs?: number;
|
|
8
8
|
verifyAbortMs?: number;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { escapeHtml } from '../../utils/escape-html';
|
|
2
|
+
import { parseFrontmatter } from '../../utils/frontmatter';
|
|
1
3
|
import type { CachedFetch, ExtractedContent } from './types';
|
|
4
|
+
export { escapeHtml, parseFrontmatter };
|
|
2
5
|
export declare function wordCount(text: string): number;
|
|
3
6
|
export declare function frontmatter(metadata: Record<string, unknown>): string;
|
|
4
7
|
export declare function trimBlankRuns(input: string): string;
|
|
5
8
|
export declare function cleanHeadingText(input: string): string;
|
|
6
9
|
export declare function cleanFetchedMarkdown(input: string): string;
|
|
7
10
|
export declare function cleanFetchedText(input: string): string;
|
|
8
|
-
export declare function escapeHtml(input: string): string;
|
|
9
11
|
export declare function withTruncationMarker(content: string, format: 'text' | 'markdown' | 'html', truncated: boolean): string;
|
|
10
12
|
export declare function joinRenderedContent(metadata: string, content: string, format: 'text' | 'markdown' | 'html'): string;
|
|
11
13
|
export declare function renderMessageForFormat(content: string, format: 'text' | 'markdown' | 'html'): string;
|
package/dist/tui-state.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ export interface TuiSnapshot {
|
|
|
4
4
|
agentModels: Record<string, string>;
|
|
5
5
|
agentVariants: Record<string, string>;
|
|
6
6
|
}
|
|
7
|
-
export declare function getTuiStatePath(): string;
|
|
8
|
-
export declare function readTuiSnapshot(): TuiSnapshot;
|
|
9
|
-
export declare function readTuiSnapshotAsync(): Promise<TuiSnapshot>;
|
|
7
|
+
export declare function getTuiStatePath(projectDir: string): string;
|
|
8
|
+
export declare function readTuiSnapshot(projectDir: string): TuiSnapshot;
|
|
9
|
+
export declare function readTuiSnapshotAsync(projectDir: string): Promise<TuiSnapshot>;
|
|
10
10
|
export declare function recordTuiAgentModels(input: {
|
|
11
11
|
agentModels: Record<string, string>;
|
|
12
12
|
agentVariants?: Record<string, string>;
|
|
13
|
-
}): void;
|
|
13
|
+
}, projectDir: string): void;
|
|
14
14
|
export declare function recordTuiAgentModel(input: {
|
|
15
15
|
agentName: string;
|
|
16
16
|
model: string;
|
|
17
17
|
variant?: string | null;
|
|
18
|
-
}): void;
|
|
18
|
+
}, projectDir: string): void;
|
package/dist/tui.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare function splitSidebarModelId(model: string): {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function getSidebarAgentNames(snapshot: TuiSnapshot): string[];
|
|
8
8
|
export declare function readConfigInvalid(directory: string): boolean;
|
|
9
|
+
export declare function readCompactSidebar(directory: string): boolean;
|
|
9
10
|
declare const plugin: TuiPluginModule & {
|
|
10
11
|
id: string;
|
|
11
12
|
};
|