pi-compact-tools 0.6.3 → 0.7.7

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/package.json CHANGED
@@ -1,64 +1,64 @@
1
- {
2
- "name": "pi-compact-tools",
3
- "version": "0.6.3",
4
- "description": "Compact, expandable UI for pi's built-in tools, bundled with a polished GitHub Dark theme.",
5
- "type": "module",
6
- "license": "MIT",
7
- "author": "Dong Hyeong Lee",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/nedleeds/pi-compact-tools.git"
11
- },
12
- "homepage": "https://github.com/nedleeds/pi-compact-tools#readme",
13
- "bugs": {
14
- "url": "https://github.com/nedleeds/pi-compact-tools/issues"
15
- },
16
- "keywords": [
17
- "pi-package",
18
- "pi-coding-agent",
19
- "pi-extension",
20
- "terminal-ui",
21
- "theme"
22
- ],
23
- "files": [
24
- "extensions",
25
- "themes",
26
- "examples",
27
- "scripts",
28
- "schemas",
29
- "README.md",
30
- "LICENSE"
31
- ],
32
- "scripts": {
33
- "test": "tsx --test tests/*.test.ts",
34
- "check": "tsc --noEmit && npm test && npm run check:resources",
35
- "check:resources": "node scripts/check-resources.mjs",
36
- "prepublishOnly": "npm run check"
37
- },
38
- "pi": {
39
- "extensions": [
40
- "./extensions/compact-tools.ts"
41
- ],
42
- "themes": [
43
- "./themes/github-dark-pro.json"
44
- ],
45
- "image": "https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/assets/nerd-font-workflow-optimized.gif"
46
- },
47
- "peerDependencies": {
48
- "@earendil-works/pi-coding-agent": "*",
49
- "@earendil-works/pi-tui": "*"
50
- },
51
- "devDependencies": {
52
- "@earendil-works/pi-coding-agent": "0.85.1",
53
- "@earendil-works/pi-tui": "0.85.1",
54
- "@types/node": "^24.0.0",
55
- "tsx": "^4.23.13",
56
- "typescript": "^5.9.0"
57
- },
58
- "engines": {
59
- "node": ">=22.19.0"
60
- },
61
- "publishConfig": {
62
- "access": "public"
63
- }
64
- }
1
+ {
2
+ "name": "pi-compact-tools",
3
+ "version": "0.7.7",
4
+ "description": "Compact, expandable UI for pi's built-in tools, bundled with a polished GitHub Dark theme.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Dong Hyeong Lee",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/nedleeds/pi-compact-tools.git"
11
+ },
12
+ "homepage": "https://github.com/nedleeds/pi-compact-tools#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/nedleeds/pi-compact-tools/issues"
15
+ },
16
+ "keywords": [
17
+ "pi-package",
18
+ "pi-coding-agent",
19
+ "pi-extension",
20
+ "terminal-ui",
21
+ "theme"
22
+ ],
23
+ "files": [
24
+ "extensions",
25
+ "themes",
26
+ "examples",
27
+ "scripts",
28
+ "schemas",
29
+ "README.md",
30
+ "LICENSE"
31
+ ],
32
+ "scripts": {
33
+ "test": "tsx --test tests/*.test.ts",
34
+ "check": "tsc --noEmit && npm test && npm run check:resources",
35
+ "check:resources": "node scripts/check-resources.mjs",
36
+ "prepublishOnly": "npm run check"
37
+ },
38
+ "pi": {
39
+ "extensions": [
40
+ "./extensions/compact-tools.ts"
41
+ ],
42
+ "themes": [
43
+ "./themes/github-dark-pro.json"
44
+ ],
45
+ "image": "https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/assets/nerd-font-workflow-optimized.gif"
46
+ },
47
+ "peerDependencies": {
48
+ "@earendil-works/pi-coding-agent": "*",
49
+ "@earendil-works/pi-tui": "*"
50
+ },
51
+ "devDependencies": {
52
+ "@earendil-works/pi-coding-agent": "0.85.1",
53
+ "@earendil-works/pi-tui": "0.85.1",
54
+ "@types/node": "^24.0.0",
55
+ "tsx": "^4.23.13",
56
+ "typescript": "^5.9.0"
57
+ },
58
+ "engines": {
59
+ "node": ">=22.19.0"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ }
64
+ }
@@ -18,8 +18,15 @@
18
18
  },
19
19
  "default": ["read", "write", "edit", "bash"]
20
20
  },
