@nyte-ai/plugin 0.0.25-nightly.20261102.45 → 0.0.27
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/THIRD-PARTY-NOTICES.md +65 -0
- package/dist/chunks/{bash-description-myvnmtt2.js → bash-description-03bm07ft.js} +2 -8
- package/dist/chunks/{bash-description-9q5rxbtt.js → bash-description-0gnxcq7q.js} +31 -11
- package/dist/chunks/bash-description-0vfhp1qd.js +54 -0
- package/dist/chunks/{bash-description-g7gfy7nw.js → bash-description-4kqkzdkp.js} +3 -5
- package/dist/chunks/{bash-description-axnga0jz.js → bash-description-a99pev5h.js} +2 -2
- package/dist/chunks/{bash-description-bkhr9zrz.js → bash-description-s6v2m3ch.js} +28 -10
- package/dist/chunks/{bash-description-qwyy182r.js → bash-description-spc5av5d.js} +1 -7
- package/dist/chunks/bash-description-t3hbavcc.js +12 -0
- package/dist/src/acp/connection.js +1 -1
- package/dist/src/acp/index.js +2 -2
- package/dist/src/acp/transcript.js +1 -1
- package/dist/src/approvals/approvals.js +6 -3
- package/dist/src/approvals/schema.js +1 -1
- package/dist/src/browser-client.d.ts +135 -0
- package/dist/src/browser-client.js +374 -0
- package/dist/src/canvas/canvas-client.d.ts +71 -0
- package/dist/src/canvas/canvas-client.js +70 -0
- package/dist/src/canvas/canvas-compile.d.ts +0 -34
- package/dist/src/canvas/canvas-libraries.d.ts +0 -6
- package/dist/src/canvas/canvas-preview.d.ts +0 -65
- package/dist/src/canvas/canvas-protocol.d.ts +5 -80
- package/dist/src/canvas/canvas.d.ts +0 -25
- package/dist/src/canvas/schema.d.ts +0 -37
- package/dist/src/client/notifications.js +2 -1
- package/dist/src/client/presentation.d.ts +3 -23
- package/dist/src/client/presentation.js +7 -3
- package/dist/src/client/transcript.js +18 -18
- package/dist/src/client/user-messages.d.ts +41 -0
- package/dist/src/client/user-messages.js +10 -0
- package/dist/src/desktop-settings/desktop-settings.d.ts +31 -0
- package/dist/src/desktop-settings/desktop-settings.js +136 -0
- package/dist/src/desktop-settings/schema.d.ts +42 -0
- package/dist/src/desktop-settings/schema.js +14 -0
- package/dist/src/question/client/questions-tui.js +6 -2
- package/dist/src/question/client/questions.js +47 -46
- package/dist/src/question/question.d.ts +37 -6
- package/dist/src/question/question.js +69 -17
- package/dist/src/question/schema.d.ts +73 -11
- package/dist/src/question/schema.js +9 -5
- package/dist/src/rename.d.ts +1 -1
- package/dist/src/subagents.js +11 -23
- package/dist/src/web/fetch.js +1 -1
- package/dist/src/web/index.js +1 -1
- package/package.json +30 -14
|
@@ -1,68 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The inline canvas contract every side shares, with no dependencies: the
|
|
3
|
-
* runtime version, the import surfaces a canvas module may use, the size
|
|
4
|
-
* caps, where a compiled module's source files sit in it, and the JSON-RPC
|
|
5
|
-
* messages between a client and the runtime shell, in the MCP Apps shape
|
|
6
|
-
* (`ui/*` methods as upstream defines them, `nyte/*` for the one extension).
|
|
7
|
-
* Builders make a message; readers narrow `unknown` data from a `message`
|
|
8
|
-
* event into a typed one or `undefined`.
|
|
9
|
-
*/
|
|
10
1
|
import { CANVAS_LIBRARIES } from "./canvas-libraries.ts";
|
|
11
|
-
/** The shell surface a compiled module was built against. Bump on any change to `KIT`, a kit component's props, the libraries or the global; a shell renders a canvas whose runtime is at most its own. Runtime 2 added `react-dom` and the libraries; the compiler stamps a canvas with 2 only when it imports one of them, so a runtime 1 shell still renders the rest. */
|
|
12
2
|
export declare const CANVAS_RUNTIME = 2;
|
|
13
|
-
/** The global the shell installs before importing a module: `{ runtime, react, jsxRuntime, reactDom, kit, library }`, where `library(specifier)` loads one of `LIBRARY_EXPORTS`' modules. */
|
|
14
3
|
export declare const CANVAS_GLOBAL = "__nyteCanvas";
|
|
15
|
-
/** The global a client may set before the shell's scripts run (iOS, through a WebView's document-start script) to a `hostContextChangedNotification` the shell applies before it first paints, so it starts in the client's scheme rather than waiting for `ui/initialize`. */
|
|
16
4
|
export declare const CANVAS_STARTUP_CONTEXT = "__nyteCanvasContext";
|
|
17
|
-
/** The import specifier for the kit. */
|
|
18
5
|
export declare const KIT_SPECIFIER = "nyte/canvas";
|
|
19
|
-
/** The entry module's file name: the tool's `source`, which its other files are imported from. */
|
|
20
6
|
export declare const CANVAS_ENTRY = "main.tsx";
|
|
21
|
-
/** Bytes of TSX the tool accepts, across every file of one canvas. */
|
|
22
7
|
export declare const CANVAS_SOURCE_LIMIT = 65536;
|
|
23
|
-
/** Bytes of compiled module a part may hold. */
|
|
24
8
|
export declare const CANVAS_CODE_LIMIT = 196608;
|
|
25
|
-
/** The frame's height range in CSS pixels; a taller canvas scrolls inside. */
|
|
26
9
|
export declare const CANVAS_MIN_HEIGHT = 48;
|
|
27
10
|
export declare const CANVAS_MAX_HEIGHT = 2000;
|
|
28
|
-
/** The height hint range the tool accepts. */
|
|
29
11
|
export declare const CANVAS_MIN_HEIGHT_HINT = 80;
|
|
30
|
-
/** The frame height before a canvas reports its own, when the agent gave no hint. */
|
|
31
12
|
export declare const CANVAS_DEFAULT_HEIGHT = 80;
|
|
32
|
-
/** React 19's public surface a canvas may import, without `act`, `version` and the unstable or server-only names. */
|
|
33
13
|
export declare const REACT_EXPORTS: readonly ["Activity", "Children", "Component", "Fragment", "Profiler", "PureComponent", "StrictMode", "Suspense", "ViewTransition", "addTransitionType", "cache", "cloneElement", "createContext", "createElement", "createRef", "forwardRef", "isValidElement", "lazy", "memo", "startTransition", "use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useEffectEvent", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
|
|
34
14
|
export declare const JSX_RUNTIME_EXPORTS: readonly ["Fragment", "jsx", "jsxs"];
|
|
35
|
-
/** The two `react-dom` names a canvas may import; the shell owns the root, so nothing that mounts one. */
|
|
36
15
|
export declare const REACT_DOM_EXPORTS: readonly ["createPortal", "flushSync"];
|
|
37
|
-
/** Every name each library exports, by its import specifier. */
|
|
38
16
|
export declare const LIBRARY_EXPORTS: Readonly<Record<string, readonly string[]>>;
|
|
39
|
-
/** A library a canvas may import, by its import specifier. */
|
|
40
17
|
export type CanvasLibrary = keyof typeof CANVAS_LIBRARIES;
|
|
41
|
-
/** Returns the library a value names, or undefined when it names none. */
|
|
42
18
|
export declare function readCanvasLibrary(value: unknown): CanvasLibrary | undefined;
|
|
43
|
-
/** Each library's pinned version, by its import specifier. */
|
|
44
19
|
export declare const LIBRARY_VERSIONS: Readonly<Record<string, string>>;
|
|
45
|
-
/**
|
|
46
|
-
* A source file's place in a compiled module: its name, the module line its
|
|
47
|
-
* first line sits on, and how many lines it has.
|
|
48
|
-
*/
|
|
49
20
|
export type CanvasFileSpan = readonly [file: string, start: number, lines: number];
|
|
50
|
-
/** Returns the comment a compiled module opens with, naming where each source file sits in it. */
|
|
51
21
|
export declare function canvasFilesComment(spans: readonly CanvasFileSpan[]): string;
|
|
52
|
-
/** Returns `file:line` for the first frame of a stack that runs in a compiled module, which the shell loads from a blob URL, or undefined when no frame lands in a source file (the linker's own lines, a module without the files comment). Sucrase keeps lines, not columns, so a stack's column belongs to the compiled code and is left out. */
|
|
53
22
|
export declare function locateCanvasStack(code: string, stack: string): string | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* The hues a series, a sparkline or a meter may name; charts without one take
|
|
56
|
-
* the first eight in this order. Neighbours stay apart under protan and deutan
|
|
57
|
-
* vision (OKLab ΔE ≥ 10 on the chart-series step), the first three stay apart
|
|
58
|
-
* pairwise, and yellow, the one hue under 3:1 on white, comes late.
|
|
59
|
-
*/
|
|
60
23
|
export declare const TINTS: readonly ["blue", "pink", "orange", "teal", "red", "yellow", "purple", "green", "gray", "brown"];
|
|
61
|
-
/**
|
|
62
|
-
* The kit, name by name, each with the one-line signature the model reads.
|
|
63
|
-
* `packages/canvas` exports exactly these names, in a test; the compiler
|
|
64
|
-
* answers any other import of `nyte/canvas` with a positioned error.
|
|
65
|
-
*/
|
|
66
24
|
export declare const KIT: {
|
|
67
25
|
readonly Stack: '{ direction?: "row" | "column" = "column", gap?: 0 | 1 | 2 | 3 | 4 | 6 = 2 (×4 px), align?: "start" | "center" | "end" | "stretch", justify?: "start" | "center" | "end" | "between", wrap?: boolean, children }: flex layout';
|
|
68
26
|
readonly Grid: '{ columns?: number | "auto" = "auto", minWidth?: number = 160 (px, with "auto"), gap?: 0 | 1 | 2 | 3 | 4 | 6 = 2, children }: equal columns';
|
|
@@ -101,12 +59,9 @@ export declare const KIT: {
|
|
|
101
59
|
readonly Spinner: "{}";
|
|
102
60
|
readonly useColorScheme: '(): "light" | "dark"';
|
|
103
61
|
};
|
|
104
|
-
/** Every name `nyte/canvas` exports, in `KIT` order. */
|
|
105
62
|
export declare const KIT_EXPORTS: readonly string[];
|
|
106
|
-
/** The custom properties a client may hand the shell; anything else is dropped. */
|
|
107
63
|
export declare const CANVAS_VARIABLES: readonly ["--nyte-custom-hue", "--nyte-custom-chroma-scale", "--nyte-font-family-sans", "--nyte-font-family-mono", "--nyte-font-size-base", "--nyte-font-size-code", "--nyte-letter-spacing-lg", "--nyte-font-smoothing", "--nyte-moz-font-smoothing", "--nyte-reduce-transparency"];
|
|
108
64
|
export declare const CANVAS_PROTOCOL_VERSION = "2026-01-26";
|
|
109
|
-
/** What a client tells the shell about where it runs. */
|
|
110
65
|
export type CanvasHostContext = {
|
|
111
66
|
readonly theme: "light" | "dark";
|
|
112
67
|
readonly styles: {
|
|
@@ -119,19 +74,16 @@ export type CanvasHostContext = {
|
|
|
119
74
|
readonly hover: boolean;
|
|
120
75
|
};
|
|
121
76
|
};
|
|
122
|
-
/** A compiled canvas, as the part holds it and the shell receives it. */
|
|
123
77
|
export type CanvasModule = {
|
|
124
78
|
readonly runtime: number;
|
|
125
79
|
readonly code: string;
|
|
126
80
|
readonly title: string;
|
|
127
81
|
};
|
|
128
|
-
/** Who answers `ui/initialize`: a client, or `nyte-preview`, the harness a previewer runs in place of one. */
|
|
129
82
|
export type CanvasHostInfo = {
|
|
130
83
|
readonly name: "nyte-desktop" | "nyte-web" | "nyte-ios" | "nyte-preview";
|
|
131
84
|
readonly version: string;
|
|
132
85
|
};
|
|
133
86
|
export type JsonRpcId = string | number;
|
|
134
|
-
/** A message the shell sends its client. */
|
|
135
87
|
export type ShellMessage = {
|
|
136
88
|
readonly kind: "initialize";
|
|
137
89
|
readonly id: JsonRpcId;
|
|
@@ -141,20 +93,14 @@ export type ShellMessage = {
|
|
|
141
93
|
} | {
|
|
142
94
|
readonly kind: "size";
|
|
143
95
|
readonly height: number;
|
|
144
|
-
}
|
|
145
|
-
/** `url` is an http(s) URL, or a reference with no scheme that the client resolves in its workspace. */
|
|
146
|
-
| {
|
|
96
|
+
} | {
|
|
147
97
|
readonly kind: "open-link";
|
|
148
98
|
readonly id: JsonRpcId;
|
|
149
99
|
readonly url: string;
|
|
150
|
-
}
|
|
151
|
-
/** Asked only by a shell with no base URL to load `libraries/<name>.js` from (the inline one in a WebView); the request's id is the name. */
|
|
152
|
-
| {
|
|
100
|
+
} | {
|
|
153
101
|
readonly kind: "library";
|
|
154
102
|
readonly name: CanvasLibrary;
|
|
155
|
-
}
|
|
156
|
-
/** Answered with `act-result`. */
|
|
157
|
-
| {
|
|
103
|
+
} | {
|
|
158
104
|
readonly kind: "act";
|
|
159
105
|
readonly id: JsonRpcId;
|
|
160
106
|
readonly action: string;
|
|
@@ -165,7 +111,6 @@ export type ShellMessage = {
|
|
|
165
111
|
readonly message: string;
|
|
166
112
|
readonly stack: string | null;
|
|
167
113
|
};
|
|
168
|
-
/** A message a client sends the shell. */
|
|
169
114
|
export type HostMessage = {
|
|
170
115
|
readonly kind: "initialize-result";
|
|
171
116
|
readonly id: JsonRpcId;
|
|
@@ -181,15 +126,11 @@ export type HostMessage = {
|
|
|
181
126
|
readonly kind: "open-link-result";
|
|
182
127
|
readonly id: JsonRpcId;
|
|
183
128
|
readonly isError: boolean;
|
|
184
|
-
}
|
|
185
|
-
/** `source` is the library's self-contained ES module. */
|
|
186
|
-
| {
|
|
129
|
+
} | {
|
|
187
130
|
readonly kind: "library-result";
|
|
188
131
|
readonly name: CanvasLibrary;
|
|
189
132
|
readonly source: string;
|
|
190
|
-
}
|
|
191
|
-
/** Sent after `render` and on each state change. */
|
|
192
|
-
| {
|
|
133
|
+
} | {
|
|
193
134
|
readonly kind: "part-state";
|
|
194
135
|
readonly state: Json;
|
|
195
136
|
} | {
|
|
@@ -200,18 +141,15 @@ export type HostMessage = {
|
|
|
200
141
|
export type Json = null | boolean | number | string | readonly Json[] | {
|
|
201
142
|
readonly [key: string]: Json;
|
|
202
143
|
};
|
|
203
|
-
/** Returns the `ui/initialize` request the shell opens with. */
|
|
204
144
|
export declare function initializeRequest(id: JsonRpcId, runtime: number): Json;
|
|
205
145
|
export declare function initializedNotification(): Json;
|
|
206
146
|
export declare function sizeChangedNotification(height: number): Json;
|
|
207
147
|
export declare function openLinkRequest(id: JsonRpcId, url: string): Json;
|
|
208
|
-
/** Returns the error notification the shell sends when a module fails to load or render. */
|
|
209
148
|
export declare function errorNotification(error: {
|
|
210
149
|
readonly phase: "load" | "render";
|
|
211
150
|
readonly message: string;
|
|
212
151
|
readonly stack?: string;
|
|
213
152
|
}): Json;
|
|
214
|
-
/** Returns the answer to the shell's `ui/initialize`. */
|
|
215
153
|
export declare function initializeResult(id: JsonRpcId, hostInfo: CanvasHostInfo, hostContext: CanvasHostContext): Json;
|
|
216
154
|
export declare function renderNotification(module: CanvasModule): Json;
|
|
217
155
|
export declare function partStateNotification(state: Json): Json;
|
|
@@ -221,28 +159,15 @@ export declare function hostContextChangedNotification(context: Partial<CanvasHo
|
|
|
221
159
|
export declare function openLinkResult(id: JsonRpcId, isError?: boolean): Json;
|
|
222
160
|
export declare function libraryRequest(name: CanvasLibrary): Json;
|
|
223
161
|
export declare function libraryResult(name: CanvasLibrary, source: string): Json;
|
|
224
|
-
/** Returns the message a shell posted, or undefined for anything that is not one. */
|
|
225
162
|
export declare function readShellMessage(data: unknown): ShellMessage | undefined;
|
|
226
|
-
/** Returns the message a client posted into the shell, or undefined for anything that is not one. */
|
|
227
163
|
export declare function readHostMessage(data: unknown): HostMessage | undefined;
|
|
228
|
-
/** Returns the height a frame shows a canvas at, within the range. */
|
|
229
164
|
export declare function clampCanvasHeight(height: number): number;
|
|
230
|
-
/** A canvas's height in CSS pixels as a preview measured it at one frame width. */
|
|
231
165
|
export type CanvasMeasuredHeight = {
|
|
232
166
|
readonly width: number;
|
|
233
167
|
readonly height: number;
|
|
234
168
|
};
|
|
235
|
-
/**
|
|
236
|
-
* Returns the height a frame `width` px wide starts a canvas at, before its
|
|
237
|
-
* shell reports one: the taller of the measured heights at the nearest widths
|
|
238
|
-
* either side, since a frame a few pixels short scrolls inside itself and
|
|
239
|
-
* takes the reader's scroll; past either end, the nearest; without any, the
|
|
240
|
-
* agent's hint, then the default. With no width yet, it skips the measured
|
|
241
|
-
* heights.
|
|
242
|
-
*/
|
|
243
169
|
export declare function canvasStartHeight(canvas: {
|
|
244
170
|
readonly height: number | null;
|
|
245
171
|
readonly heights?: readonly CanvasMeasuredHeight[];
|
|
246
172
|
}, width: number | undefined): number;
|
|
247
|
-
/** Returns the variables the shell may apply: allowlisted names, values stripped of the characters that could end a declaration. */
|
|
248
173
|
export declare function sanitizeCanvasVariables(variables: Readonly<Record<string, string>>): Record<string, string>;
|
|
@@ -42,32 +42,7 @@ export declare const canvas: import("@nyte-ai/core").PartDefinition<{
|
|
|
42
42
|
}>;
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
45
|
-
/**
|
|
46
|
-
* What the model reads about the tool and the kit; the signatures come from
|
|
47
|
-
* `KIT`, so they cannot drift from what the compiler accepts.
|
|
48
|
-
*
|
|
49
|
-
* @category plugins
|
|
50
|
-
* @since 0.1.0
|
|
51
|
-
*/
|
|
52
45
|
export declare const CANVAS_DESCRIPTION: string;
|
|
53
|
-
/**
|
|
54
|
-
* Returns the canvas plugin: the `canvas` part and `canvas_render`, which
|
|
55
|
-
* compiles in-process on any host, plus `canvas_preview` when the host
|
|
56
|
-
* passes a previewer, in which case `canvas_render` tells the model to
|
|
57
|
-
* preview first and saves the module's heights at the preview widths: the
|
|
58
|
-
* session's last clean preview's when it compiled to the same module, or
|
|
59
|
-
* measured as it renders.
|
|
60
|
-
*
|
|
61
|
-
* @category plugins
|
|
62
|
-
* @since 0.1.0
|
|
63
|
-
*/
|
|
64
46
|
export declare function canvasPlugin(preview?: CanvasPreviewer): Plugin;
|
|
65
|
-
/**
|
|
66
|
-
* The canvas plugin without a previewer, as a host that cannot render one
|
|
67
|
-
* loads it.
|
|
68
|
-
*
|
|
69
|
-
* @category plugins
|
|
70
|
-
* @since 0.1.0
|
|
71
|
-
*/
|
|
72
47
|
declare const _default: Plugin;
|
|
73
48
|
export default _default;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import type { Infer } from "@nyte-ai/schema";
|
|
2
|
-
/**
|
|
3
|
-
* The tool that renders a canvas and replaces one in place.
|
|
4
|
-
*
|
|
5
|
-
* @category plugins
|
|
6
|
-
* @since 0.1.0
|
|
7
|
-
*/
|
|
8
2
|
export declare const CANVAS_RENDER_TOOL = "canvas_render";
|
|
9
|
-
/**
|
|
10
|
-
* How many revisions a canvas lists; a replace past it drops the oldest.
|
|
11
|
-
*
|
|
12
|
-
* @category plugins
|
|
13
|
-
* @since 0.1.0
|
|
14
|
-
*/
|
|
15
3
|
export declare const CANVAS_REVISIONS_KEPT = 50;
|
|
16
4
|
declare const state: import("@nyte-ai/schema").Schema<{
|
|
17
5
|
runtime: number;
|
|
@@ -36,33 +24,8 @@ declare const state: import("@nyte-ai/schema").Schema<{
|
|
|
36
24
|
at: number;
|
|
37
25
|
}[];
|
|
38
26
|
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Returns a canvas part's state: the compiled module, the runtime it needs,
|
|
41
|
-
* its title, the agent's height hint, the module's measured heights, the last
|
|
42
|
-
* error a client reported, and its revisions, oldest first, the last one
|
|
43
|
-
* being the module itself.
|
|
44
|
-
*
|
|
45
|
-
* @category plugins
|
|
46
|
-
* @since 0.1.0
|
|
47
|
-
*/
|
|
48
27
|
export type CanvasState = Infer<typeof state>;
|
|
49
|
-
/**
|
|
50
|
-
* One revision of a canvas: its compiled module stored as a blob, with what
|
|
51
|
-
* drawing it needs besides the code.
|
|
52
|
-
*
|
|
53
|
-
* @category plugins
|
|
54
|
-
* @since 0.1.0
|
|
55
|
-
*/
|
|
56
28
|
export type CanvasRevision = CanvasState["revisions"][number];
|
|
57
|
-
/**
|
|
58
|
-
* A canvas part: a React module the agent wrote, compiled on the host and
|
|
59
|
-
* drawn by a client inside the sandboxed runtime shell. `replace` swaps the
|
|
60
|
-
* module in place and lists it as the next revision; `report` records a load
|
|
61
|
-
* or render error a client saw, which the model reads in the fallback.
|
|
62
|
-
*
|
|
63
|
-
* @category plugins
|
|
64
|
-
* @since 0.1.0
|
|
65
|
-
*/
|
|
66
29
|
export declare const canvas: import("@nyte-ai/core").PartDefinition<{
|
|
67
30
|
runtime: number;
|
|
68
31
|
title: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import"../../chunks/bash-description-t3hbavcc.js";
|
|
1
2
|
import {
|
|
2
3
|
taskLabel2,
|
|
3
4
|
endedStatus2,
|
|
4
5
|
sessionTitle2
|
|
5
|
-
} from "../../chunks/bash-description-
|
|
6
|
+
} from "../../chunks/bash-description-spc5av5d.js";
|
|
6
7
|
|
|
7
8
|
// src/client/notifications.ts
|
|
8
9
|
var notifications_default = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { text, thinking } from "@nyte-ai/core";
|
|
2
2
|
import type { PartState } from "@nyte-ai/core";
|
|
3
|
-
import type { Execution, Failure, HeadInfo, Message,
|
|
3
|
+
import type { Execution, Failure, HeadInfo, Message, RunEnd, RunId, SessionInfo, ToolClass, ToolPartState } from "@nyte-ai/schema";
|
|
4
4
|
export { jobTaskState } from "@nyte-ai/schema";
|
|
5
|
+
export { showsAnswer, showsReport, shownContent } from "./user-messages.ts";
|
|
6
|
+
export type { AnswerMessage, ReportMessage } from "./user-messages.ts";
|
|
5
7
|
/**
|
|
6
8
|
* A message the user sent, or one a child, job or action delivered for them.
|
|
7
9
|
*
|
|
@@ -42,16 +44,6 @@ export type TextMessage = PartMessage & {
|
|
|
42
44
|
export type ThinkingMessage = PartMessage & {
|
|
43
45
|
readonly state: PartState<typeof thinking>;
|
|
44
46
|
};
|
|
45
|
-
/**
|
|
46
|
-
* A user message a child session or background job delivered as its report.
|
|
47
|
-
*
|
|
48
|
-
* @category presentation
|
|
49
|
-
*/
|
|
50
|
-
export type ReportMessage = UserMessage & {
|
|
51
|
-
readonly source: Extract<MessageSource, {
|
|
52
|
-
readonly kind: "child" | "job";
|
|
53
|
-
}>;
|
|
54
|
-
};
|
|
55
47
|
/**
|
|
56
48
|
* Narrows to a tool call's part.
|
|
57
49
|
*
|
|
@@ -87,18 +79,6 @@ export type RawPart = {
|
|
|
87
79
|
* @category presentation
|
|
88
80
|
*/
|
|
89
81
|
export declare function readRawPart(message: PartMessage): RawPart;
|
|
90
|
-
/**
|
|
91
|
-
* Narrows to the report a child or job delivered; a person or an action sent the rest.
|
|
92
|
-
*
|
|
93
|
-
* @category presentation
|
|
94
|
-
*/
|
|
95
|
-
export declare function showsReport(message: UserMessage): message is ReportMessage;
|
|
96
|
-
/**
|
|
97
|
-
* What a user message shows: an action's label in place of the prompt it sent.
|
|
98
|
-
*
|
|
99
|
-
* @category presentation
|
|
100
|
-
*/
|
|
101
|
-
export declare function shownContent(message: UserMessage): UserContent;
|
|
102
82
|
/**
|
|
103
83
|
* The tense a tool line speaks in: running, done, or none when the call did
|
|
104
84
|
* not finish and no verb would be true.
|
|
@@ -3,8 +3,6 @@ import {
|
|
|
3
3
|
showsText2,
|
|
4
4
|
showsThinking2,
|
|
5
5
|
readRawPart2,
|
|
6
|
-
showsReport2,
|
|
7
|
-
shownContent2,
|
|
8
6
|
toolStatus2,
|
|
9
7
|
toolOutput2,
|
|
10
8
|
taskLabel2,
|
|
@@ -41,7 +39,12 @@ import {
|
|
|
41
39
|
toolDetail2,
|
|
42
40
|
failureNotice2,
|
|
43
41
|
jobTaskState2
|
|
44
|
-
} from "../../chunks/bash-description-
|
|
42
|
+
} from "../../chunks/bash-description-spc5av5d.js";
|
|
43
|
+
import {
|
|
44
|
+
showsReport2,
|
|
45
|
+
showsAnswer2,
|
|
46
|
+
shownContent2
|
|
47
|
+
} from "../../chunks/bash-description-t3hbavcc.js";
|
|
45
48
|
export {
|
|
46
49
|
PLANNING_DELAY_MS2 as PLANNING_DELAY_MS,
|
|
47
50
|
PLANNING_LABEL2 as PLANNING_LABEL,
|
|
@@ -71,6 +74,7 @@ export {
|
|
|
71
74
|
sessionMark2 as sessionMark,
|
|
72
75
|
sessionTitle2 as sessionTitle,
|
|
73
76
|
shownContent2 as shownContent,
|
|
77
|
+
showsAnswer2 as showsAnswer,
|
|
74
78
|
showsReport2 as showsReport,
|
|
75
79
|
showsText2 as showsText,
|
|
76
80
|
showsThinking2 as showsThinking,
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
// src/client/transcript.tsx
|
|
2
2
|
import { branchSummary, compaction, text, thinking, tool } from "@nyte-ai/plugin/client";
|
|
3
3
|
import { defineRenderer } from "@nyte-ai/plugin/client";
|
|
4
|
-
import {
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
var unreadable = () => null;
|
|
6
6
|
var transcriptRenderers = [
|
|
7
|
-
defineRenderer(text, "react", (state) => /* @__PURE__ */
|
|
7
|
+
defineRenderer(text, "react", (state) => /* @__PURE__ */ jsx("div", {
|
|
8
8
|
"data-part": "text",
|
|
9
9
|
children: state.markdown
|
|
10
|
-
}
|
|
11
|
-
defineRenderer(thinking, "react", (state) => /* @__PURE__ */
|
|
10
|
+
}), unreadable),
|
|
11
|
+
defineRenderer(thinking, "react", (state) => /* @__PURE__ */ jsxs("details", {
|
|
12
12
|
"data-part": "thinking",
|
|
13
13
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ jsx("summary", {
|
|
15
15
|
children: "Thinking"
|
|
16
|
-
}
|
|
16
|
+
}),
|
|
17
17
|
state.markdown
|
|
18
18
|
]
|
|
19
|
-
}
|
|
20
|
-
defineRenderer(tool, "react", (state, act) => /* @__PURE__ */
|
|
19
|
+
}), unreadable),
|
|
20
|
+
defineRenderer(tool, "react", (state, act) => /* @__PURE__ */ jsxs("div", {
|
|
21
21
|
"data-part": "tool",
|
|
22
22
|
"data-phase": state.phase,
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ jsx("span", {
|
|
25
25
|
children: state.class.kind === "custom" ? state.class.label : state.name
|
|
26
|
-
}
|
|
27
|
-
state.phase === "settled" ? /* @__PURE__ */
|
|
26
|
+
}),
|
|
27
|
+
state.phase === "settled" ? /* @__PURE__ */ jsx("span", {
|
|
28
28
|
children: state.outcome.kind
|
|
29
|
-
}
|
|
29
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
30
30
|
onClick: () => void act("stop", {}),
|
|
31
31
|
children: "Stop"
|
|
32
|
-
}
|
|
32
|
+
})
|
|
33
33
|
]
|
|
34
|
-
}
|
|
35
|
-
defineRenderer(compaction, "react", (state) => /* @__PURE__ */
|
|
34
|
+
}), unreadable),
|
|
35
|
+
defineRenderer(compaction, "react", (state) => /* @__PURE__ */ jsx("div", {
|
|
36
36
|
"data-part": "compaction",
|
|
37
37
|
children: state.summary ?? `Context compacted at ${state.tokensBefore} tokens.`
|
|
38
|
-
}
|
|
39
|
-
defineRenderer(branchSummary, "react", (state) => /* @__PURE__ */
|
|
38
|
+
}), unreadable),
|
|
39
|
+
defineRenderer(branchSummary, "react", (state) => /* @__PURE__ */ jsx("div", {
|
|
40
40
|
"data-part": "branchSummary",
|
|
41
41
|
children: state.markdown
|
|
42
|
-
}
|
|
42
|
+
}), unreadable)
|
|
43
43
|
];
|
|
44
44
|
var transcript_default = {
|
|
45
45
|
id: "transcript",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { MessageSource, UserContent } from "@nyte-ai/schema";
|
|
2
|
+
import type { UserMessage } from "./presentation.ts";
|
|
3
|
+
/**
|
|
4
|
+
* A user message a child session or background job delivered as its report.
|
|
5
|
+
*
|
|
6
|
+
* @category presentation
|
|
7
|
+
*/
|
|
8
|
+
export type ReportMessage = UserMessage & {
|
|
9
|
+
readonly source: Extract<MessageSource, {
|
|
10
|
+
readonly kind: "child" | "job";
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A user message that carries a late answer to a part's request, sent after the call that asked
|
|
15
|
+
* stopped waiting. The part shows the answer; the message only marks where it reached the agent.
|
|
16
|
+
*
|
|
17
|
+
* @category presentation
|
|
18
|
+
*/
|
|
19
|
+
export type AnswerMessage = UserMessage & {
|
|
20
|
+
readonly source: Extract<MessageSource, {
|
|
21
|
+
readonly kind: "answer";
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Narrows to the report a child or job delivered; a person or an action sent the rest.
|
|
26
|
+
*
|
|
27
|
+
* @category presentation
|
|
28
|
+
*/
|
|
29
|
+
export declare function showsReport(message: UserMessage): message is ReportMessage;
|
|
30
|
+
/**
|
|
31
|
+
* Narrows to a late answer to a part's request, which clients mark instead of drawing as a prompt.
|
|
32
|
+
*
|
|
33
|
+
* @category presentation
|
|
34
|
+
*/
|
|
35
|
+
export declare function showsAnswer(message: UserMessage): message is AnswerMessage;
|
|
36
|
+
/**
|
|
37
|
+
* What a user message shows: an action's or answer's label in place of the prompt it sent.
|
|
38
|
+
*
|
|
39
|
+
* @category presentation
|
|
40
|
+
*/
|
|
41
|
+
export declare function shownContent(message: UserMessage): UserContent;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Declares the desktop app's host-scoped settings, so a host the app connects to reads and writes them as `desktop.<key>`. */
|
|
2
|
+
export declare const desktopSettingsPlugin: {
|
|
3
|
+
id: string;
|
|
4
|
+
contribute: {
|
|
5
|
+
settings: ({
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
schema: import("@nyte-ai/schema").Schema<boolean>;
|
|
9
|
+
default: boolean;
|
|
10
|
+
scope: "host";
|
|
11
|
+
} | {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
schema: import("@nyte-ai/schema").Schema<string | null>;
|
|
15
|
+
default: string | null;
|
|
16
|
+
scope: "host";
|
|
17
|
+
} | {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
schema: import("@nyte-ai/schema").Schema<string[]>;
|
|
21
|
+
default: string[];
|
|
22
|
+
scope: "host";
|
|
23
|
+
} | {
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
schema: import("@nyte-ai/schema").Schema<1 | 2 | 5 | 15>;
|
|
27
|
+
default: 1 | 2 | 5 | 15;
|
|
28
|
+
scope: "host";
|
|
29
|
+
})[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DESKTOP_SETTING_SCHEMAS2,
|
|
3
|
+
DEFAULT_DESKTOP_SETTINGS2
|
|
4
|
+
} from "../../chunks/bash-description-0vfhp1qd.js";
|
|
5
|
+
|
|
6
|
+
// src/desktop-settings/desktop-settings.ts
|
|
7
|
+
import { standard } from "@nyte-ai/schema";
|
|
8
|
+
var desktopSettingsPlugin = {
|
|
9
|
+
id: "desktop",
|
|
10
|
+
contribute: {
|
|
11
|
+
settings: [
|
|
12
|
+
{
|
|
13
|
+
id: "desktop.keepAwake",
|
|
14
|
+
label: "Keep awake while working",
|
|
15
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.keepAwake),
|
|
16
|
+
default: DEFAULT_DESKTOP_SETTINGS2.keepAwake,
|
|
17
|
+
scope: "host"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "desktop.pauseOnSleep",
|
|
21
|
+
label: "Pause agents while asleep",
|
|
22
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.pauseOnSleep),
|
|
23
|
+
default: DEFAULT_DESKTOP_SETTINGS2.pauseOnSleep,
|
|
24
|
+
scope: "host"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "desktop.terminalShell",
|
|
28
|
+
label: "Terminal shell",
|
|
29
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.terminalShell),
|
|
30
|
+
default: DEFAULT_DESKTOP_SETTINGS2.terminalShell,
|
|
31
|
+
scope: "host"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "desktop.blockAds",
|
|
35
|
+
label: "Block ads",
|
|
36
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.blockAds),
|
|
37
|
+
default: DEFAULT_DESKTOP_SETTINGS2.blockAds,
|
|
38
|
+
scope: "host"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "desktop.adblockAllowedHosts",
|
|
42
|
+
label: "Shield paused on",
|
|
43
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.adblockAllowedHosts),
|
|
44
|
+
default: [],
|
|
45
|
+
scope: "host"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "desktop.upgradeToHttps",
|
|
49
|
+
label: "Upgrade to HTTPS",
|
|
50
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.upgradeToHttps),
|
|
51
|
+
default: DEFAULT_DESKTOP_SETTINGS2.upgradeToHttps,
|
|
52
|
+
scope: "host"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "desktop.webOrigins",
|
|
56
|
+
label: "Web client origins",
|
|
57
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.webOrigins),
|
|
58
|
+
default: DEFAULT_DESKTOP_SETTINGS2.webOrigins,
|
|
59
|
+
scope: "host"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "desktop.notifications",
|
|
63
|
+
label: "Show system notifications",
|
|
64
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.notifications),
|
|
65
|
+
default: DEFAULT_DESKTOP_SETTINGS2.notifications,
|
|
66
|
+
scope: "host"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "desktop.dockBadge",
|
|
70
|
+
label: "Badge Dock icon",
|
|
71
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.dockBadge),
|
|
72
|
+
default: DEFAULT_DESKTOP_SETTINGS2.dockBadge,
|
|
73
|
+
scope: "host"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "desktop.notificationSounds",
|
|
77
|
+
label: "Play sounds",
|
|
78
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.notificationSounds),
|
|
79
|
+
default: DEFAULT_DESKTOP_SETTINGS2.notificationSounds,
|
|
80
|
+
scope: "host"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "desktop.alertsWaiting",
|
|
84
|
+
label: "Needs you",
|
|
85
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.alertsWaiting),
|
|
86
|
+
default: DEFAULT_DESKTOP_SETTINGS2.alertsWaiting,
|
|
87
|
+
scope: "host"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "desktop.alertsFailed",
|
|
91
|
+
label: "Failed",
|
|
92
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.alertsFailed),
|
|
93
|
+
default: DEFAULT_DESKTOP_SETTINGS2.alertsFailed,
|
|
94
|
+
scope: "host"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "desktop.alertsDone",
|
|
98
|
+
label: "Done",
|
|
99
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.alertsDone),
|
|
100
|
+
default: DEFAULT_DESKTOP_SETTINGS2.alertsDone,
|
|
101
|
+
scope: "host"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "desktop.remindMinutes",
|
|
105
|
+
label: "Remind every",
|
|
106
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.remindMinutes),
|
|
107
|
+
default: DEFAULT_DESKTOP_SETTINGS2.remindMinutes,
|
|
108
|
+
scope: "host"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "desktop.notifyViewedChat",
|
|
112
|
+
label: "Notify about the chat you're viewing",
|
|
113
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.notifyViewedChat),
|
|
114
|
+
default: DEFAULT_DESKTOP_SETTINGS2.notifyViewedChat,
|
|
115
|
+
scope: "host"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "desktop.notifySubagents",
|
|
119
|
+
label: "Include subagent chats",
|
|
120
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.notifySubagents),
|
|
121
|
+
default: DEFAULT_DESKTOP_SETTINGS2.notifySubagents,
|
|
122
|
+
scope: "host"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "desktop.terminalNotifications",
|
|
126
|
+
label: "Terminal notifications",
|
|
127
|
+
schema: standard(DESKTOP_SETTING_SCHEMAS2.terminalNotifications),
|
|
128
|
+
default: DEFAULT_DESKTOP_SETTINGS2.terminalNotifications,
|
|
129
|
+
scope: "host"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
export {
|
|
135
|
+
desktopSettingsPlugin
|
|
136
|
+
};
|