@xynogen/pix-skills 0.6.1 → 0.6.3

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 CHANGED
@@ -183,7 +183,8 @@ lookups never run commands. Calls and results identify the operation as `list`,
183
183
  at most the first 100 characters, while the full content still reaches the agent.
184
184
  Copied-resource results show
185
185
  the destination and byte size. Tool results follow Pix's configured auto-collapse
186
- delay, including `read_skills`.
186
+ delay, including `read_skills`; expanding an elapsed result restores its normal
187
+ preview without clearing or restarting the collapse timer.
187
188
 
188
189
  ## Usage
189
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -47,6 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@xynogen/pix-data": "^0.3.2",
50
- "@xynogen/pix-gate": "^0.1.13"
50
+ "@xynogen/pix-gate": "^0.1.13",
51
+ "@xynogen/pix-pretty": "^1.7.20"
51
52
  }
52
53
  }
package/skills/plan.md CHANGED
@@ -64,6 +64,11 @@ Expected: PASS
64
64
 
65
65
  ### Save and Handoff
66
66
 
67
- - Save plan to `.pi/plans/YYYY-MM-DD-<feature-name>.md`
68
- - Commit plan document
69
- - Announce: "Plan complete. Ready to execute via `/task`."
67
+ - Save the plan locally to `.pi/plans/YYYY-MM-DD-<feature-name>.md` so an
68
+ execution agent can follow it via `/task`.
69
+ - Plans are local execution artifacts and MUST NOT be added to Git, committed,
70
+ pushed, or included in repository history under normal circumstances.
71
+ - If `.pi/` is ignored, leave it ignored. Never use `git add -f` for a plan.
72
+ - Only commit a plan when the user explicitly asks to version or publish that
73
+ specific plan; the directive itself is not permission.
74
+ - Announce: "Plan complete and saved locally. Ready to execute via `/task`."
package/src/index.test.ts CHANGED
@@ -3,7 +3,7 @@ import { mkdir, mkdtemp, rm, symlink, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
 
6
- import {
6
+ import registerSkills, {
7
7
  copySkillResource,
8
8
  extractDescription,
9
9
  extractName,
@@ -120,6 +120,46 @@ describe("formatCollapsedSkillResult", () => {
120
120
  });
121
121
  });
122
122
 
123
+ describe("skill renderer", () => {
124
+ it("restores the normal result when an elapsed card is expanded", () => {
125
+ let registered: Record<string, unknown> = {};
126
+ registerSkills({
127
+ registerTool(tool: unknown) {
128
+ registered = tool as Record<string, unknown>;
129
+ },
130
+ on() {},
131
+ } as never);
132
+ const renderResult = registered.renderResult as (...args: unknown[]) => {
133
+ render: (width: number) => string[];
134
+ };
135
+ const rendered = renderResult(
136
+ {
137
+ content: [{ type: "text", text: "portable guidance" }],
138
+ details: {
139
+ mode: "reference",
140
+ name: "docx",
141
+ resource: "references/guide.md",
142
+ bytes: 17,
143
+ },
144
+ },
145
+ {},
146
+ tagTheme,
147
+ {
148
+ expanded: true,
149
+ isError: false,
150
+ state: { collapsed: true },
151
+ invalidate: () => {},
152
+ },
153
+ )
154
+ .render(120)
155
+ .join("\n");
156
+
157
+ expect(rendered).toContain("REFERENCE · docx");
158
+ expect(rendered).toContain("portable guidance");
159
+ expect(rendered).not.toContain("✓ skill");
160
+ });
161
+ });
162
+
123
163
  describe("formatExpandedSkillResult", () => {
124
164
  it("gives description, instructions, reference, and copy distinct output", () => {
125
165
  expect(
package/src/index.ts CHANGED
@@ -19,6 +19,7 @@ import { fileURLToPath } from "node:url";
19
19
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
20
20
  import { Text } from "@earendil-works/pi-tui";
21
21
  import { type CollapseState, tickCollapse } from "@xynogen/pix-data/collapse";
22
+ import { formatCollapsedToolRow, hideCollapsedToolCall } from "@xynogen/pix-pretty/utils";
22
23
  import { Type } from "typebox";
23
24
  import {
24
25
  directiveBlockReason,
@@ -510,13 +511,20 @@ function registerSkillLoader(pi: ExtensionAPI): void {
510
511
  }
511
512
  },
512
513
 
513
- renderCall(args, theme) {
514
+ renderCall(args, theme, renderCtx) {
515
+ const component =
516
+ renderCtx.lastComponent instanceof Text ? renderCtx.lastComponent : new Text("", 0, 0);
517
+ if (
518
+ hideCollapsedToolCall(renderCtx.state as CollapseState, renderCtx.expanded, (value) =>
519
+ component.setText(value),
520
+ )
521
+ )
522
+ return component;
514
523
  const label = formatSkillCallLabel(args as SkillCallArgs);
515
- return new Text(
524
+ component.setText(
516
525
  `${theme.fg("toolTitle", theme.bold("read_skills"))} ${theme.fg("muted", label)}`,
517
- 0,
518
- 0,
519
526
  );
527
+ return component;
520
528
  },
521
529
 
522
530
  renderResult(result, _options, theme, renderCtx) {
@@ -529,8 +537,10 @@ function registerSkillLoader(pi: ExtensionAPI): void {
529
537
  const details = result.details as SkillResultDetails | undefined;
530
538
  if (!renderCtx.isError && details) {
531
539
  const state = renderCtx.state as CollapseState;
532
- if (tickCollapse("read_skills", state, renderCtx.invalidate)) {
533
- component.setText(theme.fg("muted", formatCollapsedSkillResult(details)));
540
+ if (tickCollapse("read_skills", state, renderCtx.invalidate, renderCtx.expanded)) {
541
+ component.setText(
542
+ formatCollapsedToolRow(theme, "skill", formatCollapsedSkillResult(details)),
543
+ );
534
544
  return component;
535
545
  }
536
546
  component.setText(