pi-ghost-autocomplete 0.5.1 → 0.6.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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * SPDX-License-Identifier: SSPL-1.0
3
+ * SPDX-FileCopyrightText: 2025 Alessandro Pungitore <alessandro@pungitore.ch>
4
+ */
5
+ import { type SessionEntry } from "@earendil-works/pi-coding-agent";
6
+ import { type EvalExample } from "./eval-dataset.js";
7
+ export declare const HARVEST_PROVIDER_NAME = "session-harvest";
8
+ export declare const HARVEST_PROVIDER_FINGERPRINT = "harvest:rpc-get-entries";
9
+ /** Messages of preceding conversation rendered into each example's context. */
10
+ export declare const HARVEST_CONTEXT_MESSAGES = 4;
11
+ /** Context tail cap — bounds per-example JSONL size for long sessions. */
12
+ export declare const HARVEST_CONTEXT_MAX_CHARS = 4000;
13
+ export interface HarvestOptions {
14
+ maxContextMessages?: number;
15
+ maxContextChars?: number;
16
+ }
17
+ /**
18
+ * Extract eval examples from a session branch. Walks message entries in
19
+ * order; each non-empty line of every *user* message becomes a committed
20
+ * sample, contextualized by up to `maxContextMessages` preceding
21
+ * user/assistant messages ("role: text", newline-joined, tail-capped at
22
+ * `maxContextChars`). Example timestamps come from the entry itself, so
23
+ * harvested data keeps the session's real chronology.
24
+ */
25
+ export declare function buildExamplesFromSessionEntries(entries: readonly SessionEntry[], opts?: HarvestOptions): EvalExample[];
26
+ /**
27
+ * Read a session's branch entries through pi's RPC mode. Spawns a pi
28
+ * process (requires `@earendil-works/pi-coding-agent` resolvable — same
29
+ * peer requirement as the rest of the CLI tooling), switches to the
30
+ * session file, and returns the `get_entries` result. The spawned agent
31
+ * never receives a prompt; it only serves inspection commands.
32
+ */
33
+ export declare function fetchSessionEntriesViaRpc(sessionPath: string, opts?: {
34
+ cwd?: string;
35
+ }): Promise<SessionEntry[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ghost-autocomplete",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Inline ghost-text autocomplete extension for the Pi coding agent (pi.dev). Cloud and local LLM providers, zero-flicker rendering, no popup interference.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "prepublishOnly": "node -e \"if(!process.env.CI)throw new Error('publish via release.yml CI only (manual npm publish skips native binaries & optionalDependencies)')\""
36
36
  },
37
37
  "engines": {
38
- "node": ">=20.0.0"
38
+ "node": ">=22.19.0"
39
39
  },
40
40
  "pi": {
41
41
  "extensions": [
@@ -62,16 +62,16 @@
62
62
  "groq"
63
63
  ],
64
64
  "peerDependencies": {
65
- "@earendil-works/pi-agent-core": "^0.74.0",
66
- "@earendil-works/pi-ai": "^0.74.0",
67
- "@earendil-works/pi-coding-agent": "^0.74.0",
68
- "@earendil-works/pi-tui": "^0.74.0"
65
+ "@earendil-works/pi-agent-core": "^0.80.0",
66
+ "@earendil-works/pi-ai": "^0.80.0",
67
+ "@earendil-works/pi-coding-agent": "^0.80.0",
68
+ "@earendil-works/pi-tui": "^0.80.0"
69
69
  },
70
70
  "devDependencies": {
71
- "@earendil-works/pi-agent-core": "^0.74.0",
72
- "@earendil-works/pi-ai": "^0.74.0",
73
- "@earendil-works/pi-coding-agent": "^0.74.0",
74
- "@earendil-works/pi-tui": "^0.74.0",
71
+ "@earendil-works/pi-agent-core": "^0.80.3",
72
+ "@earendil-works/pi-ai": "^0.80.3",
73
+ "@earendil-works/pi-coding-agent": "^0.80.3",
74
+ "@earendil-works/pi-tui": "^0.80.3",
75
75
  "@types/node": "^20.11.0",
76
76
  "esbuild": "^0.28.1",
77
77
  "javascript-obfuscator": "^5.4.3",
@@ -83,9 +83,9 @@
83
83
  "strip-ansi": "^7.2.0"
84
84
  },
85
85
  "optionalDependencies": {
86
- "pi-ghost-autocomplete-darwin-arm64": "0.5.1",
87
- "pi-ghost-autocomplete-linux-arm64-gnu": "0.5.1",
88
- "pi-ghost-autocomplete-linux-x64-gnu": "0.5.1",
89
- "pi-ghost-autocomplete-win32-x64-msvc": "0.5.1"
86
+ "pi-ghost-autocomplete-darwin-arm64": "0.6.0",
87
+ "pi-ghost-autocomplete-linux-arm64-gnu": "0.6.0",
88
+ "pi-ghost-autocomplete-linux-x64-gnu": "0.6.0",
89
+ "pi-ghost-autocomplete-win32-x64-msvc": "0.6.0"
90
90
  }
91
91
  }