@nikcli-ai/plugin 1.143.0 → 1.166.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/dist/tui.d.ts +15 -0
- package/dist/v2/tui/context.d.ts +41 -0
- package/dist/v2/tui/context.js +0 -0
- package/dist/v2/tui/index.d.ts +1 -0
- package/dist/v2/tui/index.js +1 -0
- package/dist/v2/tui/plugin.d.ts +8 -0
- package/dist/v2/tui/plugin.js +3 -0
- package/package.json +14 -4
package/dist/tui.d.ts
CHANGED
|
@@ -278,6 +278,16 @@ export type TuiSlotMap = {
|
|
|
278
278
|
sidebar_footer: {
|
|
279
279
|
session_id: string;
|
|
280
280
|
};
|
|
281
|
+
/** V2 plugin slots. Dotted names intentionally do not collide with v1 slots. */
|
|
282
|
+
"app.bottom": {};
|
|
283
|
+
"home.bottom": {};
|
|
284
|
+
"home.footer": {};
|
|
285
|
+
"sidebar.content": {
|
|
286
|
+
sessionID: string;
|
|
287
|
+
};
|
|
288
|
+
"sidebar.footer": {
|
|
289
|
+
sessionID: string;
|
|
290
|
+
};
|
|
281
291
|
};
|
|
282
292
|
export type TuiSlotContext = {
|
|
283
293
|
theme: TuiTheme;
|
|
@@ -288,11 +298,16 @@ export type TuiSlotPlugin = Omit<SlotCore, "id"> & {
|
|
|
288
298
|
};
|
|
289
299
|
export type TuiSlots = {
|
|
290
300
|
register: (plugin: TuiSlotPlugin) => string;
|
|
301
|
+
/** Host-backed disposable registration used by the v2 compatibility runtime. */
|
|
302
|
+
registerDisposable: (plugin: TuiSlotPlugin) => () => void;
|
|
291
303
|
};
|
|
292
304
|
export type TuiEventBus = {
|
|
293
305
|
on: <Type extends Event["type"]>(type: Type, handler: (event: Extract<Event, {
|
|
294
306
|
type: Type;
|
|
295
307
|
}>) => void) => () => void;
|
|
308
|
+
listen: (handler: (event: {
|
|
309
|
+
details: Event;
|
|
310
|
+
}) => void) => () => void;
|
|
296
311
|
};
|
|
297
312
|
export type TuiDispose = () => void | Promise<void>;
|
|
298
313
|
export type TuiLifecycle = {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { NikcliClient } from "@nikcli-ai/sdk/v2";
|
|
2
|
+
import type { JSX } from "@opentui/solid";
|
|
3
|
+
import type { TuiEventBus, TuiState } from "../../tui.js";
|
|
4
|
+
/** Reactive nikcli data exposed to a v2 TUI plugin. */
|
|
5
|
+
export interface Data extends TuiState, TuiEventBus {
|
|
6
|
+
}
|
|
7
|
+
export type Route = {
|
|
8
|
+
readonly type: "home";
|
|
9
|
+
} | {
|
|
10
|
+
readonly type: "session";
|
|
11
|
+
readonly sessionID: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly type: "plugin";
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly data?: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
export type Destination = Route | Omit<Extract<Route, {
|
|
19
|
+
readonly type: "plugin";
|
|
20
|
+
}>, "id">;
|
|
21
|
+
export interface Page {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly render: (input: {
|
|
24
|
+
readonly data?: Record<string, unknown>;
|
|
25
|
+
}) => JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
export type Slot = (props: Record<string, unknown>) => JSX.Element;
|
|
28
|
+
export interface UI {
|
|
29
|
+
readonly router: {
|
|
30
|
+
register(page: Page): () => void;
|
|
31
|
+
navigate(destination: Destination): void;
|
|
32
|
+
current(): Route;
|
|
33
|
+
};
|
|
34
|
+
readonly slot: (name: string, render: Slot) => () => void;
|
|
35
|
+
}
|
|
36
|
+
export interface Context {
|
|
37
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
38
|
+
readonly client: NikcliClient;
|
|
39
|
+
readonly data: Data;
|
|
40
|
+
readonly ui: UI;
|
|
41
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Plugin from "./plugin.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Plugin from "./plugin.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Context } from "./context.js";
|
|
2
|
+
export type { Context };
|
|
3
|
+
export type Cleanup = () => Promise<void> | void;
|
|
4
|
+
export interface Definition {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly setup: (context: Context) => Promise<Cleanup | void> | Cleanup | void;
|
|
7
|
+
}
|
|
8
|
+
export declare function define(plugin: Definition): Definition;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@nikcli-ai/plugin",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.166.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
"./tui": {
|
|
23
23
|
"import": "./src/tui.ts",
|
|
24
24
|
"types": "./src/tui.ts"
|
|
25
|
+
},
|
|
26
|
+
"./v2/tui": {
|
|
27
|
+
"import": "./src/v2/tui/index.ts",
|
|
28
|
+
"types": "./src/v2/tui/index.ts"
|
|
29
|
+
},
|
|
30
|
+
"./v2/tui/*": {
|
|
31
|
+
"import": "./src/v2/tui/*.ts",
|
|
32
|
+
"types": "./src/v2/tui/*.ts"
|
|
25
33
|
}
|
|
26
34
|
},
|
|
27
35
|
"files": [
|
|
@@ -31,11 +39,13 @@
|
|
|
31
39
|
"exports": {
|
|
32
40
|
".": "./dist/index.js",
|
|
33
41
|
"./tool": "./dist/tool.js",
|
|
34
|
-
"./tui": "./dist/tui.js"
|
|
42
|
+
"./tui": "./dist/tui.js",
|
|
43
|
+
"./v2/tui": "./dist/v2/tui/index.js",
|
|
44
|
+
"./v2/tui/*": "./dist/v2/tui/*.js"
|
|
35
45
|
}
|
|
36
46
|
},
|
|
37
47
|
"dependencies": {
|
|
38
|
-
"@nikcli-ai/sdk": "1.
|
|
48
|
+
"@nikcli-ai/sdk": "1.166.0",
|
|
39
49
|
"@opentui/core": "0.1.91",
|
|
40
50
|
"@opentui/solid": "0.1.91",
|
|
41
51
|
"zod": "4.1.8"
|
|
@@ -44,6 +54,6 @@
|
|
|
44
54
|
"@tsconfig/node22": "22.0.2",
|
|
45
55
|
"@types/node": "22.13.9",
|
|
46
56
|
"typescript": "5.8.2",
|
|
47
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
57
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2"
|
|
48
58
|
}
|
|
49
59
|
}
|