compact-agent 1.13.0 → 1.15.0

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * skill_view tool — the Level-1 step in the progressive-disclosure
3
+ * skill schema (M2 item 3, from the Hermes audit).
4
+ *
5
+ * Background. The system prompt used to inject the FULL prompt body of
6
+ * the best-matching ECC skill on every turn (up to 4KB). With 228
7
+ * skills bundled, even injecting only one match costs a lot of tokens
8
+ * for every interaction. Hermes Agent solves this with three loading
9
+ * levels:
10
+ *
11
+ * Level 0 — names + one-line descriptions ONLY in system prompt
12
+ * (~30-60 chars per skill × top-3 = ~200 char overhead)
13
+ * Level 1 — full prompt body, loaded on demand by skill_view(name)
14
+ * Level 2 — referenced sub-files inside a skill (not implemented;
15
+ * our skills are flat one-file SKILL.md units)
16
+ *
17
+ * The model sees Level 0 candidates and decides whether to escalate.
18
+ * If a skill name looks irrelevant, it skips the lookup entirely. If
19
+ * a skill clearly fits, one tool call gets the full text. Net effect
20
+ * for most turns: lower system-prompt cost, occasional one-turn
21
+ * expansion when a skill is actually needed.
22
+ *
23
+ * skill_view is read-only and non-destructive, so it bypasses every
24
+ * permission gate.
25
+ */
26
+ import type { Tool } from './types.js';
27
+ export declare const SkillViewTool: Tool;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * skill_view tool — the Level-1 step in the progressive-disclosure
3
+ * skill schema (M2 item 3, from the Hermes audit).
4
+ *
5
+ * Background. The system prompt used to inject the FULL prompt body of
6
+ * the best-matching ECC skill on every turn (up to 4KB). With 228
7
+ * skills bundled, even injecting only one match costs a lot of tokens
8
+ * for every interaction. Hermes Agent solves this with three loading
9
+ * levels:
10
+ *
11
+ * Level 0 — names + one-line descriptions ONLY in system prompt
12
+ * (~30-60 chars per skill × top-3 = ~200 char overhead)
13
+ * Level 1 — full prompt body, loaded on demand by skill_view(name)
14
+ * Level 2 — referenced sub-files inside a skill (not implemented;
15
+ * our skills are flat one-file SKILL.md units)
16
+ *
17
+ * The model sees Level 0 candidates and decides whether to escalate.
18
+ * If a skill name looks irrelevant, it skips the lookup entirely. If
19
+ * a skill clearly fits, one tool call gets the full text. Net effect
20
+ * for most turns: lower system-prompt cost, occasional one-turn
21
+ * expansion when a skill is actually needed.
22
+ *
23
+ * skill_view is read-only and non-destructive, so it bypasses every
24
+ * permission gate.
25
+ */
26
+ import { findEccSkillByName } from '../ecc.js';
27
+ export const SkillViewTool = {
28
+ name: 'skill_view',
29
+ description: 'Load the FULL prompt body of a bundled skill by name. The system prompt ' +
30
+ 'lists relevant skills as names + one-line descriptions (Level 0 disclosure); ' +
31
+ 'call this tool to read the full skill content (Level 1) when one of those ' +
32
+ 'names looks like it applies to the current request. Returns the skill\'s ' +
33
+ 'description + full prompt text. Use the exact name from the system prompt ' +
34
+ 'or any unique substring.',
35
+ parameters: {
36
+ type: 'object',
37
+ properties: {
38
+ name: {
39
+ type: 'string',
40
+ description: 'Skill name (exact or unique substring, case-insensitive)',
41
+ },
42
+ },
43
+ required: ['name'],
44
+ },
45
+ isReadOnly: true,
46
+ isDestructive: false,
47
+ async call(input) {
48
+ try {
49
+ const name = String(input.name || '').trim();
50
+ if (!name)
51
+ return { output: 'Error: name required.', isError: true };
52
+ const skill = findEccSkillByName(name);
53
+ if (!skill) {
54
+ return { output: `No skill matches "${name}". Check the Level-0 list in the system prompt for available names.`, isError: false };
55
+ }
56
+ const out = [
57
+ `# ${skill.name}`,
58
+ '',
59
+ `**Category:** ${skill.category}`,
60
+ `**Triggers:** ${skill.triggers.slice(0, 8).join(', ')}${skill.triggers.length > 8 ? '…' : ''}`,
61
+ `**Description:** ${skill.description}`,
62
+ '',
63
+ '---',
64
+ '',
65
+ skill.prompt,
66
+ ];
67
+ return { output: out.join('\n'), isError: false };
68
+ }
69
+ catch (e) {
70
+ return { output: `Error loading skill: ${e instanceof Error ? e.message : e}`, isError: true };
71
+ }
72
+ },
73
+ };
74
+ //# sourceMappingURL=skill.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I,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC/F,oBAAoB,KAAK,CAAC,WAAW,EAAE;gBACvC,EAAE;gBACF,KAAK;gBACL,EAAE;gBACF,KAAK,CAAC,MAAM;aACb,CAAC;YACF,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACpD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,EAAE,MAAM,EAAE,wBAAwB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACjG,CAAC;IACH,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compact-agent",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "A dense, feature-rich AI coding agent for the terminal. Built-in voice dictation (Whisper) + TTS readout (ElevenLabs) + screen-reader mode for blind / low-vision users. 80+ slash commands, 9 modes including Hermes self-improving loop, multi-agent orchestration, bundled everything-claude-code skills library, learning system, and observable LLM transport. Works with OpenRouter, OpenAI, Anthropic-compatible, Ollama, LM Studio, DeepSeek, or any OpenAI-compatible API.",
5
5
  "type": "module",
6
6
  "license": "MIT",