pi-ghost-autocomplete 0.3.2 → 0.4.0
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/LICENSE +561 -0
- package/README.md +464 -331
- package/dist/bench-cli.js +1 -123
- package/dist/bench.d.ts +7 -3
- package/dist/bench.js +1 -522
- package/dist/config.d.ts +4 -1
- package/dist/context-aggregator.d.ts +4 -1
- package/dist/cycle-manager.d.ts +2 -21
- package/dist/entropy-stop.d.ts +4 -1
- package/dist/eval-dataset.d.ts +2 -13
- package/dist/fuzzy-matcher.d.ts +4 -1
- package/dist/ghost-editor.d.ts +11 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -289
- package/dist/intent.d.ts +179 -0
- package/dist/metrics.d.ts +4 -1
- package/dist/path-index.d.ts +4 -1
- package/dist/path-matcher.d.ts +4 -1
- package/dist/profile-store.d.ts +4 -1
- package/dist/profile.d.ts +2 -20
- package/dist/providers/cloud-provider.d.ts +4 -1
- package/dist/providers/local-provider.d.ts +4 -1
- package/dist/providers/openai-compat-provider.d.ts +24 -1
- package/dist/providers/race.d.ts +4 -1
- package/dist/providers/types.d.ts +13 -1
- package/dist/recent-paths.d.ts +4 -1
- package/dist/replay-cli.js +1 -166
- package/dist/replay.d.ts +2 -7
- package/package.json +90 -80
- package/dist/bench-cli.d.ts +0 -3
- package/dist/bench-cli.d.ts.map +0 -1
- package/dist/bench-cli.js.map +0 -1
- package/dist/bench.d.ts.map +0 -1
- package/dist/bench.js.map +0 -1
- package/dist/cache.d.ts +0 -124
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -173
- package/dist/cache.js.map +0 -1
- package/dist/candidate-rerank.d.ts +0 -57
- package/dist/candidate-rerank.d.ts.map +0 -1
- package/dist/candidate-rerank.js +0 -78
- package/dist/candidate-rerank.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -317
- package/dist/config.js.map +0 -1
- package/dist/context-aggregator.d.ts.map +0 -1
- package/dist/context-aggregator.js +0 -87
- package/dist/context-aggregator.js.map +0 -1
- package/dist/context-selector.d.ts +0 -128
- package/dist/context-selector.d.ts.map +0 -1
- package/dist/context-selector.js +0 -300
- package/dist/context-selector.js.map +0 -1
- package/dist/cycle-manager.d.ts.map +0 -1
- package/dist/cycle-manager.js +0 -168
- package/dist/cycle-manager.js.map +0 -1
- package/dist/edit-history-ring.d.ts +0 -148
- package/dist/edit-history-ring.d.ts.map +0 -1
- package/dist/edit-history-ring.js +0 -262
- package/dist/edit-history-ring.js.map +0 -1
- package/dist/entropy-stop.d.ts.map +0 -1
- package/dist/entropy-stop.js +0 -141
- package/dist/entropy-stop.js.map +0 -1
- package/dist/eval-dataset.d.ts.map +0 -1
- package/dist/eval-dataset.js +0 -127
- package/dist/eval-dataset.js.map +0 -1
- package/dist/fast-path-engine.d.ts +0 -286
- package/dist/fast-path-engine.d.ts.map +0 -1
- package/dist/fast-path-engine.js +0 -341
- package/dist/fast-path-engine.js.map +0 -1
- package/dist/fuzzy-matcher.d.ts.map +0 -1
- package/dist/fuzzy-matcher.js +0 -162
- package/dist/fuzzy-matcher.js.map +0 -1
- package/dist/ghost-editor.d.ts.map +0 -1
- package/dist/ghost-editor.js +0 -1491
- package/dist/ghost-editor.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keystroke-timer.d.ts +0 -59
- package/dist/keystroke-timer.d.ts.map +0 -1
- package/dist/keystroke-timer.js +0 -94
- package/dist/keystroke-timer.js.map +0 -1
- package/dist/metrics-builder.d.ts +0 -71
- package/dist/metrics-builder.d.ts.map +0 -1
- package/dist/metrics-builder.js +0 -71
- package/dist/metrics-builder.js.map +0 -1
- package/dist/metrics.d.ts.map +0 -1
- package/dist/metrics.js +0 -212
- package/dist/metrics.js.map +0 -1
- package/dist/path-index.d.ts.map +0 -1
- package/dist/path-index.js +0 -148
- package/dist/path-index.js.map +0 -1
- package/dist/path-matcher.d.ts.map +0 -1
- package/dist/path-matcher.js +0 -88
- package/dist/path-matcher.js.map +0 -1
- package/dist/profile-store.d.ts.map +0 -1
- package/dist/profile-store.js +0 -199
- package/dist/profile-store.js.map +0 -1
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -434
- package/dist/profile.js.map +0 -1
- package/dist/providers/cloud-provider.d.ts.map +0 -1
- package/dist/providers/cloud-provider.js +0 -109
- package/dist/providers/cloud-provider.js.map +0 -1
- package/dist/providers/local-provider.d.ts.map +0 -1
- package/dist/providers/local-provider.js +0 -48
- package/dist/providers/local-provider.js.map +0 -1
- package/dist/providers/openai-compat-provider.d.ts.map +0 -1
- package/dist/providers/openai-compat-provider.js +0 -215
- package/dist/providers/openai-compat-provider.js.map +0 -1
- package/dist/providers/openai-completions-runner.d.ts +0 -52
- package/dist/providers/openai-completions-runner.d.ts.map +0 -1
- package/dist/providers/openai-completions-runner.js +0 -141
- package/dist/providers/openai-completions-runner.js.map +0 -1
- package/dist/providers/race.d.ts.map +0 -1
- package/dist/providers/race.js +0 -441
- package/dist/providers/race.js.map +0 -1
- package/dist/providers/truncate.d.ts +0 -7
- package/dist/providers/truncate.d.ts.map +0 -1
- package/dist/providers/truncate.js +0 -57
- package/dist/providers/truncate.js.map +0 -1
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js +0 -60
- package/dist/providers/types.js.map +0 -1
- package/dist/provisional-manager.d.ts +0 -93
- package/dist/provisional-manager.d.ts.map +0 -1
- package/dist/provisional-manager.js +0 -98
- package/dist/provisional-manager.js.map +0 -1
- package/dist/provisional.d.ts +0 -150
- package/dist/provisional.d.ts.map +0 -1
- package/dist/provisional.js +0 -238
- package/dist/provisional.js.map +0 -1
- package/dist/recent-paths.d.ts.map +0 -1
- package/dist/recent-paths.js +0 -114
- package/dist/recent-paths.js.map +0 -1
- package/dist/regret-tracker.d.ts +0 -84
- package/dist/regret-tracker.d.ts.map +0 -1
- package/dist/regret-tracker.js +0 -145
- package/dist/regret-tracker.js.map +0 -1
- package/dist/replay-cli.d.ts +0 -13
- package/dist/replay-cli.d.ts.map +0 -1
- package/dist/replay-cli.js.map +0 -1
- package/dist/replay.d.ts.map +0 -1
- package/dist/replay.js +0 -225
- package/dist/replay.js.map +0 -1
- package/dist/reranker.d.ts +0 -181
- package/dist/reranker.d.ts.map +0 -1
- package/dist/reranker.js +0 -324
- package/dist/reranker.js.map +0 -1
- package/dist/session-trie.d.ts +0 -103
- package/dist/session-trie.d.ts.map +0 -1
- package/dist/session-trie.js +0 -280
- package/dist/session-trie.js.map +0 -1
- package/dist/speculative.d.ts +0 -74
- package/dist/speculative.d.ts.map +0 -1
- package/dist/speculative.js +0 -107
- package/dist/speculative.js.map +0 -1
- package/dist/tool-summarize.d.ts +0 -40
- package/dist/tool-summarize.d.ts.map +0 -1
- package/dist/tool-summarize.js +0 -245
- package/dist/tool-summarize.js.map +0 -1
- package/dist/trie-sanitize.d.ts +0 -22
- package/dist/trie-sanitize.d.ts.map +0 -1
- package/dist/trie-sanitize.js +0 -142
- package/dist/trie-sanitize.js.map +0 -1
- package/dist/versions.d.ts +0 -23
- package/dist/versions.d.ts.map +0 -1
- package/dist/versions.js +0 -31
- package/dist/versions.js.map +0 -1
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
4
|
+
*/
|
|
1
5
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
6
|
import type { AgentMessage } from "@earendil-works/pi-agent-core";
|
|
3
7
|
/**
|
|
@@ -20,4 +24,3 @@ export declare function getRecentMessages(ctx: ExtensionContext, max: number, op
|
|
|
20
24
|
includeTools?: boolean;
|
|
21
25
|
}): RecentMessage[];
|
|
22
26
|
export declare function extractText(msg: AgentMessage): string;
|
|
23
|
-
//# sourceMappingURL=context-aggregator.d.ts.map
|
package/dist/cycle-manager.d.ts
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* PRD §M3e (Alt+]/Alt+[ cycling with clamp-at-edges, no wrap) +
|
|
6
|
-
* PRD §M3f (Ctrl+Right word-by-word acceptance in append mode).
|
|
7
|
-
*
|
|
8
|
-
* Design notes:
|
|
9
|
-
*
|
|
10
|
-
* - Candidate list is stored read-only (frozen) so that future refactors
|
|
11
|
-
* don't accidentally mutate ranked text. Per-candidate consumption from
|
|
12
|
-
* word-level accepts is tracked separately in `consumed[idx]`.
|
|
13
|
-
* - `current` returns `string | null` — `null` distinguishes "no candidates
|
|
14
|
-
* installed" from "current candidate is empty after full consumption".
|
|
15
|
-
* - `acceptPartialWordAppend()` is named to make the append-mode invariant
|
|
16
|
-
* impossible to forget at call sites. Replace-mode ghosts (fuzzy/path)
|
|
17
|
-
* accept atomically; word-by-word doesn't apply.
|
|
18
|
-
* - No hidden auto-reset: caller is responsible for `reset()` after the
|
|
19
|
-
* final-chunk accept so the lifecycle is explicit.
|
|
20
|
-
*
|
|
21
|
-
* Extracted as part of refactor #57 so `GhostEditor` stays thin.
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
22
4
|
*/
|
|
23
5
|
/**
|
|
24
6
|
* Pure helper: compute the next index for Alt+]/Alt[+ cycle.
|
|
@@ -99,4 +81,3 @@ export declare class CycleManager {
|
|
|
99
81
|
partials: number;
|
|
100
82
|
};
|
|
101
83
|
}
|
|
102
|
-
//# sourceMappingURL=cycle-manager.d.ts.map
|
package/dist/entropy-stop.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Entropy-based early stop. PRD §M7.
|
|
3
7
|
*
|
|
@@ -99,4 +103,3 @@ export declare function runWithStop(tokens: Iterable<{
|
|
|
99
103
|
stopped: boolean;
|
|
100
104
|
reason?: "entropy-spike" | "max-tokens";
|
|
101
105
|
};
|
|
102
|
-
//# sourceMappingURL=entropy-stop.d.ts.map
|
package/dist/eval-dataset.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* One JSONL example per committed prompt sample. The shape captures
|
|
5
|
-
* everything a replay run needs to reproduce the original ghost call:
|
|
6
|
-
* `(context, prefix, expected continuation, provider fingerprint)`.
|
|
7
|
-
*
|
|
8
|
-
* Privacy: examples DO contain raw prompt text. Capture is gated on the
|
|
9
|
-
* `PI_GHOST_EVAL_CAPTURE=1` env (not a default behavior — opt-in only).
|
|
10
|
-
* Sanitization still applies through `containsSensitive` so messages
|
|
11
|
-
* with API keys are dropped at capture time. Downstream tooling (CLI
|
|
12
|
-
* replay) ships a `--redact` flag that emits aggregate metrics without
|
|
13
|
-
* raw examples for publication.
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
14
4
|
*/
|
|
15
5
|
export declare const EVAL_REL = ".pi/ghost-autocomplete/eval.jsonl";
|
|
16
6
|
/** Char positions at which to sample prefixes from a committed line. */
|
|
@@ -63,4 +53,3 @@ export declare function loadExamples(cwd: string): Promise<EvalExample[]>;
|
|
|
63
53
|
export declare function parseExamples(body: string): EvalExample[];
|
|
64
54
|
/** Parse `PI_GHOST_EVAL_CAPTURE`. Returns true only when set to "1". */
|
|
65
55
|
export declare function parseEvalCaptureEnv(raw: string | undefined): boolean;
|
|
66
|
-
//# sourceMappingURL=eval-dataset.d.ts.map
|
package/dist/fuzzy-matcher.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
4
|
+
*/
|
|
1
5
|
import type { PathIndex } from "./path-index.js";
|
|
2
6
|
export interface FindFuzzyOptions {
|
|
3
7
|
recentPaths?: Set<string> | null;
|
|
@@ -55,4 +59,3 @@ export declare function hasActionTrigger(prefix: string): boolean;
|
|
|
55
59
|
* 70-84). Scores < 70 should not be shown deterministically.
|
|
56
60
|
*/
|
|
57
61
|
export declare function findFuzzyFilename(index: PathIndex, token: string, opts?: FindFuzzyOptions): FuzzyMatch | null;
|
|
58
|
-
//# sourceMappingURL=fuzzy-matcher.d.ts.map
|
package/dist/ghost-editor.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
4
|
+
*/
|
|
1
5
|
import { CustomEditor, type ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
6
|
import type { KeybindingsManager } from "@earendil-works/pi-coding-agent";
|
|
3
7
|
import { type EditorTheme, type TUI } from "@earendil-works/pi-tui";
|
|
@@ -41,6 +45,12 @@ export declare class GhostEditor extends CustomEditor {
|
|
|
41
45
|
private debounceTimer;
|
|
42
46
|
private inflight;
|
|
43
47
|
private lastTextSeen;
|
|
48
|
+
/** Last classified intent, set during handleTextChange and consumed
|
|
49
|
+
* by buildPredictionContext when the LLM fires after debounce. */
|
|
50
|
+
private currentIntent;
|
|
51
|
+
/** Ring buffer of recently-dismissed deterministic completions,
|
|
52
|
+
* used to suppress re-showing the same path in the same context. */
|
|
53
|
+
private readonly dismissCache;
|
|
44
54
|
private disposed;
|
|
45
55
|
private shownMetric;
|
|
46
56
|
private recentPaths;
|
|
@@ -194,7 +204,7 @@ export declare class GhostEditor extends CustomEditor {
|
|
|
194
204
|
* served. Profile must exist; line must start with `/`.
|
|
195
205
|
*/
|
|
196
206
|
private trySlashFastPath;
|
|
197
|
-
private
|
|
207
|
+
private tryDeterministicWithLines;
|
|
198
208
|
private getRecentPaths;
|
|
199
209
|
private applyDeterministic;
|
|
200
210
|
private replaceTokenAtCursor;
|
|
@@ -379,4 +389,3 @@ export declare function visualWidth(s: string): number;
|
|
|
379
389
|
* Returns the empty string if `maxCols <= 0` or no characters fit.
|
|
380
390
|
*/
|
|
381
391
|
export declare function clipToWidth(s: string, maxCols: number): string;
|
|
382
|
-
//# sourceMappingURL=ghost-editor.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-License-Identifier: SSPL-1.0
|
|
3
|
+
* SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
|
|
4
|
+
*/
|
|
1
5
|
import type { ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
2
6
|
import { type GhostConfig } from "./config.js";
|
|
3
7
|
import type { GhostDiagnostics } from "./ghost-editor.js";
|
|
@@ -39,4 +43,3 @@ export type { FindPathPrefixOptions } from "./path-matcher.js";
|
|
|
39
43
|
export { extractRecentPaths, getRoleWeightedRecent, recentBoost } from "./recent-paths.js";
|
|
40
44
|
export { formatReport, loadMetrics, parseMetricsText, quantile, runBenchmark, summarize, THRESHOLDS, } from "./bench.js";
|
|
41
45
|
export type { BenchmarkReport, ModeStats, ProviderStats } from "./bench.js";
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|