@timurproko/a1 0.1.8-dev.527 → 0.1.8-dev.536
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/session-shell/session-shell-root.d.ts +1 -0
- package/dist/app/session-shell/session-shell-root.js +3 -1
- package/dist/app/session-shell/session-shell.d.ts +1 -1
- package/dist/app/session-shell/session-shell.js +10 -4
- package/dist/composition/owned-ui.js +4 -3
- package/dist/composition/settings-route-host.d.ts +5 -9
- package/dist/composition/settings-route-host.js +2 -2
- package/dist/contracts/owned-ui/model.d.ts +4 -0
- package/dist/contracts/owned-ui/validation.js +25 -0
- package/dist/features/owned-ui/index.d.ts +1 -1
- package/dist/features/owned-ui/reference-screen-app.d.ts +9 -3
- package/dist/features/owned-ui/reference-screen-app.js +68 -20
- package/dist/features/owned-ui/settings-app.js +69 -24
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/integrations/pi/components/index.d.ts +3 -1
- package/dist/integrations/pi/components/index.js +2 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +9 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +10 -9
- package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +2 -2
- package/dist/integrations/pi/components/shell-hotkey-sections.d.ts +7 -0
- package/dist/integrations/pi/components/shell-hotkey-sections.js +29 -0
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +1 -0
- package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +0 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -7
- package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +8 -0
- package/dist/integrations/pi/components/thinking-selector-dialog.js +22 -0
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/daxnuts.js +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +2 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.js +22 -11
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +33 -0
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +140 -0
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +8 -1
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
- package/dist/integrations/pi/engine/adapter.js +1 -0
- package/dist/integrations/pi/engine/repository-pr.d.ts +8 -0
- package/dist/integrations/pi/engine/repository-pr.js +62 -0
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/session-runtime.d.ts +5 -0
- package/dist/integrations/pi/engine/session-runtime.js +60 -1
- package/dist/integrations/pi/engine/workflows.d.ts +1 -1
- package/dist/integrations/pi/engine/workflows.js +4 -2
- package/dist/integrations/pi/startup-public.js +43 -37
- package/dist/integrations/pi/startup-public.manifest.json +143 -142
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
- package/dist/native/darwin-arm64/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/product-identity.d.ts +1 -1
- package/dist/product-identity.js +1 -1
- package/dist/product-identity.json +1 -0
- package/dist/runtime-payload-inventory.json +2782 -2662
- package/dist/ui/components/index.d.ts +1 -1
- package/dist/ui/components/list-block.d.ts +10 -6
- package/dist/ui/components/list-block.js +28 -15
- package/dist/ui/components/list-view.d.ts +1 -1
- package/dist/ui/components/list-view.js +4 -2
- package/dist/ui/components/mouse.js +4 -2
- package/dist/ui/components/theme.d.ts +1 -5
- package/dist/ui/components/theme.js +0 -4
- package/dist/ui/components/value-menu.d.ts +3 -1
- package/dist/ui/components/value-menu.js +13 -5
- package/docs/local-worktree-cleanup.md +1 -1
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ import type { PiProjectTrustPreflightPrompt } from "./project-trust-preflight.js
|
|
|
4
4
|
import type { PiSessionForkPrompt, PiSessionSelection } from "./session-selection.js";
|
|
5
5
|
import type { OwnedUiDiagnostics } from "../../../contracts/owned-ui/index.js";
|
|
6
6
|
import type { PiSessionResumeMetadata, PiWorkflowHost } from "./workflows.js";
|
|
7
|
+
import { type PiPullRequestIdentity, type PiPullRequestProbe } from "./repository-pr.js";
|
|
7
8
|
export interface PiEngineRuntimeFactoryInput {
|
|
8
9
|
readonly cwd: string;
|
|
9
10
|
readonly agentDir: string;
|
|
@@ -25,6 +26,9 @@ export interface PiEngineRuntimeOptions {
|
|
|
25
26
|
readonly projectTrustPrompt: PiProjectTrustPreflightPrompt | undefined;
|
|
26
27
|
readonly createRuntime: PiEngineRuntimeFactory | undefined;
|
|
27
28
|
readonly checkPackageUpdates: PiEnginePackageUpdateProbe | undefined;
|
|
29
|
+
readonly pullRequestProbe?: PiPullRequestProbe;
|
|
30
|
+
readonly pullRequestRefreshMs?: number;
|
|
31
|
+
readonly gitBranchReader?: (cwd: string) => Promise<string | null>;
|
|
28
32
|
readonly host: PiWorkflowHost;
|
|
29
33
|
}
|
|
30
34
|
export interface PiEngineRuntimePorts {
|
|
@@ -62,6 +66,7 @@ export declare class PiEngineRuntime {
|
|
|
62
66
|
get bindingGeneration(): number;
|
|
63
67
|
get cwd(): string;
|
|
64
68
|
get gitBranch(): string | null;
|
|
69
|
+
get pullRequest(): PiPullRequestIdentity | null;
|
|
65
70
|
get sessionCommands(): PiSessionCommandIntegration | undefined;
|
|
66
71
|
get started(): boolean;
|
|
67
72
|
/** Create the runtime, bind its first session, and announce the changelog; startup failures propagate. */
|
|
@@ -6,7 +6,9 @@ import { observeCompactionProgress } from "./compaction-progress.js";
|
|
|
6
6
|
import { createPiRuntimeIntegration } from "./runtime-integration.js";
|
|
7
7
|
import { PiSessionCommandIntegration } from "./session-integration.js";
|
|
8
8
|
import { DefaultPackageManager, VERSION } from "../startup-public.js";
|
|
9
|
+
import { readOpenPullRequest, } from "./repository-pr.js";
|
|
9
10
|
const execFileAsync = promisify(execFile);
|
|
11
|
+
const PULL_REQUEST_REFRESH_MS = 60_000;
|
|
10
12
|
/**
|
|
11
13
|
* The pinned Pi runtime and the session bound to it: creation through the runtime factory, the
|
|
12
14
|
* session generation that stamps and invalidates events, the subscription that forwards session
|
|
@@ -18,6 +20,9 @@ export class PiEngineRuntime {
|
|
|
18
20
|
#ports;
|
|
19
21
|
#runtimeFactory;
|
|
20
22
|
#checkPackageUpdates;
|
|
23
|
+
#pullRequestProbe;
|
|
24
|
+
#pullRequestRefreshMs;
|
|
25
|
+
#gitBranchReader;
|
|
21
26
|
#cwd;
|
|
22
27
|
#runtime;
|
|
23
28
|
#session;
|
|
@@ -27,6 +32,10 @@ export class PiEngineRuntime {
|
|
|
27
32
|
#sessionCommands;
|
|
28
33
|
#compactionProgress = null;
|
|
29
34
|
#gitBranch = null;
|
|
35
|
+
#pullRequest = null;
|
|
36
|
+
#pullRequestTimer;
|
|
37
|
+
#pullRequestAbort;
|
|
38
|
+
#disposed = false;
|
|
30
39
|
constructor(options, ports) {
|
|
31
40
|
this.#options = options;
|
|
32
41
|
this.#ports = ports;
|
|
@@ -36,6 +45,9 @@ export class PiEngineRuntime {
|
|
|
36
45
|
?? (options.createRuntime
|
|
37
46
|
? async () => []
|
|
38
47
|
: settingsManager => checkDefaultPiPackageUpdates(this.#cwd, options.agentDir, settingsManager));
|
|
48
|
+
this.#pullRequestProbe = options.pullRequestProbe ?? readOpenPullRequest;
|
|
49
|
+
this.#pullRequestRefreshMs = options.pullRequestRefreshMs ?? PULL_REQUEST_REFRESH_MS;
|
|
50
|
+
this.#gitBranchReader = options.gitBranchReader ?? readGitBranch;
|
|
39
51
|
}
|
|
40
52
|
get runtime() {
|
|
41
53
|
return this.#runtime;
|
|
@@ -57,6 +69,9 @@ export class PiEngineRuntime {
|
|
|
57
69
|
get gitBranch() {
|
|
58
70
|
return this.#gitBranch;
|
|
59
71
|
}
|
|
72
|
+
get pullRequest() {
|
|
73
|
+
return this.#pullRequest;
|
|
74
|
+
}
|
|
60
75
|
get sessionCommands() {
|
|
61
76
|
return this.#sessionCommands;
|
|
62
77
|
}
|
|
@@ -76,7 +91,7 @@ export class PiEngineRuntime {
|
|
|
76
91
|
});
|
|
77
92
|
this.#runtime = runtime;
|
|
78
93
|
this.#cwd = runtime.cwd ?? this.#cwd;
|
|
79
|
-
this.#gitBranch = await
|
|
94
|
+
this.#gitBranch = await this.#gitBranchReader(this.#cwd);
|
|
80
95
|
this.#ports.started(runtime);
|
|
81
96
|
runtime.setRebindSession(async (session) => {
|
|
82
97
|
if (this.#ports.rebindBlocked())
|
|
@@ -89,6 +104,7 @@ export class PiEngineRuntime {
|
|
|
89
104
|
}
|
|
90
105
|
this.bindSession(runtime.session);
|
|
91
106
|
await this.#announceChangelog(runtime.services.settingsManager);
|
|
107
|
+
this.#startPullRequestRefresh();
|
|
92
108
|
return runtime;
|
|
93
109
|
}
|
|
94
110
|
/** Probe extension packages for updates after startup and report them as an informational diagnostic. */
|
|
@@ -184,12 +200,52 @@ export class PiEngineRuntime {
|
|
|
184
200
|
}
|
|
185
201
|
/** Unsubscribe, stop observing compaction, and dispose the runtime; the session reference is kept for final reads. */
|
|
186
202
|
async dispose() {
|
|
203
|
+
this.#disposed = true;
|
|
204
|
+
if (this.#pullRequestTimer !== undefined)
|
|
205
|
+
clearTimeout(this.#pullRequestTimer);
|
|
206
|
+
this.#pullRequestTimer = undefined;
|
|
207
|
+
this.#pullRequestAbort?.abort();
|
|
208
|
+
this.#pullRequestAbort = undefined;
|
|
187
209
|
this.#unsubscribe?.();
|
|
188
210
|
this.#unsubscribe = undefined;
|
|
189
211
|
this.#compactionProgress?.dispose();
|
|
190
212
|
this.#compactionProgress = null;
|
|
191
213
|
await this.#runtime?.dispose();
|
|
192
214
|
}
|
|
215
|
+
#startPullRequestRefresh() {
|
|
216
|
+
if (this.#gitBranch === null || this.#disposed || this.#ports.disposed())
|
|
217
|
+
return;
|
|
218
|
+
void this.#refreshPullRequest();
|
|
219
|
+
}
|
|
220
|
+
async #refreshPullRequest() {
|
|
221
|
+
const branch = this.#gitBranch;
|
|
222
|
+
if (branch === null || this.#pullRequestAbort !== undefined || this.#disposed || this.#ports.disposed())
|
|
223
|
+
return;
|
|
224
|
+
const controller = new AbortController();
|
|
225
|
+
this.#pullRequestAbort = controller;
|
|
226
|
+
let next = null;
|
|
227
|
+
try {
|
|
228
|
+
next = await this.#pullRequestProbe(this.#cwd, branch, controller.signal);
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
next = null;
|
|
232
|
+
}
|
|
233
|
+
finally {
|
|
234
|
+
if (this.#pullRequestAbort === controller)
|
|
235
|
+
this.#pullRequestAbort = undefined;
|
|
236
|
+
}
|
|
237
|
+
if (controller.signal.aborted || this.#disposed || this.#ports.disposed())
|
|
238
|
+
return;
|
|
239
|
+
if (!samePullRequest(this.#pullRequest, next)) {
|
|
240
|
+
this.#pullRequest = next;
|
|
241
|
+
this.#ports.emitView();
|
|
242
|
+
}
|
|
243
|
+
this.#pullRequestTimer = setTimeout(() => {
|
|
244
|
+
this.#pullRequestTimer = undefined;
|
|
245
|
+
void this.#refreshPullRequest();
|
|
246
|
+
}, this.#pullRequestRefreshMs);
|
|
247
|
+
this.#pullRequestTimer.unref?.();
|
|
248
|
+
}
|
|
193
249
|
#subscribe() {
|
|
194
250
|
const session = this.#session;
|
|
195
251
|
if (session === undefined)
|
|
@@ -237,6 +293,9 @@ async function checkDefaultPiPackageUpdates(cwd, agentDir, settingsManager) {
|
|
|
237
293
|
const updates = await packageManager.checkForAvailableUpdates();
|
|
238
294
|
return updates.map(update => update.displayName);
|
|
239
295
|
}
|
|
296
|
+
function samePullRequest(left, right) {
|
|
297
|
+
return left?.number === right?.number && left?.url === right?.url;
|
|
298
|
+
}
|
|
240
299
|
async function readGitBranch(cwd) {
|
|
241
300
|
try {
|
|
242
301
|
const { stdout } = await execFileAsync("git", ["branch", "--show-current"], { cwd, windowsHide: true });
|
|
@@ -14,7 +14,7 @@ export type PiHiddenWorkflowCommandName = typeof PINNED_PI_HIDDEN_COMMAND_NAMES[
|
|
|
14
14
|
export declare const OWNED_MODELS_COMMAND_NAME: "models";
|
|
15
15
|
export type OwnedModelsCommandName = typeof OWNED_MODELS_COMMAND_NAME;
|
|
16
16
|
export type OwnedWorkflowCommandName = Exclude<PiWorkflowCommandName, "model" | "scoped-models"> | OwnedModelsCommandName;
|
|
17
|
-
/** Bare A1's advertised
|
|
17
|
+
/** Bare A1's advertised catalog: `models` replaces the pinned pair and is followed by `thinking`. */
|
|
18
18
|
export declare const OWNED_WORKFLOW_COMMAND_NAMES: readonly OwnedWorkflowCommandName[];
|
|
19
19
|
export type PiProductMode = "bare" | "comparison";
|
|
20
20
|
/** The advertised command catalog for a product mode; hidden routes are shared by both. */
|
|
@@ -33,8 +33,10 @@ export const PINNED_PI_HIDDEN_COMMAND_NAMES = ["debug", "arminsayshi", "demented
|
|
|
33
33
|
export const PINNED_PI_DECLINED_COMMAND_NAMES = ["bug"];
|
|
34
34
|
/** The one bare-A1 model command; it replaces the pinned `model` and `scoped-models` routes there. */
|
|
35
35
|
export const OWNED_MODELS_COMMAND_NAME = "models";
|
|
36
|
-
/** Bare A1's advertised
|
|
37
|
-
export const OWNED_WORKFLOW_COMMAND_NAMES = Object.freeze(PINNED_PI_WORKFLOW_COMMAND_NAMES.flatMap((name) => name === "model"
|
|
36
|
+
/** Bare A1's advertised catalog: `models` replaces the pinned pair and is followed by `thinking`. */
|
|
37
|
+
export const OWNED_WORKFLOW_COMMAND_NAMES = Object.freeze(PINNED_PI_WORKFLOW_COMMAND_NAMES.flatMap((name) => name === "model"
|
|
38
|
+
? [OWNED_MODELS_COMMAND_NAME, "thinking"]
|
|
39
|
+
: name === "thinking" || name === "scoped-models" ? [] : [name]));
|
|
38
40
|
/** The advertised command catalog for a product mode; hidden routes are shared by both. */
|
|
39
41
|
export function workflowCommandNames(productMode) {
|
|
40
42
|
return productMode === "bare" ? OWNED_WORKFLOW_COMMAND_NAMES : PINNED_PI_WORKFLOW_COMMAND_NAMES;
|