@mtayfur/opencode-chat-tree 1.0.1
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 +123 -0
- package/dist/adapters/opencode-gateway.d.ts +50 -0
- package/dist/adapters/tree-repository.d.ts +25 -0
- package/dist/configuration.d.ts +9 -0
- package/dist/core/branching.d.ts +23 -0
- package/dist/core/projection.d.ts +74 -0
- package/dist/core/transcript.d.ts +23 -0
- package/dist/core/tree.d.ts +20 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2405 -0
- package/dist/ui/branch-workflow.d.ts +30 -0
- package/dist/ui/controls.d.ts +36 -0
- package/dist/ui/theme.d.ts +15 -0
- package/dist/ui/tree-route.d.ts +13 -0
- package/dist/ui/tree-view.d.ts +13 -0
- package/package.json +75 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/solid */
|
|
2
|
+
import type { TuiPluginApi } from "@opencode-ai/plugin/tui";
|
|
3
|
+
import { type Accessor } from "solid-js";
|
|
4
|
+
import type { OpenCodeTreeGateway, SummaryModel } from "../adapters/opencode-gateway";
|
|
5
|
+
import { type BranchPlan } from "../core/branching";
|
|
6
|
+
import type { TreeRow } from "../core/projection";
|
|
7
|
+
import type { TranscriptMap } from "../core/transcript";
|
|
8
|
+
import type { TreeSnapshot } from "../core/tree";
|
|
9
|
+
type BranchWorkflowApi = {
|
|
10
|
+
readonly ui: Pick<TuiPluginApi["ui"], "dialog" | "toast">;
|
|
11
|
+
readonly theme: Pick<TuiPluginApi["theme"], "current">;
|
|
12
|
+
};
|
|
13
|
+
export type CreateBranchWorkflowInput = {
|
|
14
|
+
readonly api: BranchWorkflowApi;
|
|
15
|
+
readonly gateway: () => OpenCodeTreeGateway | undefined;
|
|
16
|
+
readonly snapshot: () => TreeSnapshot | undefined;
|
|
17
|
+
readonly transcripts: () => TranscriptMap | undefined;
|
|
18
|
+
readonly selectedRow: () => TreeRow | undefined;
|
|
19
|
+
readonly summaryModel?: SummaryModel;
|
|
20
|
+
readonly summaryVariant?: string;
|
|
21
|
+
readonly navigateToSession: (sessionId: string) => void | Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
export type BranchWorkflow = {
|
|
24
|
+
readonly busy: Accessor<boolean>;
|
|
25
|
+
readonly errorMessage: Accessor<string | undefined>;
|
|
26
|
+
readonly open: (plan: BranchPlan) => void;
|
|
27
|
+
readonly dispose: () => void;
|
|
28
|
+
};
|
|
29
|
+
export declare function createBranchWorkflow(input: CreateBranchWorkflowInput): BranchWorkflow;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const TREE_COMMANDS: {
|
|
2
|
+
readonly moveUp: "chat-tree.move-up";
|
|
3
|
+
readonly moveDown: "chat-tree.move-down";
|
|
4
|
+
readonly collapse: "chat-tree.collapse";
|
|
5
|
+
readonly expand: "chat-tree.expand";
|
|
6
|
+
readonly select: "chat-tree.select";
|
|
7
|
+
readonly back: "chat-tree.back";
|
|
8
|
+
};
|
|
9
|
+
export declare const TREE_BINDINGS: readonly [{
|
|
10
|
+
readonly key: "up";
|
|
11
|
+
readonly cmd: "chat-tree.move-up";
|
|
12
|
+
}, {
|
|
13
|
+
readonly key: "down";
|
|
14
|
+
readonly cmd: "chat-tree.move-down";
|
|
15
|
+
}, {
|
|
16
|
+
readonly key: "left";
|
|
17
|
+
readonly cmd: "chat-tree.collapse";
|
|
18
|
+
}, {
|
|
19
|
+
readonly key: "right";
|
|
20
|
+
readonly cmd: "chat-tree.expand";
|
|
21
|
+
}, {
|
|
22
|
+
readonly key: "h";
|
|
23
|
+
readonly cmd: "chat-tree.collapse";
|
|
24
|
+
}, {
|
|
25
|
+
readonly key: "l";
|
|
26
|
+
readonly cmd: "chat-tree.expand";
|
|
27
|
+
}, {
|
|
28
|
+
readonly key: "return";
|
|
29
|
+
readonly cmd: "chat-tree.select";
|
|
30
|
+
}, {
|
|
31
|
+
readonly key: "escape";
|
|
32
|
+
readonly cmd: "chat-tree.back";
|
|
33
|
+
}, {
|
|
34
|
+
readonly key: "ctrl+c";
|
|
35
|
+
readonly cmd: "chat-tree.back";
|
|
36
|
+
}];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TuiThemeCurrent } from "@opencode-ai/plugin/tui";
|
|
2
|
+
import type { TreeRow } from "../core/projection";
|
|
3
|
+
export type TreePalette = {
|
|
4
|
+
readonly screenBackground: TuiThemeCurrent["background"];
|
|
5
|
+
readonly panelBackground: TuiThemeCurrent["backgroundPanel"];
|
|
6
|
+
readonly helpText: TuiThemeCurrent["textMuted"];
|
|
7
|
+
readonly helpKey: TuiThemeCurrent["text"];
|
|
8
|
+
readonly loadingText: TuiThemeCurrent["info"];
|
|
9
|
+
readonly emptyText: TuiThemeCurrent["textMuted"];
|
|
10
|
+
readonly errorText: TuiThemeCurrent["error"];
|
|
11
|
+
readonly noticeText: TuiThemeCurrent["warning"];
|
|
12
|
+
readonly branchingText: TuiThemeCurrent["accent"];
|
|
13
|
+
};
|
|
14
|
+
export declare function createTreePalette(theme: TuiThemeCurrent): TreePalette;
|
|
15
|
+
export declare function getRowForeground(theme: TuiThemeCurrent, row: TreeRow): TuiThemeCurrent["text"];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/solid */
|
|
2
|
+
import type { TuiPluginApi } from "@opencode-ai/plugin/tui";
|
|
3
|
+
import { type SummaryModel } from "../adapters/opencode-gateway";
|
|
4
|
+
export type TreeRouteProps = {
|
|
5
|
+
readonly api: TuiPluginApi;
|
|
6
|
+
readonly projectRoot?: string;
|
|
7
|
+
readonly storageRoot?: string;
|
|
8
|
+
readonly sessionId?: string;
|
|
9
|
+
readonly summaryModel?: SummaryModel;
|
|
10
|
+
readonly summaryVariant?: string;
|
|
11
|
+
readonly navigateToSession: (sessionId: string) => void | Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export declare function TreeRoute(props: TreeRouteProps): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/solid */
|
|
2
|
+
import type { TuiThemeCurrent } from "@opencode-ai/plugin/tui";
|
|
3
|
+
import type { TreeRow } from "../core/projection";
|
|
4
|
+
export type TreeViewProps = {
|
|
5
|
+
readonly rows: readonly TreeRow[];
|
|
6
|
+
readonly currentSessionId?: string;
|
|
7
|
+
readonly selectedIndex?: number;
|
|
8
|
+
readonly width: number;
|
|
9
|
+
readonly theme: () => TuiThemeCurrent;
|
|
10
|
+
readonly autoFocus?: boolean;
|
|
11
|
+
readonly onFocusChange?: (focused: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function TreeView(props: TreeViewProps): any;
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
+
"name": "@mtayfur/opencode-chat-tree",
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"description": "Conversation branching and navigation for the OpenCode TUI.",
|
|
6
|
+
"homepage": "https://github.com/mtayfur/opencode-plugins/tree/main/packages/chat-tree#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/mtayfur/opencode-plugins/issues"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/mtayfur/opencode-plugins.git",
|
|
14
|
+
"directory": "packages/chat-tree"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"exports": {
|
|
22
|
+
"./tui": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"fmt": "oxfmt",
|
|
32
|
+
"fmt:check": "oxfmt --check",
|
|
33
|
+
"build": "bun run scripts/build.ts",
|
|
34
|
+
"setup": "bash ./install.sh",
|
|
35
|
+
"setup:uninstall": "bash ./install.sh --uninstall",
|
|
36
|
+
"typecheck": "bun x tsc -p tsconfig.json",
|
|
37
|
+
"prepack": "bun run build"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@opencode-ai/plugin": "1.18.16",
|
|
41
|
+
"solid-js": "1.9.12",
|
|
42
|
+
"zod": "^4.4.3"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@opencode-ai/sdk": "1.18.16",
|
|
46
|
+
"@opentui/core": "0.5.1",
|
|
47
|
+
"@opentui/keymap": "0.5.1",
|
|
48
|
+
"@opentui/solid": "0.5.1",
|
|
49
|
+
"@types/bun": "1.3.14",
|
|
50
|
+
"jsonc-parser": "^3.3.1",
|
|
51
|
+
"oxfmt": "^0.63.0",
|
|
52
|
+
"typescript": "^5.9.3"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@opentui/core": "^0.5.1",
|
|
56
|
+
"@opentui/keymap": "^0.5.1",
|
|
57
|
+
"@opentui/solid": "^0.5.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"@opentui/core": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"@opentui/keymap": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"@opentui/solid": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"engines": {
|
|
71
|
+
"bun": ">=1.3.14",
|
|
72
|
+
"opencode": "^1.18.16"
|
|
73
|
+
},
|
|
74
|
+
"packageManager": "bun@1.3.14"
|
|
75
|
+
}
|