@compilr-dev/sdk 0.9.7 → 0.9.8
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/dist/guide/guide-tool.d.ts +31 -0
- package/dist/guide/guide-tool.js +90 -0
- package/dist/guide/index.d.ts +7 -0
- package/dist/guide/index.js +6 -0
- package/dist/guide/search.d.ts +21 -0
- package/dist/guide/search.js +62 -0
- package/dist/guide/shared-content.d.ts +8 -0
- package/dist/guide/shared-content.js +267 -0
- package/dist/guide/types.d.ts +34 -0
- package/dist/guide/types.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide Tool Factory — creates an environment-aware compilr_guide tool.
|
|
3
|
+
*
|
|
4
|
+
* The tool definition lives in the SDK. Each host app (CLI, Desktop)
|
|
5
|
+
* registers environment-specific content via additionalEntries.
|
|
6
|
+
*/
|
|
7
|
+
import type { GuideToolConfig } from './types.js';
|
|
8
|
+
interface GuideInput {
|
|
9
|
+
query?: string;
|
|
10
|
+
list_topics?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create the compilr_guide tool for the given environment.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // In CLI
|
|
18
|
+
* const guideTool = createGuideTool({
|
|
19
|
+
* environment: 'cli',
|
|
20
|
+
* additionalEntries: CLI_GUIDE_ENTRIES,
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // In Desktop
|
|
24
|
+
* const guideTool = createGuideTool({
|
|
25
|
+
* environment: 'desktop',
|
|
26
|
+
* additionalEntries: DESKTOP_GUIDE_ENTRIES,
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function createGuideTool(config: GuideToolConfig): import("@compilr-dev/agents").Tool<GuideInput>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide Tool Factory — creates an environment-aware compilr_guide tool.
|
|
3
|
+
*
|
|
4
|
+
* The tool definition lives in the SDK. Each host app (CLI, Desktop)
|
|
5
|
+
* registers environment-specific content via additionalEntries.
|
|
6
|
+
*/
|
|
7
|
+
import { defineTool } from '@compilr-dev/agents';
|
|
8
|
+
import { SHARED_GUIDE_ENTRIES } from './shared-content.js';
|
|
9
|
+
import { searchGuideEntries } from './search.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create the compilr_guide tool for the given environment.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // In CLI
|
|
16
|
+
* const guideTool = createGuideTool({
|
|
17
|
+
* environment: 'cli',
|
|
18
|
+
* additionalEntries: CLI_GUIDE_ENTRIES,
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // In Desktop
|
|
22
|
+
* const guideTool = createGuideTool({
|
|
23
|
+
* environment: 'desktop',
|
|
24
|
+
* additionalEntries: DESKTOP_GUIDE_ENTRIES,
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
29
|
+
export function createGuideTool(config) {
|
|
30
|
+
// Merge shared + environment-specific content
|
|
31
|
+
const allEntries = [...SHARED_GUIDE_ENTRIES, ...(config.additionalEntries ?? [])];
|
|
32
|
+
const envLabel = config.environment === 'desktop' ? 'Desktop' : 'CLI';
|
|
33
|
+
return defineTool({
|
|
34
|
+
name: 'compilr_guide',
|
|
35
|
+
description: `Get documentation about Compilr Dev ${envLabel} features and capabilities. ` +
|
|
36
|
+
`Use this to answer user questions about how to use the ${envLabel.toLowerCase()}. ` +
|
|
37
|
+
'Query by topic (e.g., "creating-project", "team-agents", "image-support") or ' +
|
|
38
|
+
'set list_topics=true to see all available topics.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
query: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Topic or keyword to look up. Examples: "creating-project", "team-agents", "permissions", "image-support"',
|
|
45
|
+
},
|
|
46
|
+
list_topics: {
|
|
47
|
+
type: 'boolean',
|
|
48
|
+
description: 'Set to true to list all available guide topics',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
execute: (input) => {
|
|
53
|
+
if (input.list_topics) {
|
|
54
|
+
const topics = allEntries.map((e) => `- ${e.id} — ${e.title}`).join('\n');
|
|
55
|
+
return Promise.resolve({
|
|
56
|
+
success: true,
|
|
57
|
+
result: {
|
|
58
|
+
output: `Available guide topics (${envLabel}):\n\n${topics}`,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (!input.query) {
|
|
63
|
+
return Promise.resolve({
|
|
64
|
+
success: true,
|
|
65
|
+
result: {
|
|
66
|
+
output: 'Provide a query (topic or keyword) or set list_topics=true to see all topics.',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const results = searchGuideEntries(allEntries, input.query);
|
|
71
|
+
if (results.length === 0) {
|
|
72
|
+
const topics = allEntries.map((e) => e.id).join(', ');
|
|
73
|
+
return Promise.resolve({
|
|
74
|
+
success: true,
|
|
75
|
+
result: {
|
|
76
|
+
output: `No guide found for "${input.query}".\n\nAvailable topics: ${topics}`,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const formatted = results
|
|
81
|
+
.map((entry) => `## ${entry.title}\n\n${entry.content}`)
|
|
82
|
+
.join('\n\n---\n\n');
|
|
83
|
+
return Promise.resolve({
|
|
84
|
+
success: true,
|
|
85
|
+
result: { output: formatted },
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
silent: true,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide module — environment-aware documentation tool.
|
|
3
|
+
*/
|
|
4
|
+
export { createGuideTool } from './guide-tool.js';
|
|
5
|
+
export { SHARED_GUIDE_ENTRIES } from './shared-content.js';
|
|
6
|
+
export { searchGuideEntries, topicToGuideEntry } from './search.js';
|
|
7
|
+
export type { GuideEntry, ContentTopic, ContentSection, GuideToolConfig } from './types.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide search — finds relevant entries by query.
|
|
3
|
+
*/
|
|
4
|
+
import type { GuideEntry } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Search guide entries by keyword, topic ID, or free text.
|
|
7
|
+
* Returns up to maxResults matches, ranked by relevance.
|
|
8
|
+
*/
|
|
9
|
+
export declare function searchGuideEntries(entries: GuideEntry[], query: string, maxResults?: number): GuideEntry[];
|
|
10
|
+
/**
|
|
11
|
+
* Convert a ContentTopic to a GuideEntry (plain text).
|
|
12
|
+
*/
|
|
13
|
+
export declare function topicToGuideEntry(topic: {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
keywords: string[];
|
|
17
|
+
sections: Array<{
|
|
18
|
+
title?: string;
|
|
19
|
+
items: string[];
|
|
20
|
+
}>;
|
|
21
|
+
}): GuideEntry;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide search — finds relevant entries by query.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Search guide entries by keyword, topic ID, or free text.
|
|
6
|
+
* Returns up to maxResults matches, ranked by relevance.
|
|
7
|
+
*/
|
|
8
|
+
export function searchGuideEntries(entries, query, maxResults = 3) {
|
|
9
|
+
const q = query.toLowerCase().trim();
|
|
10
|
+
if (!q)
|
|
11
|
+
return [];
|
|
12
|
+
// 1. Exact ID match
|
|
13
|
+
const exactMatch = entries.find((e) => e.id === q);
|
|
14
|
+
if (exactMatch)
|
|
15
|
+
return [exactMatch];
|
|
16
|
+
// 2. Command match (e.g., "/design" → "skill-design", or "design")
|
|
17
|
+
const cmdQuery = q.startsWith('/') ? q : `/${q}`;
|
|
18
|
+
const cmdMatch = entries.find((e) => e.keywords.includes(cmdQuery) || e.keywords.includes(q));
|
|
19
|
+
if (cmdMatch)
|
|
20
|
+
return [cmdMatch];
|
|
21
|
+
// 3. Keyword + title + content search with scoring
|
|
22
|
+
const scored = entries
|
|
23
|
+
.map((e) => {
|
|
24
|
+
let score = 0;
|
|
25
|
+
// Keyword match (strongest signal)
|
|
26
|
+
if (e.keywords.some((k) => k === q))
|
|
27
|
+
score += 10;
|
|
28
|
+
if (e.keywords.some((k) => k.includes(q)))
|
|
29
|
+
score += 5;
|
|
30
|
+
if (e.keywords.some((k) => q.includes(k) && k.length > 2))
|
|
31
|
+
score += 3;
|
|
32
|
+
// Title match
|
|
33
|
+
if (e.title.toLowerCase().includes(q))
|
|
34
|
+
score += 4;
|
|
35
|
+
// Content match (weakest signal)
|
|
36
|
+
if (e.content.toLowerCase().includes(q))
|
|
37
|
+
score += 1;
|
|
38
|
+
return { entry: e, score };
|
|
39
|
+
})
|
|
40
|
+
.filter((s) => s.score > 0)
|
|
41
|
+
.sort((a, b) => b.score - a.score);
|
|
42
|
+
return scored.slice(0, maxResults).map((s) => s.entry);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Convert a ContentTopic to a GuideEntry (plain text).
|
|
46
|
+
*/
|
|
47
|
+
export function topicToGuideEntry(topic) {
|
|
48
|
+
const parts = [];
|
|
49
|
+
for (const section of topic.sections) {
|
|
50
|
+
if (section.title)
|
|
51
|
+
parts.push(section.title);
|
|
52
|
+
for (const item of section.items) {
|
|
53
|
+
parts.push(` ${item}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
id: topic.id,
|
|
58
|
+
title: topic.title,
|
|
59
|
+
keywords: topic.keywords,
|
|
60
|
+
content: parts.join('\n'),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Guide Content — environment-agnostic topics.
|
|
3
|
+
*
|
|
4
|
+
* These apply to both CLI and Desktop. Each entry describes a feature
|
|
5
|
+
* that works the same way regardless of the host application.
|
|
6
|
+
*/
|
|
7
|
+
import type { GuideEntry } from './types.js';
|
|
8
|
+
export declare const SHARED_GUIDE_ENTRIES: GuideEntry[];
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Guide Content — environment-agnostic topics.
|
|
3
|
+
*
|
|
4
|
+
* These apply to both CLI and Desktop. Each entry describes a feature
|
|
5
|
+
* that works the same way regardless of the host application.
|
|
6
|
+
*/
|
|
7
|
+
export const SHARED_GUIDE_ENTRIES = [
|
|
8
|
+
// ── Projects ────────────────────────────────────────────────────────────
|
|
9
|
+
{
|
|
10
|
+
id: 'creating-project',
|
|
11
|
+
title: 'Creating a New Project',
|
|
12
|
+
keywords: ['create', 'new', 'project', 'start'],
|
|
13
|
+
content: `To create a new project, use the project creation flow.
|
|
14
|
+
|
|
15
|
+
You'll specify:
|
|
16
|
+
- Project name and display name
|
|
17
|
+
- Project type (software, research, book, business-plan, etc.)
|
|
18
|
+
- Project path (where files live on disk)
|
|
19
|
+
|
|
20
|
+
After creation, the project is set as active and agents can start working in it.
|
|
21
|
+
|
|
22
|
+
7 project types are available:
|
|
23
|
+
- software — Full-stack web apps, APIs, libraries
|
|
24
|
+
- research — Academic papers, literature reviews
|
|
25
|
+
- book — Books, chapters, outlines
|
|
26
|
+
- course — Courses, curricula, lessons
|
|
27
|
+
- business-plan — Business plans, pitch decks, financials
|
|
28
|
+
- content-marketing — Content calendars, articles
|
|
29
|
+
- tech-docs — Documentation, API references, tutorials`,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'project-types',
|
|
33
|
+
title: 'Project Types',
|
|
34
|
+
keywords: [
|
|
35
|
+
'project type',
|
|
36
|
+
'software',
|
|
37
|
+
'research',
|
|
38
|
+
'book',
|
|
39
|
+
'business',
|
|
40
|
+
'course',
|
|
41
|
+
'content',
|
|
42
|
+
'tech-docs',
|
|
43
|
+
],
|
|
44
|
+
content: `Each project type determines which agent roles, skills, and tools are most relevant:
|
|
45
|
+
|
|
46
|
+
**software** — Agent roles: dev, pm, qa, arch. Skills: /design, /prd, /architecture, /scaffold, /build
|
|
47
|
+
**research** — Agent roles: researcher, reviewer, writer. Skills: /outline, /literature-review, /methodology, /abstract
|
|
48
|
+
**book** — Agent roles: editor, writer, reviewer. Skills: /outline, /chapter
|
|
49
|
+
**course** — Agent roles: instructor, writer, reviewer. Skills: /outline, /lesson
|
|
50
|
+
**business-plan** — Agent roles: analyst, strategist, writer. Skills: /business-vision, /market-analysis, /financial-model, /pitch
|
|
51
|
+
**content-marketing** — Agent roles: writer, editor, strategist. Skills: /editorial-calendar, /article
|
|
52
|
+
**tech-docs** — Agent roles: writer, dev, reviewer. Skills: /getting-started, /api-reference, /tutorial
|
|
53
|
+
|
|
54
|
+
All project types support: teams, backlog, documents, knowledge base, file references, anchors.`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'importing-project',
|
|
58
|
+
title: 'Importing an Existing Project',
|
|
59
|
+
keywords: ['import', 'existing', 'project', 'folder'],
|
|
60
|
+
content: `You can import an existing project directory. The system will:
|
|
61
|
+
1. Detect the project type from its contents
|
|
62
|
+
2. Create a project entry in the database
|
|
63
|
+
3. Read COMPILR.md if present (project context for the agent)
|
|
64
|
+
4. Set it as the active project
|
|
65
|
+
|
|
66
|
+
The agent then has context about your project and can help immediately.`,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'switching-projects',
|
|
70
|
+
title: 'Switching Projects',
|
|
71
|
+
keywords: ['switch', 'change', 'project', 'select'],
|
|
72
|
+
content: `You can switch between projects at any time. When you switch:
|
|
73
|
+
- The active project changes
|
|
74
|
+
- Agents get the new project's context (COMPILR.md, anchors, KB)
|
|
75
|
+
- Existing conversations are preserved (per-project)`,
|
|
76
|
+
},
|
|
77
|
+
// ── Teams & Agents ──────────────────────────────────────────────────────
|
|
78
|
+
{
|
|
79
|
+
id: 'team-agents',
|
|
80
|
+
title: 'Team Agents',
|
|
81
|
+
keywords: ['team', 'agents', '$agent', 'mention', 'role', 'specialist'],
|
|
82
|
+
content: `Team agents are specialized AI assistants with different roles and expertise.
|
|
83
|
+
|
|
84
|
+
Use $agent to mention an agent (e.g., "$arch review this design", "$qa write tests").
|
|
85
|
+
|
|
86
|
+
Available roles:
|
|
87
|
+
- $dev — Software developer (coding, debugging)
|
|
88
|
+
- $pm — Product manager (requirements, priorities)
|
|
89
|
+
- $qa — QA engineer (testing, quality)
|
|
90
|
+
- $arch — Architect (design, patterns, decisions)
|
|
91
|
+
- $writer — Technical writer (docs, README)
|
|
92
|
+
- $researcher — Research assistant (literature, analysis)
|
|
93
|
+
- $reviewer — Code/content reviewer
|
|
94
|
+
- $editor — Content editor (prose, structure)
|
|
95
|
+
- $analyst — Data/business analyst
|
|
96
|
+
- $strategist — Strategy and planning
|
|
97
|
+
- $instructor — Teaching and course design
|
|
98
|
+
|
|
99
|
+
Each role has a tailored system prompt and tool set.`,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'coordinator-mode',
|
|
103
|
+
title: 'Coordinator Mode',
|
|
104
|
+
keywords: ['coordinator', 'delegation', 'delegate', 'background', 'multi-agent'],
|
|
105
|
+
content: `Coordinator mode allows one agent to delegate tasks to others.
|
|
106
|
+
|
|
107
|
+
The coordinator can:
|
|
108
|
+
- delegate_background: Send a task to another agent to run in background
|
|
109
|
+
- delegation_status: Check on running delegations
|
|
110
|
+
- Receive results when delegated tasks complete
|
|
111
|
+
|
|
112
|
+
Useful for: code review ($qa), documentation ($writer), architecture analysis ($arch).
|
|
113
|
+
|
|
114
|
+
The delegated agent runs independently and returns results to the coordinator.`,
|
|
115
|
+
},
|
|
116
|
+
// ── Skills ──────────────────────────────────────────────────────────────
|
|
117
|
+
{
|
|
118
|
+
id: 'skills-overview',
|
|
119
|
+
title: 'Skills Overview',
|
|
120
|
+
keywords: ['skills', 'slash', 'command', '/'],
|
|
121
|
+
content: `Skills are pre-built prompts that guide the agent through specific workflows.
|
|
122
|
+
|
|
123
|
+
Use them by typing / followed by the skill name (e.g., /design, /build).
|
|
124
|
+
|
|
125
|
+
Skills vary by project type. Software projects have: /design, /prd, /architecture, /scaffold, /build, /backlog, /session-notes.
|
|
126
|
+
|
|
127
|
+
Research projects have: /outline, /literature-review, /methodology, /abstract.
|
|
128
|
+
|
|
129
|
+
Business projects have: /business-vision, /market-analysis, /financial-model, /pitch.
|
|
130
|
+
|
|
131
|
+
Skills can be combined with your own instructions: type /design then add context.`,
|
|
132
|
+
},
|
|
133
|
+
// ── Models & Providers ──────────────────────────────────────────────────
|
|
134
|
+
{
|
|
135
|
+
id: 'models',
|
|
136
|
+
title: 'Models and Providers',
|
|
137
|
+
keywords: ['model', 'provider', 'claude', 'openai', 'gemini', 'ollama', 'llm'],
|
|
138
|
+
content: `Compilr Dev supports multiple LLM providers:
|
|
139
|
+
|
|
140
|
+
- Claude (Anthropic) — Claude Opus, Sonnet, Haiku
|
|
141
|
+
- OpenAI — GPT-4o, GPT-4o-mini
|
|
142
|
+
- Gemini (Google) — Gemini 2.5 Pro, Flash
|
|
143
|
+
- Ollama — Local models (llama, codellama, etc.)
|
|
144
|
+
- Together, Groq, Fireworks, Perplexity, OpenRouter
|
|
145
|
+
|
|
146
|
+
Each provider requires an API key (except Ollama which runs locally).
|
|
147
|
+
Models are organized by tier: premium, balanced, fast.`,
|
|
148
|
+
},
|
|
149
|
+
// ── Context & Memory ────────────────────────────────────────────────────
|
|
150
|
+
{
|
|
151
|
+
id: 'file-references',
|
|
152
|
+
title: 'File References (@file)',
|
|
153
|
+
keywords: ['file', 'reference', '@', 'attach', 'mention'],
|
|
154
|
+
content: `Reference files in your messages with @filename.
|
|
155
|
+
|
|
156
|
+
Examples:
|
|
157
|
+
@src/index.ts — Agent reads this file for context
|
|
158
|
+
@package.json — Agent checks dependencies
|
|
159
|
+
|
|
160
|
+
The agent will use its tools to read the referenced files.`,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 'compilr-md',
|
|
164
|
+
title: 'COMPILR.md — Project Context',
|
|
165
|
+
keywords: ['compilr.md', 'context', 'project', 'instructions'],
|
|
166
|
+
content: `COMPILR.md is a markdown file in your project root that gives the agent context.
|
|
167
|
+
|
|
168
|
+
It can include:
|
|
169
|
+
- Project description and goals
|
|
170
|
+
- Tech stack and dependencies
|
|
171
|
+
- Coding conventions
|
|
172
|
+
- Build/test commands
|
|
173
|
+
- Important file locations
|
|
174
|
+
|
|
175
|
+
The agent reads this on every conversation to understand your project.
|
|
176
|
+
Create one manually or let the agent generate it.`,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 'knowledge-base',
|
|
180
|
+
title: 'Knowledge Base',
|
|
181
|
+
keywords: ['knowledge', 'kb', 'reference', 'docs', 'upload', 'pin'],
|
|
182
|
+
content: `The knowledge base stores reference documents for your project.
|
|
183
|
+
|
|
184
|
+
You can add:
|
|
185
|
+
- Files (code, markdown, text, PDF, images)
|
|
186
|
+
- Pasted text snippets
|
|
187
|
+
- URLs (web page content imported)
|
|
188
|
+
|
|
189
|
+
Pin important files to include them in every agent conversation.
|
|
190
|
+
Unpinned files are available on-demand (agent uses view tools).
|
|
191
|
+
|
|
192
|
+
Images in the KB can be viewed by the agent using the view_image tool.`,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: 'context-management',
|
|
196
|
+
title: 'Context Management',
|
|
197
|
+
keywords: ['context', 'tokens', 'compaction', 'observation', 'masking', 'window'],
|
|
198
|
+
content: `The agent manages its context window automatically:
|
|
199
|
+
|
|
200
|
+
- Observation masking: Old tool results replaced with compact summaries after a few turns
|
|
201
|
+
- Image masking: Old images replaced with text placeholders (saves 1000+ tokens per image)
|
|
202
|
+
- Tool output compression: Large outputs compressed by 60-90% (git, npm, file listings)
|
|
203
|
+
- Smart windowing: Oldest messages compacted when context fills up
|
|
204
|
+
|
|
205
|
+
You can see context utilization in the status bar or via /context.`,
|
|
206
|
+
},
|
|
207
|
+
// ── Permissions ─────────────────────────────────────────────────────────
|
|
208
|
+
{
|
|
209
|
+
id: 'permissions',
|
|
210
|
+
title: 'Permissions',
|
|
211
|
+
keywords: ['permission', 'approve', 'deny', 'auto-accept', 'security'],
|
|
212
|
+
content: `Agents ask permission before running potentially dangerous tools.
|
|
213
|
+
|
|
214
|
+
Permission modes:
|
|
215
|
+
- Normal — Agent asks before bash, edit, write operations
|
|
216
|
+
- Auto-accept — Automatically approve all tool calls (faster, less safe)
|
|
217
|
+
|
|
218
|
+
You can set per-tool rules (always allow, always deny, always ask).
|
|
219
|
+
|
|
220
|
+
In restricted mode (untrusted workspace), bash/edit/write are blocked entirely.`,
|
|
221
|
+
},
|
|
222
|
+
// ── Images ──────────────────────────────────────────────────────────────
|
|
223
|
+
{
|
|
224
|
+
id: 'image-support',
|
|
225
|
+
title: 'Image Support',
|
|
226
|
+
keywords: ['image', 'screenshot', 'picture', 'paste', 'vision', 'multimodal'],
|
|
227
|
+
content: `You can send images to agents for visual analysis.
|
|
228
|
+
|
|
229
|
+
Supported formats: PNG, JPEG, GIF, WebP.
|
|
230
|
+
|
|
231
|
+
Images are automatically resized to max 1568px (Claude's recommended max) to save tokens.
|
|
232
|
+
After a few turns, images are replaced with text placeholders to further reduce token cost.
|
|
233
|
+
|
|
234
|
+
The agent can also view image files from disk using the view_image tool.
|
|
235
|
+
|
|
236
|
+
All major providers support images: Claude, OpenAI GPT-4o, Gemini.`,
|
|
237
|
+
},
|
|
238
|
+
// ── Workspace Trust ─────────────────────────────────────────────────────
|
|
239
|
+
{
|
|
240
|
+
id: 'workspace-trust',
|
|
241
|
+
title: 'Workspace Trust',
|
|
242
|
+
keywords: ['trust', 'restricted', 'security', 'untrusted', 'safe'],
|
|
243
|
+
content: `When you open a project for the first time, you're asked to trust it.
|
|
244
|
+
|
|
245
|
+
Trusted projects: Full agent capabilities — bash, file editing, terminal.
|
|
246
|
+
Restricted projects: Read-only — agents can read files and answer questions but cannot run commands or modify files.
|
|
247
|
+
|
|
248
|
+
You can change trust status by clicking the "Restricted" badge in the status bar.
|
|
249
|
+
|
|
250
|
+
Trust is inherited: if you trust /projects/myapp, all subdirectories are also trusted.`,
|
|
251
|
+
},
|
|
252
|
+
// ── Anchors ─────────────────────────────────────────────────────────────
|
|
253
|
+
{
|
|
254
|
+
id: 'anchors',
|
|
255
|
+
title: 'Anchors — Persistent Context',
|
|
256
|
+
keywords: ['anchor', 'pin', 'persistent', 'important', 'remember'],
|
|
257
|
+
content: `Anchors are persistent notes that stay in the agent's context across conversations.
|
|
258
|
+
|
|
259
|
+
Use them for:
|
|
260
|
+
- Architecture decisions ("We chose PostgreSQL because...")
|
|
261
|
+
- Important conventions ("All API routes use camelCase")
|
|
262
|
+
- Work-in-progress notes ("Auth module is half-done, don't touch")
|
|
263
|
+
|
|
264
|
+
Anchors survive session restarts and project switches.
|
|
265
|
+
The agent sees them in every conversation.`,
|
|
266
|
+
},
|
|
267
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide types — shared across SDK, CLI, and Desktop.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A single guide entry the agent can return to the user.
|
|
6
|
+
*/
|
|
7
|
+
export interface GuideEntry {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
keywords: string[];
|
|
11
|
+
content: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Structured content topic (used for tutorials in CLI, converted to GuideEntry for the tool).
|
|
15
|
+
*/
|
|
16
|
+
export interface ContentSection {
|
|
17
|
+
title?: string;
|
|
18
|
+
items: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ContentTopic {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
keywords: string[];
|
|
24
|
+
sections: ContentSection[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for the guide tool factory.
|
|
28
|
+
*/
|
|
29
|
+
export interface GuideToolConfig {
|
|
30
|
+
/** Which environment the tool is running in */
|
|
31
|
+
environment: 'cli' | 'desktop';
|
|
32
|
+
/** Additional environment-specific content to merge with shared content */
|
|
33
|
+
additionalEntries?: GuideEntry[];
|
|
34
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export { createSQLiteRepositories, SQLiteProjectRepository, SQLiteWorkItemReposi
|
|
|
58
58
|
export type { SQLiteRepositories, CreateSQLiteRepositoriesOptions, ProjectDeleteHooks, ProjectRecord, WorkItemRecord, ProjectDocumentRecord, WorkItemCommentRecord, } from './platform/index.js';
|
|
59
59
|
export { createAskUserTool, createAskUserSimpleTool } from './tools/index.js';
|
|
60
60
|
export type { AskUserQuestion, AskUserInput, AskUserResult, AskUserHandler, AskUserSimpleInput, AskUserSimpleResult, AskUserSimpleHandler, } from './tools/index.js';
|
|
61
|
+
export { createGuideTool, SHARED_GUIDE_ENTRIES, searchGuideEntries, topicToGuideEntry, } from './guide/index.js';
|
|
62
|
+
export type { GuideEntry, ContentTopic, ContentSection, GuideToolConfig } from './guide/index.js';
|
|
61
63
|
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createImageTools, ProjectAnchorStore, } from './platform/index.js';
|
|
62
64
|
export type { ProjectAnchorStoreConfig, ImageToolsConfig, ImageResizer } from './platform/index.js';
|
|
63
65
|
export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getStepCriteria, formatStepDisplay, getStepNumber, } from './platform/index.js';
|
package/dist/index.js
CHANGED
|
@@ -129,6 +129,10 @@ export { createSQLiteRepositories, SQLiteProjectRepository, SQLiteWorkItemReposi
|
|
|
129
129
|
// =============================================================================
|
|
130
130
|
export { createAskUserTool, createAskUserSimpleTool } from './tools/index.js';
|
|
131
131
|
// =============================================================================
|
|
132
|
+
// Guide Tool (environment-aware documentation)
|
|
133
|
+
// =============================================================================
|
|
134
|
+
export { createGuideTool, SHARED_GUIDE_ENTRIES, searchGuideEntries, topicToGuideEntry, } from './guide/index.js';
|
|
135
|
+
// =============================================================================
|
|
132
136
|
// Platform Tools (runtime — createPlatformTools factory + individual factories)
|
|
133
137
|
// =============================================================================
|
|
134
138
|
export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, createImageTools, ProjectAnchorStore, } from './platform/index.js';
|