@timurproko/a1 0.1.8-dev.528 → 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.
Files changed (101) hide show
  1. package/dist/app/session-shell/session-shell-root.d.ts +1 -0
  2. package/dist/app/session-shell/session-shell-root.js +3 -1
  3. package/dist/app/session-shell/session-shell.d.ts +1 -1
  4. package/dist/app/session-shell/session-shell.js +10 -4
  5. package/dist/composition/owned-ui.js +4 -3
  6. package/dist/composition/settings-route-host.d.ts +5 -9
  7. package/dist/composition/settings-route-host.js +2 -2
  8. package/dist/contracts/owned-ui/model.d.ts +4 -0
  9. package/dist/contracts/owned-ui/validation.js +25 -0
  10. package/dist/features/owned-ui/index.d.ts +1 -1
  11. package/dist/features/owned-ui/reference-screen-app.d.ts +9 -3
  12. package/dist/features/owned-ui/reference-screen-app.js +68 -20
  13. package/dist/features/owned-ui/settings-app.js +69 -24
  14. package/dist/foundation/startup/startup-descriptor.js +2 -2
  15. package/dist/integrations/pi/components/index.d.ts +3 -1
  16. package/dist/integrations/pi/components/index.js +2 -1
  17. package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +9 -1
  18. package/dist/integrations/pi/components/shell-editor-autocomplete.js +10 -9
  19. package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
  20. package/dist/integrations/pi/components/shell-footer-status.js +2 -2
  21. package/dist/integrations/pi/components/shell-hotkey-sections.d.ts +7 -0
  22. package/dist/integrations/pi/components/shell-hotkey-sections.js +29 -0
  23. package/dist/integrations/pi/components/shell-presenters-info.d.ts +1 -0
  24. package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
  25. package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +0 -1
  26. package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -7
  27. package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +8 -0
  28. package/dist/integrations/pi/components/thinking-selector-dialog.js +22 -0
  29. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  30. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  31. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  32. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  33. package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +1 -1
  34. package/dist/integrations/pi/components/upstream/components/daxnuts.js +1 -1
  35. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  36. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +2 -1
  37. package/dist/integrations/pi/components/upstream/components/extension-editor.js +7 -2
  38. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  39. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  40. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  41. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  42. package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +2 -1
  43. package/dist/integrations/pi/components/upstream/components/session-footer.js +22 -11
  44. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  45. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  46. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  47. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  48. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  49. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  50. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +33 -0
  51. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +140 -0
  52. package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
  53. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  54. package/dist/integrations/pi/components/upstream/components/tree-selector.js +8 -1
  55. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  56. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  57. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
  58. package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
  59. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  60. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  61. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  62. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  63. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  64. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  65. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  66. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  67. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  68. package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
  69. package/dist/integrations/pi/engine/adapter.js +1 -0
  70. package/dist/integrations/pi/engine/repository-pr.d.ts +8 -0
  71. package/dist/integrations/pi/engine/repository-pr.js +62 -0
  72. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  73. package/dist/integrations/pi/engine/session-runtime.d.ts +5 -0
  74. package/dist/integrations/pi/engine/session-runtime.js +60 -1
  75. package/dist/integrations/pi/engine/workflow-support.js +3 -1
  76. package/dist/integrations/pi/engine/workflows.d.ts +1 -1
  77. package/dist/integrations/pi/engine/workflows.js +4 -2
  78. package/dist/integrations/pi/startup-public.js +63 -56
  79. package/dist/integrations/pi/startup-public.manifest.json +200 -169
  80. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  81. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  82. package/dist/native/darwin-arm64/manifest.json +1 -1
  83. package/dist/native/linux-x64/manifest.json +1 -1
  84. package/dist/native/win32-x64/manifest.json +2 -2
  85. package/dist/native/win32-x64/process-guardian.exe +0 -0
  86. package/dist/product-identity.d.ts +1 -1
  87. package/dist/product-identity.js +1 -1
  88. package/dist/product-identity.json +1 -0
  89. package/dist/runtime-payload-inventory.json +2948 -2646
  90. package/dist/ui/components/index.d.ts +1 -1
  91. package/dist/ui/components/list-block.d.ts +10 -6
  92. package/dist/ui/components/list-block.js +28 -15
  93. package/dist/ui/components/list-view.d.ts +1 -1
  94. package/dist/ui/components/list-view.js +4 -2
  95. package/dist/ui/components/mouse.js +4 -2
  96. package/dist/ui/components/theme.d.ts +1 -5
  97. package/dist/ui/components/theme.js +0 -4
  98. package/dist/ui/components/value-menu.d.ts +3 -1
  99. package/dist/ui/components/value-menu.js +13 -5
  100. package/docs/local-worktree-cleanup.md +1 -1
  101. 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 readGitBranch(this.#cwd);
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 });
@@ -6,7 +6,8 @@ import { dynamicObject, finiteNumber, isRecord, stringProperty, stringValue } fr
6
6
  import { copyToClipboard } from "../startup-public.js";
7
7
  const execFileAsync = promisify(execFile);
8
8
  export const AUTH_REFRESH_TIMEOUT_MS = 15_000;
9
- // Provenance: Pi 0.84.2 core/model-resolver.ts defaultModelPerProvider.
9
+ // Provenance: the pinned engine's core/model-resolver.ts defaultModelPerProvider, which every
10
+ // upgrade that adds a provider extends; the version this mirrors is the pin, not one named here.
10
11
  export const PINNED_DEFAULT_MODEL_BY_PROVIDER = Object.freeze({
11
12
  "amazon-bedrock": "us.anthropic.claude-opus-4-6-v1",
12
13
  "ant-ling": "Ring-2.6-1T",
@@ -27,6 +28,7 @@ export const PINNED_DEFAULT_MODEL_BY_PROVIDER = Object.freeze({
27
28
  cerebras: "zai-glm-4.7",
28
29
  zai: "glm-5.1",
29
30
  "zai-coding-cn": "glm-5.1",
31
+ meta: "muse-spark-1.3",
30
32
  mistral: "devstral-medium-latest",
31
33
  minimax: "MiniMax-M2.7",
32
34
  "minimax-cn": "MiniMax-M2.7",
@@ -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 command catalog: the pinned catalog with `models` in place of `model` and `scoped-models`. */
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 command catalog: the pinned catalog with `models` in place of `model` and `scoped-models`. */
37
- export const OWNED_WORKFLOW_COMMAND_NAMES = Object.freeze(PINNED_PI_WORKFLOW_COMMAND_NAMES.flatMap((name) => name === "model" ? [OWNED_MODELS_COMMAND_NAME] : name === "scoped-models" ? [] : [name]));
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;