pi-one-instruction 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/index.ts +3 -3
  2. package/package.json +9 -3
package/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { join } from "node:path"
2
- import { existsSync, readFileSync } from "node:fs";
2
+ import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { getAgentDir, getMarkdownTheme, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
4
  import { Markdown, type AutocompleteItem } from "@earendil-works/pi-tui";
5
5
 
@@ -31,7 +31,7 @@ export default function (pi: ExtensionAPI) {
31
31
  enabled = false;
32
32
  ctx.ui.notify("One instruction disabled", "info");
33
33
  } else if (value === "view") {
34
- if (!instr) {
34
+ if (instr == null) {
35
35
  ctx.ui.notify("INSTRUCTION.md not found in project or user configuration", "warning");
36
36
  return;
37
37
  }
@@ -43,7 +43,7 @@ export default function (pi: ExtensionAPI) {
43
43
  },
44
44
  });
45
45
  pi.on("before_provider_request", (event) => {
46
- if (!(instr && enabled)) return;
46
+ if (instr == null || !enabled) return;
47
47
  (event.payload as Record<string, unknown>).instructions = instr;
48
48
  });
49
49
  }
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "pi-one-instruction",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Overwrite Pi's instructions with a single INSTRUCTION.md",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/dundun6x/pi-one-instruction.git"
9
9
  },
10
- "keywords": ["pi-package", "pi-extension", "instructions"],
10
+ "keywords": [
11
+ "pi-package",
12
+ "pi-extension",
13
+ "instructions"
14
+ ],
11
15
  "files": [
12
16
  "index.ts",
13
17
  "README.md",
@@ -15,7 +19,9 @@
15
19
  ],
16
20
  "type": "module",
17
21
  "pi": {
18
- "extensions": ["./index.ts"]
22
+ "extensions": [
23
+ "./index.ts"
24
+ ]
19
25
  },
20
26
  "peerDependencies": {
21
27
  "@earendil-works/pi-coding-agent": "*"