@timurproko/a1 0.1.8-dev.407 → 0.1.8-dev.443
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/bin/cli.js +14 -9
- package/bin/guardian.js +3 -3
- package/bin/module-identity.js +21 -3
- package/bin/pinned-pi-public.d.ts +3 -0
- package/bin/pinned-pi-public.js +74 -0
- package/bin/ui.js +17 -18
- package/bin/warmup.js +8 -10
- package/dist/composition/owned-ui.d.ts +5 -3
- package/dist/composition/owned-ui.js +17 -10
- package/dist/composition/settings-route-host.d.ts +4 -5
- package/dist/composition/settings-route-host.js +90 -55
- package/dist/features/launch/intent.d.ts +5 -3
- package/dist/features/launch/intent.js +2 -2
- package/dist/features/launch/profile-paths.js +1 -1
- package/dist/features/launch/runtime-selection.d.ts +1 -1
- package/dist/features/launch/runtime-selection.js +1 -1
- package/dist/features/owned-ui/run.d.ts +6 -0
- package/dist/features/owned-ui/run.js +34 -2
- package/dist/features/owned-ui/settings-app.d.ts +1 -3
- package/dist/features/owned-ui/settings-app.js +2 -2
- package/dist/features/owned-ui/settings-route.d.ts +2 -0
- package/dist/features/owned-ui/settings-route.js +2 -0
- package/dist/foundation/release/update.js +5 -3
- package/dist/foundation/startup/index.d.ts +1 -0
- package/dist/foundation/startup/index.js +1 -0
- package/dist/foundation/startup/startup-budget.d.ts +46 -0
- package/dist/foundation/startup/startup-budget.js +42 -0
- package/dist/foundation/startup/startup-descriptor.js +34 -0
- package/dist/foundation/startup/startup-runtime.d.ts +0 -9
- package/dist/foundation/startup/startup-runtime.js +0 -14
- package/dist/foundation/terminal-cleanup/fatal-exit.js +4 -2
- package/dist/integrations/pi/components/components.js +1 -1
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +1 -1
- package/dist/integrations/pi/components/owned-editor-ux.js +6 -2
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +2 -2
- package/dist/integrations/pi/components/shell-extension-ui.d.ts +1 -1
- package/dist/integrations/pi/components/shell-extension-ui.js +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +2 -2
- package/dist/integrations/pi/components/shell-presenters-transcript.js +2 -2
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +1 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +1 -1
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -0
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +8 -2
- package/dist/integrations/pi/components/tool-image-presentation.d.ts +1 -1
- package/dist/integrations/pi/components/tool-image-presentation.js +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/first-time-setup.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
- package/dist/integrations/pi/engine/adapter.d.ts +1 -1
- package/dist/integrations/pi/engine/adapter.js +1 -1
- package/dist/integrations/pi/engine/model-auth-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/package-integration.js +1 -1
- package/dist/integrations/pi/engine/project-trust-preflight.js +1 -1
- package/dist/integrations/pi/engine/resource-extension-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/runtime-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/runtime-integration.js +2 -2
- package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/session-selection.d.ts +1 -1
- package/dist/integrations/pi/engine/session-selection.js +1 -1
- package/dist/integrations/pi/engine/settings-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +1 -1
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +1 -1
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.d.ts +1 -1
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.js +1 -1
- package/dist/integrations/pi/session-ui/paste-executor.d.ts +1 -1
- package/dist/integrations/pi/session-ui/paste-executor.js +1 -1
- package/dist/integrations/pi/session-ui/paste-protocol.d.ts +1 -1
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +1 -1
- package/dist/integrations/pi/session-ui/prompt-chips.js +1 -1
- package/dist/integrations/pi/session-ui/response-copy-coordinator.d.ts +1 -1
- package/dist/integrations/pi/session-ui/response-copy-coordinator.js +1 -1
- package/dist/integrations/pi/session-ui/response-copy-transport.d.ts +1 -1
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +8 -6
- package/dist/integrations/pi/session-ui/session-shell-root.js +31 -10
- package/dist/integrations/pi/session-ui/session-shell.d.ts +6 -3
- package/dist/integrations/pi/session-ui/session-shell.js +54 -11
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +8 -3
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +33 -5
- package/dist/integrations/pi/session-ui/system-clipboard.d.ts +1 -1
- package/dist/integrations/pi/session-ui/system-clipboard.js +7 -4
- package/dist/integrations/pi/startup-public.d.ts +2 -0
- package/dist/integrations/pi/startup-public.js +2128 -0
- package/dist/integrations/pi/startup-public.manifest.json +11696 -0
- package/dist/integrations/pi/tui-runtime/adapter.js +1 -1
- 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 +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/runtime-payload-inventory.json +4 -1
- package/docs/architecture/response-copy-delivery.md +3 -1
- package/docs/ci-release-runbook.md +20 -7
- package/docs/local-worktree-cleanup.md +48 -13
- package/docs/openspec-archive-automation.md +191 -73
- package/docs/validation.md +79 -0
- package/package.json +4 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { AppHostServices, UiApp } from "../../ui/apps/index.js";
|
|
2
2
|
import { ShortcutRegistry, type PaneInputResult, type PaneMouseEvent, type PaneRect } from "../../ui/components/index.js";
|
|
3
3
|
import type { OwnedUiSettingsSession } from "../../ui/settings/index.js";
|
|
4
|
-
export
|
|
5
|
-
export declare const SETTINGS_ROUTE = "settings";
|
|
4
|
+
export { SETTINGS_APP_ID, SETTINGS_ROUTE } from "./settings-route.js";
|
|
6
5
|
type Action = "move-up" | "move-down" | "block-up" | "block-down" | "first" | "last" | "page-up" | "page-down" | "previous-value" | "next-value" | "activate" | "open-filter" | "close" | "part-previous" | "part-next" | "part-change";
|
|
7
6
|
export declare const SETTINGS_SHORTCUTS: ShortcutRegistry<Action>;
|
|
8
7
|
/**
|
|
@@ -19,4 +18,3 @@ export declare class SettingsApp implements UiApp {
|
|
|
19
18
|
onInput(data: string, host: AppHostServices): PaneInputResult;
|
|
20
19
|
onMouse(event: PaneMouseEvent, _host: AppHostServices): PaneInputResult;
|
|
21
20
|
}
|
|
22
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, assertNoShortcutConflicts, blockJumpTarget, dialogValueColumn, numericValues, RAIL_COLUMNS, renderDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderListRow, renderNote, renderStatusLine, dialogRowAt, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, valueColumnFor, valueMenuFrame, blockRowSpan, displayWidth, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey, isThumbRow, layoutList, moveSelection, rowKey, scrollForSelection, scrollbarGeometry, scrollbarWheelRows, selectableIndexes, } from "../../ui/components/index.js";
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
import { SETTINGS_APP_ID, SETTINGS_ROUTE } from "./settings-route.js";
|
|
3
|
+
export { SETTINGS_APP_ID, SETTINGS_ROUTE } from "./settings-route.js";
|
|
4
4
|
const SCOPE = SETTINGS_APP_ID;
|
|
5
5
|
/** The panel a setting with parts opens: its own keys, its own hint. */
|
|
6
6
|
const DIALOG_SCOPE = `${SETTINGS_APP_ID}-parts`;
|
|
@@ -190,11 +190,13 @@ const ACTIVATION_PROGRESS = {
|
|
|
190
190
|
export function renderUpdateProgressBar(percent) {
|
|
191
191
|
const bounded = Math.min(100, Math.max(0, Math.round(percent)));
|
|
192
192
|
const filled = Math.round((bounded / 100) * PROGRESS_BAR_WIDTH);
|
|
193
|
-
// Rationale:
|
|
194
|
-
//
|
|
193
|
+
// Rationale: the completed run uses A1's scrollbar-aligned teal, followed by a
|
|
194
|
+
// darker gray track and one gray space before the percentage. Explicit RGB
|
|
195
|
+
// keeps each color stable even when the terminal remaps its ANSI palette.
|
|
196
|
+
const completed = "\u001b[38;2;138;190;183m";
|
|
195
197
|
const gray = "\u001b[38;2;128;128;128m";
|
|
196
198
|
const track = "\u001b[38;2;102;102;102m";
|
|
197
|
-
return `${
|
|
199
|
+
return `${completed}${"━".repeat(filled)}${track}${"─".repeat(PROGRESS_BAR_WIDTH - filled)}${gray} ${bounded}%\u001b[39m`;
|
|
198
200
|
}
|
|
199
201
|
function createUpdateProgress(output, enabled) {
|
|
200
202
|
let visible = false;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { StartupTraceEvent } from "./startup-runtime.js";
|
|
2
|
+
export interface StartupPerformanceEvidence {
|
|
3
|
+
readonly profileId: "a1" | "pi";
|
|
4
|
+
readonly launchKind: "post-update" | "no-live-supervisor" | "warm";
|
|
5
|
+
readonly events: readonly StartupTraceEvent[];
|
|
6
|
+
readonly moduleGraph?: {
|
|
7
|
+
readonly loadedFiles: number;
|
|
8
|
+
readonly evaluatedBytes: number;
|
|
9
|
+
readonly groups: readonly {
|
|
10
|
+
readonly group: string;
|
|
11
|
+
readonly files: number;
|
|
12
|
+
readonly evaluatedBytes: number;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface StartupBudgetViolation {
|
|
17
|
+
readonly profileId: "a1" | "pi";
|
|
18
|
+
readonly launchKind: "post-update" | "no-live-supervisor" | "warm";
|
|
19
|
+
readonly elapsedMs: number;
|
|
20
|
+
readonly budgetMs: number;
|
|
21
|
+
readonly dominantPhases: readonly {
|
|
22
|
+
readonly phase: string;
|
|
23
|
+
readonly durationMs: number;
|
|
24
|
+
}[];
|
|
25
|
+
readonly moduleGraph?: StartupPerformanceEvidence["moduleGraph"];
|
|
26
|
+
}
|
|
27
|
+
/** Resolve the declared budget for one launch kind so measurement and reporting never restate the numbers. */
|
|
28
|
+
export declare function resolveStartupBudgetMs(launchKind: StartupPerformanceEvidence["launchKind"], budgets?: {
|
|
29
|
+
readonly postUpdateMs: number;
|
|
30
|
+
readonly noSupervisorMs: number;
|
|
31
|
+
readonly warmMs: number;
|
|
32
|
+
}): number;
|
|
33
|
+
/** Compare measured startup evidence with its budget without deciding whether the channel enforces it. */
|
|
34
|
+
export declare function evaluateStartupPerformanceBudget(evidence: StartupPerformanceEvidence, budgets?: {
|
|
35
|
+
readonly postUpdateMs: number;
|
|
36
|
+
readonly noSupervisorMs: number;
|
|
37
|
+
readonly warmMs: number;
|
|
38
|
+
}): StartupBudgetViolation | null;
|
|
39
|
+
/** Render one budget violation as the single message used by failures, evidence, and run summaries. */
|
|
40
|
+
export declare function formatStartupBudgetViolation(violation: StartupBudgetViolation): string;
|
|
41
|
+
/** Enforce the startup budget in a channel that fails on an overrun. */
|
|
42
|
+
export declare function assertStartupPerformanceBudget(evidence: StartupPerformanceEvidence, budgets?: {
|
|
43
|
+
readonly postUpdateMs: number;
|
|
44
|
+
readonly noSupervisorMs: number;
|
|
45
|
+
readonly warmMs: number;
|
|
46
|
+
}): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const STARTUP_PERFORMANCE_BUDGETS = { postUpdateMs: 2_000, noSupervisorMs: 2_500, warmMs: 2_000 };
|
|
2
|
+
/** Resolve the declared budget for one launch kind so measurement and reporting never restate the numbers. */
|
|
3
|
+
export function resolveStartupBudgetMs(launchKind, budgets = STARTUP_PERFORMANCE_BUDGETS) {
|
|
4
|
+
return launchKind === "warm" ? budgets.warmMs : launchKind === "no-live-supervisor" ? budgets.noSupervisorMs : budgets.postUpdateMs;
|
|
5
|
+
}
|
|
6
|
+
/** Compare measured startup evidence with its budget without deciding whether the channel enforces it. */
|
|
7
|
+
export function evaluateStartupPerformanceBudget(evidence, budgets = STARTUP_PERFORMANCE_BUDGETS) {
|
|
8
|
+
const events = [...evidence.events].sort((left, right) => left.elapsedMs - right.elapsedMs);
|
|
9
|
+
const ready = events.findLast(event => event.phase === "first-input-ready-render");
|
|
10
|
+
// Invariant: a launch that never became input-ready is a functional failure rather than a
|
|
11
|
+
// timing observation, so it throws in every enforcement mode instead of being recorded.
|
|
12
|
+
if (!ready)
|
|
13
|
+
throw new Error(`startup budget failed for ${evidence.profileId}: first input-ready render was not recorded`);
|
|
14
|
+
const budgetMs = resolveStartupBudgetMs(evidence.launchKind, budgets);
|
|
15
|
+
if (ready.elapsedMs <= budgetMs)
|
|
16
|
+
return null;
|
|
17
|
+
const intervals = events.map((event, index) => ({
|
|
18
|
+
phase: event.phase,
|
|
19
|
+
durationMs: event.elapsedMs - (events[index - 1]?.elapsedMs ?? 0),
|
|
20
|
+
})).sort((left, right) => right.durationMs - left.durationMs);
|
|
21
|
+
return {
|
|
22
|
+
profileId: evidence.profileId,
|
|
23
|
+
launchKind: evidence.launchKind,
|
|
24
|
+
elapsedMs: ready.elapsedMs,
|
|
25
|
+
budgetMs,
|
|
26
|
+
dominantPhases: intervals.slice(0, 3),
|
|
27
|
+
...evidence.moduleGraph === undefined ? {} : { moduleGraph: evidence.moduleGraph },
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** Render one budget violation as the single message used by failures, evidence, and run summaries. */
|
|
31
|
+
export function formatStartupBudgetViolation(violation) {
|
|
32
|
+
const graph = violation.moduleGraph === undefined ? ""
|
|
33
|
+
: `; module graph: ${violation.moduleGraph.loadedFiles} files, ${violation.moduleGraph.evaluatedBytes} evaluated bytes (${violation.moduleGraph.groups.map(group => `${group.group} ${group.files}/${group.evaluatedBytes}`).join(", ")})`;
|
|
34
|
+
const phases = violation.dominantPhases.map(item => `${item.phase} ${Math.round(item.durationMs)}ms`).join(", ");
|
|
35
|
+
return `startup budget failed for ${violation.profileId} ${violation.launchKind}: ${Math.round(violation.elapsedMs)}ms exceeds ${violation.budgetMs}ms; dominant phases: ${phases}${graph}`;
|
|
36
|
+
}
|
|
37
|
+
/** Enforce the startup budget in a channel that fails on an overrun. */
|
|
38
|
+
export function assertStartupPerformanceBudget(evidence, budgets) {
|
|
39
|
+
const violation = evaluateStartupPerformanceBudget(evidence, budgets);
|
|
40
|
+
if (violation)
|
|
41
|
+
throw new Error(formatStartupBudgetViolation(violation));
|
|
42
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const STARTUP_DESCRIPTOR = Object.freeze({
|
|
2
|
+
"schema": "a1-startup-descriptor-v1",
|
|
3
|
+
"entries": [
|
|
4
|
+
"dist/features/launch/runtime-selection.js",
|
|
5
|
+
"dist/foundation/lifecycle/session-selection.js",
|
|
6
|
+
"dist/features/owned-ui/project-trust-prompt.js",
|
|
7
|
+
"dist/features/owned-ui/session-fork-prompt.js",
|
|
8
|
+
"dist/features/owned-ui/run.js",
|
|
9
|
+
"dist/composition/owned-ui.js"
|
|
10
|
+
],
|
|
11
|
+
"generatedArtifact": {
|
|
12
|
+
"path": "dist/integrations/pi/startup-public.js",
|
|
13
|
+
"sha256": "bb67e0c4d0448ee596fc34a13c834416ec865c79a3d47c9d949d56e44be2ad57"
|
|
14
|
+
},
|
|
15
|
+
"dependencyLayerIdentity": {
|
|
16
|
+
"source": "A1_RELEASE_LAYERS",
|
|
17
|
+
"encoding": "ordered-comma-separated-layer-ids-v1"
|
|
18
|
+
},
|
|
19
|
+
"compileCacheNamespace": {
|
|
20
|
+
"strategy": "node-abi-version-and-ordered-layer-sha256-v1"
|
|
21
|
+
},
|
|
22
|
+
"identity": "fb00d3c36b3bcb0aa2f5402fa06ac758cac7585961cc483118f430e617632a48"
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export function loadDeclaredStartupGraph() {
|
|
26
|
+
return Promise.all([
|
|
27
|
+
import("../../features/launch/runtime-selection.js"),
|
|
28
|
+
import("../../foundation/lifecycle/session-selection.js"),
|
|
29
|
+
import("../../features/owned-ui/project-trust-prompt.js"),
|
|
30
|
+
import("../../features/owned-ui/session-fork-prompt.js"),
|
|
31
|
+
import("../../features/owned-ui/run.js"),
|
|
32
|
+
import("../../composition/owned-ui.js"),
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
2
2
|
export type StartupPhase = "command-invoked" | "bootstrap-start" | "bootstrap-selected" | "durable-validation-start" | "durable-validation-complete" | "replacement-supervisor-start" | "replacement-supervisor-ready" | "guardian-start" | "guardian-connected" | "ui-entry" | "ui-modules-loaded" | "pi-services" | "resource-discovery" | "session-created" | "settings-loaded" | "first-input-ready-render";
|
|
3
|
-
export interface StartupPerformanceEvidence {
|
|
4
|
-
readonly profileId: "a1" | "pi";
|
|
5
|
-
readonly launchKind: "post-update" | "no-live-supervisor" | "warm";
|
|
6
|
-
readonly events: readonly StartupTraceEvent[];
|
|
7
|
-
}
|
|
8
3
|
export interface StartupTraceEvent {
|
|
9
4
|
readonly schema: typeof PRODUCT_IDENTITY.evidence.startupTraceSchema;
|
|
10
5
|
readonly traceId: string;
|
|
@@ -29,8 +24,4 @@ export declare function enableStartupCompileCache(dataDir: string, releaseId: st
|
|
|
29
24
|
export declare function startupCompileCachePath(dataDir: string, releaseId: string | null, dependencyLayerIds: readonly string[]): string;
|
|
30
25
|
/** Retain current compile namespaces plus a bounded number of recent fallbacks. */
|
|
31
26
|
export declare function collectCompileCaches(dataDir: string, protectedPaths: readonly string[], keepRecent?: number): Promise<void>;
|
|
32
|
-
export declare function assertStartupPerformanceBudget(evidence: StartupPerformanceEvidence, budgets?: {
|
|
33
|
-
readonly postUpdateMs: number;
|
|
34
|
-
readonly warmMs: number;
|
|
35
|
-
}): void;
|
|
36
27
|
export declare function parseStartupTrace(source: string): readonly StartupTraceEvent[];
|
|
@@ -97,20 +97,6 @@ export async function collectCompileCaches(dataDir, protectedPaths, keepRecent =
|
|
|
97
97
|
await rm(candidate.path, { recursive: true, force: true });
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
export function assertStartupPerformanceBudget(evidence, budgets = { postUpdateMs: 5_000, warmMs: 3_000 }) {
|
|
101
|
-
const events = [...evidence.events].sort((left, right) => left.elapsedMs - right.elapsedMs);
|
|
102
|
-
const ready = events.findLast(event => event.phase === "first-input-ready-render");
|
|
103
|
-
if (!ready)
|
|
104
|
-
throw new Error(`startup budget failed for ${evidence.profileId}: first input-ready render was not recorded`);
|
|
105
|
-
const budget = evidence.launchKind === "warm" ? budgets.warmMs : budgets.postUpdateMs;
|
|
106
|
-
if (ready.elapsedMs <= budget)
|
|
107
|
-
return;
|
|
108
|
-
const intervals = events.map((event, index) => ({
|
|
109
|
-
phase: event.phase,
|
|
110
|
-
durationMs: event.elapsedMs - (events[index - 1]?.elapsedMs ?? 0),
|
|
111
|
-
})).sort((left, right) => right.durationMs - left.durationMs);
|
|
112
|
-
throw new Error(`startup budget failed for ${evidence.profileId} ${evidence.launchKind}: ${Math.round(ready.elapsedMs)}ms exceeds ${budget}ms; dominant phases: ${intervals.slice(0, 3).map(item => `${item.phase} ${Math.round(item.durationMs)}ms`).join(", ")}`);
|
|
113
|
-
}
|
|
114
100
|
export function parseStartupTrace(source) {
|
|
115
101
|
const events = source.split(/\r?\n/).filter(Boolean).map(line => JSON.parse(line));
|
|
116
102
|
for (const event of events) {
|
|
@@ -68,10 +68,12 @@ export function installFatalExit(options) {
|
|
|
68
68
|
catch { }
|
|
69
69
|
process.exit(1);
|
|
70
70
|
};
|
|
71
|
-
const
|
|
71
|
+
const cleanupTimeoutMs = options.timeoutMs ?? 1000;
|
|
72
|
+
// Rationale: a short cleanup budget must not terminate the process while its bounded diagnostic write is still in flight.
|
|
73
|
+
const deadline = setTimeout(finish, Math.max(1000, cleanupTimeoutMs));
|
|
72
74
|
void Promise.all([
|
|
73
75
|
writeFatalDiagnostic(options.directory, origin, error, options.releaseId).then(path => { record = path; }),
|
|
74
|
-
boundedCleanup(() => options.dispose?.(),
|
|
76
|
+
boundedCleanup(() => options.dispose?.(), cleanupTimeoutMs).catch(() => undefined),
|
|
75
77
|
]).then(() => { clearTimeout(deadline); finish(); }, finish);
|
|
76
78
|
};
|
|
77
79
|
const exception = (error) => terminate("uncaughtException", error);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssistantMessageComponent, ToolExecutionComponent, UserMessageComponent, } from "
|
|
1
|
+
import { AssistantMessageComponent, ToolExecutionComponent, UserMessageComponent, } from "../startup-public.js";
|
|
2
2
|
import { createTuiFacade, validatedAssistantMessage } from "./shell-components.js";
|
|
3
3
|
import { ensurePiTheme } from "./theme.js";
|
|
4
4
|
export function adaptPiUserMessage(block, width) {
|
|
@@ -50,7 +50,7 @@ export interface PromptSelectionUxOptions {
|
|
|
50
50
|
readonly beginTextPaste?: (text: string) => PiShellPasteReservation;
|
|
51
51
|
readonly deferTextPaste?: (text: string) => boolean;
|
|
52
52
|
readonly onPasteRejected?: (error: unknown) => void;
|
|
53
|
-
readonly onPasteInput?: (bytes: number) => void;
|
|
53
|
+
readonly onPasteInput?: (bytes: number, phase: "framing" | "inserting" | "settled") => void;
|
|
54
54
|
readonly transformPastedContent: (content: PiShellClipboardContent) => string;
|
|
55
55
|
readonly atomicRanges: (line: string) => readonly PiShellEditorTextRange[];
|
|
56
56
|
readonly hiddenRanges?: (line: string) => readonly PiShellEditorTextRange[];
|
|
@@ -485,21 +485,24 @@ class PromptSelectionInterceptor {
|
|
|
485
485
|
append(fragment.slice(0, end));
|
|
486
486
|
const remaining = fragment.slice(end + 6);
|
|
487
487
|
this.#terminalPaste = undefined;
|
|
488
|
-
this.options.onPasteInput?.(pending.bytes);
|
|
489
488
|
if (pending.oversized) {
|
|
489
|
+
this.options.onPasteInput?.(pending.bytes, "framing");
|
|
490
490
|
this.options.onPasteRejected?.(new ImageAttachmentError("paste-size"));
|
|
491
491
|
if (remaining.length > 0)
|
|
492
492
|
this.handleInput(remaining, (replacement = remaining) => next(replacement));
|
|
493
493
|
return true;
|
|
494
494
|
}
|
|
495
495
|
const text = pending.parts.join("") + pending.piece;
|
|
496
|
+
const deferred = text.length > 0 && this.options.beginTextPaste !== undefined && (this.options.deferTextPaste?.(text) ?? true);
|
|
497
|
+
this.options.onPasteInput?.(pending.bytes, "framing");
|
|
496
498
|
if (text.length > 0)
|
|
497
499
|
this.#redoStack = [];
|
|
498
500
|
if (text.length === 0)
|
|
499
501
|
this.pasteClipboard();
|
|
500
|
-
else if (
|
|
502
|
+
else if (deferred)
|
|
501
503
|
this.#pasteFromClipboard(text);
|
|
502
504
|
else {
|
|
505
|
+
this.options.onPasteInput?.(pending.bytes, "inserting");
|
|
503
506
|
const transformed = this.options.transformPastedContent({ kind: "text", text });
|
|
504
507
|
if (transformed === text && this.#orderedSelection() === undefined)
|
|
505
508
|
next(`\x1b[200~${text}\x1b[201~`);
|
|
@@ -511,6 +514,7 @@ class PromptSelectionInterceptor {
|
|
|
511
514
|
this.#redoStack = [];
|
|
512
515
|
this.#requestRender();
|
|
513
516
|
}
|
|
517
|
+
this.options.onPasteInput?.(pending.bytes, "settled");
|
|
514
518
|
}
|
|
515
519
|
if (remaining.length > 0)
|
|
516
520
|
this.handleInput(remaining, (replacement = remaining) => next(replacement));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSelectListTheme } from "
|
|
1
|
+
import { getSelectListTheme } from "../startup-public.js";
|
|
2
2
|
import { CombinedAutocompleteProvider, matchesKey, setKeybindings, visibleWidth, } from "#pi-tui";
|
|
3
3
|
import { PROMPT_HISTORY_EDITOR_REPLACEMENT } from "../../../contracts/owned-ui/index.js";
|
|
4
4
|
import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
|
|
@@ -28,7 +28,7 @@ export const PINNED_PI_BUILTIN_SLASH_COMMANDS = [
|
|
|
28
28
|
{ name: "compact", description: "Manually compact the session context" },
|
|
29
29
|
{ name: "resume", description: "Resume a different session" },
|
|
30
30
|
{ name: "reload", description: "Reload keybindings, extensions, skills, prompts, themes, and context files" },
|
|
31
|
-
{ name: "quit", description: "Quit
|
|
31
|
+
{ name: "quit", description: "Quit" },
|
|
32
32
|
];
|
|
33
33
|
export function createPiShellEditor(options) {
|
|
34
34
|
ensureTheme();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ExtensionUIContext } from "
|
|
1
|
+
import { type ExtensionUIContext } from "../startup-public.js";
|
|
2
2
|
import type { OwnedUiExtensionOverlayHandle, OwnedUiExtensionOverlayOptions } from "../../../contracts/owned-ui/index.js";
|
|
3
3
|
import { type PiShellComponentPort, type PiShellEditorOptions } from "./shell-shared-facade.js";
|
|
4
4
|
export interface PiExtensionUiBridgeHost {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionInputComponent, ExtensionSelectorComponent, getSelectListTheme, } from "
|
|
1
|
+
import { ExtensionInputComponent, ExtensionSelectorComponent, getSelectListTheme, } from "../startup-public.js";
|
|
2
2
|
import { ExtensionEditorComponent, } from "./upstream/components/extension-editor.js";
|
|
3
3
|
import { setKeybindings, Text, } from "#pi-tui";
|
|
4
4
|
import { KeybindingsManager, } from "./upstream/adjacent/core/keybindings.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rawKeyHint, VERSION } from "
|
|
1
|
+
import { rawKeyHint, VERSION } from "../startup-public.js";
|
|
2
2
|
import { Spacer, Text, } from "#pi-tui";
|
|
3
3
|
import { SessionFooter } from "./upstream/components/session-footer.js";
|
|
4
4
|
import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicBorder, getMarkdownTheme } from "
|
|
1
|
+
import { DynamicBorder, getMarkdownTheme } from "../startup-public.js";
|
|
2
2
|
import { Container, Markdown, Spacer, Text } from "#pi-tui";
|
|
3
3
|
import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
|
|
4
4
|
import { PINNED_PI_LAYOUT, piTheme } from "./theme.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AssistantMessageComponent } from "
|
|
1
|
+
import { AssistantMessageComponent } from "../startup-public.js";
|
|
2
2
|
import { type MermaidRenderingMode } from "./upstream/components/mermaid.js";
|
|
3
3
|
import type { OwnedUiTranscriptBlock } from "../../../contracts/owned-ui/index.js";
|
|
4
4
|
import { type PiShellSubmittedPromptComposer } from "./submitted-prompt-adapter.js";
|
|
5
|
-
export { isPiPromptStyleCompaction, type PiShellSubmittedPromptComposer } from "./submitted-prompt-adapter.js";
|
|
5
|
+
export { isPiPromptStyleCompaction, paintPiSubmittedPromptTimestamp, type PiShellSubmittedPromptComposer } from "./submitted-prompt-adapter.js";
|
|
6
6
|
import { type PiShellExtensionRendererResolver, type PiShellImageAssetResolver, type PiShellTranscriptComponentPort } from "./shell-shared-facade.js";
|
|
7
7
|
export declare function createPiShellTranscriptComponent(initial: OwnedUiTranscriptBlock, cwd: string, extensions?: PiShellExtensionRendererResolver, submittedPrompt?: PiShellSubmittedPromptComposer, initialOutputPad?: 0 | 1, initialHideThinkingBlock?: boolean, initialMermaidRenderingMode?: MermaidRenderingMode, initialShowImages?: boolean, initialImageWidthCells?: number, imageAssets?: PiShellImageAssetResolver, presentation?: {
|
|
8
8
|
readonly getColumns: () => number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssistantMessageComponent, BashExecutionComponent, CompactionSummaryMessageComponent, CustomMessageComponent, DynamicBorder, getMarkdownTheme, parseSkillBlock, UserMessageComponent, } from "
|
|
1
|
+
import { AssistantMessageComponent, BashExecutionComponent, CompactionSummaryMessageComponent, CustomMessageComponent, DynamicBorder, getMarkdownTheme, parseSkillBlock, UserMessageComponent, } from "../startup-public.js";
|
|
2
2
|
import { ToolExecutionComponent } from "./upstream/components/tool-execution.js";
|
|
3
3
|
import { SkillInvocationMessageComponent } from "./upstream/components/skill-invocation-message.js";
|
|
4
4
|
import { piToolArguments as toolArguments, updatePiToolResult as updateToolResult } from "./tool-result-adapter.js";
|
|
@@ -7,7 +7,7 @@ import { createMermaidMarkdownTransformer } from "./upstream/components/mermaid.
|
|
|
7
7
|
import { Container, Image, Spacer, Text, } from "#pi-tui";
|
|
8
8
|
import { PRODUCT_TEXT } from "../../../product-identity.js";
|
|
9
9
|
import { createPiSubmittedPromptComponent, isPiPromptStyleCompaction, } from "./submitted-prompt-adapter.js";
|
|
10
|
-
export { isPiPromptStyleCompaction } from "./submitted-prompt-adapter.js";
|
|
10
|
+
export { isPiPromptStyleCompaction, paintPiSubmittedPromptTimestamp } from "./submitted-prompt-adapter.js";
|
|
11
11
|
import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
|
|
12
12
|
import { componentPort, createTuiFacade, ensureTheme, isRecord, } from "./shell-shared-facade.js";
|
|
13
13
|
export function createPiShellTranscriptComponent(initial, cwd, extensions, submittedPrompt, initialOutputPad = PINNED_PI_LAYOUT.outputPad, initialHideThinkingBlock = false, initialMermaidRenderingMode = "off", initialShowImages = true, initialImageWidthCells = 80, imageAssets, presentation) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelSelectorComponent, type SessionInfo, type SettingsCallbacks, type SettingsConfig } from "
|
|
1
|
+
import { ModelSelectorComponent, type SessionInfo, type SettingsCallbacks, type SettingsConfig } from "../startup-public.js";
|
|
2
2
|
import type { OwnedUiDialog } from "../../../contracts/owned-ui/index.js";
|
|
3
3
|
import { type TrustDecision, type TrustOption, type TrustUpdate } from "./upstream/components/trust-selector.js";
|
|
4
4
|
import { type PiShellComponentPort, type PiShellEditorOptions, type PiShellSelectorOption, type PiShellSelectorOptions } from "./shell-shared-facade.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArminComponent, BorderedLoader, DynamicBorder, ExtensionSelectorComponent, getSelectListTheme, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, ThemeSelectorComponent, ThinkingSelectorComponent, UserMessageSelectorComponent, } from "
|
|
1
|
+
import { ArminComponent, BorderedLoader, DynamicBorder, ExtensionSelectorComponent, getSelectListTheme, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, ThemeSelectorComponent, ThinkingSelectorComponent, UserMessageSelectorComponent, } from "../startup-public.js";
|
|
2
2
|
import { DaxnutsComponent, } from "./upstream/components/daxnuts.js";
|
|
3
3
|
import { EarendilAnnouncementComponent, } from "./upstream/components/earendil-announcement.js";
|
|
4
4
|
import { SessionSelectorComponent, } from "./upstream/components/session-selector.js";
|
|
@@ -173,7 +173,7 @@ export interface PiShellEditorOptions {
|
|
|
173
173
|
readonly beginTextPaste?: (text: string) => PiShellPasteReservation;
|
|
174
174
|
readonly deferTextPaste?: (text: string) => boolean;
|
|
175
175
|
readonly onPasteRejected?: (error: unknown) => void;
|
|
176
|
-
readonly onPasteInput?: (bytes: number) => void;
|
|
176
|
+
readonly onPasteInput?: (bytes: number, phase: "framing" | "inserting" | "settled") => void;
|
|
177
177
|
readonly editorHiddenRanges?: (line: string) => readonly PiShellEditorTextRange[];
|
|
178
178
|
readonly transformPastedContent?: (content: PiShellClipboardContent) => string;
|
|
179
179
|
readonly editorAtomicRanges?: (line: string) => readonly PiShellEditorTextRange[];
|
|
@@ -11,5 +11,7 @@ export interface PiShellSubmittedPromptComposer {
|
|
|
11
11
|
}
|
|
12
12
|
/** Branch summaries share the block kind but do not participate in prompt navigation. */
|
|
13
13
|
export declare function isPiPromptStyleCompaction(block: OwnedUiTranscriptBlock): boolean;
|
|
14
|
+
/** Keep prompt timestamps metadata-grey even inside hover and quiet whole-row wrappers. */
|
|
15
|
+
export declare function paintPiSubmittedPromptTimestamp(text: string): string;
|
|
14
16
|
/** Pi owns Markdown and theme adaptation; the injected composer owns neutral row geometry. */
|
|
15
17
|
export declare function createPiSubmittedPromptComponent(block: OwnedUiTranscriptBlock, composer: PiShellSubmittedPromptComposer, heading?: string): Component;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getMarkdownTheme } from "
|
|
1
|
+
import { getMarkdownTheme } from "../startup-public.js";
|
|
2
2
|
import { Box, Markdown, Text } from "#pi-tui";
|
|
3
3
|
import { piTheme } from "./theme.js";
|
|
4
4
|
/** Branch summaries share the block kind but do not participate in prompt navigation. */
|
|
@@ -7,6 +7,12 @@ export function isPiPromptStyleCompaction(block) {
|
|
|
7
7
|
&& typeof block.payload === "object" && block.payload !== null
|
|
8
8
|
&& block.payload.role === "compactionSummary";
|
|
9
9
|
}
|
|
10
|
+
/** Keep prompt timestamps metadata-grey even inside hover and quiet whole-row wrappers. */
|
|
11
|
+
export function paintPiSubmittedPromptTimestamp(text) {
|
|
12
|
+
// Protocol: combine the intensity/foreground reset so quietSticky does not immediately
|
|
13
|
+
// reapply faint; the semantic foreground that follows remains theme-controlled.
|
|
14
|
+
return `\u001b[22;39m${piTheme().fg("dim", text)}`;
|
|
15
|
+
}
|
|
10
16
|
/** Pi owns Markdown and theme adaptation; the injected composer owns neutral row geometry. */
|
|
11
17
|
export function createPiSubmittedPromptComponent(block, composer, heading) {
|
|
12
18
|
const timestamp = numericTimestamp(block);
|
|
@@ -23,7 +29,7 @@ export function createPiSubmittedPromptComponent(block, composer, heading) {
|
|
|
23
29
|
];
|
|
24
30
|
return [...composer.compose(rows, width, timestamp, {
|
|
25
31
|
prefix: text => piTheme().fg("muted", text),
|
|
26
|
-
timestamp:
|
|
32
|
+
timestamp: paintPiSubmittedPromptTimestamp,
|
|
27
33
|
})];
|
|
28
34
|
},
|
|
29
35
|
invalidate() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { TUI_KEYBINDINGS, KeybindingsManager as TuiKeybindingsManager, } from "#pi-tui";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { getAgentDir } from "
|
|
5
|
+
import { getAgentDir } from "../../../../startup-public.js";
|
|
6
6
|
export const KEYBINDINGS = {
|
|
7
7
|
...TUI_KEYBINDINGS,
|
|
8
8
|
"app.interrupt": { defaultKeys: "escape", description: "Cancel or abort" },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Local modifications: remap private imports to public package-root/owned theme boundaries; load the verified owned copy of the image lazily.
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
import { Container, Image, Spacer, Text } from "#pi-tui";
|
|
6
|
-
import { DynamicBorder } from "
|
|
6
|
+
import { DynamicBorder } from "../../../startup-public.js";
|
|
7
7
|
import { piTheme } from "../theme/theme.js";
|
|
8
8
|
const BLOG_URL = "https://mariozechner.at/posts/2026-04-08-ive-sold-out/";
|
|
9
9
|
const IMAGE_FILENAME = "clankolas.png";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Modifications: root public pi-tui singleton, owned keybindings/theme seam, owned external-editor import.
|
|
5
5
|
*/
|
|
6
6
|
import { Container, Editor, Spacer, Text, } from "#pi-tui";
|
|
7
|
-
import { DynamicBorder, getSelectListTheme } from "
|
|
7
|
+
import { DynamicBorder, getSelectListTheme } from "../../../startup-public.js";
|
|
8
8
|
import { editInExternalEditor } from "../external-editor.js";
|
|
9
9
|
import { piTheme } from "../../theme.js";
|
|
10
10
|
function keyHint(keybindings, keybinding, description) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// packages/coding-agent/src/modes/interactive/components/first-time-setup.ts (MIT).
|
|
3
3
|
// Local modifications: remap private imports to public package-root or owned theme boundaries.
|
|
4
4
|
import { Container, getKeybindings, Spacer, Text } from "#pi-tui";
|
|
5
|
-
import { DynamicBorder, keyHint, rawKeyHint } from "
|
|
5
|
+
import { DynamicBorder, keyHint, rawKeyHint } from "../../../startup-public.js";
|
|
6
6
|
import { piTheme } from "../theme/theme.js";
|
|
7
7
|
const APP_NAME = "pi";
|
|
8
8
|
const THEME_OPTIONS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, fuzzyFilter, getKeybindings, Input, Key, matchesKey, Spacer, Text, } from "#pi-tui";
|
|
2
|
-
import { DynamicBorder } from "
|
|
2
|
+
import { DynamicBorder } from "../../../startup-public.js";
|
|
3
3
|
import { getModelSearchText } from "../model-search.js";
|
|
4
4
|
import { piTheme } from "../theme/theme.js";
|
|
5
5
|
function keyText(keybinding) {
|
|
@@ -9,7 +9,7 @@ import { unlink } from "node:fs/promises";
|
|
|
9
9
|
import * as os from "node:os";
|
|
10
10
|
import { Container, getKeybindings, Input, Spacer, Text, truncateToWidth, visibleWidth, } from "#pi-tui";
|
|
11
11
|
import { KeybindingsManager } from "../adjacent/core/keybindings.js";
|
|
12
|
-
import { DynamicBorder } from "
|
|
12
|
+
import { DynamicBorder } from "../../../startup-public.js";
|
|
13
13
|
import { piTheme } from "../theme/theme.js";
|
|
14
14
|
const theme = new Proxy({}, {
|
|
15
15
|
get(_target, property) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/status-indicator.ts
|
|
4
4
|
*/
|
|
5
5
|
import { Loader } from "#pi-tui";
|
|
6
|
-
import { keyText } from "
|
|
6
|
+
import { keyText } from "../../../startup-public.js";
|
|
7
7
|
import { piTheme } from "../theme/theme.js";
|
|
8
8
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
9
9
|
export class StatusIndicator extends Loader {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { stripVTControlCharacters } from "node:util";
|
|
11
11
|
import { Box, Container, getCapabilities, getImageDimensions, imageFallback, Spacer, Text } from "#pi-tui";
|
|
12
|
-
import { createReadToolDefinition, createBashToolDefinition, createEditToolDefinition, createWriteToolDefinition, createGrepToolDefinition, createFindToolDefinition, createLsToolDefinition, keyHint, } from "
|
|
12
|
+
import { createReadToolDefinition, createBashToolDefinition, createEditToolDefinition, createWriteToolDefinition, createGrepToolDefinition, createFindToolDefinition, createLsToolDefinition, keyHint, } from "../../../startup-public.js";
|
|
13
13
|
import { piTheme } from "../theme/theme.js";
|
|
14
14
|
import { ToolImagePresentation } from "../../tool-image-presentation.js";
|
|
15
15
|
const definitions = { read: createReadToolDefinition, bash: createBashToolDefinition, edit: createEditToolDefinition,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Mechanical changes: public component/type imports and owned keybindings/theme helpers.
|
|
5
5
|
*/
|
|
6
6
|
import { Container, Input, Spacer, sliceByColumn, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "#pi-tui";
|
|
7
|
-
import { DynamicBorder } from "
|
|
7
|
+
import { DynamicBorder } from "../../../startup-public.js";
|
|
8
8
|
import { KeybindingsManager } from "../adjacent/core/keybindings.js";
|
|
9
9
|
import { piTheme } from "../theme/theme.js";
|
|
10
10
|
const theme = new Proxy({}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Mechanically adapted from Pi commit 914cf14
|
|
2
2
|
// packages/coding-agent/src/modes/interactive/components/trust-selector.ts (MIT).
|
|
3
3
|
// Local modifications: inject trust options and remap theme/import boundaries.
|
|
4
|
-
import { DynamicBorder, keyHint, rawKeyHint } from "
|
|
4
|
+
import { DynamicBorder, keyHint, rawKeyHint } from "../../../startup-public.js";
|
|
5
5
|
import { Container, getKeybindings, Spacer, Text } from "#pi-tui";
|
|
6
6
|
import { piTheme } from "../theme/theme.js";
|
|
7
7
|
function formatDecision(trustPath, decision) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync, watch } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { getAgentDir, initTheme, Theme, } from "
|
|
3
|
+
import { getAgentDir, initTheme, Theme, } from "../../../startup-public.js";
|
|
4
4
|
import { getCapabilities } from "#pi-tui";
|
|
5
5
|
import { BUILTIN_THEME_RESOURCES, isBuiltinThemeName } from "../../resources/builtin-themes.js";
|
|
6
6
|
export const PINNED_PI_LAYOUT = Object.freeze({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PiSessionForkPrompt, PiSessionSelection } from "./session-selection.js";
|
|
2
|
-
import { type AgentSession, type AgentSessionRuntime, type AgentSessionServices, type SessionInfo } from "
|
|
2
|
+
import { type AgentSession, type AgentSessionRuntime, type AgentSessionServices, type SessionInfo } from "../startup-public.js";
|
|
3
3
|
import { OWNED_UI_EXTENSION_CONTRACT_VERSION, OWNED_UI_EXTENSION_RENDER_CALLBACKS, OWNED_UI_EXTENSION_UI_CALLBACKS, OWNED_UI_EXTENSION_UI_PROPERTIES, type OwnedUiCommand, type OwnedUiCommandOutcome, type OwnedUiImageAttachment, type OwnedUiPromptSuggestionGeneratorPort, type OwnedUiPromptSuggestionReasoning, type OwnedUiPromptSuggestionRequest, type OwnedUiPromptSuggestionResult, type OwnedUiEvent, type OwnedUiSessionViewModel, type OwnedUiSnapshot } from "../../../contracts/owned-ui/index.js";
|
|
4
4
|
import { type PiAuthenticationProviderOption, type PiBashWorkflowResult, type PiPinnedSettingsCallback, type PiPinnedSettingsSnapshot, type PiWorkflowAutocompleteCommand, type PiWorkflowHost, type PiWorkflowInteractionHost, type PiWorkflowOption, type PiWorkflowRequest, type PiWorkflowResult } from "./workflows.js";
|
|
5
5
|
import { PiSettingsIntegration } from "./settings-integration.js";
|
|
@@ -9,7 +9,7 @@ import { configureOwnedHttpDispatcher } from "./http-dispatcher.js";
|
|
|
9
9
|
import { readPinnedCommandChangelog } from "./changelog.js";
|
|
10
10
|
import { toolRenderingInput } from "./tool-rendering.js";
|
|
11
11
|
import { TranscriptImageAssets } from "./transcript-image-assets.js";
|
|
12
|
-
import { copyToClipboard, CredentialSynchronizationError, DefaultPackageManager, getAgentDir, ProjectTrustStore, SessionManager, VERSION, } from "
|
|
12
|
+
import { copyToClipboard, CredentialSynchronizationError, DefaultPackageManager, getAgentDir, ProjectTrustStore, SessionManager, VERSION, } from "../startup-public.js";
|
|
13
13
|
import { OWNED_UI_EXTENSION_CONTRACT_VERSION, OWNED_UI_EXTENSION_RENDER_CALLBACKS, OWNED_UI_EXTENSION_UI_CALLBACKS, OWNED_UI_EXTENSION_UI_PROPERTIES, CONTEXTUAL_PROMPT_SUGGESTION_INSTRUCTION, acceptsTranscriptUpdate, transcriptToolState, assertOwnedUiCommand, assertOwnedUiExtensionUiPort, assertOwnedUiPromptSuggestionRequest, assertOwnedUiPromptSuggestionResult, assertOwnedUiSnapshot, normalizePromptSuggestionCandidate, } from "../../../contracts/owned-ui/index.js";
|
|
14
14
|
import { PINNED_PI_SETTINGS_CALLBACKS, PINNED_PI_WORKFLOW_COMMAND_NAMES, } from "./workflows.js";
|
|
15
15
|
import { createPiRuntimeIntegration } from "./runtime-integration.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModelRuntime } from "
|
|
1
|
+
import type { ModelRuntime } from "../startup-public.js";
|
|
2
2
|
import type { AgentAuthenticationPort, AgentModelDescriptor, AgentModelPort } from "../../../contracts/agent-engine/index.js";
|
|
3
3
|
export type PiDocumentedModelRuntime = Pick<ModelRuntime, "getAvailableSnapshot" | "getModel" | "getProvider" | "hasConfiguredAuth" | "refresh" | "logout">;
|
|
4
4
|
export interface PiModelAuthenticationOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { DefaultPackageManager, ModelRuntime, SettingsManager } from "
|
|
2
|
+
import { DefaultPackageManager, ModelRuntime, SettingsManager } from "../startup-public.js";
|
|
3
3
|
import { agentPackageOutcome, } from "../../../contracts/agent-engine/index.js";
|
|
4
4
|
const MODEL_REFRESH_TIMEOUT_MS = 15_000;
|
|
5
5
|
/**
|