@xynogen/pix-skills 0.10.6 → 0.10.8
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 +16 -10
- package/package.json +4 -4
- package/skills/agents.md +78 -0
- package/skills/report.md +131 -0
- package/src/index.ts +7 -1
- package/src/picker.ts +15 -2
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/xynogen/pix-mono/main/.github/assets/pix-logo.svg" alt="Pix" width="152" height="80">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# pix-skills
|
|
2
6
|
|
|
3
7
|
Pi coding agent extension — skill loader tool + skills bundle.
|
|
@@ -7,7 +11,7 @@ Pi coding agent extension — skill loader tool + skills bundle.
|
|
|
7
11
|
| Resource | Type | Description |
|
|
8
12
|
|---|---|---|
|
|
9
13
|
| `read_skills` | tool | Browse local skills, search Skills.sh, explicitly fetch/cache a selected public GitHub skill, read references, and copy bundled resources. |
|
|
10
|
-
| `skills/` | skills |
|
|
14
|
+
| `skills/` | skills | 36 bundled skills (off-context by default — discovered on demand via `read_skills`) |
|
|
11
15
|
|
|
12
16
|
## New: Skills.sh search and remote skill cache
|
|
13
17
|
|
|
@@ -81,8 +85,7 @@ skills/docx/
|
|
|
81
85
|
└── assets/ # optional data, templates, images, or themes
|
|
82
86
|
```
|
|
83
87
|
|
|
84
|
-
The bundle relies
|
|
85
|
-
no separate metadata file. `SKILL.md` frontmatter is the single source of truth
|
|
88
|
+
The bundle relies on this folder structure; there is no separate metadata file. `SKILL.md` frontmatter is the single source of truth
|
|
86
89
|
for skill metadata, while the presence and contents of `scripts/`, `references/`,
|
|
87
90
|
and `assets/` define the available resources. Empty resource directories do not
|
|
88
91
|
need to be created.
|
|
@@ -121,7 +124,7 @@ Copying does not execute a script. It creates missing destination directories
|
|
|
121
124
|
and atomically replaces the destination with the bundled file. The agent can
|
|
122
125
|
then use ordinary tools to inspect or run the copied resource.
|
|
123
126
|
|
|
124
|
-
Resource resolution
|
|
127
|
+
Resource resolution is confined to the selected skill bundle:
|
|
125
128
|
|
|
126
129
|
- only `scripts/`, `references/`, and `assets/` are addressable;
|
|
127
130
|
- absolute paths and `..` traversal are rejected;
|
|
@@ -130,8 +133,8 @@ Resource resolution will be confined to the selected skill bundle:
|
|
|
130
133
|
cannot read neighboring skills or files;
|
|
131
134
|
- callers use bundle-relative names and never need an absolute `${SKILL_DIR}`;
|
|
132
135
|
- `output` is relative to the current project working directory;
|
|
133
|
-
- invalid source or output paths
|
|
134
|
-
absolute paths, traversal, and escaping symlinks
|
|
136
|
+
- invalid source or output paths (including paths outside the permitted roots,
|
|
137
|
+
absolute paths, traversal, and escaping symlinks) are rejected.
|
|
135
138
|
|
|
136
139
|
`read_skills` is the safe version of "agent prompts itself":
|
|
137
140
|
|
|
@@ -147,6 +150,7 @@ as `/skill:<name>` slash commands.
|
|
|
147
150
|
|
|
148
151
|
| Skill | Description |
|
|
149
152
|
|---|---|
|
|
153
|
+
| `agents` | Create, audit, or prune AGENTS.md / CLAUDE.md to verified, non-inferable rules only |
|
|
150
154
|
| `ask-user` | Ask 1–4 structured questions before high-stakes, irreversible, or ambiguous decisions |
|
|
151
155
|
| `audit` | Security audit, integrity check, and secret/vulnerability scan with evidence |
|
|
152
156
|
| `bootstrap` | Scaffold a new project or tool from authoritative docs, with install consent |
|
|
@@ -169,6 +173,7 @@ as `/skill:<name>` slash commands.
|
|
|
169
173
|
| `long-task` | Multi-session build state in files: `init.sh`, `features.json`, `PROGRESS.md`, one commit per feature |
|
|
170
174
|
| `lsp` | Select, install with consent, and configure a language server in `.pi/lsp.json` |
|
|
171
175
|
| `readme` | Create or update a deployment-focused README in a fixed style |
|
|
176
|
+
| `report` | Detailed terminal report — verdict, numbered findings with file:line, cause, impact and fix, checks, next steps; emoji only as status markers beside text labels |
|
|
172
177
|
| `review` | Strict code review by severity, ending in a Pass / Pass with suggestions / Fail verdict |
|
|
173
178
|
| `runner` | Generate or convert a task runner (just/make/mise/task/npm/sh; bundle with references) |
|
|
174
179
|
| `search` | Deep code discovery and project context mapping with grep, graph, and LSP |
|
|
@@ -211,13 +216,14 @@ Directive commands are gated by the **same rule engine** as the `bash` tool
|
|
|
211
216
|
throw — they inline a marker so skill loading always completes.
|
|
212
217
|
- **Escape.** `` \!`cmd` `` is left literal, so docs can show the syntax without
|
|
213
218
|
running it.
|
|
214
|
-
- **Single source of truth.** Expanding pix-gate's rule table or
|
|
215
|
-
`~/.pi/agent/pix
|
|
219
|
+
- **Single source of truth.** Expanding pix-gate's rule table or the user's
|
|
220
|
+
`gate` section in `~/.pi/agent/pix.json` automatically tightens the skill path too.
|
|
216
221
|
|
|
217
222
|
Interpolation only happens on the `full=true` path; name listing and description
|
|
218
223
|
lookups never run commands. Calls and results identify the operation as `list`,
|
|
219
|
-
`description`, `instructions`, `reference`, or `copy
|
|
220
|
-
|
|
224
|
+
`description`, `instructions`, `reference`, or `copy`. A long result shows its first
|
|
225
|
+
rows, fades the last of them, and ends with `… N more lines (ctrl+o to expand)`;
|
|
226
|
+
the full content still reaches the agent.
|
|
221
227
|
Copied-resource results show
|
|
222
228
|
the destination and byte size. Tool results follow Pix's configured auto-collapse
|
|
223
229
|
delay, including `read_skills`; expanding an elapsed result restores its normal
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-skills",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "Pi extension
|
|
3
|
+
"version": "0.10.8",
|
|
4
|
+
"description": "Pi extension — agent skill loader (skill tool + skills bundle)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@xynogen/pix-gate": "^0.4.0",
|
|
51
|
-
"@xynogen/pix-pretty": "^1.
|
|
52
|
-
"@xynogen/pix-runtime": "^0.
|
|
51
|
+
"@xynogen/pix-pretty": "^1.37.0",
|
|
52
|
+
"@xynogen/pix-runtime": "^0.17.0"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/skills/agents.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agents
|
|
3
|
+
description: Creates, audits, or prunes a repository context file (AGENTS.md / CLAUDE.md) so it holds only non-inferable, verified instructions — no repo overview. Use when asked to write, init, review, trim, or update AGENTS.md, CLAUDE.md, or agent instructions for a repo.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
# AGENTS.md
|
|
7
|
+
|
|
8
|
+
The host loads this file into every turn. Each line costs tokens on every task, so it must earn its place.
|
|
9
|
+
|
|
10
|
+
Evidence (ETH Zurich, arXiv 2602.11988; arXiv 2601.20404):
|
|
11
|
+
- LLM-generated context files cut task success by ~3% and raise cost by >20%.
|
|
12
|
+
- Repository overviews do not help. Agents find structure themselves.
|
|
13
|
+
- Agents follow instructions closely. A specific, non-obvious rule pays off. A stale or wrong rule does harm.
|
|
14
|
+
|
|
15
|
+
Rule: **write only what an agent cannot infer from the code in a few tool calls.**
|
|
16
|
+
|
|
17
|
+
## 1. What belongs
|
|
18
|
+
|
|
19
|
+
| Keep | Example |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Non-standard commands | `bun run test` (not `bun test`): needs `--isolate` + preload |
|
|
22
|
+
| Hidden constraints | "Never import across packages by path; use `exports`" |
|
|
23
|
+
| Traps the agent hit before | "Tests fail without `PI_CODING_AGENT_DIR` sandbox" |
|
|
24
|
+
| Approval / safety gates | "Patch bumps only; minor/major need approval" |
|
|
25
|
+
| Project conventions a linter does not enforce | commit scope = package name |
|
|
26
|
+
| Pointers to deep docs, loaded on demand | "Before adding a package, read `docs/architecture.md`" |
|
|
27
|
+
|
|
28
|
+
| Drop | Why |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Directory tree, file list, "this repo contains…" | Inferable via `ls`/graph; measured as unhelpful |
|
|
31
|
+
| Tech stack restated from `package.json` / lockfiles | Inferable |
|
|
32
|
+
| Rules the linter, formatter, or typecheck already enforce | The tool tells the agent |
|
|
33
|
+
| Generic advice ("write clean code", "add tests") | No information |
|
|
34
|
+
| Anything you did not verify | Wrong rules are followed faithfully |
|
|
35
|
+
|
|
36
|
+
## 2. Steps
|
|
37
|
+
|
|
38
|
+
1. **Read the current file** if present. Treat it as input, not truth.
|
|
39
|
+
2. **Mine the non-inferable facts** — do not summarize the repo:
|
|
40
|
+
- Task runner, CI config, and pre-commit hooks: find commands that differ from the ecosystem default.
|
|
41
|
+
- Linter/tsconfig/guard tests: note what is already enforced, so you can drop it.
|
|
42
|
+
- `CONTRIBUTING.md`, `docs/`, and the git log (`git log --oneline -50`): find conventions and repeated fix-ups that show traps.
|
|
43
|
+
- Ask the user once (`ask_user`) for gates and traps you cannot see in the code.
|
|
44
|
+
3. **Verify every command** by running it or checking `--help`. Verify every path with `ls`. Delete a claim that you cannot verify.
|
|
45
|
+
4. **Prune** an existing file against §1. Every line must pass this test: "Would a capable agent get this wrong without it?" If not, cut it.
|
|
46
|
+
5. **Draft** in the shape below. Aim for under ~150 lines. Move long detail to a linked doc that the agent reads only when the task needs it.
|
|
47
|
+
6. **Show the diff** and get confirmation before you overwrite a non-trivial file.
|
|
48
|
+
|
|
49
|
+
## 3. Shape
|
|
50
|
+
|
|
51
|
+
```md
|
|
52
|
+
# <Project> — Agent Guide
|
|
53
|
+
|
|
54
|
+
## Commands
|
|
55
|
+
<only commands that differ from the ecosystem default, each with a one-line why>
|
|
56
|
+
|
|
57
|
+
## Rules
|
|
58
|
+
<hard constraints and gates, imperative, one line each>
|
|
59
|
+
|
|
60
|
+
## Traps
|
|
61
|
+
<known failure modes and the fix>
|
|
62
|
+
|
|
63
|
+
## Read before
|
|
64
|
+
<task → doc path, for detail that is loaded on demand>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- Imperative, one rule per line, no rationale paragraphs. A short "why" is fine when it stops a wrong workaround.
|
|
68
|
+
- If both files exist, keep one source. Make `CLAUDE.md` a one-line pointer (`See AGENTS.md`) or a symlink, so the files cannot drift.
|
|
69
|
+
- In a monorepo, put package-specific rules in a nested `AGENTS.md`. Do not grow the root file.
|
|
70
|
+
|
|
71
|
+
## 4. Report
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
## AGENTS.md: [created | pruned | updated]
|
|
75
|
+
Lines: [before] → [after]
|
|
76
|
+
Kept: [n] rules · Dropped: [n] (overview/inferable/unverified)
|
|
77
|
+
Unverified (removed): [list or none]
|
|
78
|
+
```
|
package/skills/report.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: report
|
|
3
|
+
description: Writes a detailed report that reads well in a terminal — verdict first, then numbered findings with severity, file:line, cause, impact, and fix, plus what was checked and what was not. Emoji only as a status marker beside a text label, never as decoration. Use when the user asks for a "report", "laporan", "status report", or "write up what we did".
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
# Report
|
|
7
|
+
|
|
8
|
+
Goal: the reader sees the verdict at once, and gets enough detail on every real problem to act on it without asking again. The report reads well in an 80-column terminal.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. Collect facts from the conversation, code, and commands. Never report from memory. Re-run a check if its result may be stale.
|
|
13
|
+
2. For each finding, get the evidence: `file:line`, command output, or test name. Read the code around it so you can state the cause.
|
|
14
|
+
3. Print the report in chat, in the user's language. Size follows content: about 30–60 lines. Above 80 lines, give every finding in short form and offer "detail #N".
|
|
15
|
+
|
|
16
|
+
## Format
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
**Verdict:** [emoji] [WORD] — [one sentence: state + what blocks done]
|
|
20
|
+
|
|
21
|
+
**Scope:** [what was checked: commits, packages, files, commands]
|
|
22
|
+
|
|
23
|
+
**Findings**
|
|
24
|
+
|
|
25
|
+
1. 🔴 [HIGH] [symptom, one line]
|
|
26
|
+
Where: `file:line`
|
|
27
|
+
Cause: [why it happens, one sentence]
|
|
28
|
+
Impact: [what breaks, for whom, when]
|
|
29
|
+
Fix: [concrete change]
|
|
30
|
+
|
|
31
|
+
2. 🟡 [MED] [symptom]
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
**Checks:** ✅ [n] tests pass · ✅ lint · ❌ typecheck FAIL (`[error]`)
|
|
35
|
+
**Not checked:** [area] ([reason]), [area] ([reason])
|
|
36
|
+
|
|
37
|
+
**Next:**
|
|
38
|
+
1. [step] — [file or package]
|
|
39
|
+
2. [step] — [file or package]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Rules
|
|
43
|
+
|
|
44
|
+
Readers scan first, then read the items they care about. Write for both.
|
|
45
|
+
|
|
46
|
+
1. **Front-load.** Put the verdict on line 1. Start each finding with its severity label and a one-line symptom. Put the detail on indented lines below it.
|
|
47
|
+
2. **Emoji as markers, not decoration.** The text label carries the meaning. The emoji is only a fast visual cue, because it renders differently per terminal and font.
|
|
48
|
+
- Use only this set: 🔴 HIGH · 🟡 MED · 🔵 LOW · ✅ pass · ❌ FAIL · ⚠️ partial or warning.
|
|
49
|
+
- Put it only at the start of a verdict, finding, or check item. Use at most one per line.
|
|
50
|
+
- Always pair it with a text label: `🔴 [HIGH]`, `✅ 584 pass`, `❌ format FAIL`.
|
|
51
|
+
- Never put emoji in prose, in `Cause:`/`Impact:`/`Fix:` lines, in headings, in tables, or in the `Next:` list.
|
|
52
|
+
- Verdict words: `DONE`, `READY`, `READY WITH FIXES`, `BLOCKED`. Write the bad state in uppercase, so it stands out even when the emoji does not render.
|
|
53
|
+
3. **Order and number.** Sort findings by severity, then by impact. Number them, so the user can say "detail #2".
|
|
54
|
+
4. **Chunk.** Give at most 8 findings in full. List the rest as one line each under `**Minor (+N)**`.
|
|
55
|
+
5. **Evidence beside the claim.** Every finding has a `Where:` line with `file:line`, a command, or a test name. Quote the exact error string in backticks when there is one.
|
|
56
|
+
6. **Fit the terminal.** Keep lines to 80 characters or less. Do not use `#` headings. Indent finding detail by 3 spaces and align the field names. Put one blank line between findings and between sections.
|
|
57
|
+
|
|
58
|
+
**Language:** write in the user's language with STE100 rules (common words, short active sentences, one fact per sentence), in that language's own grammar. Keep standard English technical terms as-is (`race condition`, `signature resistance`, `passive PoE`). Never translate them literally. Keep code names, paths, versions, and errors exact. Field names (`Where`, `Cause`, `Impact`, `Fix`) may use the user's language.
|
|
59
|
+
|
|
60
|
+
## Content
|
|
61
|
+
|
|
62
|
+
- **Each finding has five parts:** symptom, location, cause, impact, and fix. If you do not know a part, write `(unverified)`. Never guess.
|
|
63
|
+
- **Fact or inference:** mark inference as `(likely)`. Mark claims you did not check as `(unverified)`.
|
|
64
|
+
- **Exact values:** keep exact numbers, paths, versions, status codes, and error strings.
|
|
65
|
+
- **Strengths:** give them on one `**Good:**` line with at most 3 items, and only when they affect the decision.
|
|
66
|
+
- **Not checked:** list what you did not check, with a reason (no access, no test, out of scope).
|
|
67
|
+
- **Next:** give ordered steps, each with the file or package it touches.
|
|
68
|
+
- **No filler:** no intro, no outro, and no restating the request.
|
|
69
|
+
- **Nothing broken:** write `**Findings:** none`, then say what you checked.
|
|
70
|
+
- **"detail #N":** expand only that item, with a code excerpt, the trace, and alternative fixes.
|
|
71
|
+
|
|
72
|
+
## Visual tools
|
|
73
|
+
|
|
74
|
+
Use one only when it is clearer than text.
|
|
75
|
+
|
|
76
|
+
| Data | Tool | Limit |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| Quality, fit, confidence | Stars `★★★☆☆` | Out of 5, next to an exact count |
|
|
79
|
+
| Same fields over 3+ items | Compact table | ≤ 4 columns, ≤ 80 chars, no sentences |
|
|
80
|
+
| Flow, layers, before/after | ASCII diagram | ≤ 8 lines, ≤ 70 chars, code block, mark the problem with `<-- #N` |
|
|
81
|
+
|
|
82
|
+
## Example
|
|
83
|
+
|
|
84
|
+
````markdown
|
|
85
|
+
**Verdict:** ⚠️ READY WITH FIXES — the intrusion feature (6 commits) works;
|
|
86
|
+
2 HIGH and 2 MED issues block prod.
|
|
87
|
+
|
|
88
|
+
**Scope:** commits a1b2c3..f6e7d8, `intrusion_*` modules, pytest, ruff.
|
|
89
|
+
|
|
90
|
+
**Findings**
|
|
91
|
+
|
|
92
|
+
1. 🔴 [HIGH] A worker can resolve another camera's event
|
|
93
|
+
Where: `intrusion_service.py:209`
|
|
94
|
+
Cause: `resolve()` filters by `event_id` only, not by `camera_id`.
|
|
95
|
+
Impact: any worker can close any open alert; the audit log shows the
|
|
96
|
+
wrong camera.
|
|
97
|
+
Fix: add `camera_id` to the WHERE clause; return 404 on a mismatch.
|
|
98
|
+
|
|
99
|
+
2. 🔴 [HIGH] Concurrent uploads overwrite MinIO evidence
|
|
100
|
+
Where: `intrusion_service.py:236`
|
|
101
|
+
Cause: the object key is `event_id.jpg`, with no lock and no version.
|
|
102
|
+
Impact: the second upload replaces the first; the evidence is lost.
|
|
103
|
+
Fix: key by `event_id/<uuid>.jpg`, or enable bucket versioning.
|
|
104
|
+
|
|
105
|
+
3. 🟡 [MED] A second resolve returns 200, not 409
|
|
106
|
+
Where: `intrusion_repository.py:216`
|
|
107
|
+
Cause: the update does not check the current status.
|
|
108
|
+
Impact: clients cannot detect a double resolve.
|
|
109
|
+
Fix: `WHERE status = 'open'`; return 409 when 0 rows match.
|
|
110
|
+
|
|
111
|
+
4. 🟡 [MED] Config upsert is not atomic; parallel PUT gives 500
|
|
112
|
+
Where: `intrusion_repository.py:59`
|
|
113
|
+
Cause: SELECT then INSERT, without `ON CONFLICT`.
|
|
114
|
+
Impact: `UniqueViolation` under load (reproduced with 2 parallel PUTs).
|
|
115
|
+
Fix: `INSERT ... ON CONFLICT (camera_id) DO UPDATE`.
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
worker --> service --> PostgreSQL pass (tx)
|
|
119
|
+
\------> MinIO same key, no lock <-- #2
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Checks:** ✅ 584 tests pass · ✅ ruff · ❌ format FAIL (6 files)
|
|
123
|
+
**Not checked:** concurrency under load (no test), PG + MinIO together (no
|
|
124
|
+
staging access), monitoring and analytics (out of scope)
|
|
125
|
+
**Quality:** Design ★★★★☆ · Tests ★★☆☆☆ (no concurrency tests)
|
|
126
|
+
|
|
127
|
+
**Next:**
|
|
128
|
+
1. Fix #1 and #2 — `intrusion_service.py`
|
|
129
|
+
2. Add regression tests for #1–#4 — `tests/test_intrusion.py`
|
|
130
|
+
3. Run `ruff format` — 6 files
|
|
131
|
+
````
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { copyFile, mkdir, readFile, realpath, rename, rm, stat } from "node:fs/p
|
|
|
16
16
|
import { dirname, isAbsolute, join, relative, resolve, win32 } from "node:path";
|
|
17
17
|
import { type ExtensionAPI, stripFrontmatter } from "@earendil-works/pi-coding-agent";
|
|
18
18
|
import { Text } from "@earendil-works/pi-tui";
|
|
19
|
+
import { type FadeTheme, fadeTextRow } from "@xynogen/pix-pretty/text";
|
|
19
20
|
import {
|
|
20
21
|
dotJoin,
|
|
21
22
|
formatCollapsedToolRow,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
getErrorMessage,
|
|
25
26
|
hideCollapsedToolCall,
|
|
26
27
|
humanSize,
|
|
28
|
+
moreLines,
|
|
27
29
|
} from "@xynogen/pix-pretty/utils";
|
|
28
30
|
import { type CollapseState, tickCollapse } from "@xynogen/pix-runtime/collapse";
|
|
29
31
|
import { ioTimeoutMs } from "@xynogen/pix-runtime/io";
|
|
@@ -737,8 +739,12 @@ function registerSkillLoader(pi: ExtensionAPI): void {
|
|
|
737
739
|
component.setText(formatRemoteSkillSearchSummary(details.query, details.results, theme));
|
|
738
740
|
return options.isPartial ? component : frameToolResult(component, theme, false);
|
|
739
741
|
}
|
|
742
|
+
const body = formatSkillSummary(formatExpandedSkillResult(details, text ?? ""), theme);
|
|
743
|
+
// Long skill bodies collapse to a fading preview; ctrl+o shows the full text.
|
|
740
744
|
component.setText(
|
|
741
|
-
|
|
745
|
+
options.expanded
|
|
746
|
+
? body
|
|
747
|
+
: fadeTextRow(body, theme as FadeTheme, (n) => moreLines(n, theme, renderCtx)),
|
|
742
748
|
);
|
|
743
749
|
return options.isPartial ? component : frameToolResult(component, theme, false);
|
|
744
750
|
}
|
package/src/picker.ts
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { CustomEditor, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
10
|
-
import { fuzzyFilter, matchesKey, type TUI
|
|
10
|
+
import { fuzzyFilter, matchesKey, mixColors, type TUI } from "@earendil-works/pi-tui";
|
|
11
11
|
import { chipTag, SKILL_TAG } from "@xynogen/pix-pretty/chips";
|
|
12
12
|
import { frameLines, modalWidth } from "@xynogen/pix-pretty/modal-frame";
|
|
13
|
+
import { fadeLine } from "@xynogen/pix-pretty/text";
|
|
13
14
|
import { showTransientMessage } from "@xynogen/pix-pretty/transient-error";
|
|
14
15
|
import type { ThemeLike } from "@xynogen/pix-pretty/types";
|
|
15
16
|
import { getErrorMessage } from "@xynogen/pix-pretty/utils";
|
|
@@ -174,6 +175,18 @@ export class SkillPicker {
|
|
|
174
175
|
}`,
|
|
175
176
|
"",
|
|
176
177
|
];
|
|
178
|
+
// Overflow fades into the modal background instead of ending in "…".
|
|
179
|
+
const { colors, style } = theme as Partial<{
|
|
180
|
+
colors: Record<string, Parameters<typeof mixColors>[0]>;
|
|
181
|
+
style: (text: string, options: { fg: ReturnType<typeof mixColors> }) => string;
|
|
182
|
+
}>;
|
|
183
|
+
const muted = colors?.muted;
|
|
184
|
+
const base = colors?.customMessageBg;
|
|
185
|
+
// Ease in over a wide ramp and stop short of the background: a quiet fade, not a cutoff.
|
|
186
|
+
const fade = (text: string, amount: number) =>
|
|
187
|
+
muted && base && style
|
|
188
|
+
? style.call(theme, text, { fg: mixColors(muted, base, amount ** 1.6 * 0.8) })
|
|
189
|
+
: theme.fg(amount < 0.5 ? "dim" : "muted", text);
|
|
177
190
|
if (!results.length) rows.push(theme.fg("muted", " no matching skills"));
|
|
178
191
|
for (const [i, item] of results.slice(start, start + MAX_VISIBLE).entries()) {
|
|
179
192
|
const isSel = start + i === this.selected;
|
|
@@ -181,7 +194,7 @@ export class SkillPicker {
|
|
|
181
194
|
const name = theme.fg(isSel ? "accent" : "dim", item.name);
|
|
182
195
|
const tag = theme.fg("muted", item.source ? "skills.sh" : "local");
|
|
183
196
|
rows.push(
|
|
184
|
-
|
|
197
|
+
fadeLine(`${marker} ${name} ${tag} ${theme.fg("muted", item.detail)}`, inner, fade, 12),
|
|
185
198
|
);
|
|
186
199
|
}
|
|
187
200
|
if (this.status) rows.push("", theme.fg("muted", ` ${this.status}`));
|