chore: include pre-built dist for github install
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export declare const INTERACTIVE_BASH_SESSION_STORAGE: string;
|
||||
export declare const OMO_SESSION_PREFIX = "omo-";
|
||||
export declare function buildSessionReminderMessage(sessions: string[]): string;
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
interface ToolExecuteInput {
|
||||
tool: string;
|
||||
sessionID: string;
|
||||
callID: string;
|
||||
args?: Record<string, unknown>;
|
||||
}
|
||||
interface ToolExecuteOutput {
|
||||
title: string;
|
||||
output: string;
|
||||
metadata: unknown;
|
||||
}
|
||||
interface EventInput {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}
|
||||
export declare function createInteractiveBashSessionHook(ctx: PluginInput): {
|
||||
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
||||
event: ({ event }: EventInput) => Promise<void>;
|
||||
};
|
||||
export {};
|
||||
@@ -0,0 +1,3 @@
|
||||
export { createInteractiveBashSessionHook } from "./hook";
|
||||
export { createInteractiveBashSessionTracker } from "./interactive-bash-session-tracker";
|
||||
export { parseTmuxCommand } from "./tmux-command-parser";
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { InteractiveBashSessionState } from "./types";
|
||||
type AbortSession = (args: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<unknown>;
|
||||
export declare function createInteractiveBashSessionTracker(options: {
|
||||
abortSession: AbortSession;
|
||||
}): {
|
||||
getOrCreateState: (sessionID: string) => InteractiveBashSessionState;
|
||||
handleSessionDeleted: (sessionID: string) => Promise<void>;
|
||||
handleTmuxCommand: (input: {
|
||||
sessionID: string;
|
||||
subCommand: string;
|
||||
sessionName: string | null;
|
||||
toolOutput: string;
|
||||
}) => {
|
||||
reminderToAppend: string | null;
|
||||
};
|
||||
};
|
||||
export {};
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Quote-aware command tokenizer with escape handling
|
||||
* Handles single/double quotes and backslash escapes
|
||||
*/
|
||||
export declare function tokenizeCommand(cmd: string): string[];
|
||||
/**
|
||||
* Normalize session name by stripping :window and .pane suffixes
|
||||
* e.g., "omo-x:1" -> "omo-x", "omo-x:1.2" -> "omo-x"
|
||||
*/
|
||||
export declare function normalizeSessionName(name: string): string;
|
||||
export declare function findFlagValue(tokens: string[], flag: string): string | null;
|
||||
/**
|
||||
* Extract session name from tokens, considering the subCommand
|
||||
* For new-session: prioritize -s over -t
|
||||
* For other commands: use -t
|
||||
*/
|
||||
export declare function extractSessionNameFromTokens(tokens: string[], subCommand: string): string | null;
|
||||
/**
|
||||
* Find the tmux subcommand from tokens, skipping global options.
|
||||
* tmux allows global options before the subcommand:
|
||||
* e.g., `tmux -L socket-name new-session -s omo-x`
|
||||
* Global options with args: -L, -S, -f, -c, -T
|
||||
* Standalone flags: -C, -v, -V, etc.
|
||||
* Special: -- (end of options marker)
|
||||
*/
|
||||
export declare function findSubcommand(tokens: string[]): string;
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { InteractiveBashSessionState } from "./types";
|
||||
export declare function getOrCreateState(sessionID: string, sessionStates: Map<string, InteractiveBashSessionState>): InteractiveBashSessionState;
|
||||
export declare function isOmoSession(sessionName: string | null): boolean;
|
||||
export declare function killAllTrackedSessions(state: InteractiveBashSessionState): Promise<void>;
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { InteractiveBashSessionState } from "./types";
|
||||
export declare function loadInteractiveBashSessionState(sessionID: string): InteractiveBashSessionState | null;
|
||||
export declare function saveInteractiveBashSessionState(state: InteractiveBashSessionState): void;
|
||||
export declare function clearInteractiveBashSessionState(sessionID: string): void;
|
||||
@@ -0,0 +1,4 @@
|
||||
export declare function parseTmuxCommand(tmuxCommand: string): {
|
||||
subCommand: string;
|
||||
sessionName: string | null;
|
||||
};
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
export interface InteractiveBashSessionState {
|
||||
sessionID: string;
|
||||
tmuxSessions: Set<string>;
|
||||
updatedAt: number;
|
||||
}
|
||||
export interface SerializedInteractiveBashSessionState {
|
||||
sessionID: string;
|
||||
tmuxSessions: string[];
|
||||
updatedAt: number;
|
||||
}
|
||||
Reference in New Issue
Block a user