pi-repl-py 0.2.5 → 0.2.6
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 +10 -2
- package/package.json +1 -1
- package/src/extension/prompt.ts +13 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# pi-repl
|
|
1
|
+
# pi-repl-py
|
|
2
2
|
|
|
3
3
|
A [pi](https://pi.dev) extension that gives the agent a single `execute` tool backed by a
|
|
4
4
|
**persistent Python evaluator**: a real `ipython` kernel that keeps variables, functions, imports,
|
|
@@ -32,7 +32,15 @@ A plain `pi` session is untouched; the extension is dormant until `--repl` is pa
|
|
|
32
32
|
|
|
33
33
|
## Installing as a pi package
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Install the package from npm or directly from GitHub:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pi install npm:pi-repl-py
|
|
39
|
+
# or
|
|
40
|
+
pi install github:k3-2o/pi-repl-py
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The install runs a `postinstall` that creates the Python venv the evaluator needs, at a stable
|
|
36
44
|
per-user path (`~/.pi/agent/pi-repl/venv`). If `python3` or the network is missing, it prints a
|
|
37
45
|
clear notice. How the interpreter is resolved is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
38
46
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-repl-py",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A pi extension with a single tool: execute, running a TypeScript host with a persistent Python (ipykernel) evaluator and a user-configurable toolbox of functions.",
|
|
6
6
|
"keywords": [
|
package/src/extension/prompt.ts
CHANGED
|
@@ -9,8 +9,7 @@ export const executeToolDescription =
|
|
|
9
9
|
"You have one tool: a persistent Python workspace backed by a real `ipython` kernel. " +
|
|
10
10
|
"Variables, imports, and definitions survive across cells and turns — it is your working memory and action " +
|
|
11
11
|
"language. " +
|
|
12
|
-
"Helpers in `~/.pi/agent/pi-repl/helpers/` load at boot;
|
|
13
|
-
"`[k for k in globals() if not k.startswith('_')]`. A cell returns its final expression; printed output is " +
|
|
12
|
+
"Helpers in `~/.pi/agent/pi-repl/helpers/` load at boot. A cell returns its final expression; printed output is " +
|
|
14
13
|
"captured separately.";
|
|
15
14
|
|
|
16
15
|
export const executePromptSnippet =
|
|
@@ -40,6 +39,17 @@ export function buildPromptGuidelines(preloaded: string[]): string[] {
|
|
|
40
39
|
"Inspect what is present — count, print a few lines, list what is loaded — before committing. Build one " +
|
|
41
40
|
"step, run it, and use its output to choose the next.",
|
|
42
41
|
"",
|
|
42
|
+
"## Precise file and search work",
|
|
43
|
+
"Search narrowly and inspect only the lines needed. Do not dump whole files or repeat unchanged context. " +
|
|
44
|
+
"For existing files, prefer a surgical old-text/new-text replacement over rewriting the file. Read the " +
|
|
45
|
+
"target region first, make the smallest unique replacement, then verify the changed region and file validity. " +
|
|
46
|
+
"Use complete writes only for new files or intentional full rewrites. Never leave a bare final expression: " +
|
|
47
|
+
"IPython displays it automatically; assign results and explicitly print only what you need.",
|
|
48
|
+
"",
|
|
49
|
+
"## Repository discipline",
|
|
50
|
+
"Inspect before changing. Preserve project conventions and unrelated content. Make the smallest valid change, " +
|
|
51
|
+
"verify it afterward, and never invent files, APIs, conventions, or test results.",
|
|
52
|
+
"",
|
|
43
53
|
"## Batch and print sparingly",
|
|
44
54
|
"Batch as much independent work as reasonably possible into one call. Keep large values in variables; " +
|
|
45
55
|
"print slices, counts, and summaries.",
|
|
@@ -48,7 +58,7 @@ export function buildPromptGuidelines(preloaded: string[]): string[] {
|
|
|
48
58
|
? [
|
|
49
59
|
"## Helpers",
|
|
50
60
|
"User helpers load from `~/.pi/agent/pi-repl/helpers/` as workspace definitions. Their descriptions " +
|
|
51
|
-
"appear below.
|
|
61
|
+
"appear below.",
|
|
52
62
|
"",
|
|
53
63
|
...preloaded,
|
|
54
64
|
"",
|