@oh-my-pi/pi-coding-agent 15.2.2 → 15.2.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/CHANGELOG.md +49 -1
- package/dist/types/cli/worktree-cli.d.ts +26 -0
- package/dist/types/commands/worktree.d.ts +34 -0
- package/dist/types/config/settings-schema.d.ts +23 -0
- package/dist/types/hashline/constants.d.ts +0 -2
- package/dist/types/hashline/hash.d.ts +13 -39
- package/dist/types/hashline/parser.d.ts +2 -6
- package/dist/types/modes/shared.d.ts +9 -0
- package/dist/types/modes/theme/shimmer.d.ts +21 -10
- package/dist/types/session/agent-session.d.ts +2 -0
- package/dist/types/session/yield-queue.d.ts +24 -0
- package/dist/types/slash-commands/helpers/format.d.ts +1 -1
- package/dist/types/task/worktree.d.ts +0 -1
- package/dist/types/utils/git.d.ts +1 -0
- package/package.json +7 -7
- package/src/autoresearch/storage.ts +14 -2
- package/src/cli/worktree-cli.ts +291 -0
- package/src/cli.ts +1 -0
- package/src/commands/worktree.ts +56 -0
- package/src/config/prompt-templates.ts +1 -8
- package/src/config/settings-schema.ts +16 -0
- package/src/edit/index.ts +1 -1
- package/src/edit/renderer.ts +5 -7
- package/src/edit/streaming.ts +24 -12
- package/src/hashline/constants.ts +0 -3
- package/src/hashline/diff.ts +1 -1
- package/src/hashline/execute.ts +2 -2
- package/src/hashline/grammar.lark +7 -8
- package/src/hashline/hash.ts +21 -43
- package/src/hashline/input.ts +15 -13
- package/src/hashline/parser.ts +62 -161
- package/src/internal-urls/docs-index.generated.ts +2 -2
- package/src/modes/components/mcp-add-wizard.ts +4 -3
- package/src/modes/components/settings-selector.ts +23 -10
- package/src/modes/components/welcome.ts +77 -35
- package/src/modes/controllers/event-controller.ts +2 -1
- package/src/modes/controllers/mcp-command-controller.ts +4 -3
- package/src/modes/interactive-mode.ts +51 -10
- package/src/modes/shared.ts +16 -0
- package/src/modes/theme/shimmer.ts +173 -33
- package/src/modes/utils/ui-helpers.ts +31 -13
- package/src/prompts/tools/async-result.md +5 -2
- package/src/prompts/tools/hashline.md +62 -81
- package/src/sdk.ts +95 -21
- package/src/session/agent-session.ts +22 -0
- package/src/session/yield-queue.ts +155 -0
- package/src/slash-commands/helpers/format.ts +4 -1
- package/src/task/worktree.ts +2 -7
- package/src/tools/gh.ts +35 -32
- package/src/utils/commit-message-generator.ts +6 -1
- package/src/utils/git.ts +4 -0
- package/src/utils/title-generator.ts +45 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.2.4] - 2026-05-22
|
|
6
|
+
### Breaking Changes
|
|
7
|
+
|
|
8
|
+
- Replaced the legacy `@@` header and `+`/`<`/`=`/`-` hashline syntax with the new `§PATH` header and `«`/`»`/`≔` operation format, so existing hashline scripts and prompts using old symbols must be updated
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added one-anchor `≔ANCHOR` shorthand equivalent to `≔ANCHOR..ANCHOR` for single-line replace/delete
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Changed `≔A..B` so an omitted payload now deletes the range, and added an explicit empty payload line to keep a literal blank replacement line
|
|
17
|
+
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
- Removed the `hsep` prompt helper and `PI_HL_SEP` payload-prefix configuration because hashline payloads are no longer line-prefixed
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fixed hashline payload handling in parser and streaming preview to preserve blank lines as actual payload text until the next op, file header, or envelope marker
|
|
25
|
+
|
|
26
|
+
## [15.2.3] - 2026-05-22
|
|
27
|
+
### Breaking Changes
|
|
28
|
+
|
|
29
|
+
- Changed PR and task-isolation worktree directory layout to hash-based `~/.omp/wt/<identifier>-<path-hash>` style paths, replacing the previous nested encoded-repo layout
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- Added `omp worktree` command (alias `wt`) to list and manage agent-managed worktrees under `~/.omp/wt`
|
|
34
|
+
- Added `omp worktree clear` to remove orphaned worktree directories, with `--all` to include live PR-checkouts, `--dry-run` for preview, and `--json` reporting
|
|
35
|
+
- Added machine-readable JSON output to `omp worktree list` for scripted inspection
|
|
36
|
+
- Added `display.shimmer` appearance setting with `classic`, `kitt` (Knight Rider K.I.T.T. scanner), and `disabled` modes
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Changed the welcome intro animation to a 3-second eased gradient sweep with a diagonal shine highlight across the logo
|
|
41
|
+
- Changed background job completion follow-ups to batch multiple finished jobs into a single `async-result` message, showing each completed job and its result in one place
|
|
42
|
+
- Changed MCP notification follow-ups to combine multiple resource updates into a single consolidated message and suppress duplicate server/uri entries
|
|
43
|
+
- Updated PR checkout to reuse `hashPath`-based worktree roots when creating and scanning worktrees for cleanup
|
|
44
|
+
- Updated `worktree` cleanup logic to gracefully prune parent git metadata after removing worktree directories
|
|
45
|
+
- Reworked working-message shimmer animation for 60fps rendering: ANSI sequences are coalesced per same-tier run instead of emitted per code point, palettes compile once and cache per active theme, and the band position is now fractional so motion is smooth at any frame rate
|
|
46
|
+
- Switched MCP health-check and "Connecting to…" spinners from hard-coded ASCII (`|/-\`) to `theme.spinnerFrames` so they pick up the active symbol preset (braille on unicode/nerd, ASCII when explicitly themed)
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- Fixed PR checkout failures when the default worktree path was already registered or occupied by stale leftovers by automatically selecting suffixed alternatives (`-2`, `-3`, etc.)
|
|
51
|
+
- Fixed Memory tab in the settings UI not revealing or hiding the Hindsight-only rows (`Hindsight API URL`, `Hindsight Bank ID`, `Hindsight Scoping`, etc.) when `Memory Backend` was switched via the inline submenu. The selector now rebuilds its item list after every change so condition-gated rows appear/disappear immediately instead of requiring a tab switch
|
|
52
|
+
|
|
5
53
|
## [15.2.2] - 2026-05-22
|
|
6
54
|
|
|
7
55
|
### Fixed
|
|
@@ -8511,4 +8559,4 @@ Initial public release.
|
|
|
8511
8559
|
- Git branch display in footer
|
|
8512
8560
|
- Message queueing during streaming responses
|
|
8513
8561
|
- OAuth integration for Gmail and Google Calendar access
|
|
8514
|
-
- HTML export with syntax highlighting and collapsible sections
|
|
8562
|
+
- HTML export with syntax highlighting and collapsible sections
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type WorktreeKind = "pr-checkout" | "task-isolation" | "empty" | "stray";
|
|
2
|
+
export interface WorktreeEntry {
|
|
3
|
+
/** Absolute path to the worktree dir (or stray container) under `~/.omp/wt/`. */
|
|
4
|
+
path: string;
|
|
5
|
+
/** Classification of what we found on disk. */
|
|
6
|
+
kind: WorktreeKind;
|
|
7
|
+
/** Parent repo root, when this is a registered git worktree. */
|
|
8
|
+
parentRepo?: string;
|
|
9
|
+
/** Branch name extracted from the parent's tracking file, when available. */
|
|
10
|
+
branch?: string;
|
|
11
|
+
/** When set, the entry is unhealthy and `omp worktree clear` will remove it. */
|
|
12
|
+
orphanReason?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ListWorktreesOptions {
|
|
15
|
+
json: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ClearWorktreesOptions {
|
|
18
|
+
/** Remove every entry, including live PR-checkout worktrees. */
|
|
19
|
+
all: boolean;
|
|
20
|
+
/** Print what would be removed without touching the filesystem. */
|
|
21
|
+
dryRun: boolean;
|
|
22
|
+
json: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function listWorktrees(options: ListWorktreesOptions): Promise<void>;
|
|
25
|
+
export declare function clearWorktrees(options: ClearWorktreesOptions): Promise<void>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List and clean up agent-managed git worktrees under `~/.omp/wt`.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from "@oh-my-pi/pi-utils/cli";
|
|
5
|
+
export default class Worktree extends Command {
|
|
6
|
+
static description: string;
|
|
7
|
+
static aliases: string[];
|
|
8
|
+
static args: {
|
|
9
|
+
action: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & {
|
|
10
|
+
description: string;
|
|
11
|
+
required: false;
|
|
12
|
+
options: string[];
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
static flags: {
|
|
17
|
+
all: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
|
|
18
|
+
description: string;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
"dry-run": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
|
|
22
|
+
char: string;
|
|
23
|
+
description: string;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
json: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
|
|
27
|
+
char: string;
|
|
28
|
+
description: string;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
static examples: string[];
|
|
33
|
+
run(): Promise<void>;
|
|
34
|
+
}
|
|
@@ -648,6 +648,29 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
648
648
|
readonly type: "number";
|
|
649
649
|
readonly default: 3;
|
|
650
650
|
};
|
|
651
|
+
readonly "display.shimmer": {
|
|
652
|
+
readonly type: "enum";
|
|
653
|
+
readonly values: readonly ["classic", "kitt", "disabled"];
|
|
654
|
+
readonly default: "classic";
|
|
655
|
+
readonly ui: {
|
|
656
|
+
readonly tab: "appearance";
|
|
657
|
+
readonly label: "Shimmer";
|
|
658
|
+
readonly description: "Animation style for working/loading messages";
|
|
659
|
+
readonly options: readonly [{
|
|
660
|
+
readonly value: "classic";
|
|
661
|
+
readonly label: "Classic";
|
|
662
|
+
readonly description: "Soft cosine wave sweeping across the text";
|
|
663
|
+
}, {
|
|
664
|
+
readonly value: "kitt";
|
|
665
|
+
readonly label: "KITT Scanner";
|
|
666
|
+
readonly description: "Knight Rider 1982 red light bouncing left-right";
|
|
667
|
+
}, {
|
|
668
|
+
readonly value: "disabled";
|
|
669
|
+
readonly label: "Disabled";
|
|
670
|
+
readonly description: "No animation; static muted text";
|
|
671
|
+
}];
|
|
672
|
+
};
|
|
673
|
+
};
|
|
651
674
|
readonly "display.showTokenUsage": {
|
|
652
675
|
readonly type: "boolean";
|
|
653
676
|
readonly default: false;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
export declare const MISMATCH_CONTEXT = 2;
|
|
3
3
|
/** Filler hash used for the interior of a multi-line range; not validated. */
|
|
4
4
|
export declare const RANGE_INTERIOR_HASH = "**";
|
|
5
|
-
/** Header marker introducing a new file section in multi-section input. */
|
|
6
|
-
export declare const FILE_HEADER_PREFIX = "@";
|
|
7
5
|
/** Optional patch envelope start marker; silently consumed when present. */
|
|
8
6
|
export declare const BEGIN_PATCH_MARKER = "*** Begin Patch";
|
|
9
7
|
/** Optional patch envelope end marker; terminates parsing when encountered. */
|
|
@@ -64,47 +64,21 @@ export declare function resolveHashlineGrammarPlaceholders(grammar: string): str
|
|
|
64
64
|
/** @deprecated Use {@link resolveHashlineGrammarPlaceholders}. */
|
|
65
65
|
export declare const resolveLarkLidPlaceholders: typeof resolveHashlineGrammarPlaceholders;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
67
|
+
* Hashline edit input markers. File section headers start with {@link HL_FILE_PREFIX};
|
|
68
|
+
* op lines start with a direction/action sigil: {@link HL_OP_INSERT_BEFORE},
|
|
69
|
+
* {@link HL_OP_INSERT_AFTER}, or {@link HL_OP_REPLACE}. Payload lines are
|
|
70
|
+
* verbatim file content and have no per-line marker.
|
|
71
71
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* the edit grammar, prompt helper, and edit parser derive from it.
|
|
75
|
-
*
|
|
76
|
-
* Default is `~`, chosen empirically. Benchmark across 8 candidate separators
|
|
77
|
-
* x 3 models (glm-4.7:nitro, gpt-5.4-nano, claude-sonnet-4-6), 24-48 runs per
|
|
78
|
-
* cell, hashline variant, 12 sampled tasks per run:
|
|
79
|
-
*
|
|
80
|
-
* sep | task ✓ | edit ✓ | patch fail | tok/run
|
|
81
|
-
* ----|--------|--------|-----------------|--------
|
|
82
|
-
* + | 70.8% | 78.0% | 27/125 (21.6%) | 32,127
|
|
83
|
-
* ÷ | 70.7% | 90.6% | 22/211 (10.4%) | 31,666
|
|
84
|
-
* ~ | 69.4% | 94.9% | 6/107 ( 5.6%) | 30,529 <-- default
|
|
85
|
-
* > | 69.2% | 91.5% | 21/219 ( 9.6%) | 30,777
|
|
86
|
-
* : | 66.7% | 86.4% | 20/126 (15.9%) | 33,900
|
|
87
|
-
* | | 65.9% | 86.9% | 20/127 (15.7%) | 34,589
|
|
88
|
-
* \ | 65.5% | 89.8% | 16/124 (12.9%) | 36,010
|
|
89
|
-
* % | 63.9% | 92.8% | 11/125 ( 8.8%) | 36,530
|
|
90
|
-
*
|
|
91
|
-
* `~` wins because:
|
|
92
|
-
* - highest edit-tool success rate (94.9%) of any tested separator
|
|
93
|
-
* - lowest patch-failure rate (5.6%) — model rarely emits a malformed payload
|
|
94
|
-
* - cheapest in tokens alongside `>` (no retry overhead from format collisions)
|
|
95
|
-
* - no line-leading role in any mainstream language, markdown, diff, regex,
|
|
96
|
-
* or shell, so payload lines are unambiguous to both the parser and models
|
|
97
|
-
* - task-success is statistically tied with `>` and `÷` (within run-to-run
|
|
98
|
-
* noise), so the edit-reliability win is free
|
|
99
|
-
*
|
|
100
|
-
* `+` and `÷` lead on raw task-success but at the cost of ~2-4x more patch
|
|
101
|
-
* failures (the model retries until it lands a valid edit). `:`, `|`, `\`
|
|
102
|
-
* collide with line-leading syntax (label/object-key, body separator, escape)
|
|
103
|
-
* and degrade both edit reliability and intent-match.
|
|
72
|
+
* These constants are the single source of truth for the edit parser, grammar,
|
|
73
|
+
* renderer, and prompt.
|
|
104
74
|
*/
|
|
105
|
-
export declare const
|
|
106
|
-
|
|
107
|
-
export declare const
|
|
75
|
+
export declare const HL_OP_INSERT_BEFORE = "\u00AB";
|
|
76
|
+
export declare const HL_OP_INSERT_AFTER = "\u00BB";
|
|
77
|
+
export declare const HL_OP_REPLACE = "\u2254";
|
|
78
|
+
/** All hashline edit op sigils, concatenated for fast membership tests. */
|
|
79
|
+
export declare const HL_OP_CHARS = "\u00AB\u00BB\u2254";
|
|
80
|
+
/** Hashline edit file section header marker. */
|
|
81
|
+
export declare const HL_FILE_PREFIX = "\u00A7";
|
|
108
82
|
/** Stable separator for read/search/hashline display output. Intentionally not configurable. */
|
|
109
83
|
export declare const HL_BODY_SEP = "|";
|
|
110
84
|
/** Regex-escaped form of {@link HL_BODY_SEP}, safe for embedding inside a regex. */
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { HashlineCursor, HashlineEdit } from "./types";
|
|
2
2
|
export declare function cloneCursor(cursor: HashlineCursor): HashlineCursor;
|
|
3
|
-
export declare function parseHashline(diff: string
|
|
4
|
-
export
|
|
5
|
-
/** File path the diff targets. Used to suppress indent-sensitive false-positive warnings. */
|
|
6
|
-
path?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function parseHashlineWithWarnings(diff: string, opts?: ParseHashlineOptions): {
|
|
3
|
+
export declare function parseHashline(diff: string): HashlineEdit[];
|
|
4
|
+
export declare function parseHashlineWithWarnings(diff: string): {
|
|
9
5
|
edits: HashlineEdit[];
|
|
10
6
|
warnings: string[];
|
|
11
7
|
};
|
|
@@ -3,4 +3,13 @@ import type { TabBarTheme } from "@oh-my-pi/pi-tui";
|
|
|
3
3
|
export declare function sanitizeStatusText(text: string): string;
|
|
4
4
|
/** Shared tab bar theme used by model-selector and settings-selector. */
|
|
5
5
|
export declare function getTabBarTheme(): TabBarTheme;
|
|
6
|
+
/**
|
|
7
|
+
* Suffix appended to the loader's working message to remind users they can
|
|
8
|
+
* abort with Esc. Rendered with the active theme's bracket glyphs so it stays
|
|
9
|
+
* visually consistent with badges and other bracketed UI affordances.
|
|
10
|
+
*
|
|
11
|
+
* The leading space separates the hint from the message body and is consumed
|
|
12
|
+
* by `endsWith`/`slice` matching in the loader renderer.
|
|
13
|
+
*/
|
|
14
|
+
export declare function interruptHint(): string;
|
|
6
15
|
export { parseCommandArgs } from "../utils/command-args";
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { Theme, ThemeColor } from "./theme";
|
|
2
|
-
type ShimmerTheme = Pick<Theme, "bold" | "fg">;
|
|
2
|
+
type ShimmerTheme = Pick<Theme, "bold" | "fg" | "getFgAnsi">;
|
|
3
|
+
type ShimmerPaletteTier = ThemeColor | {
|
|
4
|
+
ansi: string;
|
|
5
|
+
};
|
|
3
6
|
/** Three-tier color stack a shimmer character cycles through as the band sweeps. */
|
|
4
7
|
export interface ShimmerPalette {
|
|
5
|
-
/** Color for chars outside / at the edge of the band (intensity < 0.
|
|
6
|
-
low:
|
|
7
|
-
/** Color for chars approaching the crest (0.
|
|
8
|
-
mid:
|
|
9
|
-
/** Color at the band's crest (intensity
|
|
10
|
-
high:
|
|
8
|
+
/** Color for chars outside / at the edge of the band (intensity < ~0.22). */
|
|
9
|
+
low: ShimmerPaletteTier;
|
|
10
|
+
/** Color for chars approaching the crest (~0.22 ≤ intensity < ~0.65). */
|
|
11
|
+
mid: ShimmerPaletteTier;
|
|
12
|
+
/** Color at the band's crest (intensity ≥ ~0.65). */
|
|
13
|
+
high: ShimmerPaletteTier;
|
|
11
14
|
/** Whether to bold the crest tier. Default `false`. */
|
|
12
15
|
bold?: boolean;
|
|
13
16
|
}
|
|
@@ -18,9 +21,17 @@ export interface ShimmerSegment {
|
|
|
18
21
|
}
|
|
19
22
|
export declare const DEFAULT_SHIMMER_PALETTE: ShimmerPalette;
|
|
20
23
|
/**
|
|
21
|
-
* Apply a shimmer sweep across one or more segments, treating them as a
|
|
22
|
-
* continuous string for band positioning. Each segment can supply
|
|
23
|
-
* palette so the gradient stays in lockstep while the colors
|
|
24
|
+
* Apply a shimmer sweep across one or more segments, treating them as a
|
|
25
|
+
* single continuous string for band positioning. Each segment can supply
|
|
26
|
+
* its own palette so the gradient stays in lockstep while the colors
|
|
27
|
+
* differ.
|
|
28
|
+
*
|
|
29
|
+
* Performance shape (per call, dominant cost):
|
|
30
|
+
* - One `Date.now()` read.
|
|
31
|
+
* - One `compile()` lookup per segment (Symbol-keyed cache slot, hot path
|
|
32
|
+
* skipped after first frame).
|
|
33
|
+
* - One ANSI open/close pair per **run of same-tier chars**, not per char.
|
|
34
|
+
* - No per-char allocations beyond the run buffer.
|
|
24
35
|
*/
|
|
25
36
|
export declare function shimmerSegments(segments: readonly ShimmerSegment[], theme: ShimmerTheme): string;
|
|
26
37
|
export declare function shimmerText(text: string, theme: ShimmerTheme, palette?: ShimmerPalette): string;
|
|
@@ -45,6 +45,7 @@ import type { ClientBridge } from "./client-bridge";
|
|
|
45
45
|
import { type CustomMessage } from "./messages";
|
|
46
46
|
import type { BranchSummaryEntry, NewSessionOptions, SessionContext, SessionManager } from "./session-manager";
|
|
47
47
|
import { ToolChoiceQueue } from "./tool-choice-queue";
|
|
48
|
+
import { YieldQueue } from "./yield-queue";
|
|
48
49
|
/** Session-specific events that extend the core AgentEvent */
|
|
49
50
|
export type AgentSessionEvent = AgentEvent | {
|
|
50
51
|
type: "auto_compaction_start";
|
|
@@ -264,6 +265,7 @@ export declare class AgentSession {
|
|
|
264
265
|
readonly agent: Agent;
|
|
265
266
|
readonly sessionManager: SessionManager;
|
|
266
267
|
readonly settings: Settings;
|
|
268
|
+
readonly yieldQueue: YieldQueue;
|
|
267
269
|
readonly configWarnings: string[];
|
|
268
270
|
readonly rawSseDebugBuffer: RawSseDebugBuffer;
|
|
269
271
|
constructor(config: AgentSessionConfig);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
export interface YieldDispatcher<P> {
|
|
3
|
+
/** Drop entries already delivered through another path. Called per-entry at flush time. */
|
|
4
|
+
isStale?(entry: P): boolean;
|
|
5
|
+
/** Produce one batched AgentMessage from non-stale entries. Return null to skip. */
|
|
6
|
+
build(survivors: P[]): AgentMessage | null;
|
|
7
|
+
}
|
|
8
|
+
export interface YieldQueueOptions {
|
|
9
|
+
isStreaming: () => boolean;
|
|
10
|
+
injectStreaming(msg: AgentMessage): void;
|
|
11
|
+
injectIdle(messages: AgentMessage[]): Promise<void>;
|
|
12
|
+
scheduleIdleFlush(run: () => Promise<void>): void;
|
|
13
|
+
}
|
|
14
|
+
type YieldFlushMode = "streaming" | "idle";
|
|
15
|
+
export declare class YieldQueue {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(options: YieldQueueOptions);
|
|
18
|
+
register<P>(kind: string, dispatcher: YieldDispatcher<P>): () => void;
|
|
19
|
+
enqueue<P>(kind: string, entry: P): void;
|
|
20
|
+
has(kind?: string): boolean;
|
|
21
|
+
flush(mode: YieldFlushMode): Promise<void>;
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Theme } from "../../modes/theme/theme";
|
|
2
2
|
/** Format a millisecond duration as a coarse-grained human label. */
|
|
3
3
|
export declare function formatDuration(ms: number): string;
|
|
4
|
-
type ProgressBarTheme = Pick<Theme, "bold" | "fg">;
|
|
4
|
+
type ProgressBarTheme = Pick<Theme, "bold" | "fg" | "getFgAnsi">;
|
|
5
5
|
/**
|
|
6
6
|
* Render an ASCII progress bar with a trailing percent label.
|
|
7
7
|
* `fraction` is clamped to `[0, 1]`. `undefined` renders a dotted placeholder.
|
|
@@ -19,7 +19,6 @@ export interface WorktreeBaseline {
|
|
|
19
19
|
baseline: RepoBaseline;
|
|
20
20
|
}>;
|
|
21
21
|
}
|
|
22
|
-
export declare function getEncodedProjectName(cwd: string): string;
|
|
23
22
|
export declare function getRepoRoot(cwd: string): Promise<string>;
|
|
24
23
|
export declare function getGitNoIndexNullPath(): string;
|
|
25
24
|
export declare function captureBaseline(repoRoot: string): Promise<WorktreeBaseline>;
|
|
@@ -263,6 +263,7 @@ export declare const worktree: {
|
|
|
263
263
|
signal?: AbortSignal;
|
|
264
264
|
}): Promise<boolean>;
|
|
265
265
|
list(cwd: string, signal?: AbortSignal): Promise<GitWorktreeEntry[]>;
|
|
266
|
+
prune(cwd: string, signal?: AbortSignal): Promise<void>;
|
|
266
267
|
};
|
|
267
268
|
export declare const patch: {
|
|
268
269
|
/** Apply a patch file. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "15.2.
|
|
4
|
+
"version": "15.2.4",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@agentclientprotocol/sdk": "0.21.0",
|
|
48
48
|
"@babel/parser": "^7.29.3",
|
|
49
49
|
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"@oh-my-pi/omp-stats": "15.2.
|
|
51
|
-
"@oh-my-pi/pi-agent-core": "15.2.
|
|
52
|
-
"@oh-my-pi/pi-ai": "15.2.
|
|
53
|
-
"@oh-my-pi/pi-natives": "15.2.
|
|
54
|
-
"@oh-my-pi/pi-tui": "15.2.
|
|
55
|
-
"@oh-my-pi/pi-utils": "15.2.
|
|
50
|
+
"@oh-my-pi/omp-stats": "15.2.4",
|
|
51
|
+
"@oh-my-pi/pi-agent-core": "15.2.4",
|
|
52
|
+
"@oh-my-pi/pi-ai": "15.2.4",
|
|
53
|
+
"@oh-my-pi/pi-natives": "15.2.4",
|
|
54
|
+
"@oh-my-pi/pi-tui": "15.2.4",
|
|
55
|
+
"@oh-my-pi/pi-utils": "15.2.4",
|
|
56
56
|
"@puppeteer/browsers": "^2.13.0",
|
|
57
57
|
"@types/turndown": "5.0.6",
|
|
58
58
|
"@xterm/headless": "^6.0.0",
|
|
@@ -2,10 +2,22 @@ import { Database, type SQLQueryBindings } from "bun:sqlite";
|
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { getAutoresearchDbPath, getAutoresearchProjectDir, logger } from "@oh-my-pi/pi-utils";
|
|
5
|
-
import { getEncodedProjectName } from "../task/worktree";
|
|
6
5
|
import * as git from "../utils/git";
|
|
7
6
|
import type { ASIData, ExperimentStatus, MetricDirection, NumericMetricMap } from "./types";
|
|
8
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Encode an absolute project path into a single filesystem-safe segment.
|
|
10
|
+
*
|
|
11
|
+
* Used to key per-project autoresearch state under `~/.omp/autoresearch/`.
|
|
12
|
+
* The `--…--` wrapper is historical — existing on-disk state depends on it,
|
|
13
|
+
* so changing the format here would orphan every prior autoresearch DB.
|
|
14
|
+
* Not collision-free for pathological inputs (`/a/b` vs `/a-b`) but matches
|
|
15
|
+
* the rest of the codebase and stays human-readable for `ls`.
|
|
16
|
+
*/
|
|
17
|
+
function encodeProjectKey(repoRoot: string): string {
|
|
18
|
+
return `--${repoRoot.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
|
|
19
|
+
}
|
|
20
|
+
|
|
9
21
|
export interface SessionRow {
|
|
10
22
|
id: number;
|
|
11
23
|
name: string;
|
|
@@ -561,7 +573,7 @@ export async function openAutoresearchStorageIfExists(cwd: string): Promise<Auto
|
|
|
561
573
|
async function resolveAutoresearchPaths(cwd: string): Promise<{ dbPath: string; projectDir: string }> {
|
|
562
574
|
const override = process.env.OMP_AUTORESEARCH_DB_DIR;
|
|
563
575
|
const repoRoot = (await git.repo.root(cwd)) ?? cwd;
|
|
564
|
-
const encoded =
|
|
576
|
+
const encoded = encodeProjectKey(repoRoot);
|
|
565
577
|
if (override) {
|
|
566
578
|
return {
|
|
567
579
|
dbPath: path.join(override, `${encoded}.db`),
|