@timurproko/a1 0.1.8-dev.137 → 0.1.8-dev.151
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 +2 -4
- package/dist/cli/capabilities.d.ts +2 -11
- package/dist/cli/capabilities.js +1 -1
- package/dist/cli/dispatch.js +3 -6
- package/dist/composition/owned-ui.js +26 -5
- package/dist/composition/settings-route-host.d.ts +1 -1
- package/dist/composition/settings-route-host.js +1 -1
- package/dist/contracts/owned-ui/model.d.ts +28 -0
- package/dist/contracts/owned-ui/validation.js +14 -0
- package/dist/features/launch/development-launch.js +11 -3
- package/dist/features/launch/index.d.ts +0 -1
- package/dist/features/launch/index.js +0 -1
- package/dist/features/launch/intent.d.ts +3 -2
- package/dist/features/launch/intent.js +1 -2
- package/dist/features/launch/prepare-launch.d.ts +0 -2
- package/dist/features/launch/prepare-launch.js +2 -9
- package/dist/features/launch/profile-paths.d.ts +1 -2
- package/dist/features/launch/profile-paths.js +2 -8
- package/dist/features/launch/runtime-selection.d.ts +2 -5
- package/dist/features/owned-ui/settings-app.js +38 -14
- package/dist/foundation/lifecycle/model.d.ts +1 -1
- package/dist/foundation/lifecycle/model.js +1 -1
- package/dist/foundation/release/bootstrap.d.ts +1 -3
- package/dist/foundation/release/bootstrap.js +1 -1
- package/dist/foundation/storage/control-store.js +37 -3
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +55 -0
- package/dist/integrations/pi/components/owned-editor-ux.js +778 -0
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +44 -6
- package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +14 -5
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +3 -2
- package/dist/integrations/pi/components/shell-presenters-transcript.js +9 -8
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +41 -7
- package/dist/integrations/pi/components/shell-shared-facade.js +3 -1
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +13 -0
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +27 -0
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +10 -2
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +36 -3
- package/dist/integrations/pi/engine/adapter.js +21 -3
- package/dist/integrations/pi/engine/session-integration.d.ts +2 -1
- package/dist/integrations/pi/engine/session-integration.js +17 -3
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +23 -0
- package/dist/integrations/pi/session-ui/prompt-chips.js +242 -0
- package/dist/integrations/pi/session-ui/route-host.d.ts +5 -0
- package/dist/integrations/pi/{owned-ui → session-ui}/session-shell-root.d.ts +34 -5
- package/dist/integrations/pi/{owned-ui → session-ui}/session-shell-root.js +294 -45
- package/dist/integrations/pi/{owned-ui → session-ui}/session-shell.d.ts +1 -1
- package/dist/integrations/pi/{owned-ui → session-ui}/session-shell.js +167 -24
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +39 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +369 -0
- package/dist/integrations/pi/session-ui/system-clipboard.d.ts +11 -0
- package/dist/integrations/pi/session-ui/system-clipboard.js +101 -0
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
- package/dist/integrations/pi/tui-runtime/adapter.js +51 -2
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +4 -6
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +3 -3
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/product-identity.d.ts +2 -2
- package/dist/product-identity.js +3 -4
- package/dist/product-identity.json +3 -5
- package/dist/ui/apps/contracts.d.ts +23 -1
- package/dist/ui/apps/host.js +9 -1
- package/dist/ui/components/index.d.ts +3 -0
- package/dist/ui/components/index.js +3 -0
- package/dist/ui/components/mouse.d.ts +10 -0
- package/dist/ui/components/mouse.js +23 -0
- package/dist/ui/components/prompt-row.d.ts +14 -0
- package/dist/ui/components/prompt-row.js +20 -0
- package/dist/ui/components/scrollbar.d.ts +26 -0
- package/dist/ui/components/scrollbar.js +35 -0
- package/dist/ui/components/spans.d.ts +21 -0
- package/dist/ui/components/spans.js +178 -0
- package/dist/ui/components/submitted-prompt.d.ts +23 -0
- package/dist/ui/components/submitted-prompt.js +50 -0
- package/dist/ui/components/text-selection.d.ts +53 -0
- package/dist/ui/components/text-selection.js +168 -0
- package/dist/ui/components/text.d.ts +14 -0
- package/dist/ui/components/text.js +40 -0
- package/dist/ui/components/transcript-viewport.d.ts +104 -0
- package/dist/ui/components/transcript-viewport.js +381 -0
- package/dist/ui/settings/declarations.d.ts +8 -1
- package/dist/ui/settings/declarations.js +33 -5
- package/dist/ui/settings/migrations.d.ts +1 -1
- package/dist/ui/settings/migrations.js +21 -2
- package/dist/ui/settings/sections.js +15 -8
- package/dist/ui/settings/session.d.ts +2 -0
- package/dist/ui/settings/session.js +7 -5
- package/docs/architecture/boundaries.md +3 -3
- package/docs/architecture/project-structure.md +2 -2
- package/docs/architecture/resource-and-data-policy.md +1 -1
- package/docs/architecture/toolchain.md +5 -5
- package/docs/architecture/ui-reference-provenance.md +11 -2
- package/docs/features/launch-profiles.md +7 -14
- package/docs/manual-launch-instance-acceptance.md +12 -35
- package/docs/manual-owned-ui-checkpoint.md +2 -3
- package/docs/manual-pi-boundary-candidate.md +4 -5
- package/package.json +4 -2
- package/dist/features/launch/profiles.d.ts +0 -12
- package/dist/features/launch/profiles.js +0 -26
- package/dist/integrations/pi/owned-ui/route-host.d.ts +0 -29
- /package/dist/integrations/pi/{owned-ui → session-ui}/index.d.ts +0 -0
- /package/dist/integrations/pi/{owned-ui → session-ui}/index.js +0 -0
- /package/dist/integrations/pi/{owned-ui → session-ui}/route-host.js +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { existsSync, statSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
const CHIP_PATTERN = /\[(?:📷 [^\]]+|📁 [^\]]+|📄 [^\]]+|🖼 {1,2}[^\]]+|🔗 [^\]]+)\]/gu;
|
|
6
|
+
const IMAGE_EXTENSION = /\.(?:jpe?g|png|webp|gif|bmp|tiff?)$/iu;
|
|
7
|
+
const URL_PATTERN = /^https?:\/\/[^\s\u0000-\u001f\u007f]+$/iu;
|
|
8
|
+
const URL_DISPLAY_LENGTH = 40;
|
|
9
|
+
/** Owns semantic clipboard records while the prompt displays compact chips. */
|
|
10
|
+
export class PromptChipStore {
|
|
11
|
+
#chips = new Map();
|
|
12
|
+
transformPastedContent(content) {
|
|
13
|
+
if (content.kind === "image") {
|
|
14
|
+
const id = randomBytes(5).toString("hex");
|
|
15
|
+
const tag = `[📷 screenshot-${id}.png]`;
|
|
16
|
+
this.#chips.set(tag, {
|
|
17
|
+
kind: "image",
|
|
18
|
+
tag,
|
|
19
|
+
image: { type: "image", data: content.data, mimeType: content.mimeType },
|
|
20
|
+
});
|
|
21
|
+
return tag;
|
|
22
|
+
}
|
|
23
|
+
const text = content.text;
|
|
24
|
+
if (this.#chips.has(text.trim()))
|
|
25
|
+
return text.trim();
|
|
26
|
+
const url = text.trim();
|
|
27
|
+
if (URL_PATTERN.test(url)) {
|
|
28
|
+
const label = url.length <= URL_DISPLAY_LENGTH ? url : `${url.slice(0, URL_DISPLAY_LENGTH)}…`;
|
|
29
|
+
return this.#recordUnique({ kind: "url", tag: `[🔗 ${label}]`, label, url });
|
|
30
|
+
}
|
|
31
|
+
const paths = pathsFromClipboard(text);
|
|
32
|
+
if (paths.length === 0)
|
|
33
|
+
return text;
|
|
34
|
+
return paths.map(item => {
|
|
35
|
+
const label = pathLabel(item.fullPath);
|
|
36
|
+
if (item.kind === "folder") {
|
|
37
|
+
return this.#recordUnique({ kind: "folder", tag: `[📁 ${label}]`, path: item.fullPath });
|
|
38
|
+
}
|
|
39
|
+
const icon = IMAGE_EXTENSION.test(item.fullPath) ? "🖼 " : "📄";
|
|
40
|
+
return this.#recordUnique({ kind: "file", tag: `[${icon} ${label}]`, path: item.fullPath });
|
|
41
|
+
}).join("");
|
|
42
|
+
}
|
|
43
|
+
atomicRanges(line) {
|
|
44
|
+
return [...line.matchAll(CHIP_PATTERN)].map(match => ({
|
|
45
|
+
start: match.index,
|
|
46
|
+
end: match.index + match[0].length,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
hyperlinkRanges(text) {
|
|
50
|
+
const ranges = [];
|
|
51
|
+
for (const chip of this.#chips.values()) {
|
|
52
|
+
if (chip.kind !== "url")
|
|
53
|
+
continue;
|
|
54
|
+
const labelOffset = chip.tag.indexOf(chip.label);
|
|
55
|
+
if (labelOffset < 0)
|
|
56
|
+
continue;
|
|
57
|
+
let searchFrom = 0;
|
|
58
|
+
while (searchFrom <= text.length - chip.tag.length) {
|
|
59
|
+
const tagStart = text.indexOf(chip.tag, searchFrom);
|
|
60
|
+
if (tagStart < 0)
|
|
61
|
+
break;
|
|
62
|
+
const start = tagStart + labelOffset;
|
|
63
|
+
ranges.push({ start, end: start + chip.label.length, target: chip.url });
|
|
64
|
+
searchFrom = tagStart + chip.tag.length;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return ranges.sort((left, right) => right.start - left.start);
|
|
68
|
+
}
|
|
69
|
+
expandCopiedText(text) {
|
|
70
|
+
return this.#replaceResolvable(text, false).text;
|
|
71
|
+
}
|
|
72
|
+
prepareSubmission(text) {
|
|
73
|
+
const expanded = this.#replaceResolvable(text, true);
|
|
74
|
+
return { text: expanded.text, images: expanded.images };
|
|
75
|
+
}
|
|
76
|
+
#replaceResolvable(text, includeImages) {
|
|
77
|
+
let expanded = text;
|
|
78
|
+
const images = [];
|
|
79
|
+
const seenImages = new Set();
|
|
80
|
+
for (const [tag, chip] of this.#chips) {
|
|
81
|
+
if (!expanded.includes(tag))
|
|
82
|
+
continue;
|
|
83
|
+
if (chip.kind === "image") {
|
|
84
|
+
if (includeImages && !seenImages.has(tag)) {
|
|
85
|
+
images.push(chip.image);
|
|
86
|
+
seenImages.add(tag);
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const value = chip.kind === "url" ? chip.url : chip.path;
|
|
91
|
+
expanded = expanded.replaceAll(tag, value);
|
|
92
|
+
}
|
|
93
|
+
return { text: expanded, images };
|
|
94
|
+
}
|
|
95
|
+
#recordUnique(chip) {
|
|
96
|
+
const existing = this.#chips.get(chip.tag);
|
|
97
|
+
if (existing === undefined || sameChipValue(existing, chip)) {
|
|
98
|
+
this.#chips.set(chip.tag, chip);
|
|
99
|
+
return chip.tag;
|
|
100
|
+
}
|
|
101
|
+
const suffix = randomBytes(2).toString("hex");
|
|
102
|
+
const uniqueTag = `${chip.tag.slice(0, -1)} #${suffix}]`;
|
|
103
|
+
const unique = { ...chip, tag: uniqueTag };
|
|
104
|
+
this.#chips.set(uniqueTag, unique);
|
|
105
|
+
return uniqueTag;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function pathsFromClipboard(text) {
|
|
109
|
+
const normalized = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n").trim();
|
|
110
|
+
if (normalized.length === 0)
|
|
111
|
+
return [];
|
|
112
|
+
const paths = [];
|
|
113
|
+
for (const line of normalized.split("\n").filter(value => value.trim().length > 0)) {
|
|
114
|
+
const wholeLine = existingClipboardPath(line);
|
|
115
|
+
if (wholeLine !== null) {
|
|
116
|
+
paths.push(wholeLine);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const tokens = tokenizePathLine(line)?.filter(token => token.quoted || token.text !== "&");
|
|
120
|
+
if (tokens === undefined || tokens.length === 0)
|
|
121
|
+
return [];
|
|
122
|
+
for (let index = 0; index < tokens.length;) {
|
|
123
|
+
const token = tokens[index];
|
|
124
|
+
if (token === undefined)
|
|
125
|
+
return [];
|
|
126
|
+
if (token.quoted) {
|
|
127
|
+
const quoted = existingClipboardPath(token.text);
|
|
128
|
+
if (quoted === null)
|
|
129
|
+
return [];
|
|
130
|
+
paths.push(quoted);
|
|
131
|
+
index += 1;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (normalizePath(token.text) === null)
|
|
135
|
+
return [];
|
|
136
|
+
let runEnd = index;
|
|
137
|
+
while (runEnd < tokens.length && tokens[runEnd]?.quoted !== true)
|
|
138
|
+
runEnd += 1;
|
|
139
|
+
let matched = null;
|
|
140
|
+
let matchedEnd = index;
|
|
141
|
+
for (let end = runEnd; end > index; end -= 1) {
|
|
142
|
+
matched = existingClipboardPath(tokens.slice(index, end).map(candidate => candidate.text).join(" "));
|
|
143
|
+
if (matched !== null) {
|
|
144
|
+
matchedEnd = end;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (matched === null)
|
|
149
|
+
return [];
|
|
150
|
+
paths.push(matched);
|
|
151
|
+
index = matchedEnd;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return paths;
|
|
155
|
+
}
|
|
156
|
+
function existingClipboardPath(value) {
|
|
157
|
+
const fullPath = normalizePath(unquote(value.trim()));
|
|
158
|
+
if (fullPath === null || !existsSync(fullPath))
|
|
159
|
+
return null;
|
|
160
|
+
try {
|
|
161
|
+
const stat = statSync(fullPath);
|
|
162
|
+
if (stat.isDirectory())
|
|
163
|
+
return { fullPath, kind: "folder" };
|
|
164
|
+
if (stat.isFile())
|
|
165
|
+
return { fullPath, kind: "file" };
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
// Clipboard path probing is best-effort.
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
function tokenizePathLine(line) {
|
|
173
|
+
const tokens = [];
|
|
174
|
+
let index = 0;
|
|
175
|
+
while (index < line.length) {
|
|
176
|
+
while (index < line.length && /\s/u.test(line[index] ?? ""))
|
|
177
|
+
index += 1;
|
|
178
|
+
if (index >= line.length)
|
|
179
|
+
break;
|
|
180
|
+
const quote = line[index] === '"' || line[index] === "'" ? line[index] : undefined;
|
|
181
|
+
if (quote !== undefined) {
|
|
182
|
+
index += 1;
|
|
183
|
+
const start = index;
|
|
184
|
+
while (index < line.length && line[index] !== quote)
|
|
185
|
+
index += 1;
|
|
186
|
+
if (index >= line.length)
|
|
187
|
+
return undefined;
|
|
188
|
+
tokens.push({ text: line.slice(start, index), quoted: true });
|
|
189
|
+
index += 1;
|
|
190
|
+
if (index < line.length && !/\s/u.test(line[index] ?? ""))
|
|
191
|
+
return undefined;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const start = index;
|
|
195
|
+
while (index < line.length && !/\s/u.test(line[index] ?? ""))
|
|
196
|
+
index += 1;
|
|
197
|
+
tokens.push({ text: line.slice(start, index), quoted: false });
|
|
198
|
+
}
|
|
199
|
+
return tokens;
|
|
200
|
+
}
|
|
201
|
+
function normalizePath(value) {
|
|
202
|
+
let candidate = value;
|
|
203
|
+
if (/^file:\/\//iu.test(candidate)) {
|
|
204
|
+
try {
|
|
205
|
+
candidate = fileURLToPath(candidate);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (process.platform === "win32") {
|
|
212
|
+
const msys = /^\/([A-Za-z])\/(.*)$/u.exec(candidate);
|
|
213
|
+
if (msys !== null)
|
|
214
|
+
candidate = `${msys[1]}:\\${msys[2]?.replaceAll("/", "\\") ?? ""}`;
|
|
215
|
+
}
|
|
216
|
+
return /^(?:[A-Za-z]:\\|\/)/u.test(candidate) ? path.normalize(candidate) : null;
|
|
217
|
+
}
|
|
218
|
+
function unquote(value) {
|
|
219
|
+
let result = value.startsWith("& ") ? value.slice(2).trim() : value;
|
|
220
|
+
if ((result.startsWith('"') && result.endsWith('"')) || (result.startsWith("'") && result.endsWith("'"))) {
|
|
221
|
+
result = result.slice(1, -1).trim();
|
|
222
|
+
}
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
function pathLabel(fullPath) {
|
|
226
|
+
const basename = path.basename(fullPath);
|
|
227
|
+
if (basename.length > 0)
|
|
228
|
+
return basename;
|
|
229
|
+
return path.parse(fullPath).root.replace(/[\\/]+$/u, "") || fullPath;
|
|
230
|
+
}
|
|
231
|
+
function sameChipValue(left, right) {
|
|
232
|
+
if (left.kind !== right.kind)
|
|
233
|
+
return false;
|
|
234
|
+
if (left.kind === "url" && right.kind === "url")
|
|
235
|
+
return left.url === right.url;
|
|
236
|
+
if ((left.kind === "file" || left.kind === "folder") && (right.kind === "file" || right.kind === "folder")) {
|
|
237
|
+
return path.normalize(left.path) === path.normalize(right.path);
|
|
238
|
+
}
|
|
239
|
+
if (left.kind === "image" && right.kind === "image")
|
|
240
|
+
return left.image.data === right.image.data;
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import type { OwnedUiSessionViewModel } from "../../../contracts/owned-ui/index.js";
|
|
2
|
-
import type { UiRouteHost } from "
|
|
1
|
+
import type { OwnedUiSessionViewModel, OwnedUiViewportSettings, OwnedUiViewportSettingsPort } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { UiRouteHost } from "../../../ui/apps/index.js";
|
|
3
3
|
import { type PiEngineAdapter, type PiWorkflowResult } from "../engine/index.js";
|
|
4
|
-
import { type PiShellComponentPort, type PiShellEditorPort, type PiShellExtensionRendererResolver, type PiShellHeaderOptions, type PiShellHeaderPort, type PiShellLoadedResourcesPort, type PiShellResourceEntry, type PiShellTranscriptComponentPort } from "../components/index.js";
|
|
4
|
+
import { type PiShellClipboardContent, type PiShellComponentPort, type PiShellEditorPort, type PiShellExtensionRendererResolver, type PiShellHeaderOptions, type PiShellHeaderPort, type PiShellLoadedResourcesPort, type PiShellResourceEntry, type PiShellTranscriptComponentPort } from "../components/index.js";
|
|
5
5
|
import { type PiTuiComponentPort, type PiTuiLayoutNode, type PiTuiTerminalPort } from "../tui-runtime/index.js";
|
|
6
|
+
import { type PreparedPrompt } from "./prompt-chips.js";
|
|
6
7
|
export type OwnedUiBackendPort = PiEngineAdapter;
|
|
7
8
|
export type OwnedUiTerminalPort = PiTuiTerminalPort;
|
|
8
9
|
type OwnedUiStartupOptions = PiShellHeaderOptions;
|
|
10
|
+
export interface OwnedUiClipboardPort {
|
|
11
|
+
readText(): Promise<string | null>;
|
|
12
|
+
readImage?(): Promise<{
|
|
13
|
+
readonly data: string;
|
|
14
|
+
readonly mimeType: string;
|
|
15
|
+
} | null>;
|
|
16
|
+
writeText?(text: string): Promise<void>;
|
|
17
|
+
}
|
|
9
18
|
export interface OwnedUiSessionShellOptions {
|
|
10
19
|
readonly backend: OwnedUiBackendPort;
|
|
11
20
|
readonly cwd: string;
|
|
@@ -16,6 +25,12 @@ export interface OwnedUiSessionShellOptions {
|
|
|
16
25
|
* every other route continues to the pinned workflow table unchanged.
|
|
17
26
|
*/
|
|
18
27
|
readonly routeHost?: UiRouteHost;
|
|
28
|
+
/** Bare A1 selects the owned bounded viewport; comparison profiles stay pinned. */
|
|
29
|
+
readonly sessionLayout?: "pinned" | "custom-viewport";
|
|
30
|
+
/** Live profile-local settings, supplied only to the bare-A1 composition. */
|
|
31
|
+
readonly viewportSettings?: OwnedUiViewportSettingsPort;
|
|
32
|
+
/** Optional platform seam; production uses A1's system clipboard adapter. */
|
|
33
|
+
readonly clipboard?: OwnedUiClipboardPort;
|
|
19
34
|
}
|
|
20
35
|
export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
21
36
|
#private;
|
|
@@ -25,7 +40,7 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
25
40
|
constructor(view: OwnedUiSessionViewModel, cwd: string, handlers: {
|
|
26
41
|
readonly getColumns: () => number;
|
|
27
42
|
readonly getRows: () => number;
|
|
28
|
-
readonly requestRender: () => void;
|
|
43
|
+
readonly requestRender: (force?: boolean) => void;
|
|
29
44
|
readonly onSubmit: (text: string) => void;
|
|
30
45
|
readonly onInterrupt: () => void;
|
|
31
46
|
readonly onClear?: () => void;
|
|
@@ -37,7 +52,10 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
37
52
|
readonly onMessageCopy?: () => void;
|
|
38
53
|
readonly onFollowUp?: () => void;
|
|
39
54
|
readonly onDequeue?: () => void;
|
|
40
|
-
|
|
55
|
+
readonly onCopyText?: (text: string) => void;
|
|
56
|
+
readonly readClipboardContent?: () => Promise<PiShellClipboardContent | null>;
|
|
57
|
+
}, startup?: PiShellHeaderOptions, agentDir?: string, extensionRenderers?: PiShellExtensionRendererResolver, sessionLayout?: "pinned" | "custom-viewport");
|
|
58
|
+
preparePromptSubmission(text: string): PreparedPrompt;
|
|
41
59
|
update(view: OwnedUiSessionViewModel): void;
|
|
42
60
|
/**
|
|
43
61
|
* Applies one block: its component is created or updated in place and the order grows
|
|
@@ -46,6 +64,16 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
46
64
|
*/
|
|
47
65
|
applyTranscriptBlock(block: OwnedUiSessionViewModel["transcript"][number]): void;
|
|
48
66
|
render(width: number): readonly string[];
|
|
67
|
+
setViewportConfig(config: OwnedUiViewportSettings): void;
|
|
68
|
+
resumeViewportFollowing(): void;
|
|
69
|
+
noteCompletedAssistantMessage(): void;
|
|
70
|
+
resetViewport(): void;
|
|
71
|
+
clearViewportPointerState(): void;
|
|
72
|
+
handleViewportPreInput(data: string, allowWheel?: boolean, now?: number): {
|
|
73
|
+
readonly data: string;
|
|
74
|
+
readonly consumed: boolean;
|
|
75
|
+
readonly copyText?: string;
|
|
76
|
+
};
|
|
49
77
|
layoutRoot(): PiTuiLayoutNode;
|
|
50
78
|
transcriptComponent(id: string): PiShellTranscriptComponentPort | undefined;
|
|
51
79
|
appendWorkflowStatus(message: string): void;
|
|
@@ -63,6 +91,7 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
63
91
|
resetExtensionUi(): void;
|
|
64
92
|
addExtensionNotification(message: string, type: "info" | "warning" | "error"): void;
|
|
65
93
|
extensionFooterData(): unknown;
|
|
94
|
+
usesDefaultInputSurface(): boolean;
|
|
66
95
|
setInputSurface(component: PiShellComponentPort | null, disposePrevious?: boolean): void;
|
|
67
96
|
handleInput(data: string): void;
|
|
68
97
|
invalidate(): void;
|