@timurproko/a1 0.2.6-dev.734 → 0.2.6
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/index.d.ts +2 -2
- package/dist/app/session-shell/index.js +1 -1
- package/dist/app/session-shell/session-shell-root.d.ts +9 -1
- package/dist/app/session-shell/session-shell-root.js +56 -47
- package/dist/app/session-shell/session-shell.d.ts +37 -9
- package/dist/app/session-shell/session-shell.js +266 -446
- package/dist/app/session-shell/shell-host.d.ts +105 -0
- package/dist/app/session-shell/shell-host.js +523 -0
- package/dist/cli/session-context.js +6 -3
- package/dist/composition/owned-ui.js +45 -25
- package/dist/contracts/owned-ui/index.d.ts +1 -1
- package/dist/contracts/owned-ui/session-presenters.d.ts +35 -8
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/index.js +1 -1
- package/dist/features/launch/session-context.d.ts +1 -0
- package/dist/features/launch/session-context.js +1 -0
- package/dist/features/owned-ui/resources/release-notes.json +4 -0
- package/dist/features/owned-ui/settings-app.js +3 -3
- package/dist/foundation/lifecycle/index.d.ts +1 -1
- package/dist/foundation/lifecycle/index.js +1 -1
- package/dist/foundation/lifecycle/session-repository-context.d.ts +8 -2
- package/dist/foundation/lifecycle/session-repository-context.js +200 -65
- package/dist/foundation/release/cohort-state.js +5 -2
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +11 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +18 -2
- 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/ui/components/value-menu.d.ts +6 -3
- package/dist/ui/components/value-menu.js +6 -5
- package/docs/architecture/boundaries.md +1 -1
- package/docs/architecture/evidence/terminal-host-spike/manual-one-pane-terminal-host.md +70 -0
- package/docs/architecture/evidence/terminal-host-spike/manual-two-by-two-basic-terminal-host.md +32 -0
- package/docs/architecture/evidence/terminal-host-spike/milestone-baseline.json +115 -0
- package/docs/architecture/evidence/terminal-host-spike/owned-ui-foundation-prerequisite.json +48 -0
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-provenance.json +125 -0
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-1.json +56 -0
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-3.json +174 -0
- package/docs/architecture/evidence/terminal-host-spike/terminal-spike-acceptance-record.json +18 -0
- package/docs/architecture/terminal-host-proof-gate.md +1 -1
- package/docs/architecture/terminal-host-spike-evidence.md +1 -1
- package/docs/architecture/ui-reference-provenance.md +1 -1
- package/docs/releases/0.2.6.md +44 -0
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import { createPiSessionPresenters } from "../integrations/pi/session-presenters
|
|
|
12
12
|
import { ClipboardDiagnosticCapture } from "../app/session-shell/clipboard-diagnostics.js";
|
|
13
13
|
import { createOwnedUiClipboardServices } from "../app/session-shell/clipboard-services.js";
|
|
14
14
|
import { createPiKeybindingsHost } from "../integrations/pi/components/shell-shared-facade.js";
|
|
15
|
-
import {
|
|
15
|
+
import { OwnedUiSessionPresenter, OwnedUiTerminalHost, sessionTerminalHostOptions, } from "../app/session-shell/session-shell.js";
|
|
16
16
|
import { OwnedSettingsManager } from "../ui/settings/manager.js";
|
|
17
17
|
import { createPiTerminalBridge } from "../integrations/pi/tui-runtime/presentation-adapter.js";
|
|
18
18
|
import { createOwnedRouteHost } from "./settings-route-host.js";
|
|
@@ -28,7 +28,8 @@ export async function composeOwnedUi(options = {}) {
|
|
|
28
28
|
const sessionRuntimeId = ownedSurfaces ? process.env[PRODUCT_IDENTITY.environment.sessionRuntimeId] : undefined;
|
|
29
29
|
const inspectSessionProcess = options.inspectProcess;
|
|
30
30
|
let sessionRuntimeIdentity = null;
|
|
31
|
-
|
|
31
|
+
// Invariant: one entry per agent of this runtime; each agent holds its own claim, and the runtime's exit releases all.
|
|
32
|
+
const activeSessionIdentities = new Map();
|
|
32
33
|
let sessionRuntimeRefreshTimer = null;
|
|
33
34
|
let sessionRuntimeRefresh = Promise.resolve();
|
|
34
35
|
let sessionRuntimeDisposed = false;
|
|
@@ -39,19 +40,41 @@ export async function composeOwnedUi(options = {}) {
|
|
|
39
40
|
return await sessionRuntimeIdentity;
|
|
40
41
|
};
|
|
41
42
|
const queueSessionRuntimeRefresh = () => {
|
|
42
|
-
if (sessionRuntimeDisposed ||
|
|
43
|
+
if (sessionRuntimeDisposed || activeSessionIdentities.size === 0 || sessionRuntimeId === undefined || inspectSessionProcess === undefined)
|
|
43
44
|
return;
|
|
44
45
|
sessionRuntimeRefresh = sessionRuntimeRefresh.then(async () => {
|
|
45
|
-
|
|
46
|
-
if (sessionRuntimeDisposed || identity === null)
|
|
46
|
+
if (sessionRuntimeDisposed)
|
|
47
47
|
return;
|
|
48
48
|
const owner = await runtimeIdentity();
|
|
49
49
|
if (owner === null)
|
|
50
50
|
return;
|
|
51
51
|
const { registerSessionRepositoryRuntime } = await import("../foundation/lifecycle/session-repository-context.js");
|
|
52
|
-
|
|
52
|
+
for (const [agentId, identity] of activeSessionIdentities) {
|
|
53
|
+
if (sessionRuntimeDisposed)
|
|
54
|
+
return;
|
|
55
|
+
await registerSessionRepositoryRuntime(identity, sessionRuntimeId, owner, {
|
|
56
|
+
inspectProcess: inspectSessionProcess,
|
|
57
|
+
...(agentId === undefined ? {} : { agentId }),
|
|
58
|
+
}).catch(() => undefined);
|
|
59
|
+
}
|
|
53
60
|
}).catch(() => undefined);
|
|
54
61
|
};
|
|
62
|
+
/** The repository context reader for one agent; undefined names the primary agent, the only one composed today. */
|
|
63
|
+
const repositoryContextReaderFor = (agentId) => async (sessionId, sessionFile, signal) => {
|
|
64
|
+
const owner = await runtimeIdentity();
|
|
65
|
+
if (owner === null || sessionRuntimeId === undefined || inspectSessionProcess === undefined)
|
|
66
|
+
return null;
|
|
67
|
+
const identity = { sessionId, sessionFile };
|
|
68
|
+
activeSessionIdentities.set(agentId, identity);
|
|
69
|
+
const { activateSessionRepositoryContext } = await import("../foundation/lifecycle/session-repository-context.js");
|
|
70
|
+
const context = await activateSessionRepositoryContext(identity, sessionRuntimeId, owner, {
|
|
71
|
+
signal,
|
|
72
|
+
inspectProcess: inspectSessionProcess,
|
|
73
|
+
...(agentId === undefined ? {} : { agentId }),
|
|
74
|
+
});
|
|
75
|
+
armSessionRuntimeRefresh();
|
|
76
|
+
return context;
|
|
77
|
+
};
|
|
55
78
|
const armSessionRuntimeRefresh = () => {
|
|
56
79
|
if (sessionRuntimeRefreshTimer !== null)
|
|
57
80
|
return;
|
|
@@ -87,18 +110,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
87
110
|
try {
|
|
88
111
|
backend = await host.create({
|
|
89
112
|
cwd,
|
|
90
|
-
...(ownedSurfaces ? {
|
|
91
|
-
repositoryContextReader: async (sessionId, sessionFile, signal) => {
|
|
92
|
-
const owner = await runtimeIdentity();
|
|
93
|
-
if (owner === null || sessionRuntimeId === undefined || inspectSessionProcess === undefined)
|
|
94
|
-
return null;
|
|
95
|
-
activeSessionIdentity = { sessionId, sessionFile };
|
|
96
|
-
const { activateSessionRepositoryContext } = await import("../foundation/lifecycle/session-repository-context.js");
|
|
97
|
-
const context = await activateSessionRepositoryContext(activeSessionIdentity, sessionRuntimeId, owner, { signal, inspectProcess: inspectSessionProcess });
|
|
98
|
-
armSessionRuntimeRefresh();
|
|
99
|
-
return context;
|
|
100
|
-
},
|
|
101
|
-
} : {}),
|
|
113
|
+
...(ownedSurfaces ? { repositoryContextReader: repositoryContextReaderFor(undefined) } : {}),
|
|
102
114
|
...(options.sessionPath === undefined ? {} : { sessionPath: options.sessionPath }),
|
|
103
115
|
...(options.sessionSelection === undefined ? {} : { sessionSelection: options.sessionSelection }),
|
|
104
116
|
...(options.sessionForkPrompt === undefined ? {} : { sessionForkPrompt: options.sessionForkPrompt }),
|
|
@@ -140,7 +152,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
140
152
|
return { rows: width => renderPiShellChangelogLines(markdown, width).map(row => nativeHyperlinkStyle(row)) };
|
|
141
153
|
},
|
|
142
154
|
hotkeys: async () => {
|
|
143
|
-
const presentation =
|
|
155
|
+
const presentation = presenter.hotkeysPresentation();
|
|
144
156
|
const { renderPiShellHotkeySections } = await import("../integrations/pi/components/shell-hotkey-sections.js");
|
|
145
157
|
return { sections: width => renderPiShellHotkeySections(presentation, width) };
|
|
146
158
|
},
|
|
@@ -194,10 +206,12 @@ export async function composeOwnedUi(options = {}) {
|
|
|
194
206
|
// keybinding registry is applied before any presenter is built, so none of them reads Pi's defaults.
|
|
195
207
|
const keybindings = createPiKeybindingsHost({ profile: ownedSurfaces ? "a1" : "pi", agentDir: backend.identity.agentDir });
|
|
196
208
|
const clipboardServices = ownedSurfaces ? createOwnedUiClipboardServices() : null;
|
|
197
|
-
let
|
|
209
|
+
let createdTerminalHost;
|
|
210
|
+
let terminalHost;
|
|
211
|
+
let presenter;
|
|
198
212
|
let releaseNoteAcknowledgement = null;
|
|
199
213
|
try {
|
|
200
|
-
|
|
214
|
+
const presenterOptions = {
|
|
201
215
|
presenters: createPiSessionPresenters(backend),
|
|
202
216
|
engine: {
|
|
203
217
|
backend,
|
|
@@ -236,9 +250,15 @@ export async function composeOwnedUi(options = {}) {
|
|
|
236
250
|
...promptHistory,
|
|
237
251
|
editor: await import("../integrations/pi/components/history-editor-loader.js").then(module => module.loadHistoryEditor()),
|
|
238
252
|
} }),
|
|
239
|
-
}
|
|
253
|
+
};
|
|
254
|
+
// Invariant: one terminal host owns the process terminal; the session presenter reaches it only through
|
|
255
|
+
// the host and paints once attached.
|
|
256
|
+
terminalHost = createdTerminalHost = new OwnedUiTerminalHost(sessionTerminalHostOptions(presenterOptions));
|
|
257
|
+
presenter = new OwnedUiSessionPresenter(terminalHost, presenterOptions);
|
|
258
|
+
terminalHost.attach(presenter);
|
|
240
259
|
}
|
|
241
260
|
catch (error) {
|
|
261
|
+
await createdTerminalHost?.dispose().catch(() => undefined);
|
|
242
262
|
unsubscribeAccent();
|
|
243
263
|
await releaseNoteClaim?.release();
|
|
244
264
|
clipboardDiagnostics?.dispose();
|
|
@@ -273,14 +293,14 @@ export async function composeOwnedUi(options = {}) {
|
|
|
273
293
|
if (exitNoticePath)
|
|
274
294
|
exitNotice = import("../app/session-shell/exit-notice.js")
|
|
275
295
|
.then(module => module.armExitNotice(backend, exitNoticePath), () => null);
|
|
276
|
-
|
|
296
|
+
presenter.start();
|
|
277
297
|
void announceNewerRelease().catch(() => undefined);
|
|
278
298
|
},
|
|
279
299
|
flush: () => backend.session.flushEvents(),
|
|
280
|
-
waitUntilStopped: () =>
|
|
300
|
+
waitUntilStopped: () => presenter.waitUntilStopped(),
|
|
281
301
|
dispose: async () => {
|
|
282
302
|
try {
|
|
283
|
-
await
|
|
303
|
+
await terminalHost.dispose();
|
|
284
304
|
// Invariant: cleared only once the terminal is restored; a failed dispose leaves it armed.
|
|
285
305
|
(await exitNotice)?.clear();
|
|
286
306
|
await releaseNoteAcknowledgement?.catch(() => undefined);
|
|
@@ -5,7 +5,7 @@ export type { OwnedUiExtensionAutocompleteItem, OwnedUiExtensionAutocompleteProv
|
|
|
5
5
|
export { OWNED_UI_CONTRACT_VERSION } from "./model.js";
|
|
6
6
|
export type { OwnedUiBackgroundSettingsPort, OwnedUiBackgroundStyle, OwnedUiBlockStatus, OwnedUiCommand, OwnedUiCommandOutcome, OwnedUiCorrelationId, OwnedUiCustomization, OwnedUiDiagnostics, OwnedUiDialog, OwnedUiEditorState, OwnedUiEntityId, OwnedUiEvent, OwnedUiFooterView, OwnedUiImageAttachment, OwnedUiLifecycle, OwnedUiModelInfo, OwnedUiOverlay, OwnedUiPromptSuggestionGeneratorPort, OwnedUiPromptSuggestionIdentity, OwnedUiPromptSuggestionReasoning, OwnedUiPromptSuggestionRequest, OwnedUiPromptSuggestionResult, OwnedUiPromptSuggestionState, OwnedUiQuitOutroSettings, OwnedUiQuitOutroSettingsPort, OwnedUiSessionId, OwnedUiSessionViewModel, OwnedUiSeverity, OwnedUiSlotId, OwnedUiSnapshot, OwnedUiStatusView, OwnedUiTerminalSurface, OwnedUiThinkingLevel, OwnedUiToolRendering, OwnedUiToolResultPart, OwnedUiToolState, OwnedUiTranscriptBlock, OwnedUiTranscriptBlockKind, OwnedUiTranscriptImageReference, OwnedUiUsageView, OwnedUiViewportSettings, OwnedUiViewportSettingsPort, } from "./model.js";
|
|
7
7
|
export type { OwnedUiExtensionPort, OwnedUiSessionBackend, OwnedUiSessionCatalogPort, OwnedUiSessionFactory, OwnedUiSessionIdentityPort, OwnedUiSessionPort, OwnedUiSessionRequest, OwnedUiSessionSettingsPort, OwnedUiWorkflowPort, } from "./session-backend.js";
|
|
8
|
-
export type { OwnedUiDialogHost, OwnedUiInputSurface, OwnedUiSessionPresenters, OwnedUiShortcutDescription, OwnedUiTranscriptRendererPort, } from "./session-presenters.js";
|
|
8
|
+
export type { OwnedUiDialogHost, OwnedUiInputSurface, OwnedUiPresenterHost, OwnedUiSessionPresenter, OwnedUiSessionPresenters, OwnedUiShortcutDescription, OwnedUiTerminalHost, OwnedUiTranscriptRendererPort, } from "./session-presenters.js";
|
|
9
9
|
export { OWNED_UI_HIDDEN_COMMAND_NAMES, OWNED_UI_MODELS_COMMAND_NAME, OWNED_UI_WORKFLOW_COMMAND_NAMES, } from "./session-workflows.js";
|
|
10
10
|
export type { OwnedUiAmbientAuthentication, OwnedUiAuthenticationProviderOption, OwnedUiAuthenticationProviderStatus, OwnedUiBashWorkflowResult, OwnedUiCacheWarmingPresentation, OwnedUiCommandResult, OwnedUiExtensionResourceSummary, OwnedUiExtensionSourceSummary, OwnedUiHiddenWorkflowCommandName, OwnedUiJsonValue, OwnedUiModelsCommandName, OwnedUiModelsContext, OwnedUiModelsRefreshResult, OwnedUiProjectTrustContext, OwnedUiProjectTrustUpdate, OwnedUiReleaseUpdate, OwnedUiResourceSummary, OwnedUiScopedModelDescriptor, OwnedUiScopedModelsContext, OwnedUiScopedModelsRefreshResult, OwnedUiSessionInfoPresentation, OwnedUiSessionProductMode, OwnedUiSessionResumeMetadata, OwnedUiSessionSettingKey, OwnedUiSessionSettingsSnapshot, OwnedUiSettingEffectHandler, OwnedUiSettingOwner, OwnedUiSettingOwnerHandlers, OwnedUiSettingsThinkingLevel, OwnedUiVisualExtensionSupport, OwnedUiWorkflowAutocompleteCommand, OwnedUiWorkflowCommandName, OwnedUiWorkflowInteractionHost, OwnedUiWorkflowInteractionRequest, OwnedUiWorkflowLoginNotification, OwnedUiWorkflowLoginStart, OwnedUiWorkflowMessage, OwnedUiWorkflowMessageKind, OwnedUiWorkflowOption, OwnedUiWorkflowOutcome, OwnedUiWorkflowPresentation, OwnedUiWorkflowRequest, OwnedUiWorkflowResult, OwnedUiWorkflowRoute, } from "./session-workflows.js";
|
|
11
11
|
export { acceptsTranscriptUpdate, transcriptToolState } from "./transcript-lifecycle.js";
|
|
@@ -11,21 +11,48 @@ export interface OwnedUiInputSurface {
|
|
|
11
11
|
setFocused?(focused: boolean): void;
|
|
12
12
|
dispose?(): void;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
requestRender(): void;
|
|
14
|
+
/**
|
|
15
|
+
* The terminal as one session presenter sees it. A render request from a presenter that is not the host's
|
|
16
|
+
* active presenter paints nothing; the presenter keeps its state current and paints once it is attached.
|
|
17
|
+
*/
|
|
18
|
+
export interface OwnedUiPresenterHost {
|
|
19
|
+
requestRender(force?: boolean): void;
|
|
20
20
|
viewport(): {
|
|
21
21
|
readonly columns: number;
|
|
22
22
|
readonly rows: number;
|
|
23
23
|
};
|
|
24
|
+
/** Present only where the shell holds frames while an optional selector module loads. */
|
|
25
|
+
beginPresentationHold?(): () => void;
|
|
26
|
+
}
|
|
27
|
+
/** One engine session's presentation: its transcript, editor, controllers, and dialogs, and nothing terminal-wide. */
|
|
28
|
+
export interface OwnedUiSessionPresenter {
|
|
29
|
+
render(width: number): readonly string[];
|
|
30
|
+
handleInput(data: string): void;
|
|
31
|
+
invalidate(): void;
|
|
32
|
+
setFocused(focused: boolean): void;
|
|
33
|
+
start(): void;
|
|
34
|
+
waitUntilStopped(): Promise<void>;
|
|
35
|
+
dispose(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/** Owns the process terminal and shows exactly one active presenter. */
|
|
38
|
+
export interface OwnedUiTerminalHost<Presenter extends OwnedUiSessionPresenter = OwnedUiSessionPresenter> {
|
|
39
|
+
/** Makes the presenter active; its first frame is a full paint. */
|
|
40
|
+
attach(presenter: Presenter): void;
|
|
41
|
+
active(): Presenter | null;
|
|
42
|
+
/** No-op unless `from` is the active presenter. */
|
|
43
|
+
requestRender(from: Presenter, force?: boolean): void;
|
|
44
|
+
start(): void;
|
|
45
|
+
/** Ends the terminal: every presenter is released, the quit presentation plays, and the terminal is restored. */
|
|
46
|
+
dispose(): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
/** The shell's side of a presenter: where the selector is shown and how its choices reach the session. */
|
|
49
|
+
export interface OwnedUiDialogHost extends OwnedUiPresenterHost {
|
|
50
|
+
/** True once the shell is disposed; a presenter that awaited stops before showing anything. */
|
|
51
|
+
readonly disposed: boolean;
|
|
52
|
+
setInputSurface(surface: OwnedUiInputSurface | null): void;
|
|
24
53
|
appendWorkflowStatus(text: string): void;
|
|
25
54
|
appendWorkflowResult(result: OwnedUiWorkflowResult): void;
|
|
26
55
|
runWorkflow(request: OwnedUiWorkflowRequest): Promise<OwnedUiCommandResult>;
|
|
27
|
-
/** Present only where the shell holds frames while an optional selector module loads. */
|
|
28
|
-
beginPresentationHold?(): () => void;
|
|
29
56
|
/** Present only where the surface can change TUI mode; false means overlays block the switch. */
|
|
30
57
|
switchTuiMode?(mode: "regular" | "fullscreen"): boolean;
|
|
31
58
|
}
|
|
@@ -8,7 +8,7 @@ export { configurationRootForProfile, resolveLaunchProfilePaths, resolvePromptHi
|
|
|
8
8
|
export type { LaunchProfilePathOptions, LaunchProfilePaths } from "./profile-paths.js";
|
|
9
9
|
export { prepareInteractiveLaunch } from "./prepare-launch.js";
|
|
10
10
|
export type { PrepareInteractiveLaunchOptions, PreparedInteractiveLaunch } from "./prepare-launch.js";
|
|
11
|
-
export { updateSessionRepositoryContext } from "./session-context.js";
|
|
11
|
+
export { PRIMARY_SESSION_AGENT_ID, updateSessionRepositoryContext } from "./session-context.js";
|
|
12
12
|
export type { SessionContextOutcome, SessionContextRequest, SessionContextRuntime } from "./session-context.js";
|
|
13
13
|
export { runSelectedInteractiveRuntime, selectInteractiveRuntime } from "./runtime-selection.js";
|
|
14
14
|
export type { InteractiveRuntimeRunners, InteractiveRuntimeSelection, OwnedUiProfileId } from "./runtime-selection.js";
|
|
@@ -3,5 +3,5 @@ export { PI_PROFILE_RESOURCE_DIRECTORIES, initializeProductProfile } from "./ini
|
|
|
3
3
|
export { interactiveLaunchIntent, parseSessionSelection } from "./intent.js";
|
|
4
4
|
export { configurationRootForProfile, resolveLaunchProfilePaths, resolvePromptHistoryDataDir } from "./profile-paths.js";
|
|
5
5
|
export { prepareInteractiveLaunch } from "./prepare-launch.js";
|
|
6
|
-
export { updateSessionRepositoryContext } from "./session-context.js";
|
|
6
|
+
export { PRIMARY_SESSION_AGENT_ID, updateSessionRepositoryContext } from "./session-context.js";
|
|
7
7
|
export { runSelectedInteractiveRuntime, selectInteractiveRuntime } from "./runtime-selection.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type NativeProcessIdentity, type SessionRepositoryIdentity, type SessionWorktreeInventoryEntry } from "../../foundation/lifecycle/index.js";
|
|
2
|
+
export { PRIMARY_SESSION_AGENT_ID } from "../../foundation/lifecycle/index.js";
|
|
2
3
|
export type SessionContextRequest = {
|
|
3
4
|
readonly action: "link-worktree";
|
|
4
5
|
readonly path: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { clearSessionRepositoryContext, listSessionRepositoryWorktrees, setSessionRepositoryContext, } from "../../foundation/lifecycle/index.js";
|
|
2
|
+
export { PRIMARY_SESSION_AGENT_ID } from "../../foundation/lifecycle/index.js";
|
|
2
3
|
export async function updateSessionRepositoryContext(identity, request, runtime) {
|
|
3
4
|
const options = { runtimeId: runtime.runtimeId, inspectProcess: runtime.inspectProcess };
|
|
4
5
|
if (request.action === "unlink-worktree") {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "a1-release-notes-v1",
|
|
3
3
|
"releases": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.2.6",
|
|
6
|
+
"markdown": "## [0.2.6] - 2026-10-10\n\n### New Features\n\n- customize the UI accent ([#718](https://github.com/timurproko/a1/pull/718))\n- allow concurrent worktree cleanup ([#725](https://github.com/timurproko/a1/pull/725))\n- add background appearance options ([#738](https://github.com/timurproko/a1/pull/738))\n\n### Changed\n\n- optimize Windows release validation ([#705](https://github.com/timurproko/a1/pull/705))\n- allow human auto-merge ([#711](https://github.com/timurproko/a1/pull/711))\n- remove disposable root links ([#713](https://github.com/timurproko/a1/pull/713))\n- upgrade pinned Pi to 1.1.0 ([#715](https://github.com/timurproko/a1/pull/715))\n- align menu and input counters ([#726](https://github.com/timurproko/a1/pull/726))\n- narrow the session backend port ([#730](https://github.com/timurproko/a1/pull/730))\n- extract session presenters owner ([#731](https://github.com/timurproko/a1/pull/731))\n- share helper pools and keybindings per process ([#733](https://github.com/timurproko/a1/pull/733))\n- introduce a process-level engine host ([#734](https://github.com/timurproko/a1/pull/734))\n- split the terminal host from the session presenter ([#735](https://github.com/timurproko/a1/pull/735))\n- key worktree claims by agent ([#736](https://github.com/timurproko/a1/pull/736))\n- follow the menu opening on the value in effect ([#752](https://github.com/timurproko/a1/pull/752))\n\n### Fixed\n\n- distinguish changelog titles ([#707](https://github.com/timurproko/a1/pull/707))\n- route release reopening validation ([#708](https://github.com/timurproko/a1/pull/708))\n- preserve resume row colors ([#709](https://github.com/timurproko/a1/pull/709))\n- prevent selector opening flash ([#710](https://github.com/timurproko/a1/pull/710))\n- recover missing generation ([#712](https://github.com/timurproko/a1/pull/712))\n- support standalone documentation ([#716](https://github.com/timurproko/a1/pull/716))\n- prevent prompt selection flash ([#719](https://github.com/timurproko/a1/pull/719))\n- simplify value feedback ([#720](https://github.com/timurproko/a1/pull/720))\n- keep final validation on PR ([#721](https://github.com/timurproko/a1/pull/721))\n- make tree selection full width ([#722](https://github.com/timurproko/a1/pull/722))\n- allow selection across progress spinner ([#727](https://github.com/timurproko/a1/pull/727))\n- order session shell construction and teardown ([#732](https://github.com/timurproko/a1/pull/732))\n- disambiguate same-name path chips ([#737](https://github.com/timurproko/a1/pull/737))\n- distinguish brand blue accent ([#739](https://github.com/timurproko/a1/pull/739))\n- open value menus with Enter ([#740](https://github.com/timurproko/a1/pull/740))\n- hide refreshed model status ([#741](https://github.com/timurproko/a1/pull/741))\n- open value menus over their anchor ([#742](https://github.com/timurproko/a1/pull/742))\n- recognize method-specific auto-merge enables ([#743](https://github.com/timurproko/a1/pull/743))\n- retry Windows lock release contention ([#753](https://github.com/timurproko/a1/pull/753))\n"
|
|
7
|
+
},
|
|
4
8
|
{
|
|
5
9
|
"version": "0.2.5",
|
|
6
10
|
"markdown": "## [0.2.5] - 2026-10-07\n\n### New Features\n\n- show session info full screen ([#680](https://github.com/timurproko/a1/pull/680))\n- redesign session tree dialog ([#682](https://github.com/timurproko/a1/pull/682))\n- add name command input dialog ([#694](https://github.com/timurproko/a1/pull/694))\n\n### Changed\n\n- refine animated separator ([#681](https://github.com/timurproko/a1/pull/681))\n- upgrade pinned Pi to 1.0.4 ([#683](https://github.com/timurproko/a1/pull/683))\n- unify selection treatment ([#686](https://github.com/timurproko/a1/pull/686))\n- align project trust dialogs ([#687](https://github.com/timurproko/a1/pull/687))\n- standardize share dialog ([#689](https://github.com/timurproko/a1/pull/689))\n- align Resume Session dialog ([#693](https://github.com/timurproko/a1/pull/693))\n- unify dialog close hints ([#695](https://github.com/timurproko/a1/pull/695))\n- accent model scope markers ([#696](https://github.com/timurproko/a1/pull/696))\n\n### Fixed\n\n- wrap session file after label ([#684](https://github.com/timurproko/a1/pull/684))\n- align thinking markers with models ([#685](https://github.com/timurproko/a1/pull/685))\n- place new-session notice above prompt ([#688](https://github.com/timurproko/a1/pull/688))\n- close dialogs with Ctrl+C ([#690](https://github.com/timurproko/a1/pull/690))\n- restore suggestion after Backspace ([#691](https://github.com/timurproko/a1/pull/691))\n- cycle dialog filters backward ([#692](https://github.com/timurproko/a1/pull/692))\n- avoid initial value-menu highlight ([#697](https://github.com/timurproko/a1/pull/697))\n- keep session root expanded ([#698](https://github.com/timurproko/a1/pull/698))\n- hide skill prefixes in collapsed menu ([#699](https://github.com/timurproko/a1/pull/699))\n- omit space after command completion ([#700](https://github.com/timurproko/a1/pull/700))\n- stabilize values and add undo ([#701](https://github.com/timurproko/a1/pull/701))\n- standardize typing search hints ([#702](https://github.com/timurproko/a1/pull/702))\n- show tree time toggle state ([#703](https://github.com/timurproko/a1/pull/703))\n- refine resume search hints ([#704](https://github.com/timurproko/a1/pull/704))\n"
|
|
@@ -470,15 +470,15 @@ export class SettingsApp {
|
|
|
470
470
|
this.#hoverKey = anchorKey;
|
|
471
471
|
this.#hoverRegion = "value";
|
|
472
472
|
}
|
|
473
|
-
// Invariant:
|
|
474
|
-
//
|
|
473
|
+
// Invariant: the menu lays the value in effect over its source row, so both a press on
|
|
474
|
+
// that value and Enter start on it: the pointer is already resting on that entry.
|
|
475
475
|
this.#menu = {
|
|
476
476
|
entry,
|
|
477
477
|
current,
|
|
478
478
|
anchorKey,
|
|
479
479
|
choices: entry.choices,
|
|
480
480
|
keyboardOpened: selectCurrent,
|
|
481
|
-
index:
|
|
481
|
+
index: current,
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
484
|
#closeMenu(menu) {
|
|
@@ -7,7 +7,7 @@ export { resolveCohortEndpoint, resolveProductPaths } from "./paths.js";
|
|
|
7
7
|
export type { CohortEndpointPaths, ProductPaths } from "./paths.js";
|
|
8
8
|
export { parseSessionSelection, sessionSelectionArguments } from "./session-selection.js";
|
|
9
9
|
export type { SessionSelection } from "./session-selection.js";
|
|
10
|
-
export { activateSessionRepositoryContext, clearSessionRepositoryContext, listSessionRepositoryWorktrees, readSessionRepositoryContext, registerSessionRepositoryRuntime, releaseSessionRepositoryRuntime, setSessionRepositoryContext, } from "./session-repository-context.js";
|
|
10
|
+
export { PRIMARY_SESSION_AGENT_ID, activateSessionRepositoryContext, clearSessionRepositoryContext, listSessionRepositoryWorktrees, readSessionRepositoryContext, registerSessionRepositoryRuntime, releaseSessionRepositoryRuntime, setSessionRepositoryContext, } from "./session-repository-context.js";
|
|
11
11
|
export type { SessionRepositoryContext, SessionRepositoryContextOptions, SessionRepositoryIdentity, SessionWorktreeInventoryEntry, SessionWorktreeStatus, } from "./session-repository-context.js";
|
|
12
12
|
export { createSupervisorStartupAttempt, publishSupervisorStartupResult, readSupervisorStartupResult, supervisorStartupFailure, supervisorStartupReady, supervisorStartupResultPath, } from "./supervisor-startup.js";
|
|
13
13
|
export type { SupervisorStartupAttemptIdentity, SupervisorStartupResult } from "./supervisor-startup.js";
|
|
@@ -2,5 +2,5 @@ export { assertLaunchInstance, assertLaunchInstanceOutcome, assertLaunchInstance
|
|
|
2
2
|
export { assertDimensions, assertLaunchProfileId, assertNativeProcessIdentity, assertTransparentTerminalLaunchProfile } from "./model.js";
|
|
3
3
|
export { resolveCohortEndpoint, resolveProductPaths } from "./paths.js";
|
|
4
4
|
export { parseSessionSelection, sessionSelectionArguments } from "./session-selection.js";
|
|
5
|
-
export { activateSessionRepositoryContext, clearSessionRepositoryContext, listSessionRepositoryWorktrees, readSessionRepositoryContext, registerSessionRepositoryRuntime, releaseSessionRepositoryRuntime, setSessionRepositoryContext, } from "./session-repository-context.js";
|
|
5
|
+
export { PRIMARY_SESSION_AGENT_ID, activateSessionRepositoryContext, clearSessionRepositoryContext, listSessionRepositoryWorktrees, readSessionRepositoryContext, registerSessionRepositoryRuntime, releaseSessionRepositoryRuntime, setSessionRepositoryContext, } from "./session-repository-context.js";
|
|
6
6
|
export { createSupervisorStartupAttempt, publishSupervisorStartupResult, readSupervisorStartupResult, supervisorStartupFailure, supervisorStartupReady, supervisorStartupResultPath, } from "./supervisor-startup.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { NativeProcessIdentity } from "./model.js";
|
|
2
|
+
/** Records without an agent id were written by a single-agent release and belong to its one agent. */
|
|
3
|
+
export declare const PRIMARY_SESSION_AGENT_ID = "primary";
|
|
2
4
|
export interface SessionRepositoryIdentity {
|
|
3
5
|
readonly sessionId: string;
|
|
4
6
|
readonly sessionFile: string;
|
|
@@ -10,20 +12,24 @@ export interface SessionRepositoryContext {
|
|
|
10
12
|
export type SessionWorktreeStatus = "current" | "busy" | "available" | "unverifiable";
|
|
11
13
|
export interface SessionWorktreeInventoryEntry extends SessionRepositoryContext {
|
|
12
14
|
readonly status: SessionWorktreeStatus;
|
|
15
|
+
/** Agent holding the claim within its runtime; null when the worktree is unclaimed or unverifiable. */
|
|
16
|
+
readonly agentId: string | null;
|
|
13
17
|
}
|
|
14
18
|
export interface SessionRepositoryContextOptions {
|
|
15
19
|
readonly dataDir?: string;
|
|
16
20
|
readonly signal?: AbortSignal;
|
|
17
21
|
readonly runtimeId?: string;
|
|
22
|
+
/** Agent within the runtime that owns the claim; defaults to the primary agent. */
|
|
23
|
+
readonly agentId?: string;
|
|
18
24
|
readonly runtimeIdentity?: NativeProcessIdentity;
|
|
19
25
|
readonly inspectProcess?: (pid: number) => Promise<NativeProcessIdentity | null>;
|
|
20
26
|
readonly lockTimeoutMs?: number;
|
|
21
27
|
}
|
|
22
28
|
/** Publish the exact live runtime that may acquire a delivery worktree. */
|
|
23
29
|
export declare function registerSessionRepositoryRuntime(identity: SessionRepositoryIdentity, runtimeId: string, runtimeIdentity: NativeProcessIdentity, options?: SessionRepositoryContextOptions): Promise<void>;
|
|
24
|
-
/** Revalidate a durable association and acquire its live claim for this runtime. */
|
|
30
|
+
/** Revalidate a durable association and acquire its live claim for this runtime's agent; sibling agents' claims stay. */
|
|
25
31
|
export declare function activateSessionRepositoryContext(identity: SessionRepositoryIdentity, runtimeId: string, runtimeIdentity: NativeProcessIdentity, options?: SessionRepositoryContextOptions): Promise<SessionRepositoryContext | null>;
|
|
26
|
-
/** Release
|
|
32
|
+
/** Release every agent's cooperative editing claims held by this exact runtime generation. */
|
|
27
33
|
export declare function releaseSessionRepositoryRuntime(runtimeId: string, runtimeIdentity: NativeProcessIdentity, options?: SessionRepositoryContextOptions): Promise<void>;
|
|
28
34
|
/** Persist one explicit same-repository worktree association after atomically claiming it. */
|
|
29
35
|
export declare function setSessionRepositoryContext(identity: SessionRepositoryIdentity, worktreePath: string, options?: SessionRepositoryContextOptions): Promise<SessionRepositoryContext>;
|