@mirrowel/opencode-openshare 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +181 -2
- package/ci/README.md +56 -0
- package/ci/openshare.config.json +10 -0
- package/ci/openshare.js +2270 -0
- package/dist/commands.d.ts +7 -0
- package/dist/commands.js +440 -0
- package/dist/config.d.ts +138 -0
- package/dist/config.js +524 -0
- package/dist/core.d.ts +117 -0
- package/dist/core.js +1944 -0
- package/dist/dialogs.d.ts +94 -0
- package/dist/dialogs.js +725 -0
- package/dist/server.d.ts +64 -0
- package/dist/server.js +30 -0
- package/dist/settings.d.ts +24 -0
- package/dist/settings.js +1226 -0
- package/dist/share-flow.d.ts +287 -0
- package/dist/share-flow.js +516 -0
- package/dist/sidebar.d.ts +19 -0
- package/dist/sidebar.js +144 -0
- package/dist/tui-host.d.ts +158 -0
- package/dist/tui-host.js +6 -0
- package/dist/tui.d.ts +17 -0
- package/dist/tui.js +4719 -0
- package/dist/ui-prefs.d.ts +16 -0
- package/dist/ui-prefs.js +27 -0
- package/dist/v2-server.d.ts +81 -0
- package/dist/v2-server.js +402 -0
- package/dist/v2-tui.d.ts +24 -0
- package/dist/v2-tui.js +313 -0
- package/dist/v2-types.d.ts +134 -0
- package/dist/v2-types.js +8 -0
- package/openshare.config.json +16 -0
- package/package.json +98 -4
- package/src/banner.txt +25 -0
- package/src/commands.ts +452 -0
- package/src/config.ts +524 -0
- package/src/core.ts +1997 -0
- package/src/dialogs.tsx +971 -0
- package/src/server.ts +47 -0
- package/src/settings.ts +1239 -0
- package/src/share-flow.ts +551 -0
- package/src/sidebar.tsx +187 -0
- package/src/tui-host.ts +134 -0
- package/src/tui.tsx +318 -0
- package/src/ui-prefs.ts +36 -0
- package/src/v2-server.ts +438 -0
- package/src/v2-tui.ts +315 -0
- package/src/v2-types.ts +102 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/solid */
|
|
2
|
+
import type { JSX } from "@opentui/solid";
|
|
3
|
+
import type { TuiPluginApi } from "@opencode-ai/plugin/tui";
|
|
4
|
+
import type { ShareDialogSelectOption } from "./tui-host.js";
|
|
5
|
+
import { type DialogWidth } from "./ui-prefs.js";
|
|
6
|
+
export declare function dialogWidthOf(api: TuiPluginApi): DialogWidth;
|
|
7
|
+
export declare function setDialogWidth(api: TuiPluginApi, width: DialogWidth): void;
|
|
8
|
+
export declare function dialogHeightPercentOf(api: TuiPluginApi): number;
|
|
9
|
+
export declare function setDialogHeightPercent(api: TuiPluginApi, value: number): void;
|
|
10
|
+
/** usable text columns inside a dialog at the current width (frame padding
|
|
11
|
+
* accounted); the estimator and the pre-wrapper both use this so heights
|
|
12
|
+
* match what actually renders. */
|
|
13
|
+
export declare function dialogContentWidth(api: TuiPluginApi): number;
|
|
14
|
+
/** Deterministic character-level pre-wrap (parity lesson: opentui's
|
|
15
|
+
* word wrap cannot break unbreakable tokens like a JSON policy blob, so
|
|
16
|
+
* "wrapped" text still escaped the dialog border — live-caught). Both the
|
|
17
|
+
* [i] pane and InfoDialog render THESE lines; the row estimate uses the
|
|
18
|
+
* same output, so heights match what renders. */
|
|
19
|
+
export declare function preWrap(text: string, width: number): string[];
|
|
20
|
+
export type MenuOption<Value = string> = {
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
value: Value;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** long-form detail for the [i] pane: what it is, current value + source,
|
|
26
|
+
* why it matters, full data the row truncates (URLs, ids, statuses).
|
|
27
|
+
* Lines starting with "## " become section headers (paged [i] pane). */
|
|
28
|
+
help?: string;
|
|
29
|
+
/** destructive action — title renders red (config-studio port) */
|
|
30
|
+
danger?: boolean;
|
|
31
|
+
/** pending/edited state — title renders green (config-studio port) */
|
|
32
|
+
edited?: boolean;
|
|
33
|
+
/** non-interactive section separator row (never focusable) */
|
|
34
|
+
divider?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function MenuDialog<Value>(props: {
|
|
37
|
+
api: TuiPluginApi;
|
|
38
|
+
title: string;
|
|
39
|
+
options: MenuOption<Value>[];
|
|
40
|
+
current?: Value;
|
|
41
|
+
hint?: string;
|
|
42
|
+
onDone: (value: Value | undefined) => void;
|
|
43
|
+
}): JSX.Element;
|
|
44
|
+
/** showMenuOnce, family discipline with the flicker fix (2026-10-19):
|
|
45
|
+
* done() does NOT clear the host stack — the next dialog's replace() is an
|
|
46
|
+
* atomic swap, so clearing first paints one empty frame (the esc-to-parent
|
|
47
|
+
* flicker, live-caught). Chain ends clear explicitly (command exits,
|
|
48
|
+
* settings exit). */
|
|
49
|
+
export declare function showMenuOnce<Value>(api: TuiPluginApi, props: {
|
|
50
|
+
title: string;
|
|
51
|
+
options: MenuOption<Value>[];
|
|
52
|
+
current?: Value;
|
|
53
|
+
hint?: string;
|
|
54
|
+
}): Promise<Value | undefined>;
|
|
55
|
+
export type DialogAction = {
|
|
56
|
+
title: string;
|
|
57
|
+
value: string;
|
|
58
|
+
key?: string;
|
|
59
|
+
danger?: boolean;
|
|
60
|
+
};
|
|
61
|
+
export declare function showInfoDialog(api: TuiPluginApi, props: {
|
|
62
|
+
title: string;
|
|
63
|
+
message: string;
|
|
64
|
+
actions?: DialogAction[];
|
|
65
|
+
}): Promise<string | undefined>;
|
|
66
|
+
export declare function showConfirmMenu(api: TuiPluginApi, props: {
|
|
67
|
+
title: string;
|
|
68
|
+
message: string;
|
|
69
|
+
confirmLabel?: string;
|
|
70
|
+
danger?: boolean;
|
|
71
|
+
}): Promise<boolean>;
|
|
72
|
+
export declare function showAlertMenu(api: TuiPluginApi, props: {
|
|
73
|
+
title: string;
|
|
74
|
+
message: string;
|
|
75
|
+
}): Promise<void>;
|
|
76
|
+
export declare function PromptDialog(props: {
|
|
77
|
+
api: TuiPluginApi;
|
|
78
|
+
title: string;
|
|
79
|
+
placeholder?: string;
|
|
80
|
+
value?: string;
|
|
81
|
+
onDone: (value: string | undefined) => void;
|
|
82
|
+
}): JSX.Element;
|
|
83
|
+
export declare function showPromptOnce(api: TuiPluginApi, props: {
|
|
84
|
+
title: string;
|
|
85
|
+
placeholder?: string;
|
|
86
|
+
value?: string;
|
|
87
|
+
}): Promise<string | undefined>;
|
|
88
|
+
/** host-facade adapter: ShareDialogSelectOption (flows) -> MenuOption */
|
|
89
|
+
export declare function toMenuOptions<Value>(options: ShareDialogSelectOption<Value>[]): MenuOption<Value>[];
|
|
90
|
+
export type SizePickerResult = {
|
|
91
|
+
width: DialogWidth;
|
|
92
|
+
heightPercent: number;
|
|
93
|
+
};
|
|
94
|
+
export declare function showSizePickerOnce(api: TuiPluginApi, current: SizePickerResult): Promise<SizePickerResult | undefined>;
|