21
+ "previewLines": {
22
+ "description": "Maximum rendered lines shown initially when auto_compact is false. Explicit expansion always shows the complete result.",
23
+ "type": "integer",
24
+ "minimum": 1,
25
+ "maximum": 100,
26
+ "default": 10
27
+ },
21
28
  "auto_compact": {
22
- "description": "Whether each compact-rendered tool starts compact and participates in the global Ctrl+O expand/collapse action. False starts expanded and excludes the tool from that action; clicking remains available.",
29
+ "description": "Whether each compact-rendered tool starts hidden. False starts with a bounded preview; Pi's normal click and Ctrl+O flow can expand either state.",
23
30
  "type": "object",
24
31
  "additionalProperties": false,
25
32
  "properties": {
@@ -38,29 +45,6 @@
38
45
  "edit": false,
39
46
  "bash": true
40
47
  }
41
- },
42
- "spinner": {
43
- "type": "object",
44
- "additionalProperties": false,
45
- "properties": {
46
- "frames": {
47
- "description": "Animation frames. Use terminal-safe single-width characters for consistent alignment.",
48
- "type": "array",
49
- "minItems": 1,
50
- "items": {
51
- "type": "string",
52
- "minLength": 1
53
- },
54
- "default": ["◐", "◓", "◑", "◒"]
55
- },
56
- "intervalMs": {
57
- "description": "Milliseconds between spinner frames.",
58
- "type": "integer",
59
- "minimum": 40,
60
- "maximum": 5000,
61
- "default": 120
62
- }
63
- }
64
48
  }
65
49
  }
66
50
  }
@@ -21,7 +21,7 @@ if (theme.name !== "github-dark-pro" || !theme.colors || typeof theme.colors !==
21
21
  throw new Error("themes/github-dark-pro.json is not a valid pi theme document");
22
22
  }
23
23
  if (!theme.colors.border || !theme.colors.dim || !theme.colors.muted) {
24
- throw new Error("github-dark-pro must define spinner and separator colors");
24
+ throw new Error("github-dark-pro must define separator colors");
25
25
  }
26
26
  if (!theme.vars?.thinkingText || !theme.colors.thinkingMax) {
27
27
  throw new Error("github-dark-pro must define thinking text and summary colors");
@@ -33,31 +33,25 @@ if (!theme.colors.mdQuote || !theme.colors.mdCodeBlockBorder) {
33
33
  const example = JSON.parse(
34
34
  await readFile(new URL("../examples/compact-tools.json", import.meta.url), "utf8"),
35
35
  );
36
- if (!Array.isArray(example.spinner?.frames) || example.spinner.frames.length === 0) {
37
- throw new Error("example spinner.frames must be a non-empty array");
38
- }
39
- if (!Number.isInteger(example.spinner.intervalMs)) {
40
- throw new Error("example spinner.intervalMs must be an integer");
41
- }
42
36
  if (!example.auto_compact || example.auto_compact.edit !== false) {
43
37
  throw new Error("example auto_compact policy must keep edit diffs visible by default");
44
38
  }
45
39
  if (Object.values(example.auto_compact).some((enabled) => typeof enabled !== "boolean")) {
46
40
  throw new Error("example auto_compact values must be booleans");
47
41
  }
48
- if ("previewLines" in example) {
49
- throw new Error("example must not contain the removed previewLines setting");
42
+ if (!Number.isInteger(example.previewLines) || example.previewLines < 1 || example.previewLines > 100) {
43
+ throw new Error("example previewLines must be an integer from 1 to 100");
50
44
  }
51
- const blinkExample = JSON.parse(
45
+ const alternateExample = JSON.parse(
52
46
  await readFile(new URL("../examples/compact-tools-2.json", import.meta.url), "utf8"),
53
47
  );
54
- if (JSON.stringify(blinkExample.spinner?.frames) !== JSON.stringify(["●", "●", " ", "●", "●"])) {
55
- throw new Error("compact-tools-2 spinner must fade through repeated circles and a blank frame");
56
- }
57
- for (const [name, config] of [["compact-tools", example], ["compact-tools-2", blinkExample]]) {
48
+ for (const [name, config] of [["compact-tools", example], ["compact-tools-2", alternateExample]]) {
58
49
  if ("durationIndicators" in config) {
59
50
  throw new Error(`${name} must not contain the removed durationIndicators setting`);
60
51
  }
52
+ if ("spinner" in config) {
53
+ throw new Error(`${name} must not contain the removed spinner setting`);
54
+ }
61
55
  }
62
56
 
63
57
  const schema = JSON.parse(
@@ -66,11 +60,14 @@ const schema = JSON.parse(
66
60
  if (schema.properties?.durationIndicators) {
67
61
  throw new Error("schema must not expose the removed durationIndicators setting");
68
62
  }
63
+ if (schema.properties?.spinner) {
64
+ throw new Error("schema must not expose the removed spinner setting");
65
+ }
69
66
  if (!schema.properties?.auto_compact?.properties?.edit) {
70
67
  throw new Error("schema must describe per-tool auto_compact policies");
71
68
  }
72
- if (schema.properties?.previewLines) {
73
- throw new Error("schema must not expose the removed previewLines setting");
69
+ if (schema.properties?.previewLines?.default !== 10) {
70
+ throw new Error("schema must expose the bounded previewLines setting");
74
71
  }
75
72
 
76
73
  console.log("Resource checks passed");
@@ -1,8 +0,0 @@
1
- import { isKeyRelease, Key, matchesKey } from "@earendil-works/pi-tui";
2
-
3
- export type ToggleInput = "toggle" | "release";
4
-
5
- export function classifyToggleInput(data: string): ToggleInput | undefined {
6
- if (!matchesKey(data, Key.ctrl("o"))) return undefined;
7
- return isKeyRelease(data) ? "release" : "toggle";
8
- }