@timurproko/a1 0.2.7-dev.779 → 0.2.7-dev.788
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/app/session-shell/session-shell-root.js +4 -3
- package/dist/app/session-shell/session-shell.js +5 -1
- package/dist/app/session-shell/shell-host.d.ts +0 -2
- package/dist/app/session-shell/shell-host.js +3 -20
- package/dist/cli/tabs.js +15 -0
- package/dist/composition/owned-ui.d.ts +0 -1
- package/dist/composition/owned-ui.js +39 -30
- package/dist/contracts/owned-ui/session-workflows.d.ts +4 -1
- package/dist/features/resident-tab/auto-name.d.ts +2 -2
- package/dist/features/resident-tab/auto-name.js +7 -5
- package/dist/features/resident-tab/index.d.ts +1 -1
- package/dist/features/resident-tab/index.js +1 -1
- package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
- package/dist/foundation/release/progress-palette.generated.js +2 -2
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
- package/dist/integrations/pi/components/share-operation-dialog.d.ts +2 -0
- package/dist/integrations/pi/components/share-operation-dialog.js +2 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -0
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +3 -11
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
- package/dist/integrations/pi/engine/pi-settings-metadata.json +12 -0
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/settings-bridge.js +2 -0
- package/dist/integrations/pi/engine/settings-port.js +10 -1
- package/dist/integrations/pi/engine/workflow-runner.js +64 -2
- package/dist/integrations/pi/engine/workflow-support.d.ts +12 -0
- package/dist/integrations/pi/engine/workflow-support.js +36 -0
- package/dist/integrations/pi/engine/workflows.d.ts +3 -1
- package/dist/integrations/pi/engine/workflows.js +1 -0
- package/dist/integrations/pi/startup-public.js +38 -35
- package/dist/integrations/pi/startup-public.manifest.json +110 -116
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
- package/dist/native/darwin-arm64/a1_session_lock.node +0 -0
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/darwin-arm64/terminal-host +0 -0
- package/dist/native/darwin-arm64/terminal-host.manifest.json +5 -5
- package/dist/native/darwin-x64/a1_session_lock.node +0 -0
- package/dist/native/darwin-x64/manifest.json +1 -1
- package/dist/native/darwin-x64/terminal-host +0 -0
- package/dist/native/darwin-x64/terminal-host.manifest.json +5 -5
- package/dist/native/linux-x64/a1_session_lock.node +0 -0
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/linux-x64/terminal-host +0 -0
- package/dist/native/linux-x64/terminal-host.manifest.json +5 -5
- package/dist/native/win32-x64/a1_session_lock.node +0 -0
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/native/win32-x64/terminal-host.exe +0 -0
- package/dist/native/win32-x64/terminal-host.manifest.json +4 -4
- package/dist/runtime-payload-inventory.json +4242 -3716
- package/docs/architecture/toolchain.md +1 -1
- package/docs/ci-release-runbook.md +2 -2
- package/docs/openspec-archive-automation.md +5 -5
- package/docs/validation.md +9 -1
- package/package.json +3 -3
|
@@ -24,6 +24,7 @@ export const PI_SETTING_EFFECTS = Object.freeze({
|
|
|
24
24
|
enableInstallTelemetry: effect("next-start", "installation", "none", "install lifecycle and its pinned failure diagnostic", "settings-effects-installation-parity"),
|
|
25
25
|
quietStartup: hiddenEffect("next-start", "startup", "pinned startup suppression lifecycle", "pi-startup-composition-parity"),
|
|
26
26
|
defaultProjectTrust: effect("next-start", "startup", "startup-selector", "pinned pre-resource project trust selector", "project-trust-startup-parity"),
|
|
27
|
+
sessionShareDestination: effect("live", "agent", "none", "pinned /share Radius or gist upload and its status rows", "pinned-share-destination-parity"),
|
|
27
28
|
doubleEscapeAction: effect("live", "shell", "selector", "pinned tree or fork selector", "pinned-selector-parity"),
|
|
28
29
|
treeFilterMode: effect("live", "shell", "selector", "pinned tree selector filter, rows, and hints", "pinned-selector-parity"),
|
|
29
30
|
showHardwareCursor: effect("live", "terminal", "terminal-cursor", "pinned editor, overlay, blur, failure, and exit cursor operations", "pi-terminal-operation-parity"),
|
|
@@ -411,6 +412,7 @@ function operations(settings, providers) {
|
|
|
411
412
|
bool("enableInstallTelemetry", () => settings.getEnableInstallTelemetry(), value => settings.setEnableInstallTelemetry(value)),
|
|
412
413
|
quietStartupSetting(settings),
|
|
413
414
|
choice("defaultProjectTrust", offered("defaultProjectTrust"), () => settings.getDefaultProjectTrust(), value => settings.setDefaultProjectTrust(value)),
|
|
415
|
+
choice("sessionShareDestination", offered("sessionShareDestination"), () => settings.getSessionShareDestination(), value => settings.setSessionShareDestination(value)),
|
|
414
416
|
choice("doubleEscapeAction", offered("doubleEscapeAction"), () => settings.getDoubleEscapeAction(), value => settings.setDoubleEscapeAction(value)),
|
|
415
417
|
choice("treeFilterMode", offered("treeFilterMode"), () => settings.getTreeFilterMode(), value => settings.setTreeFilterMode(value)),
|
|
416
418
|
bool("showHardwareCursor", () => settings.getShowHardwareCursor(), value => settings.setShowHardwareCursor(value)),
|
|
@@ -142,6 +142,12 @@ export class PiEngineSettings {
|
|
|
142
142
|
session.setThinkingLevel(level);
|
|
143
143
|
this.#ports.thinkingLevelChanged(readThinkingLevel(session.thinkingLevel));
|
|
144
144
|
} },
|
|
145
|
+
sessionShareDestination: { apply: value => {
|
|
146
|
+
if (value !== "auto" && value !== "gist" && value !== "radius")
|
|
147
|
+
throw new TypeError("Session share destination is invalid");
|
|
148
|
+
// Invariant: `/share` reads the manager per run, so persisting is the whole live effect.
|
|
149
|
+
settings.setSessionShareDestination(value);
|
|
150
|
+
} },
|
|
145
151
|
warnings: { apply: value => {
|
|
146
152
|
if (!isRecord(value) || Object.values(value).some(flag => typeof flag !== "boolean"))
|
|
147
153
|
throw new TypeError("Warnings setting is invalid");
|
|
@@ -222,6 +228,7 @@ export class PiEngineSettings {
|
|
|
222
228
|
autocompleteMaxVisible: setting(settings?.getAutocompleteMaxVisible, 5),
|
|
223
229
|
quietStartup: setting(settings?.getQuietStartup, false),
|
|
224
230
|
defaultProjectTrust: setting(settings?.getDefaultProjectTrust, "ask"),
|
|
231
|
+
sessionShareDestination: setting(settings?.getSessionShareDestination, "auto"),
|
|
225
232
|
clearOnShrink: setting(settings?.getClearOnShrink, false),
|
|
226
233
|
showTerminalProgress: setting(settings?.getShowTerminalProgress, false),
|
|
227
234
|
tuiMode: setting(settings?.getTuiMode, "regular"),
|
|
@@ -274,6 +281,7 @@ export class PiEngineSettings {
|
|
|
274
281
|
onEnableInstallTelemetryChange: snapshot.enableInstallTelemetry,
|
|
275
282
|
onQuietStartupChange: snapshot.quietStartup,
|
|
276
283
|
onDefaultProjectTrustChange: snapshot.defaultProjectTrust,
|
|
284
|
+
onSessionShareDestinationChange: snapshot.sessionShareDestination,
|
|
277
285
|
onDoubleEscapeActionChange: snapshot.doubleEscapeAction,
|
|
278
286
|
onTreeFilterModeChange: snapshot.treeFilterMode,
|
|
279
287
|
onShowHardwareCursorChange: snapshot.showHardwareCursor,
|
|
@@ -331,7 +339,8 @@ function settingKeyForCallback(callback) {
|
|
|
331
339
|
onHideThinkingBlockChange: "hideThinkingBlock", onMermaidRenderingModeChange: "mermaidRenderingMode",
|
|
332
340
|
onShowCacheMissNoticesChange: "showCacheMissNotices", onCollapseChangelogChange: "collapseChangelog",
|
|
333
341
|
onEnableInstallTelemetryChange: "enableInstallTelemetry", onQuietStartupChange: "quietStartup",
|
|
334
|
-
onDefaultProjectTrustChange: "defaultProjectTrust",
|
|
342
|
+
onDefaultProjectTrustChange: "defaultProjectTrust", onSessionShareDestinationChange: "sessionShareDestination",
|
|
343
|
+
onDoubleEscapeActionChange: "doubleEscapeAction",
|
|
335
344
|
onTreeFilterModeChange: "treeFilterMode", onShowHardwareCursorChange: "showHardwareCursor",
|
|
336
345
|
onEditorPaddingXChange: "editorPaddingX", onOutputPadChange: "outputPad", onAutocompleteMaxVisibleChange: "autocompleteMaxVisible",
|
|
337
346
|
onClearOnShrinkChange: "clearOnShrink", onShowTerminalProgressChange: "showTerminalProgress", onTuiModeChange: "tuiMode",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
2
3
|
import { tmpdir } from "node:os";
|
|
3
4
|
import { dirname, join } from "node:path";
|
|
4
5
|
import { PRODUCT_IDENTITY } from "../../../product-identity.js";
|
|
5
6
|
import { isRecord, readModel, readThinkingLevel, requireCapability, stringProperty } from "./message-values.js";
|
|
6
|
-
import { AUTH_REFRESH_TIMEOUT_MS, commandMissing, errorMessage, findExactWorkflowModel, isAbortError, pathArgument, pinnedHotkeySummary, pinnedSessionInfoPresentation, shareCommandFailureDetail, shareViewerUrl, workflowConfirmation, workflowResult, } from "./workflow-support.js";
|
|
7
|
+
import { AUTH_REFRESH_TIMEOUT_MS, commandMissing, errorMessage, findExactWorkflowModel, isAbortError, pathArgument, pinnedHotkeySummary, pinnedSessionInfoPresentation, RADIUS_AUTH_MIN_VALIDITY_MS, RADIUS_SHARE_GATEWAY, radiusAuthCredential, shareCommandFailureDetail, shareViewerUrl, withRadiusShareTrailingEntry, workflowConfirmation, workflowResult, } from "./workflow-support.js";
|
|
7
8
|
import { PiProviderAuthentication } from "./provider-authentication.js";
|
|
8
9
|
/** How many workflows and engine commands may be admitted together before new work is rejected. */
|
|
9
10
|
const MAX_PENDING_WORK = 32;
|
|
@@ -90,6 +91,58 @@ export class PiWorkflowRunner {
|
|
|
90
91
|
await this.#host.copyText(text);
|
|
91
92
|
return true;
|
|
92
93
|
}
|
|
94
|
+
// Protocol: the pinned Radius `/share` route. Undefined means Radius has no provider or credential,
|
|
95
|
+
// so the caller may fall back to a gist; any other outcome, including an upload failure, is final.
|
|
96
|
+
async #shareViaRadius(session, runtime, request) {
|
|
97
|
+
const signal = request.signal;
|
|
98
|
+
const models = runtime.services.modelRuntime;
|
|
99
|
+
if (models.getProvider?.("radius") === undefined)
|
|
100
|
+
return undefined;
|
|
101
|
+
const token = radiusAuthCredential(await models.getAuth("radius", { minOAuthValidityMs: RADIUS_AUTH_MIN_VALIDITY_MS }));
|
|
102
|
+
if (!token)
|
|
103
|
+
return undefined;
|
|
104
|
+
if (signal?.aborted)
|
|
105
|
+
return workflowResult(request.command, "cancelled", "Share cancelled", undefined, "status");
|
|
106
|
+
request.onProgress?.("Uploading to Radius…");
|
|
107
|
+
const temporary = join(tmpdir(), `${PRODUCT_IDENTITY.filesystem.temporaryPrefix}pi-session-${process.pid}.jsonl`);
|
|
108
|
+
let body;
|
|
109
|
+
try {
|
|
110
|
+
requireCapability(session.exportToJsonl, "exportToJsonl").call(session, temporary);
|
|
111
|
+
body = withRadiusShareTrailingEntry(await readFile(temporary, "utf8"), session.state ?? {}, randomUUID().slice(0, 8));
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
return workflowResult(request.command, "failed", `Failed to export session: ${errorMessage(error, "Unknown error")}`);
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
await rm(temporary, { force: true });
|
|
118
|
+
}
|
|
119
|
+
const url = new URL("/v1/artifacts", RADIUS_SHARE_GATEWAY);
|
|
120
|
+
url.searchParams.set("visibility", "organization");
|
|
121
|
+
url.searchParams.set("title", "Pi session");
|
|
122
|
+
try {
|
|
123
|
+
const response = await (this.#host.fetch ?? fetch)(url, {
|
|
124
|
+
method: "POST",
|
|
125
|
+
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/x-ndjson" },
|
|
126
|
+
body,
|
|
127
|
+
...(signal === undefined ? {} : { signal }),
|
|
128
|
+
});
|
|
129
|
+
const json = await response.json().catch(() => null);
|
|
130
|
+
if (signal?.aborted)
|
|
131
|
+
return workflowResult(request.command, "cancelled", "Share cancelled", undefined, "status");
|
|
132
|
+
const artifact = isRecord(json) && isRecord(json.artifact) ? json.artifact : undefined;
|
|
133
|
+
const shareUrl = artifact === undefined ? undefined : stringProperty(artifact, "canonical_url");
|
|
134
|
+
if (!response.ok || shareUrl === undefined) {
|
|
135
|
+
const detail = (isRecord(json) ? stringProperty(json, "error") : undefined) || response.statusText || String(response.status);
|
|
136
|
+
return workflowResult(request.command, "failed", `Failed to upload Radius artifact: ${detail}`);
|
|
137
|
+
}
|
|
138
|
+
return workflowResult(request.command, "completed", `Share URL: ${shareUrl}`);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
if (signal?.aborted || isAbortError(error))
|
|
142
|
+
return workflowResult(request.command, "cancelled", "Share cancelled", undefined, "status");
|
|
143
|
+
return workflowResult(request.command, "failed", `Failed to upload Radius artifact: ${errorMessage(error, "Unknown error")}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
93
146
|
abortBashWorkflow() {
|
|
94
147
|
this.#requireSession().abortBash?.();
|
|
95
148
|
}
|
|
@@ -336,6 +389,15 @@ export class PiWorkflowRunner {
|
|
|
336
389
|
const signal = request.signal;
|
|
337
390
|
if (signal?.aborted)
|
|
338
391
|
return workflowResult(request.command, "cancelled", "Share cancelled", undefined, "status");
|
|
392
|
+
const destination = runtime.services.settingsManager?.getSessionShareDestination?.() ?? "auto";
|
|
393
|
+
if (destination !== "gist") {
|
|
394
|
+
const radius = await this.#shareViaRadius(session, runtime, request);
|
|
395
|
+
if (radius !== undefined)
|
|
396
|
+
return radius;
|
|
397
|
+
if (destination === "radius")
|
|
398
|
+
return workflowResult(request.command, "failed", "Radius authentication is not configured. Run '/login radius' first.");
|
|
399
|
+
}
|
|
400
|
+
request.onProgress?.("Creating gist…");
|
|
339
401
|
try {
|
|
340
402
|
await this.#host.runCommand("gh", ["auth", "status"], signal === undefined ? undefined : { signal });
|
|
341
403
|
}
|
|
@@ -20,6 +20,18 @@ export declare function shareCommandFailureDetail(error: unknown): string;
|
|
|
20
20
|
export declare function commandMissing(error: unknown): boolean;
|
|
21
21
|
export declare function isAbortError(error: unknown): boolean;
|
|
22
22
|
export declare function shareViewerUrl(gistId: string): string;
|
|
23
|
+
export declare const RADIUS_SHARE_GATEWAY = "https://radius.pi.dev";
|
|
24
|
+
export declare const RADIUS_AUTH_MIN_VALIDITY_MS: number;
|
|
25
|
+
/** The bearer token in a model-runtime auth result: an API key or an `Authorization: Bearer` header. */
|
|
26
|
+
export declare function radiusAuthCredential(auth: unknown): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Append the pinned `pi.share` trailing entry (system prompt and tool schemas for the session viewer)
|
|
29
|
+
* to a branch JSONL export. It chains to the last exported entry and reuses the header timestamp.
|
|
30
|
+
*/
|
|
31
|
+
export declare function withRadiusShareTrailingEntry(jsonl: string, state: {
|
|
32
|
+
readonly systemPrompt?: unknown;
|
|
33
|
+
readonly tools?: readonly unknown[];
|
|
34
|
+
}, id: string): string;
|
|
23
35
|
export declare function workflowOptions(value: unknown, idKey: string, labelKey: string): readonly PiWorkflowOption[];
|
|
24
36
|
export declare function sessionInfoOptions(value: readonly unknown[]): readonly PiWorkflowOption[];
|
|
25
37
|
export declare function pathArgument(value: string): string | undefined;
|
|
@@ -279,6 +279,42 @@ export function shareViewerUrl(gistId) {
|
|
|
279
279
|
const baseUrl = process.env.PI_SHARE_VIEWER_URL || "https://pi.dev/session/";
|
|
280
280
|
return `${baseUrl}#${gistId}`;
|
|
281
281
|
}
|
|
282
|
+
// Provenance: the pinned engine's modes/interactive/session-share.ts Radius route and the model
|
|
283
|
+
// runtime's DEFAULT_RADIUS_GATEWAY; neither is in the public API, so each upgrade re-checks them.
|
|
284
|
+
export const RADIUS_SHARE_GATEWAY = "https://radius.pi.dev";
|
|
285
|
+
export const RADIUS_AUTH_MIN_VALIDITY_MS = 5 * 60_000;
|
|
286
|
+
/** The bearer token in a model-runtime auth result: an API key or an `Authorization: Bearer` header. */
|
|
287
|
+
export function radiusAuthCredential(auth) {
|
|
288
|
+
const resolved = isRecord(auth) && isRecord(auth.auth) ? auth.auth : undefined;
|
|
289
|
+
if (resolved === undefined)
|
|
290
|
+
return undefined;
|
|
291
|
+
if (typeof resolved.apiKey === "string" && resolved.apiKey)
|
|
292
|
+
return resolved.apiKey;
|
|
293
|
+
const headers = isRecord(resolved.headers) ? resolved.headers : {};
|
|
294
|
+
const authorization = Object.entries(headers).find(([name]) => name.toLowerCase() === "authorization")?.[1];
|
|
295
|
+
return typeof authorization === "string" ? /^Bearer\s+(.+)$/iu.exec(authorization)?.[1] : undefined;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Append the pinned `pi.share` trailing entry (system prompt and tool schemas for the session viewer)
|
|
299
|
+
* to a branch JSONL export. It chains to the last exported entry and reuses the header timestamp.
|
|
300
|
+
*/
|
|
301
|
+
export function withRadiusShareTrailingEntry(jsonl, state, id) {
|
|
302
|
+
const lines = jsonl.split("\n").filter(line => line.length > 0);
|
|
303
|
+
const header = lines[0] === undefined ? undefined : JSON.parse(lines[0]);
|
|
304
|
+
const last = lines.length > 1 ? JSON.parse(lines.at(-1)) : undefined;
|
|
305
|
+
const entry = {
|
|
306
|
+
type: "custom",
|
|
307
|
+
customType: "pi.share",
|
|
308
|
+
id,
|
|
309
|
+
parentId: isRecord(last) && typeof last.id === "string" ? last.id : null,
|
|
310
|
+
timestamp: isRecord(header) && typeof header.timestamp === "string" ? header.timestamp : new Date().toISOString(),
|
|
311
|
+
data: {
|
|
312
|
+
systemPrompt: state.systemPrompt,
|
|
313
|
+
tools: (state.tools ?? []).filter(isRecord).map(tool => ({ name: tool.name, description: tool.description, parameters: tool.parameters })),
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
return `${[...lines, JSON.stringify(entry)].join("\n")}\n`;
|
|
317
|
+
}
|
|
282
318
|
export function workflowOptions(value, idKey, labelKey) {
|
|
283
319
|
if (!Array.isArray(value))
|
|
284
320
|
return [];
|
|
@@ -20,7 +20,7 @@ export type PiProductMode = OwnedUiSessionProductMode;
|
|
|
20
20
|
/** The advertised command catalog for a product mode; hidden routes are shared by both. */
|
|
21
21
|
export declare function workflowCommandNames(productMode: PiProductMode): readonly (PiWorkflowCommandName | OwnedModelsCommandName)[];
|
|
22
22
|
export type PiWorkflowRoute = OwnedUiWorkflowRoute;
|
|
23
|
-
export declare const PINNED_PI_SETTINGS_CALLBACKS: readonly ["onAutoCompactChange", "onShowImagesChange", "onImageWidthCellsChange", "onAutoResizeImagesChange", "onBlockImagesChange", "onEnableSkillCommandsChange", "onSteeringModeChange", "onFollowUpModeChange", "onTransportChange", "onHttpIdleTimeoutMsChange", "onCacheWarmingModeChange", "onModelThinkingLevelChange", "onModelThinkingLevelRemove", "onThemeChange", "onThemePreview", "onHideThinkingBlockChange", "onMermaidRenderingModeChange", "onShowCacheMissNoticesChange", "onCollapseChangelogChange", "onEnableInstallTelemetryChange", "onQuietStartupChange", "onDefaultProjectTrustChange", "onDoubleEscapeActionChange", "onTreeFilterModeChange", "onShowHardwareCursorChange", "onEditorPaddingXChange", "onOutputPadChange", "onAutocompleteMaxVisibleChange", "onClearOnShrinkChange", "onShowTerminalProgressChange", "onTuiModeChange", "onFullscreenExitOutputChange", "onFullscreenScrollbarChange", "onFullscreenCopyOnSelectChange", "onFullscreenWheelScrollLinesChange", "onWarningsChange", "onCancel"];
|
|
23
|
+
export declare const PINNED_PI_SETTINGS_CALLBACKS: readonly ["onAutoCompactChange", "onShowImagesChange", "onImageWidthCellsChange", "onAutoResizeImagesChange", "onBlockImagesChange", "onEnableSkillCommandsChange", "onSteeringModeChange", "onFollowUpModeChange", "onTransportChange", "onHttpIdleTimeoutMsChange", "onCacheWarmingModeChange", "onModelThinkingLevelChange", "onModelThinkingLevelRemove", "onThemeChange", "onThemePreview", "onHideThinkingBlockChange", "onMermaidRenderingModeChange", "onShowCacheMissNoticesChange", "onCollapseChangelogChange", "onEnableInstallTelemetryChange", "onQuietStartupChange", "onDefaultProjectTrustChange", "onSessionShareDestinationChange", "onDoubleEscapeActionChange", "onTreeFilterModeChange", "onShowHardwareCursorChange", "onEditorPaddingXChange", "onOutputPadChange", "onAutocompleteMaxVisibleChange", "onClearOnShrinkChange", "onShowTerminalProgressChange", "onTuiModeChange", "onFullscreenExitOutputChange", "onFullscreenScrollbarChange", "onFullscreenCopyOnSelectChange", "onFullscreenWheelScrollLinesChange", "onWarningsChange", "onCancel"];
|
|
24
24
|
export type PiPinnedSettingsCallback = typeof PINNED_PI_SETTINGS_CALLBACKS[number];
|
|
25
25
|
/** The neutral settings snapshot plus the model values only the pinned settings selector reads. */
|
|
26
26
|
export interface PiPinnedSettingsSnapshot extends OwnedUiSessionSettingsSnapshot {
|
|
@@ -61,6 +61,8 @@ export interface PiWorkflowHost {
|
|
|
61
61
|
readonly stderr: string;
|
|
62
62
|
}>;
|
|
63
63
|
readChangelog(sinceVersion?: string): Promise<string>;
|
|
64
|
+
/** HTTP for uploads such as Radius `/share`; defaults to the global fetch. */
|
|
65
|
+
readonly fetch?: typeof fetch;
|
|
64
66
|
}
|
|
65
67
|
export interface PiTreeSelectorContext {
|
|
66
68
|
readonly tree: readonly unknown[];
|
|
@@ -42,6 +42,7 @@ export const PINNED_PI_SETTINGS_CALLBACKS = [
|
|
|
42
42
|
"onEnableInstallTelemetryChange",
|
|
43
43
|
"onQuietStartupChange",
|
|
44
44
|
"onDefaultProjectTrustChange",
|
|
45
|
+
"onSessionShareDestinationChange",
|
|
45
46
|
"onDoubleEscapeActionChange",
|
|
46
47
|
"onTreeFilterModeChange",
|
|
47
48
|
"onShowHardwareCursorChange",
|