opencode-subagent-magazine 1.5.2 → 1.6.0-beta.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/LICENSE +21 -21
- package/README.md +192 -192
- package/dist/_version.d.ts +1 -1
- package/dist/_version.js +1 -1
- package/dist/core/color.d.ts +20 -0
- package/dist/core/color.js +68 -0
- package/dist/core/format.d.ts +5 -0
- package/dist/core/format.js +68 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/kv.d.ts +20 -0
- package/dist/core/kv.js +30 -0
- package/dist/core/state-machine.d.ts +17 -0
- package/dist/core/state-machine.js +27 -0
- package/dist/core/types.d.ts +51 -0
- package/dist/core/types.js +2 -0
- package/dist/core/usage.d.ts +15 -0
- package/dist/core/usage.js +1 -0
- package/dist/index.js +148 -1484
- package/dist/panel/SubAgentPanel.d.ts +13 -0
- package/dist/panel/SubAgentPanel.js +1232 -0
- package/dist/panel/panel-api.d.ts +67 -0
- package/dist/panel/panel-api.js +1 -0
- package/dist/panel/store.d.ts +5 -0
- package/dist/panel/store.js +5 -0
- package/dist/tui.js +383 -289
- package/dist/v2/commands.d.ts +7 -0
- package/dist/v2/commands.js +263 -0
- package/dist/v2/index.d.ts +8 -0
- package/dist/v2/index.js +62 -0
- package/dist/v2/theme.d.ts +3 -0
- package/dist/v2/theme.js +12 -0
- package/dist/v2/types.d.ts +231 -0
- package/dist/v2/types.js +6 -0
- package/dist/v2/v2-panel-api.d.ts +12 -0
- package/dist/v2/v2-panel-api.js +345 -0
- package/dist/v2.js +3003 -0
- package/install.mjs +103 -103
- package/package.json +64 -63
- package/src/_version.ts +1 -1
- package/src/clipboard.ts +134 -134
- package/src/core/color.ts +70 -0
- package/src/core/format.ts +61 -0
- package/src/core/index.ts +6 -0
- package/src/core/kv.ts +36 -0
- package/src/core/state-machine.ts +46 -0
- package/src/core/types.ts +58 -0
- package/src/core/usage.ts +16 -0
- package/src/i18n.ts +261 -261
- package/src/index.tsx +124 -1750
- package/src/panel/SubAgentPanel.tsx +1460 -0
- package/src/panel/panel-api.ts +72 -0
- package/src/panel/store.ts +8 -0
- package/src/server.ts +10 -10
- package/src/v2/commands.ts +251 -0
- package/src/v2/index.tsx +98 -0
- package/src/v2/theme.ts +14 -0
- package/src/v2/types.ts +165 -0
- package/src/v2/v2-panel-api.ts +301 -0
- package/tui/index.js +11 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { KVApi } from "../core/kv";
|
|
2
|
+
import type { UsageReader, TodoStats } from "../core/usage";
|
|
3
|
+
import type { Lang, SortOrder, ScrollMode } from "../core/types";
|
|
4
|
+
/** Minimal session shape the panel reads from the host SDK. */
|
|
5
|
+
export interface SessionLike {
|
|
6
|
+
id?: string;
|
|
7
|
+
parentID?: string;
|
|
8
|
+
agent?: string;
|
|
9
|
+
cost?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionStatusLike {
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Standardized panel events. Adapter layers (V1/V2) translate host events
|
|
16
|
+
* into these shapes so the panel component never touches host APIs directly.
|
|
17
|
+
*/
|
|
18
|
+
export type PanelEventType = "part.updated" | "message.updated" | "session.idle" | "session.error";
|
|
19
|
+
export interface PanelEvent {
|
|
20
|
+
type: PanelEventType;
|
|
21
|
+
/** part payload for part.updated; session properties for idle/error. */
|
|
22
|
+
payload?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface ToastOptions {
|
|
25
|
+
variant?: "success" | "warning" | "error";
|
|
26
|
+
title?: string;
|
|
27
|
+
duration?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The full surface the SubAgentPanel component consumes.
|
|
31
|
+
* V1 and V2 each implement this against their host SDK; the panel is agnostic.
|
|
32
|
+
* Theme is slot-scoped in both hosts, so it is passed as a panel prop,
|
|
33
|
+
* not part of the API.
|
|
34
|
+
*/
|
|
35
|
+
export interface PanelApi {
|
|
36
|
+
kv: KVApi;
|
|
37
|
+
usage: UsageReader;
|
|
38
|
+
session: {
|
|
39
|
+
get(sid: string): SessionLike | undefined;
|
|
40
|
+
status(sid: string): SessionStatusLike | undefined;
|
|
41
|
+
/** Raw message list for a session (scan / error extraction). */
|
|
42
|
+
messages(sid: string): unknown[] | undefined;
|
|
43
|
+
/** Raw parts of a message (scan). */
|
|
44
|
+
part(messageID: string): unknown[] | undefined;
|
|
45
|
+
};
|
|
46
|
+
event: {
|
|
47
|
+
on(type: PanelEventType, cb: (e: PanelEvent) => void): () => void;
|
|
48
|
+
};
|
|
49
|
+
client: {
|
|
50
|
+
abort(input: {
|
|
51
|
+
sessionID: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
route: {
|
|
55
|
+
navigateSession(sessionID: string): void;
|
|
56
|
+
};
|
|
57
|
+
ui: {
|
|
58
|
+
toast(message: string, opts?: ToastOptions): void;
|
|
59
|
+
};
|
|
60
|
+
settings: {
|
|
61
|
+
lang: () => Lang;
|
|
62
|
+
maxEntries: () => number;
|
|
63
|
+
sortOrder: () => SortOrder;
|
|
64
|
+
scrollMode: () => ScrollMode;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export type { TodoStats };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SubEntry } from "../core/types";
|
|
2
|
+
/** 模块级缓存:各 session 的 entry 状态独立存储,不随当前视图切换而清除。 */
|
|
3
|
+
export declare const globalEntryCache: Map<string, Map<string, SubEntry>>;
|
|
4
|
+
/** 模块级刷新信号:外部(如斜杠命令)触发清除后 +1,组件 scan 依赖它以重扫。 */
|
|
5
|
+
export declare const clearTick: import("solid-js").Accessor<number>, setClearTick: import("solid-js").Setter<number>;
|