@selesai/code 0.5.21 → 0.5.23
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 +1 -1
- package/dist/core/agent-session-skill-block.test.d.ts +2 -0
- package/dist/core/agent-session-skill-block.test.d.ts.map +1 -0
- package/dist/core/agent-session-skill-block.test.js +20 -0
- package/dist/core/agent-session-skill-block.test.js.map +1 -0
- package/dist/core/agent-session.d.ts +7 -4
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +22 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/data/capabilities.d.ts +48 -0
- package/dist/data/capabilities.d.ts.map +1 -0
- package/dist/data/capabilities.js +282 -0
- package/dist/data/capabilities.js.map +1 -0
- package/dist/data/navigation.d.ts +3 -0
- package/dist/data/navigation.d.ts.map +1 -0
- package/dist/data/navigation.js +90 -0
- package/dist/data/navigation.js.map +1 -0
- package/dist/extensions/inline-skills.test.ts +96 -0
- package/dist/extensions/inline-skills.ts +92 -0
- package/dist/extensions/package.json +1 -0
- package/dist/extensions/pi-powerline-footer/tests/tps.test.ts +39 -0
- package/dist/extensions/pi-powerline-footer/tps.ts +172 -113
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +0 -4
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1 -1
- package/dist/extensions/question/batch.ts +89 -25
- package/dist/extensions/question/constants.ts +1 -1
- package/dist/extensions/question/helpers.ts +34 -78
- package/dist/extensions/question/index.ts +327 -564
- package/dist/extensions/question/package.json +2 -1
- package/dist/extensions/question/question-list.ts +21 -14
- package/dist/extensions/question/row-layout.ts +2 -2
- package/dist/extensions/question/schemas.ts +33 -47
- package/dist/extensions/question/selection-mode.ts +5 -7
- package/dist/extensions/question/tests/batch.test.ts +65 -16
- package/dist/extensions/question/tests/helpers.test.ts +31 -156
- package/dist/extensions/question/tests/question-list.test.ts +17 -3
- package/dist/extensions/question/tests/row-layout.test.ts +4 -4
- package/dist/extensions/question/tests/schemas.test.ts +30 -0
- package/dist/extensions/question/tests/wizard.test.ts +99 -0
- package/dist/extensions/question/types.ts +65 -66
- package/dist/extensions/workflow/adapter.ts +20 -77
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +10 -10
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/skills/workflow-creation/SKILL.md +2 -2
- package/docs/skills.md +8 -0
- package/docs/workflows.md +4 -4
- package/package.json +1 -1
|
@@ -38,20 +38,30 @@ import { createLocalBashOperations } from "./tools/bash.js";
|
|
|
38
38
|
import { createAllToolDefinitions } from "./tools/index.js";
|
|
39
39
|
import { createToolDefinitionFromAgentTool } from "./tools/tool-definition-wrapper.js";
|
|
40
40
|
import { addUsageToTotals, createUsageTotals } from "./usage-totals.js";
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
/** Parse consecutive skill blocks at the start of a user message. */
|
|
42
|
+
export function parseSkillBlocks(text) {
|
|
43
|
+
const skills = [];
|
|
44
|
+
let remaining = text;
|
|
45
|
+
while (remaining.startsWith("<skill ")) {
|
|
46
|
+
const match = remaining.match(/^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?=\n\n|$)/);
|
|
47
|
+
if (!match)
|
|
48
|
+
return null;
|
|
49
|
+
skills.push({ name: match[1], location: match[2], content: match[3], userMessage: undefined });
|
|
50
|
+
remaining = remaining.slice(match[0].length);
|
|
51
|
+
if (remaining.startsWith("\n\n"))
|
|
52
|
+
remaining = remaining.slice(2);
|
|
53
|
+
}
|
|
54
|
+
if (skills.length === 0)
|
|
55
|
+
return null;
|
|
56
|
+
const userMessage = remaining.trim() || undefined;
|
|
57
|
+
return { skills, userMessage };
|
|
58
|
+
}
|
|
59
|
+
/** Parse one skill block, retained for API compatibility. */
|
|
45
60
|
export function parseSkillBlock(text) {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
61
|
+
const parsed = parseSkillBlocks(text);
|
|
62
|
+
if (!parsed || parsed.skills.length !== 1)
|
|
48
63
|
return null;
|
|
49
|
-
return {
|
|
50
|
-
name: match[1],
|
|
51
|
-
location: match[2],
|
|
52
|
-
content: match[3],
|
|
53
|
-
userMessage: match[4]?.trim() || undefined,
|
|
54
|
-
};
|
|
64
|
+
return { ...parsed.skills[0], userMessage: parsed.userMessage };
|
|
55
65
|
}
|
|
56
66
|
// ============================================================================
|
|
57
67
|
// Types
|