@timurproko/a1 0.1.8-dev.182 → 0.1.8-dev.218
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 +2 -2
- package/bin/sync-pi-tui-proxy.js +1 -1
- package/bin/ui.js +1 -1
- package/dist/cli/dispatch.js +3 -3
- package/dist/cli/packages.js +1 -1
- package/dist/cli/version-stats.js +3 -3
- package/dist/composition/owned-ui.js +1 -1
- package/dist/composition/settings-route-host.js +6 -4
- package/dist/features/launch/development-launch.js +1 -1
- package/dist/features/owned-ui/customization.d.ts +2 -0
- package/dist/features/owned-ui/customization.js +2 -0
- package/dist/features/owned-ui/diagnostics.d.ts +1 -0
- package/dist/features/owned-ui/diagnostics.js +1 -0
- package/dist/features/owned-ui/project-trust-prompt.d.ts +11 -6
- package/dist/features/owned-ui/project-trust-prompt.js +134 -17
- package/dist/features/owned-ui/settings-app.js +47 -50
- package/dist/features/workspace/reducer.d.ts +1 -0
- package/dist/features/workspace/reducer.js +1 -0
- package/dist/features/workspace/router.d.ts +1 -0
- package/dist/features/workspace/router.js +1 -0
- package/dist/features/workspace/store.d.ts +1 -0
- package/dist/features/workspace/store.js +1 -0
- package/dist/foundation/launch-guardian/main.js +1 -1
- package/dist/foundation/native-host-protocol/codec.d.ts +2 -0
- package/dist/foundation/native-host-protocol/codec.js +2 -0
- package/dist/foundation/process-containment/linux-process-inspector.d.ts +1 -0
- package/dist/foundation/process-containment/linux-process-inspector.js +1 -0
- package/dist/foundation/process-containment/native-guardian-containment.d.ts +1 -0
- package/dist/foundation/process-containment/native-guardian-containment.js +1 -0
- package/dist/foundation/process-containment/windows-process-inspector.d.ts +1 -0
- package/dist/foundation/process-containment/windows-process-inspector.js +1 -0
- package/dist/foundation/protocol/client.d.ts +1 -0
- package/dist/foundation/protocol/client.js +1 -0
- package/dist/foundation/protocol/messages.d.ts +1 -0
- package/dist/foundation/protocol/messages.js +1 -0
- package/dist/foundation/release/bootstrap.js +6 -6
- package/dist/foundation/release/cohort-state.d.ts +1 -0
- package/dist/foundation/release/cohort-state.js +1 -0
- package/dist/foundation/release/release-gc.js +1 -1
- package/dist/foundation/release/release.js +1 -1
- package/dist/foundation/release/update-transaction.d.ts +1 -0
- package/dist/foundation/release/update-transaction.js +1 -0
- package/dist/foundation/release/update.js +12 -12
- package/dist/foundation/storage/control-store.d.ts +1 -0
- package/dist/foundation/storage/control-store.js +1 -0
- package/dist/foundation/structured-agent-runtime/backpressure.d.ts +1 -0
- package/dist/foundation/structured-agent-runtime/backpressure.js +1 -0
- package/dist/foundation/structured-agent-runtime/commands.d.ts +1 -0
- package/dist/foundation/structured-agent-runtime/commands.js +1 -0
- package/dist/foundation/structured-agent-runtime/reconnection.d.ts +1 -0
- package/dist/foundation/structured-agent-runtime/reconnection.js +1 -0
- package/dist/foundation/structured-agent-runtime/state.d.ts +1 -0
- package/dist/foundation/structured-agent-runtime/state.js +1 -0
- package/dist/foundation/supervision/main.js +1 -1
- package/dist/foundation/supervision/server.d.ts +1 -0
- package/dist/foundation/supervision/server.js +4 -6
- package/dist/integrations/pi/components/conformance.d.ts +1 -0
- package/dist/integrations/pi/components/conformance.js +1 -0
- package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +8 -7
- package/dist/integrations/pi/components/shell-shared-facade.js +1 -1
- package/dist/integrations/pi/engine/adapter.d.ts +7 -0
- package/dist/integrations/pi/engine/adapter.js +37 -35
- package/dist/integrations/pi/engine/conformance.d.ts +2 -0
- package/dist/integrations/pi/engine/conformance.js +2 -0
- package/dist/integrations/pi/engine/http-dispatcher.js +1 -1
- package/dist/integrations/pi/engine/model-auth-integration.d.ts +1 -0
- package/dist/integrations/pi/engine/model-auth-integration.js +1 -0
- 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 -0
- package/dist/integrations/pi/engine/resource-extension-integration.js +1 -0
- package/dist/integrations/pi/engine/session-integration.d.ts +1 -0
- package/dist/integrations/pi/engine/session-integration.js +2 -1
- package/dist/integrations/pi/engine/settings-effects.d.ts +13 -2
- package/dist/integrations/pi/engine/settings-effects.js +62 -42
- package/dist/integrations/pi/engine/settings-integration.js +4 -4
- package/dist/integrations/pi/engine/workflow-controllers.d.ts +1 -0
- package/dist/integrations/pi/engine/workflow-controllers.js +1 -0
- package/dist/integrations/pi/session-ui/index.d.ts +1 -0
- package/dist/integrations/pi/session-ui/index.js +1 -0
- package/dist/integrations/pi/session-ui/prompt-chips.js +1 -1
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +30 -2
- package/dist/integrations/pi/session-ui/session-shell-root.js +133 -72
- package/dist/integrations/pi/session-ui/session-shell.d.ts +9 -2
- package/dist/integrations/pi/session-ui/session-shell.js +112 -37
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +5 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +44 -11
- package/dist/integrations/pi/session-ui/stream-presentation-coalescer.d.ts +29 -0
- package/dist/integrations/pi/session-ui/stream-presentation-coalescer.js +79 -0
- package/dist/integrations/pi/session-ui/system-clipboard.js +6 -6
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -0
- package/dist/integrations/pi/tui-runtime/adapter.js +138 -8
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +25 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +63 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +240 -0
- package/dist/integrations/pi/tui-runtime/index.d.ts +2 -0
- package/dist/integrations/pi/tui-runtime/index.js +2 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +39 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.js +139 -0
- package/dist/native/darwin-arm64/manifest.json +3 -3
- package/dist/native/darwin-arm64/process-guardian +0 -0
- 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/ui/apps/host.js +5 -9
- package/dist/ui/apps/registry.d.ts +1 -0
- package/dist/ui/apps/registry.js +1 -0
- package/dist/ui/components/dialog-panel.js +5 -3
- package/dist/ui/components/frame.d.ts +1 -0
- package/dist/ui/components/frame.js +1 -0
- package/dist/ui/components/index.d.ts +1 -0
- package/dist/ui/components/index.js +1 -0
- package/dist/ui/components/line-input.d.ts +1 -6
- package/dist/ui/components/line-input.js +4 -9
- package/dist/ui/components/list-view.d.ts +0 -6
- package/dist/ui/components/list-view.js +14 -7
- package/dist/ui/components/progress-status.d.ts +2 -0
- package/dist/ui/components/progress-status.js +4 -0
- package/dist/ui/components/scrollbar.js +1 -1
- package/dist/ui/components/shortcuts.d.ts +1 -0
- package/dist/ui/components/shortcuts.js +1 -0
- package/dist/ui/components/spans.d.ts +0 -5
- package/dist/ui/components/spans.js +3 -8
- package/dist/ui/components/surface.d.ts +0 -5
- package/dist/ui/components/surface.js +1 -5
- package/dist/ui/components/text-selection.d.ts +10 -1
- package/dist/ui/components/text-selection.js +96 -29
- package/dist/ui/components/text.js +3 -3
- package/dist/ui/components/transcript-viewport.d.ts +42 -0
- package/dist/ui/components/transcript-viewport.js +287 -39
- package/dist/ui/settings/sections.d.ts +0 -2
- package/dist/ui/settings/sections.js +10 -16
- package/dist/ui/settings/session.js +5 -4
- package/dist/ui/settings/store.d.ts +1 -0
- package/dist/ui/settings/store.js +2 -1
- package/docs/architecture/code-documentation.md +77 -0
- package/docs/architecture/project-structure.md +1 -1
- package/docs/architecture/ui-reference-provenance.md +23 -3
- package/docs/ci-release-runbook.md +48 -4
- package/docs/manual-owned-ui-checkpoint.md +28 -1
- package/docs/manual-terminal-colour-check.md +4 -3
- package/package.json +7 -2
|
@@ -52,7 +52,7 @@ export function createPiPackagesPort(input) {
|
|
|
52
52
|
},
|
|
53
53
|
async update(source) {
|
|
54
54
|
return await attempt("update", source ?? null, async () => {
|
|
55
|
-
//
|
|
55
|
+
// Rationale: asking first keeps "that package is not installed here" a structural
|
|
56
56
|
// answer rather than a string a caller would have to recognize.
|
|
57
57
|
if (source !== undefined && !isConfigured(source))
|
|
58
58
|
return agentPackageOutcome("update", "not-found", null, source);
|
|
@@ -13,7 +13,7 @@ export async function resolvePiProjectTrustPreflight(options) {
|
|
|
13
13
|
const saved = trustStore.get(options.cwd);
|
|
14
14
|
if (saved !== null)
|
|
15
15
|
return { trusted: saved, source: "saved", diagnostic: null };
|
|
16
|
-
// projectTrusted:false is the
|
|
16
|
+
// Security: projectTrusted:false is the boundary: this read may see global
|
|
17
17
|
// settings but cannot consume project settings or construct project resources.
|
|
18
18
|
const globalSettings = SettingsManager.create(options.cwd, options.agentDir, { projectTrusted: false });
|
|
19
19
|
const fallback = globalSettings.getDefaultProjectTrust();
|
|
@@ -5,6 +5,7 @@ export interface PiResourceExtensionOptions {
|
|
|
5
5
|
readonly bindUi: () => Promise<void>;
|
|
6
6
|
readonly unbindUi: () => Promise<void>;
|
|
7
7
|
}
|
|
8
|
+
/** Adapts Pi resource discovery and extension binding while containing extension failures at the port. */
|
|
8
9
|
export declare class PiResourceExtensionIntegration implements AgentResourcesPort, AgentExtensionPort {
|
|
9
10
|
#private;
|
|
10
11
|
private readonly options;
|
|
@@ -31,6 +31,7 @@ export interface PiSessionCommandResult {
|
|
|
31
31
|
readonly outcome: AgentCommandOutcome;
|
|
32
32
|
readonly value?: unknown;
|
|
33
33
|
}
|
|
34
|
+
/** Routes neutral session commands to Pi while preserving Pi streaming and retry semantics. */
|
|
34
35
|
export declare class PiSessionCommandIntegration {
|
|
35
36
|
#private;
|
|
36
37
|
private readonly session;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AGENT_ENGINE_CONTRACT_VERSION, } from "../../../contracts/agent-engine/index.js";
|
|
2
|
+
/** Routes neutral session commands to Pi while preserving Pi streaming and retry semantics. */
|
|
2
3
|
export class PiSessionCommandIntegration {
|
|
3
4
|
session;
|
|
4
5
|
#lastPrompt = null;
|
|
@@ -18,7 +19,7 @@ export class PiSessionCommandIntegration {
|
|
|
18
19
|
return { outcome: "completed" };
|
|
19
20
|
case "steer":
|
|
20
21
|
this.#lastPrompt = command.text;
|
|
21
|
-
//
|
|
22
|
+
// Compatibility: match interactive Pi: prompt() owns template/extension expansion and
|
|
22
23
|
// turns the accepted steering message into the visible user row while
|
|
23
24
|
// later messages remain in the pending queue.
|
|
24
25
|
await this.session.prompt(command.text, {
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import type { AgentJsonValue, AgentSettingApplicationBoundary, AgentSettingChangeOutcome, AgentSettingOwner } from "../../../contracts/agent-engine/index.js";
|
|
2
2
|
export type PiSettingKey = "autoCompact" | "showImages" | "imageWidthCells" | "autoResizeImages" | "blockImages" | "enableSkillCommands" | "steeringMode" | "followUpMode" | "transport" | "httpIdleTimeoutMs" | "thinkingLevel" | "theme" | "hideThinkingBlock" | "mermaidRenderingMode" | "showCacheMissNotices" | "collapseChangelog" | "enableInstallTelemetry" | "quietStartup" | "defaultProjectTrust" | "doubleEscapeAction" | "treeFilterMode" | "showHardwareCursor" | "editorPaddingX" | "outputPad" | "autocompleteMaxVisible" | "clearOnShrink" | "showTerminalProgress" | "tuiMode" | "fullscreenExitOutput" | "fullscreenScrollbar" | "warnings";
|
|
3
|
+
export type PiSettingVisualClass = "none" | "transcript" | "transcript-geometry" | "editor-menu" | "queue-transcript" | "status-error" | "retry-error" | "footer-transcript" | "markdown" | "transcript-notice" | "startup-transcript" | "startup-selector" | "selector" | "terminal-cursor" | "editor-geometry" | "menu-geometry" | "terminal-frame" | "terminal-status" | "restored-parent-output" | "hidden";
|
|
4
|
+
export interface PiSettingVisualEvidence {
|
|
5
|
+
/** Reviewed visual family; `none` still names the behavior that can emit styled diagnostics. */
|
|
6
|
+
readonly class: PiSettingVisualClass;
|
|
7
|
+
/** Pinned component, lifecycle, or provider-visible failure surface used as the visual authority. */
|
|
8
|
+
readonly pinnedSurface: string;
|
|
9
|
+
/** Independent pinned/A1 test or physical checkpoint that owns acceptance. */
|
|
10
|
+
readonly evidence: string;
|
|
11
|
+
}
|
|
3
12
|
export interface PiSettingEffectDefinition {
|
|
4
13
|
readonly application: AgentSettingApplicationBoundary;
|
|
5
14
|
readonly owner: AgentSettingOwner;
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
readonly visual: PiSettingVisualEvidence;
|
|
16
|
+
/** Bare A1 deliberately replaces this Pi behavior, so its settings UI omits the entry. */
|
|
17
|
+
readonly hiddenInBare?: true;
|
|
8
18
|
}
|
|
9
19
|
/**
|
|
10
20
|
* Reviewed effect authority for every generated Pi setting. Presentation remains
|
|
@@ -53,3 +63,4 @@ export declare function settingsEffectInventoryDrift(presented: readonly string[
|
|
|
53
63
|
readonly stale: readonly string[];
|
|
54
64
|
readonly duplicated: readonly string[];
|
|
55
65
|
};
|
|
66
|
+
export declare function settingsVisualInventoryViolations(presented: readonly string[], reviewed?: Readonly<Partial<Record<PiSettingKey, PiSettingEffectDefinition>>>): readonly string[];
|
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
const PRODUCT_FIXED = {
|
|
2
|
-
theme: "Bare A1 uses its product-fixed dark owned theme",
|
|
3
|
-
quietStartup: "Bare A1 owns startup composition and does not expose Pi startup suppression",
|
|
4
|
-
tuiMode: "Bare A1 uses its product-fixed custom fullscreen viewport",
|
|
5
|
-
fullscreenScrollbar: "Bare A1 replaces Pi's scrollbar with declared A1 viewport settings",
|
|
6
|
-
enableInstallTelemetry: "Bare A1 does not run Pi's install/update telemetry lifecycle",
|
|
7
|
-
};
|
|
8
1
|
/**
|
|
9
2
|
* Reviewed effect authority for every generated Pi setting. Presentation remains
|
|
10
3
|
* generated; this table states who must make each accepted value observable.
|
|
11
4
|
*/
|
|
12
5
|
export const PI_SETTING_EFFECTS = Object.freeze({
|
|
13
|
-
autoCompact:
|
|
14
|
-
showImages:
|
|
15
|
-
imageWidthCells:
|
|
16
|
-
autoResizeImages:
|
|
17
|
-
blockImages:
|
|
18
|
-
enableSkillCommands:
|
|
19
|
-
steeringMode:
|
|
20
|
-
followUpMode:
|
|
21
|
-
transport:
|
|
22
|
-
httpIdleTimeoutMs:
|
|
23
|
-
thinkingLevel:
|
|
24
|
-
theme:
|
|
25
|
-
hideThinkingBlock:
|
|
26
|
-
mermaidRenderingMode:
|
|
27
|
-
showCacheMissNotices:
|
|
28
|
-
collapseChangelog:
|
|
29
|
-
enableInstallTelemetry:
|
|
30
|
-
quietStartup:
|
|
31
|
-
defaultProjectTrust:
|
|
32
|
-
doubleEscapeAction:
|
|
33
|
-
treeFilterMode:
|
|
34
|
-
showHardwareCursor:
|
|
35
|
-
editorPaddingX:
|
|
36
|
-
outputPad:
|
|
37
|
-
autocompleteMaxVisible:
|
|
38
|
-
clearOnShrink:
|
|
39
|
-
showTerminalProgress:
|
|
40
|
-
tuiMode:
|
|
41
|
-
fullscreenExitOutput:
|
|
42
|
-
fullscreenScrollbar:
|
|
43
|
-
warnings:
|
|
6
|
+
autoCompact: effect("live", "agent", "transcript", "compaction status, summary, completion, and failure rows", "pinned-transcript-lifecycle-parity"),
|
|
7
|
+
showImages: effect("live", "shell", "transcript", "pinned inline image and textual fallback components", "pinned-transcript-image-parity"),
|
|
8
|
+
imageWidthCells: effect("live", "shell", "transcript-geometry", "pinned image component width and clipping", "pinned-transcript-image-parity"),
|
|
9
|
+
autoResizeImages: effect("live", "agent", "none", "provider image preparation and pinned warning row", "settings-effects-provider-parity"),
|
|
10
|
+
blockImages: effect("live", "agent", "none", "provider context conversion and pinned blocked-image notice", "settings-effects-provider-parity"),
|
|
11
|
+
enableSkillCommands: effect("live", "shell", "editor-menu", "pinned command autocomplete list", "pinned-editor-input-parity"),
|
|
12
|
+
steeringMode: effect("live", "agent", "queue-transcript", "pinned steering queue and submitted prompt rows", "pinned-status-indicator-parity"),
|
|
13
|
+
followUpMode: effect("live", "agent", "queue-transcript", "pinned follow-up queue and submitted prompt rows", "pinned-status-indicator-parity"),
|
|
14
|
+
transport: effect("live", "agent", "status-error", "pinned provider request status and failure rows", "settings-effects-provider-parity"),
|
|
15
|
+
httpIdleTimeoutMs: effect("live", "agent", "retry-error", "pinned timeout, retry, and terminal failure rows", "pinned-transcript-lifecycle-parity"),
|
|
16
|
+
thinkingLevel: effect("live", "agent", "footer-transcript", "pinned footer indicator, thinking rows, and clamp notice", "pinned-status-indicator-parity"),
|
|
17
|
+
theme: hiddenEffect("live", "shell", "pinned theme selector and complete themed shell", "pinned-theme-parity"),
|
|
18
|
+
hideThinkingBlock: effect("live", "shell", "transcript", "pinned thinking block presence and spacing", "pinned-transcript-lifecycle-parity"),
|
|
19
|
+
mermaidRenderingMode: effect("live", "shell", "markdown", "pinned Mermaid Markdown transformation", "pinned-assistant-content-parity"),
|
|
20
|
+
showCacheMissNotices: effect("live", "shell", "transcript-notice", "pinned cache-miss transcript notice", "pinned-transcript-lifecycle-parity"),
|
|
21
|
+
collapseChangelog: effect("next-start", "startup", "startup-transcript", "pinned startup and command changelog components", "pi-startup-composition-parity"),
|
|
22
|
+
enableInstallTelemetry: effect("next-start", "installation", "none", "install lifecycle and its pinned failure diagnostic", "settings-effects-installation-parity"),
|
|
23
|
+
quietStartup: hiddenEffect("next-start", "startup", "pinned startup suppression lifecycle", "pi-startup-composition-parity"),
|
|
24
|
+
defaultProjectTrust: effect("next-start", "startup", "startup-selector", "pinned pre-resource project trust selector", "project-trust-startup-parity"),
|
|
25
|
+
doubleEscapeAction: effect("live", "shell", "selector", "pinned tree or fork selector", "pinned-selector-parity"),
|
|
26
|
+
treeFilterMode: effect("live", "shell", "selector", "pinned tree selector filter, rows, and hints", "pinned-selector-parity"),
|
|
27
|
+
showHardwareCursor: effect("live", "terminal", "terminal-cursor", "pinned editor, overlay, blur, failure, and exit cursor operations", "pi-terminal-operation-parity"),
|
|
28
|
+
editorPaddingX: effect("live", "shell", "editor-geometry", "pinned editor border, padding, wrapping, and cursor column", "pinned-editor-input-parity"),
|
|
29
|
+
outputPad: effect("live", "shell", "transcript-geometry", "pinned transcript, tool, status, and error horizontal padding", "pinned-transcript-lifecycle-parity"),
|
|
30
|
+
autocompleteMaxVisible: effect("live", "shell", "menu-geometry", "pinned autocomplete clipping and editor anchoring", "pinned-editor-input-parity"),
|
|
31
|
+
clearOnShrink: effect("live", "terminal", "terminal-frame", "pinned resize clearing and resulting terminal frame", "pi-terminal-operation-parity"),
|
|
32
|
+
showTerminalProgress: effect("live", "terminal", "terminal-status", "pinned OSC progress lifecycle", "pi-terminal-operation-parity"),
|
|
33
|
+
tuiMode: hiddenEffect("next-session", "shell", "pinned regular/fullscreen selector and terminal lifecycle", "pi-terminal-operation-parity"),
|
|
34
|
+
fullscreenExitOutput: effect("current-exit", "shutdown", "restored-parent-output", "pinned styled transcript and compact dim resume hint", "pinned-fullscreen-exit-parity"),
|
|
35
|
+
fullscreenScrollbar: hiddenEffect("live", "shell", "pinned fullscreen scrollbar reservation", "pi-terminal-operation-parity"),
|
|
36
|
+
warnings: effect("live", "agent", "transcript-notice", "pinned warning rows by warning part", "pinned-transcript-lifecycle-parity"),
|
|
44
37
|
});
|
|
38
|
+
function effect(application, owner, visualClass, pinnedSurface, evidence) {
|
|
39
|
+
return { application, owner, visual: { class: visualClass, pinnedSurface, evidence } };
|
|
40
|
+
}
|
|
41
|
+
function hiddenEffect(application, owner, pinnedSurface, evidence) {
|
|
42
|
+
return { application, owner, hiddenInBare: true, visual: { class: "hidden", pinnedSurface, evidence } };
|
|
43
|
+
}
|
|
45
44
|
/**
|
|
46
45
|
* One transactional authority for Pi setting validation, active effects,
|
|
47
46
|
* persistence, durability, rollback, and owner lifecycle.
|
|
@@ -74,8 +73,8 @@ export class PiSettingsCoordinator {
|
|
|
74
73
|
throw new Error(`unknown Pi setting effect: ${key}`);
|
|
75
74
|
if (definition.owner !== owner)
|
|
76
75
|
throw new Error(`${key} belongs to ${definition.owner}, not ${owner}`);
|
|
77
|
-
if (this.#productMode === "bare" && definition.
|
|
78
|
-
throw new Error(`${key} is
|
|
76
|
+
if (this.#productMode === "bare" && definition.hiddenInBare === true) {
|
|
77
|
+
throw new Error(`${key} is hidden in bare A1`);
|
|
79
78
|
}
|
|
80
79
|
this.#handlers.set(key, handler);
|
|
81
80
|
bound.push(key);
|
|
@@ -103,8 +102,8 @@ export class PiSettingsCoordinator {
|
|
|
103
102
|
}
|
|
104
103
|
limitationReason(key) {
|
|
105
104
|
const definition = PI_SETTING_EFFECTS[key];
|
|
106
|
-
if (this.#productMode === "bare" && definition.
|
|
107
|
-
return
|
|
105
|
+
if (this.#productMode === "bare" && definition.hiddenInBare === true)
|
|
106
|
+
return "setting is not available in the active product mode";
|
|
108
107
|
const inconsistent = this.#requireState(key).inconsistentReason;
|
|
109
108
|
if (inconsistent !== null)
|
|
110
109
|
return inconsistent;
|
|
@@ -221,6 +220,27 @@ export function settingsEffectInventoryDrift(presented, reviewed = Object.keys(P
|
|
|
221
220
|
duplicated: [...counts].filter(([, count]) => count > 1).map(([key]) => key),
|
|
222
221
|
};
|
|
223
222
|
}
|
|
223
|
+
export function settingsVisualInventoryViolations(presented, reviewed = PI_SETTING_EFFECTS) {
|
|
224
|
+
const violations = [];
|
|
225
|
+
for (const candidate of presented) {
|
|
226
|
+
const key = candidate;
|
|
227
|
+
const definition = reviewed[key];
|
|
228
|
+
if (definition === undefined) {
|
|
229
|
+
violations.push(`${candidate}: missing visual classification`);
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const visual = definition.visual;
|
|
233
|
+
if (!visual || visual.pinnedSurface.trim().length === 0)
|
|
234
|
+
violations.push(`${candidate}: missing pinned visual source`);
|
|
235
|
+
if (!visual || visual.evidence.trim().length === 0)
|
|
236
|
+
violations.push(`${candidate}: missing independent visual evidence`);
|
|
237
|
+
if (definition.hiddenInBare === true && visual?.class !== "hidden")
|
|
238
|
+
violations.push(`${candidate}: hidden setting declares a visible frame`);
|
|
239
|
+
if (definition.hiddenInBare !== true && visual?.class === "hidden")
|
|
240
|
+
violations.push(`${candidate}: visible setting declares hidden evidence`);
|
|
241
|
+
}
|
|
242
|
+
return violations;
|
|
243
|
+
}
|
|
224
244
|
function outcome(status, application, storedValue, effectiveValue, failure, limitationReason) {
|
|
225
245
|
return { status, application, storedValue, effectiveValue, failure, limitationReason };
|
|
226
246
|
}
|
|
@@ -75,19 +75,19 @@ export class PiSettingsIntegration {
|
|
|
75
75
|
return at < 0 ? PRESENTATION.order.length : at;
|
|
76
76
|
};
|
|
77
77
|
return [...this.#operations.values()]
|
|
78
|
+
.filter(operation => this.#coordinator.available(operation.key))
|
|
78
79
|
.map(operation => {
|
|
79
80
|
const key = operation.key;
|
|
80
81
|
const wording = PRESENTATION.settings[key];
|
|
81
82
|
const flags = PRESENTATION.dialogs[key];
|
|
82
83
|
const bounds = PRESENTATION.bounds[key];
|
|
83
|
-
const limitationReason = this.#coordinator.limitationReason(key);
|
|
84
84
|
const descriptor = {
|
|
85
85
|
...operation.descriptor,
|
|
86
86
|
application: PI_SETTING_EFFECTS[key].application,
|
|
87
87
|
owner: PI_SETTING_EFFECTS[key].owner,
|
|
88
|
-
available:
|
|
89
|
-
limitationReason,
|
|
90
|
-
writable:
|
|
88
|
+
available: true,
|
|
89
|
+
limitationReason: null,
|
|
90
|
+
writable: true,
|
|
91
91
|
storedValue: this.#coordinator.storedValue(key),
|
|
92
92
|
effectiveValue: this.#coordinator.effectiveValue(key),
|
|
93
93
|
...(bounds === undefined ? {} : bounds),
|
|
@@ -6,6 +6,7 @@ export interface WorkflowControllerResult {
|
|
|
6
6
|
readonly message: string;
|
|
7
7
|
readonly value?: AgentJsonValue;
|
|
8
8
|
}
|
|
9
|
+
/** Capability-gates pinned Pi workflows before delegating execution through the neutral workflow port. */
|
|
9
10
|
export declare class PiWorkflowControllerPort implements AgentWorkflowPort {
|
|
10
11
|
#private;
|
|
11
12
|
private readonly execute;
|
|
@@ -8,6 +8,7 @@ const DEFINITIONS = [
|
|
|
8
8
|
define("new", "session.new"), define("compact", "compact"), define("resume", "session.resume"), define("reload", "resources.reload"),
|
|
9
9
|
define("quit", "process.quit"), define("debug", "diagnostics.read"), define("arminsayshi", "resources.read"), define("dementedelves", "resources.read"),
|
|
10
10
|
];
|
|
11
|
+
/** Capability-gates pinned Pi workflows before delegating execution through the neutral workflow port. */
|
|
11
12
|
export class PiWorkflowControllerPort {
|
|
12
13
|
execute;
|
|
13
14
|
capabilities = { execute: true };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { OwnedUiSessionViewModel, OwnedUiViewportSettings, OwnedUiViewportSettingsPort } from "../../../contracts/owned-ui/index.js";
|
|
2
2
|
import type { UiRouteHost } from "../../../ui/apps/index.js";
|
|
3
|
+
import { type TranscriptViewportFrame, type TranscriptViewportFrameDescriptor } from "../../../ui/components/index.js";
|
|
3
4
|
import { type PiEngineAdapter, type PiWorkflowResult } from "../engine/index.js";
|
|
4
5
|
import { type PiShellClipboardContent, type PiShellComponentPort, type PiShellEditorPort, type PiShellExtensionRendererResolver, type PiShellHeaderOptions, type PiShellHeaderPort, type PiShellImageAssetResolver, type PiShellLoadedResourcesPort, type PiShellResourceEntry, type PiShellTranscriptComponentPort } from "../components/index.js";
|
|
5
|
-
import { type PiTuiComponentPort, type PiTuiLayoutNode, type PiTuiTerminalPort } from "../tui-runtime/index.js";
|
|
6
|
+
import { type PiTuiComponentPort, type PiTuiInputSurfaceKind, type PiTuiInputCoordinationScheduler, type PiTuiInputDiagnosticsEvent, type PiTuiLayoutNode, type PiTuiTerminalPort } from "../tui-runtime/index.js";
|
|
6
7
|
import { type PreparedPrompt } from "./prompt-chips.js";
|
|
8
|
+
import type { StreamPresentationScheduler } from "./stream-presentation-coalescer.js";
|
|
7
9
|
export type OwnedUiBackendPort = PiEngineAdapter;
|
|
8
10
|
export type OwnedUiTerminalPort = PiTuiTerminalPort;
|
|
9
11
|
type OwnedUiStartupOptions = PiShellHeaderOptions;
|
|
@@ -31,7 +33,23 @@ export interface OwnedUiSessionShellOptions {
|
|
|
31
33
|
readonly viewportSettings?: OwnedUiViewportSettingsPort;
|
|
32
34
|
/** Optional platform seam; production uses A1's system clipboard adapter. */
|
|
33
35
|
readonly clipboard?: OwnedUiClipboardPort;
|
|
36
|
+
/** Deterministic scheduling seam for presentation-cadence tests. */
|
|
37
|
+
readonly streamPresentation?: {
|
|
38
|
+
readonly intervalMs?: number;
|
|
39
|
+
readonly scheduler?: StreamPresentationScheduler;
|
|
40
|
+
};
|
|
41
|
+
/** Optional deterministic seam for keyboard scheduling and phase evidence. */
|
|
42
|
+
readonly inputPresentation?: {
|
|
43
|
+
readonly scheduler?: PiTuiInputCoordinationScheduler;
|
|
44
|
+
readonly onEvent?: (event: PiTuiInputDiagnosticsEvent) => void;
|
|
45
|
+
readonly now?: () => number;
|
|
46
|
+
/** Evidence-only baseline seam; production leaves coordination enabled. */
|
|
47
|
+
readonly coordination?: boolean;
|
|
48
|
+
/** Evidence-only baseline seam; production leaves dock reuse enabled. */
|
|
49
|
+
readonly viewportReuse?: boolean;
|
|
50
|
+
};
|
|
34
51
|
}
|
|
52
|
+
/** Composes backend session state into the owned transcript, viewport, editor, and dock presentation. */
|
|
35
53
|
export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
36
54
|
#private;
|
|
37
55
|
readonly editor: PiShellEditorPort;
|
|
@@ -41,6 +59,8 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
41
59
|
readonly getColumns: () => number;
|
|
42
60
|
readonly getRows: () => number;
|
|
43
61
|
readonly requestRender: (force?: boolean) => void;
|
|
62
|
+
readonly onViewportFrame?: (frame: TranscriptViewportFrame) => void;
|
|
63
|
+
readonly enableDockInputReuse?: boolean;
|
|
44
64
|
readonly onSubmit: (text: string) => void;
|
|
45
65
|
readonly onInterrupt: () => void;
|
|
46
66
|
readonly onClear?: () => void;
|
|
@@ -70,6 +90,8 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
70
90
|
*/
|
|
71
91
|
applyTranscriptBlock(block: OwnedUiSessionViewModel["transcript"][number]): void;
|
|
72
92
|
render(width: number): readonly string[];
|
|
93
|
+
viewportFrameDescriptor(): TranscriptViewportFrameDescriptor | null;
|
|
94
|
+
hasActiveSelection(): boolean;
|
|
73
95
|
setViewportConfig(config: OwnedUiViewportSettings): void;
|
|
74
96
|
resumeViewportFollowing(): void;
|
|
75
97
|
noteCompletedAssistantMessage(): void;
|
|
@@ -99,7 +121,13 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
99
121
|
addExtensionNotification(message: string, type: "info" | "warning" | "error"): void;
|
|
100
122
|
extensionFooterData(): unknown;
|
|
101
123
|
usesDefaultInputSurface(): boolean;
|
|
102
|
-
|
|
124
|
+
inputCoordinationSurface(): PiTuiInputSurfaceKind;
|
|
125
|
+
viewportCompositionEvidence(): {
|
|
126
|
+
readonly full: number;
|
|
127
|
+
readonly dockOnly: number;
|
|
128
|
+
};
|
|
129
|
+
transcriptRenderCount(): number;
|
|
130
|
+
setInputSurface(component: PiShellComponentPort | null, disposePrevious?: boolean, coordination?: Exclude<PiTuiInputSurfaceKind, "editor">): void;
|
|
103
131
|
handleInput(data: string): void;
|
|
104
132
|
invalidate(): void;
|
|
105
133
|
setFocused(focused: boolean): void;
|