@xynogen/pix-skills 0.6.0 → 0.6.2
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 +3 -2
- package/skills/clone.md +3 -3
- package/src/index.ts +16 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-skills",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
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/clone.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clone
|
|
3
|
-
description:
|
|
3
|
+
description: Temporarily clone an external git repository into /tmp/clones for read-only exploration. Use only when the user's goal is to inspect or analyze a repository; do not use for working copies or requested destinations.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
|
-
#
|
|
6
|
+
# Temporary Repository Exploration
|
|
7
7
|
|
|
8
8
|
## Below are what agent MUST do
|
|
9
9
|
|
|
10
|
+
- **FIT CHECK**: Use only for temporary, read-only exploration. Do not use when the user asks to clone "here," specifies a destination, needs a persistent working copy, or intends to modify the repository. A git URL or the word "clone" alone is not sufficient.
|
|
10
11
|
- **AUTO-RUN**: Run terminal commands proactively without confirmation unless explicit input required.
|
|
11
|
-
- **AUTO-INVOKE**: Trigger automatically when user message contains git URL, repo shorthand (`owner/repo`), or phrases like "clone", "look at this repo", "explore", "analyze this project", "check out <url>".
|
|
12
12
|
- **INPUT**: Accept git URL (https, ssh, or `github.com/owner/repo` / `owner/repo` shorthand). Normalize shorthand → `https://github.com/owner/repo`.
|
|
13
13
|
- **TARGET**: Derive repo name from URL (strip `.git`). Clone dest: `/tmp/clones/<repo-name>`.
|
|
14
14
|
- **IDEMPOTENT**: `/tmp/clones/<repo-name>` exists + is git repo → `cd` in, `git fetch --all --prune`, report current branch/HEAD instead of re-cloning. Path exists but NOT git repo → abort with error.
|
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,
|
|
@@ -412,7 +413,7 @@ function registerSkillLoader(pi: ExtensionAPI): void {
|
|
|
412
413
|
"Browse skills and access conventional bundle resources. References can be read into context; scripts/assets must be copied to a project-relative output path before use.",
|
|
413
414
|
promptSnippet: "Browse and load bundled skill instructions",
|
|
414
415
|
promptGuidelines: [
|
|
415
|
-
"
|
|
416
|
+
"Load a skill only when it clearly fits the user's intent, never by keyword alone, and do not reload skills already read this session.",
|
|
416
417
|
],
|
|
417
418
|
executionMode: "sequential",
|
|
418
419
|
parameters: ParamsSchema,
|
|
@@ -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
|
-
|
|
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) {
|
|
@@ -530,7 +538,9 @@ function registerSkillLoader(pi: ExtensionAPI): void {
|
|
|
530
538
|
if (!renderCtx.isError && details) {
|
|
531
539
|
const state = renderCtx.state as CollapseState;
|
|
532
540
|
if (tickCollapse("read_skills", state, renderCtx.invalidate)) {
|
|
533
|
-
component.setText(
|
|
541
|
+
component.setText(
|
|
542
|
+
formatCollapsedToolRow(theme, "skill", formatCollapsedSkillResult(details)),
|
|
543
|
+
);
|
|
534
544
|
return component;
|
|
535
545
|
}
|
|
536
546
|
component.setText(
|