@gtrabanco/pi-agentic-workflow 0.4.0 → 0.4.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/README.es.md +3 -2
- package/README.md +3 -2
- package/dist/routing/catalogue.js +59 -1
- package/package.json +2 -1
package/README.es.md
CHANGED
|
@@ -145,8 +145,9 @@ archivo de proyecto mientras el proyecto no sea de confianza.
|
|
|
145
145
|
|
|
146
146
|
## Notas
|
|
147
147
|
|
|
148
|
-
- Probado con Pi 0.
|
|
149
|
-
|
|
148
|
+
- Probado con Pi 0.85.0 (2026-09-04) (`pi install`, skills de paquete, registro de
|
|
149
|
+
comandos amigables, set/clear enrutado, round-trip de consola de ajustes,
|
|
150
|
+
`sendUserMessage` con expansión de plantillas).
|
|
150
151
|
- El paquete declara Pi como peer dependency; no incluye ninguna copia de Pi.
|
|
151
152
|
- Las skills pueden indicar al modelo que ejecute comandos. Revísalas como con
|
|
152
153
|
cualquier paquete de terceros.
|
package/README.md
CHANGED
|
@@ -139,8 +139,9 @@ touch the project file while the project is untrusted.
|
|
|
139
139
|
|
|
140
140
|
## Notes
|
|
141
141
|
|
|
142
|
-
- Verified against Pi 0.
|
|
143
|
-
|
|
142
|
+
- Verified against Pi 0.85.0 (2026-09-04) (`pi install`, package skills, friendly
|
|
143
|
+
command registration, routed set/clear, settings console round-trip, `sendUserMessage`
|
|
144
|
+
with prompt template expansion).
|
|
144
145
|
- The package declares Pi as a peer dependency; it bundles no copy of Pi.
|
|
145
146
|
- Skills can instruct the model to run commands. Review them as you would any
|
|
146
147
|
third-party package.
|
|
@@ -34,7 +34,31 @@ export function readSkillMeta(text, dir) {
|
|
|
34
34
|
if (colon === -1)
|
|
35
35
|
continue;
|
|
36
36
|
const key = line.slice(0, colon).trim();
|
|
37
|
-
const
|
|
37
|
+
const rawValue = line.slice(colon + 1).trim();
|
|
38
|
+
const value = rawValue.replace(/^["']|["']$/gu, "");
|
|
39
|
+
// YAML block scalars: `description: >` (folded) / `description: |` (literal)
|
|
40
|
+
// carry their content on the following indented lines, not inline. Collect
|
|
41
|
+
// those continuation lines (they never start a top-level `key: value` line)
|
|
42
|
+
// and advance the loop past them. ">" is not a description, so the old
|
|
43
|
+
// line-oriented reader storing `>` is the bug (#165).
|
|
44
|
+
if (key === "description" && (value === ">" || value === "|")) {
|
|
45
|
+
const folded = value === ">";
|
|
46
|
+
const collected = [];
|
|
47
|
+
let cursor = index + 1;
|
|
48
|
+
for (; cursor < lines.length; cursor += 1) {
|
|
49
|
+
const next = lines[cursor];
|
|
50
|
+
if (next.trim() === "---")
|
|
51
|
+
break;
|
|
52
|
+
// A non-empty, non-indented line starts the next top-level key.
|
|
53
|
+
if (next !== "" && !/^[ \t]/u.test(next))
|
|
54
|
+
break;
|
|
55
|
+
collected.push(next);
|
|
56
|
+
}
|
|
57
|
+
meta.description = buildBlockScalar(collected, folded);
|
|
58
|
+
// Outer loop += 1 moves past the last consumed continuation line.
|
|
59
|
+
index = cursor - 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
38
62
|
if (key === "name" && value !== "")
|
|
39
63
|
meta.name = value;
|
|
40
64
|
else if (key === "description" && value !== "")
|
|
@@ -44,6 +68,40 @@ export function readSkillMeta(text, dir) {
|
|
|
44
68
|
}
|
|
45
69
|
return meta;
|
|
46
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Assemble a YAML block scalar from its collected, indented continuation lines.
|
|
73
|
+
*
|
|
74
|
+
* Strip the common leading indentation, then: folded (`>`) joins non-blank
|
|
75
|
+
* lines into a single space-separated string (blank lines become page breaks);
|
|
76
|
+
* literal (`|`) preserves the line breaks. Both are trimmed of outer blank
|
|
77
|
+
* whitespace so the value matches the frontmatter's intended text.
|
|
78
|
+
*/
|
|
79
|
+
function buildBlockScalar(lines, folded) {
|
|
80
|
+
const nonEmpty = lines.filter((line) => line.length > 0);
|
|
81
|
+
const indent = nonEmpty.reduce((min, line) => {
|
|
82
|
+
const width = /^[ \t]*/u.exec(line)[0].length;
|
|
83
|
+
return Math.min(min, width);
|
|
84
|
+
}, Number.POSITIVE_INFINITY);
|
|
85
|
+
if (!Number.isFinite(indent))
|
|
86
|
+
return "";
|
|
87
|
+
const unindented = lines.map((line) => (line.length === 0 ? "" : line.slice(indent)));
|
|
88
|
+
if (!folded)
|
|
89
|
+
return unindented.join("\n").trim();
|
|
90
|
+
const parts = [];
|
|
91
|
+
let pendingBreak = false;
|
|
92
|
+
for (const raw of unindented) {
|
|
93
|
+
const line = raw.trimEnd();
|
|
94
|
+
if (line === "") {
|
|
95
|
+
pendingBreak = true;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (pendingBreak && parts.length > 0)
|
|
99
|
+
parts.push("\n");
|
|
100
|
+
pendingBreak = false;
|
|
101
|
+
parts.push(line);
|
|
102
|
+
}
|
|
103
|
+
return parts.join(" ").replace(/ \n/g, "\n").trim();
|
|
104
|
+
}
|
|
47
105
|
/**
|
|
48
106
|
* Read a bundled skills directory. A duplicate `name:` is reported instead of
|
|
49
107
|
* silently shadowing an alias: two skills claiming one command is a packaging
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtrabanco/pi-agentic-workflow",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Pi package: canonical agentic-workflow skills, friendly slash commands, and per-command model routing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@earendil-works/pi-coding-agent": "*"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
+
"@earendil-works/pi-server": "0.85.0",
|
|
56
57
|
"@types/node": "^24",
|
|
57
58
|
"typescript": "6"
|
|
58
59
|
}
|