pi-note 0.33.2 → 0.33.4

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/README.md CHANGED
@@ -90,18 +90,13 @@ client-local and is never sent to the service or persisted as launch state.
90
90
  Only a fresh session can consume it. The service must share the GUI's database;
91
91
  missing/stale revisions fail closed. Resume, reload and `/new` never replay the
92
92
  handoff or replace another selection. Pi keeps its normal endpoint/token settings.
93
- With pi-note 0.33.1+, completing the launched task from the menu, footer or
94
- **Complete task and exit** runs `git pull --ff-only --no-rebase --no-autostash` in
95
- Pi's working directory before exiting, so Kitty closes its dedicated tab (or the
96
- standalone window's last tab). It never merges, rebases or stashes local changes.
97
- If Git fails, times out (30 seconds), or the session/draft changes, Pi stays open;
98
- the task remains completed and is not retried. Check Git manually, then `/quit`.
99
- With pi-note 0.33.2+, directories outside a Git repository skip the pull and exit
100
- normally. Branches without an upstream still stay open after a failed pull.
101
- `/quit` and Exit without completing do not pull.
93
+ With pi-note 0.33.4+, completing the launched task from the menu, footer or
94
+ **Complete task and exit** exits Pi directly, so Kitty closes its dedicated tab
95
+ (or the standalone window's last tab). Completion never runs Git commands;
96
+ Git configuration and network availability do not affect closing the session.
102
97
  This ownership survives `/reload`, but not `/new`, resume, fork, tree navigation
103
98
  or process restart. Completing a different task or an externally completed task
104
- does not pull or close Pi; failed/uncertain completion stays open.
99
+ does not close Pi; failed/uncertain completion stays open.
105
100
 
106
101
  ### Agent tools and context
107
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-note",
3
- "version": "0.33.2",
3
+ "version": "0.33.4",
4
4
  "description": "Persistent pinote tasks, Markdown handoffs, and task status for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/remote/exit.ts CHANGED
@@ -1,32 +1,10 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { CustomEditor, type ExtensionAPI, type ExtensionContext } from '@earendil-works/pi-coding-agent';
1
+ import { CustomEditor, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
3
2
  import { truncateToWidth } from '@earendil-works/pi-tui';
4
3
  import { clean } from './protocol.ts';
5
4
  import type { RemoteSession } from './session.ts';
6
5
 
7
- /** Completion is already committed: pull failures must never retry the task action. */
8
- export async function pullBeforeExit(pi: ExtensionAPI, ctx: ExtensionContext, signal: AbortSignal, current: () => boolean): Promise<boolean> {
9
- const sessionId = ctx.sessionManager.getSessionId(), branch = ctx.sessionManager.getLeafId();
10
- const draft = ctx.ui.getEditorText();
11
- const unchanged = () => current() && !signal.aborted && ctx.isIdle() &&
12
- ctx.sessionManager.getSessionId() === sessionId && ctx.sessionManager.getLeafId() === branch && ctx.ui.getEditorText() === draft;
13
- if (!unchanged()) return false;
14
- try {
15
- const repository = spawnSync('git', ['rev-parse', '--show-toplevel'], {
16
- cwd: ctx.cwd, encoding: 'utf8', timeout: 3000, env: { ...process.env, LC_ALL: 'C' },
17
- });
18
- if (!repository.error && repository.status === 128 && repository.stderr.startsWith('fatal: not a git repository (or any ')) return unchanged();
19
- if (repository.error || repository.status !== 0 || !unchanged()) throw new Error('Git repository check failed');
20
- ctx.ui.notify('Task completed. Running git pull --ff-only before closing Pi…', 'info');
21
- const result = await pi.exec('git', ['pull', '--ff-only', '--no-rebase', '--no-autostash'], { cwd: ctx.cwd, signal, timeout: 30_000 });
22
- if (result.code === 0 && !result.killed && unchanged()) return true;
23
- } catch { /* Completion succeeded; only the local pull failed. */ }
24
- if (current()) ctx.ui.notify('Task completed, but Pi stayed open: git pull failed or the session changed. Check Git manually, then /quit. Completion will not be retried.', 'warning');
25
- return false;
26
- }
27
-
28
6
  /** Default remote companion. /quit and nonempty-editor exit input remain Pi-owned. */
29
- export function registerRemoteExit(pi: ExtensionAPI, getSession: () => RemoteSession | undefined, ownsLaunch = (_taskId: number) => false): void {
7
+ export function registerRemoteExit(pi: ExtensionAPI, getSession: () => RemoteSession | undefined): void {
30
8
  let invalidate: (() => void) | undefined;
31
9
  let stop: (() => void) | undefined;
32
10
  let confirm: ((reason: 'exit' | 'new') => Promise<boolean>) | undefined;
@@ -77,9 +55,6 @@ export function registerRemoteExit(pi: ExtensionAPI, getSession: () => RemoteSes
77
55
  await session.action(view, done, undefined, () => current() && ctx.isIdle() && ctx.sessionManager.getLeafId() === branch);
78
56
  if (!current()) return false;
79
57
  if (session.view && session.view.state.selectedId == null) {
80
- if (reason === 'exit' && typeof view.state.selectedId === 'number' && ownsLaunch(view.state.selectedId)) {
81
- return await pullBeforeExit(pi, ctx, operation.signal, current);
82
- }
83
58
  return true;
84
59
  }
85
60
  ctx.ui.notify('Pinote: Pi stayed in this session because the selection was not cleared. Refresh /pinote before retrying.', 'warning');
package/remote/ui.ts CHANGED
@@ -4,7 +4,6 @@ import { NativeFooter } from './footer.ts';
4
4
  import { clean, cleanUnbounded, editorText, footerText, literal, type NativeControl, type NativeView } from './protocol.ts';
5
5
  import { RemoteFailure } from './client.ts';
6
6
  import { RemoteSession } from './session.ts';
7
- import { pullBeforeExit } from './exit.ts';
8
7
  import { inlineHeight, remoteMenu, type MenuState } from './menu.ts';
9
8
 
10
9
  const line = (text: string) => clean(text).replace(/\n/g, ' ');
@@ -114,10 +113,8 @@ export class RemoteUI {
114
113
  if (!current()) return false;
115
114
  if (control.id === 'done' && ctx.isIdle() && typeof view.state.selectedId === 'number' &&
116
115
  this.session.view && this.session.view.state.selectedId == null && this.exitOnComplete(view.state.selectedId)) {
117
- if (await pullBeforeExit(this.pi, ctx, signal, current)) {
118
- this.closing = true;
119
- ctx.shutdown();
120
- }
116
+ this.closing = true;
117
+ ctx.shutdown();
121
118
  return true;
122
119
  }
123
120
  if (result.preview) this.pi.appendEntry('pinote-remote-preview', { title: line(view.title), text: clean(result.preview) });
package/remote.ts CHANGED
@@ -112,5 +112,5 @@ export default function pinoteRemote(pi: ExtensionAPI): void {
112
112
  (char) => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`),
113
113
  ].join('\n\n');
114
114
  });
115
- registerRemoteExit(pi, () => session, ownsLaunch);
115
+ registerRemoteExit(pi, () => session);
116
116
  }