@autonav/core 1.0.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.
- package/README.md +115 -0
- package/dist/adapter/claude-adapter.d.ts +136 -0
- package/dist/adapter/claude-adapter.d.ts.map +1 -0
- package/dist/adapter/claude-adapter.js +340 -0
- package/dist/adapter/claude-adapter.js.map +1 -0
- package/dist/adapter/index.d.ts +7 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +7 -0
- package/dist/adapter/index.js.map +1 -0
- package/dist/cli/autonav.d.ts +11 -0
- package/dist/cli/autonav.d.ts.map +1 -0
- package/dist/cli/autonav.js +79 -0
- package/dist/cli/autonav.js.map +1 -0
- package/dist/cli/nav-chat.d.ts +3 -0
- package/dist/cli/nav-chat.d.ts.map +1 -0
- package/dist/cli/nav-chat.js +151 -0
- package/dist/cli/nav-chat.js.map +1 -0
- package/dist/cli/nav-init.d.ts +3 -0
- package/dist/cli/nav-init.d.ts.map +1 -0
- package/dist/cli/nav-init.js +366 -0
- package/dist/cli/nav-init.js.map +1 -0
- package/dist/cli/nav-query.d.ts +3 -0
- package/dist/cli/nav-query.d.ts.map +1 -0
- package/dist/cli/nav-query.js +217 -0
- package/dist/cli/nav-query.js.map +1 -0
- package/dist/conversation/App.d.ts +14 -0
- package/dist/conversation/App.d.ts.map +1 -0
- package/dist/conversation/App.js +229 -0
- package/dist/conversation/App.js.map +1 -0
- package/dist/conversation/index.d.ts +29 -0
- package/dist/conversation/index.d.ts.map +1 -0
- package/dist/conversation/index.js +44 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/conversation/prompts.d.ts +9 -0
- package/dist/conversation/prompts.d.ts.map +1 -0
- package/dist/conversation/prompts.js +47 -0
- package/dist/conversation/prompts.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/interview/App.d.ts +14 -0
- package/dist/interview/App.d.ts.map +1 -0
- package/dist/interview/App.js +159 -0
- package/dist/interview/App.js.map +1 -0
- package/dist/interview/index.d.ts +30 -0
- package/dist/interview/index.d.ts.map +1 -0
- package/dist/interview/index.js +52 -0
- package/dist/interview/index.js.map +1 -0
- package/dist/interview/prompts.d.ts +36 -0
- package/dist/interview/prompts.d.ts.map +1 -0
- package/dist/interview/prompts.js +116 -0
- package/dist/interview/prompts.js.map +1 -0
- package/dist/pack-installer/github.d.ts +41 -0
- package/dist/pack-installer/github.d.ts.map +1 -0
- package/dist/pack-installer/github.js +294 -0
- package/dist/pack-installer/github.js.map +1 -0
- package/dist/pack-installer/index.d.ts +57 -0
- package/dist/pack-installer/index.d.ts.map +1 -0
- package/dist/pack-installer/index.js +257 -0
- package/dist/pack-installer/index.js.map +1 -0
- package/dist/plugins/config-schema.d.ts +32 -0
- package/dist/plugins/config-schema.d.ts.map +1 -0
- package/dist/plugins/config-schema.js +26 -0
- package/dist/plugins/config-schema.js.map +1 -0
- package/dist/plugins/implementations/file-watcher/index.d.ts +110 -0
- package/dist/plugins/implementations/file-watcher/index.d.ts.map +1 -0
- package/dist/plugins/implementations/file-watcher/index.js +212 -0
- package/dist/plugins/implementations/file-watcher/index.js.map +1 -0
- package/dist/plugins/implementations/github/index.d.ts +201 -0
- package/dist/plugins/implementations/github/index.d.ts.map +1 -0
- package/dist/plugins/implementations/github/index.js +337 -0
- package/dist/plugins/implementations/github/index.js.map +1 -0
- package/dist/plugins/implementations/slack/index.d.ts +153 -0
- package/dist/plugins/implementations/slack/index.d.ts.map +1 -0
- package/dist/plugins/implementations/slack/index.js +221 -0
- package/dist/plugins/implementations/slack/index.js.map +1 -0
- package/dist/plugins/index.d.ts +23 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +35 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/plugin-manager.d.ts +66 -0
- package/dist/plugins/plugin-manager.d.ts.map +1 -0
- package/dist/plugins/plugin-manager.js +198 -0
- package/dist/plugins/plugin-manager.js.map +1 -0
- package/dist/plugins/types.d.ts +102 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +38 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/utils/security.d.ts +43 -0
- package/dist/plugins/utils/security.d.ts.map +1 -0
- package/dist/plugins/utils/security.js +115 -0
- package/dist/plugins/utils/security.js.map +1 -0
- package/dist/query-engine/index.d.ts +10 -0
- package/dist/query-engine/index.d.ts.map +1 -0
- package/dist/query-engine/index.js +10 -0
- package/dist/query-engine/index.js.map +1 -0
- package/dist/query-engine/navigator-loader.d.ts +37 -0
- package/dist/query-engine/navigator-loader.d.ts.map +1 -0
- package/dist/query-engine/navigator-loader.js +167 -0
- package/dist/query-engine/navigator-loader.js.map +1 -0
- package/dist/query-engine/output-formatter.d.ts +55 -0
- package/dist/query-engine/output-formatter.d.ts.map +1 -0
- package/dist/query-engine/output-formatter.js +165 -0
- package/dist/query-engine/output-formatter.js.map +1 -0
- package/dist/query-engine/response-validator.d.ts +55 -0
- package/dist/query-engine/response-validator.d.ts.map +1 -0
- package/dist/query-engine/response-validator.js +92 -0
- package/dist/query-engine/response-validator.js.map +1 -0
- package/dist/templates/.gitignore.template +23 -0
- package/dist/templates/CLAUDE-pack.md.template +32 -0
- package/dist/templates/CLAUDE.md.template +128 -0
- package/dist/templates/README.md.template +174 -0
- package/dist/templates/config-pack.json.template +16 -0
- package/dist/templates/config.json.template +11 -0
- package/dist/templates/index.d.ts +22 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +32 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/plugins.json.template +33 -0
- package/dist/templates/system-configuration.md.template +66 -0
- package/dist/tools/handler.d.ts +20 -0
- package/dist/tools/handler.d.ts.map +1 -0
- package/dist/tools/handler.js +202 -0
- package/dist/tools/handler.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/response.d.ts +30 -0
- package/dist/tools/response.d.ts.map +1 -0
- package/dist/tools/response.js +68 -0
- package/dist/tools/response.js.map +1 -0
- package/dist/tools/self-config.d.ts +54 -0
- package/dist/tools/self-config.d.ts.map +1 -0
- package/dist/tools/self-config.js +84 -0
- package/dist/tools/self-config.js.map +1 -0
- package/dist/validation/index.d.ts +19 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +91 -0
- package/dist/validation/index.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# {{NAVIGATOR_NAME}}
|
|
2
|
+
|
|
3
|
+
{{NAVIGATOR_DESCRIPTION}}
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
This navigator was created using `@autonav/core`.
|
|
8
|
+
|
|
9
|
+
### Directory Structure
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
{{NAVIGATOR_NAME}}/
|
|
13
|
+
├── config.json # Navigator configuration
|
|
14
|
+
├── CLAUDE.md # System prompt and grounding rules
|
|
15
|
+
├── knowledge/ # Add your documentation here
|
|
16
|
+
├── .claude/
|
|
17
|
+
│ └── plugins.json # Plugin configuration
|
|
18
|
+
├── .gitignore
|
|
19
|
+
└── README.md # This file
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Adding Documentation
|
|
23
|
+
|
|
24
|
+
1. Add your markdown files, text files, or documentation to the `knowledge/` directory
|
|
25
|
+
2. Organize files in subdirectories as needed
|
|
26
|
+
3. The navigator will search all files in this directory when answering questions
|
|
27
|
+
|
|
28
|
+
Example structure:
|
|
29
|
+
```
|
|
30
|
+
knowledge/
|
|
31
|
+
├── getting-started/
|
|
32
|
+
│ └── quickstart.md
|
|
33
|
+
├── deployment/
|
|
34
|
+
│ ├── aws.md
|
|
35
|
+
│ └── kubernetes.md
|
|
36
|
+
└── troubleshooting/
|
|
37
|
+
└── common-issues.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Using the Navigator
|
|
41
|
+
|
|
42
|
+
### Option 1: Interactive Mode (Recommended)
|
|
43
|
+
|
|
44
|
+
The simplest way to use your navigator is with Claude Code directly:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd {{NAVIGATOR_NAME}}
|
|
48
|
+
claude
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This opens an interactive session with your navigator's context already loaded. You can:
|
|
52
|
+
- Have natural conversations
|
|
53
|
+
- Ask follow-up questions
|
|
54
|
+
- Let Claude search your docs
|
|
55
|
+
|
|
56
|
+
The `CLAUDE.md` file tells Claude what this navigator knows about and how to behave.
|
|
57
|
+
|
|
58
|
+
### Option 2: Programmatic Queries
|
|
59
|
+
|
|
60
|
+
For scripts and automation, use structured queries:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @autonav/core query . "How do I deploy to production?"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or from the parent directory:
|
|
67
|
+
```bash
|
|
68
|
+
npx @autonav/core query ./{{NAVIGATOR_NAME}} "Your question here"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Response Format
|
|
72
|
+
|
|
73
|
+
The navigator returns structured JSON responses:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"protocolVersion": "1.0.0",
|
|
78
|
+
"query": "Your question",
|
|
79
|
+
"answer": "Detailed answer with citations",
|
|
80
|
+
"sources": [
|
|
81
|
+
{
|
|
82
|
+
"filePath": "path/to/source.md",
|
|
83
|
+
"excerpt": "Relevant quote",
|
|
84
|
+
"section": "Section name"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"confidence": 0.95
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Customization
|
|
92
|
+
|
|
93
|
+
### Updating Instructions
|
|
94
|
+
|
|
95
|
+
Edit `CLAUDE.md` to customize how the navigator behaves:
|
|
96
|
+
- Add domain-specific rules
|
|
97
|
+
- Include terminology definitions
|
|
98
|
+
- Specify answer formatting preferences
|
|
99
|
+
|
|
100
|
+
### Configuration
|
|
101
|
+
|
|
102
|
+
Edit `config.json` to:
|
|
103
|
+
- Update the navigator name or description
|
|
104
|
+
- Change the knowledge base path
|
|
105
|
+
- Add metadata fields
|
|
106
|
+
|
|
107
|
+
## Security
|
|
108
|
+
|
|
109
|
+
### Plugin Credentials
|
|
110
|
+
|
|
111
|
+
**⚠️ IMPORTANT**: If you use plugins (`.claude/plugins.json`), be aware:
|
|
112
|
+
|
|
113
|
+
1. **Credentials are stored in PLAIN TEXT** in `.claude/plugins.json`
|
|
114
|
+
2. **NEVER commit** `.claude/plugins.json` to version control
|
|
115
|
+
3. **Always add** `.claude/plugins.json` to your `.gitignore`
|
|
116
|
+
4. **Recommended**: Use environment variables instead:
|
|
117
|
+
```bash
|
|
118
|
+
export SLACK_TOKEN="xoxb-your-token"
|
|
119
|
+
export GITHUB_TOKEN="ghp_your-token"
|
|
120
|
+
```
|
|
121
|
+
5. **For production**: Use a secrets management system (AWS Secrets Manager, HashiCorp Vault, etc.)
|
|
122
|
+
|
|
123
|
+
### File Watcher Plugin
|
|
124
|
+
|
|
125
|
+
The file-watcher plugin has security restrictions:
|
|
126
|
+
- Cannot watch system directories (`/etc`, `/sys`, `/proc`, `/root`, etc.)
|
|
127
|
+
- Cannot watch sensitive user directories (`~/.ssh`, `~/.aws`, etc.)
|
|
128
|
+
- Only watches project-specific directories you explicitly configure
|
|
129
|
+
|
|
130
|
+
### GitHub/Slack Plugins
|
|
131
|
+
|
|
132
|
+
All content posted to GitHub and Slack is automatically scanned for credentials to prevent accidental exposure. However:
|
|
133
|
+
- Review all automated posts before enabling production use
|
|
134
|
+
- Use webhook secrets where applicable
|
|
135
|
+
- Limit plugin permissions to the minimum required
|
|
136
|
+
|
|
137
|
+
## Best Practices
|
|
138
|
+
|
|
139
|
+
1. **Keep docs updated**: The navigator is only as good as the knowledge base
|
|
140
|
+
2. **Organize clearly**: Use directories and clear file names
|
|
141
|
+
3. **Version control**: Commit both the navigator and knowledge base to git (but NOT `.claude/plugins.json`)
|
|
142
|
+
4. **Review responses**: Check that citations are accurate and relevant
|
|
143
|
+
5. **Security first**: Never commit credentials, use environment variables for tokens
|
|
144
|
+
|
|
145
|
+
## Troubleshooting
|
|
146
|
+
|
|
147
|
+
### Navigator can't find files
|
|
148
|
+
|
|
149
|
+
- Ensure files are in the `knowledge/` directory
|
|
150
|
+
- Check that file paths in responses match actual files
|
|
151
|
+
- Verify the `knowledgeBase` in `config.json` is correct
|
|
152
|
+
|
|
153
|
+
### Low confidence responses
|
|
154
|
+
|
|
155
|
+
- Add more detailed documentation
|
|
156
|
+
- Ensure docs cover the topic thoroughly
|
|
157
|
+
- Check that docs are up to date
|
|
158
|
+
|
|
159
|
+
### No answers to questions
|
|
160
|
+
|
|
161
|
+
- Verify the knowledge base contains relevant information
|
|
162
|
+
- Try rephrasing the question
|
|
163
|
+
- Ensure Claude Code is authenticated (run `claude` to check)
|
|
164
|
+
|
|
165
|
+
## Support
|
|
166
|
+
|
|
167
|
+
For issues with the navigator framework:
|
|
168
|
+
- GitHub: https://github.com/terraboops/autonav
|
|
169
|
+
- Documentation: See the main project README
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
**Created**: {{CREATED_AT}}
|
|
174
|
+
**Protocol Version**: 1.0.0
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.0",
|
|
3
|
+
"name": "{{NAVIGATOR_NAME}}",
|
|
4
|
+
"description": "{{NAVIGATOR_DESCRIPTION}}",
|
|
5
|
+
"created": "{{CREATED_AT}}",
|
|
6
|
+
"knowledgePack": {
|
|
7
|
+
"name": "{{PACK_NAME}}",
|
|
8
|
+
"version": "{{PACK_VERSION}}",
|
|
9
|
+
"installedAt": "{{CREATED_AT}}"
|
|
10
|
+
},
|
|
11
|
+
"knowledgeBase": "./knowledge",
|
|
12
|
+
"systemConfiguration": "./system-configuration.md",
|
|
13
|
+
"plugins": {
|
|
14
|
+
"configFile": "./.claude/plugins.json"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template files available for scaffolding navigators
|
|
3
|
+
*/
|
|
4
|
+
export interface Templates {
|
|
5
|
+
claudeMd: string;
|
|
6
|
+
claudeMdPack: string;
|
|
7
|
+
configJson: string;
|
|
8
|
+
configJsonPack: string;
|
|
9
|
+
pluginsJson: string;
|
|
10
|
+
gitignore: string;
|
|
11
|
+
readme: string;
|
|
12
|
+
systemConfiguration: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Load all template files
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadTemplates(): Templates;
|
|
18
|
+
/**
|
|
19
|
+
* Replace template variables in a string
|
|
20
|
+
*/
|
|
21
|
+
export declare function replaceTemplateVars(template: string, vars: Record<string, string>): string;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,SAAS,CAmCzC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CAMR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
// Get the directory of this module
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
/**
|
|
8
|
+
* Load all template files
|
|
9
|
+
*/
|
|
10
|
+
export function loadTemplates() {
|
|
11
|
+
return {
|
|
12
|
+
claudeMd: fs.readFileSync(path.join(__dirname, "CLAUDE.md.template"), "utf-8"),
|
|
13
|
+
claudeMdPack: fs.readFileSync(path.join(__dirname, "CLAUDE-pack.md.template"), "utf-8"),
|
|
14
|
+
configJson: fs.readFileSync(path.join(__dirname, "config.json.template"), "utf-8"),
|
|
15
|
+
configJsonPack: fs.readFileSync(path.join(__dirname, "config-pack.json.template"), "utf-8"),
|
|
16
|
+
pluginsJson: fs.readFileSync(path.join(__dirname, "plugins.json.template"), "utf-8"),
|
|
17
|
+
gitignore: fs.readFileSync(path.join(__dirname, ".gitignore.template"), "utf-8"),
|
|
18
|
+
readme: fs.readFileSync(path.join(__dirname, "README.md.template"), "utf-8"),
|
|
19
|
+
systemConfiguration: fs.readFileSync(path.join(__dirname, "system-configuration.md.template"), "utf-8"),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Replace template variables in a string
|
|
24
|
+
*/
|
|
25
|
+
export function replaceTemplateVars(template, vars) {
|
|
26
|
+
let result = template;
|
|
27
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
28
|
+
result = result.replace(new RegExp(`{{${key}}}`, "g"), value);
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AA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C;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,IAA4B;IAE5B,IAAI,MAAM,GAAG,QAAQ,CAAC;IACtB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_SECURITY_NOTICE": "WARNING: This file stores credentials in PLAIN TEXT. NEVER commit this file to version control. Use environment variables instead: SLACK_TOKEN, GITHUB_TOKEN. Add .claude/plugins.json to your .gitignore file. For production use, consider using a secrets management system.",
|
|
3
|
+
"file-watcher": {
|
|
4
|
+
"enabled": false,
|
|
5
|
+
"config": {
|
|
6
|
+
"paths": [],
|
|
7
|
+
"patterns": ["**/*.md"],
|
|
8
|
+
"ignorePatterns": ["**/node_modules/**", "**/.git/**", "**/dist/**"],
|
|
9
|
+
"pollInterval": 1000
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"slack": {
|
|
13
|
+
"enabled": false,
|
|
14
|
+
"config": {
|
|
15
|
+
"token": "RECOMMENDED: Use process.env.SLACK_TOKEN instead of hardcoding here",
|
|
16
|
+
"channels": [],
|
|
17
|
+
"threadNotifications": true,
|
|
18
|
+
"summaryFrequency": "daily"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"github": {
|
|
22
|
+
"enabled": false,
|
|
23
|
+
"config": {
|
|
24
|
+
"token": "RECOMMENDED: Use process.env.GITHUB_TOKEN instead of hardcoding here",
|
|
25
|
+
"owner": "",
|
|
26
|
+
"repo": "",
|
|
27
|
+
"watchIssues": true,
|
|
28
|
+
"watchPullRequests": true,
|
|
29
|
+
"watchCommits": false,
|
|
30
|
+
"pollIntervalMinutes": 5
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# System Configuration: {{PACK_NAME}}
|
|
2
|
+
|
|
3
|
+
This is the system configuration file from the {{PACK_NAME}} knowledge pack.
|
|
4
|
+
|
|
5
|
+
## Domain Description
|
|
6
|
+
|
|
7
|
+
[Describe what this knowledge pack covers and what types of questions it can answer]
|
|
8
|
+
|
|
9
|
+
## Knowledge Scope
|
|
10
|
+
|
|
11
|
+
This navigator has knowledge about:
|
|
12
|
+
- [Topic 1]
|
|
13
|
+
- [Topic 2]
|
|
14
|
+
- [Topic 3]
|
|
15
|
+
|
|
16
|
+
This navigator does NOT have knowledge about:
|
|
17
|
+
- [Out of scope topic 1]
|
|
18
|
+
- [Out of scope topic 2]
|
|
19
|
+
|
|
20
|
+
## Response Guidelines
|
|
21
|
+
|
|
22
|
+
When answering questions:
|
|
23
|
+
1. Always cite specific files from the `knowledge/` directory
|
|
24
|
+
2. Use exact headings and section references
|
|
25
|
+
3. If information isn't in the knowledge base, say so explicitly
|
|
26
|
+
4. Provide confidence scores based on how well-grounded your answer is
|
|
27
|
+
|
|
28
|
+
## Source Citation Format
|
|
29
|
+
|
|
30
|
+
For every answer, include:
|
|
31
|
+
- **Direct answer**: Clear, concise response to the question
|
|
32
|
+
- **File references**: [filename.md: Section Heading]
|
|
33
|
+
- **Excerpts**: Relevant quotes from the sources
|
|
34
|
+
- **Confidence**: Score from 0.0 to 1.0
|
|
35
|
+
|
|
36
|
+
## Response Structure
|
|
37
|
+
|
|
38
|
+
Always respond with JSON following this structure:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"protocolVersion": "0.1.0",
|
|
43
|
+
"query": "the question asked",
|
|
44
|
+
"answer": "detailed answer with inline citations",
|
|
45
|
+
"sources": [
|
|
46
|
+
{
|
|
47
|
+
"filePath": "relative/path/from/knowledge/file.md",
|
|
48
|
+
"excerpt": "exact quote from the file",
|
|
49
|
+
"section": "section heading"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"confidence": 0.95
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Confidence Scoring
|
|
57
|
+
|
|
58
|
+
- **1.0**: Fully grounded in multiple authoritative sources, no ambiguity
|
|
59
|
+
- **0.8-0.9**: Well grounded with clear sources, minor gaps acceptable
|
|
60
|
+
- **0.6-0.7**: Partially grounded, some inference required
|
|
61
|
+
- **0.4-0.5**: Weakly grounded, significant uncertainty
|
|
62
|
+
- **0.0-0.3**: Not grounded in knowledge base, requires human review
|
|
63
|
+
|
|
64
|
+
## Special Instructions
|
|
65
|
+
|
|
66
|
+
[Add any pack-specific instructions, terminology definitions, or special handling here]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Handler for Self-Configuration
|
|
3
|
+
*
|
|
4
|
+
* Processes tool calls from Claude and executes the corresponding actions.
|
|
5
|
+
*/
|
|
6
|
+
import { PluginManager } from "../plugins/index.js";
|
|
7
|
+
import { type UpdatePluginConfigInput, type GetPluginConfigInput, type SelfConfigResult } from "./self-config.js";
|
|
8
|
+
/**
|
|
9
|
+
* Handle the update_plugin_config tool call
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleUpdatePluginConfig(input: UpdatePluginConfigInput, pluginManager: PluginManager | undefined, pluginsConfigPath: string): Promise<SelfConfigResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Handle the get_plugin_config tool call
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleGetPluginConfig(input: GetPluginConfigInput, pluginsConfigPath: string): Promise<SelfConfigResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Process a tool call and return the result
|
|
18
|
+
*/
|
|
19
|
+
export declare function processToolCall(toolName: string, toolInput: Record<string, unknown>, pluginManager: PluginManager | undefined, pluginsConfigPath: string): Promise<SelfConfigResult>;
|
|
20
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/tools/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAA0B,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAGtB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,uBAAuB,EAC9B,aAAa,EAAE,aAAa,GAAG,SAAS,EACxC,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAuF3B;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,oBAAoB,EAC3B,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,gBAAgB,CAAC,CA4D3B;AAkCD;;GAEG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,aAAa,EAAE,aAAa,GAAG,SAAS,EACxC,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAoC3B"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Handler for Self-Configuration
|
|
3
|
+
*
|
|
4
|
+
* Processes tool calls from Claude and executes the corresponding actions.
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
|
+
import { PluginConfigFileSchema } from "../plugins/index.js";
|
|
8
|
+
import { CONFIGURABLE_PLUGINS, } from "./self-config.js";
|
|
9
|
+
/**
|
|
10
|
+
* Handle the update_plugin_config tool call
|
|
11
|
+
*/
|
|
12
|
+
export async function handleUpdatePluginConfig(input, pluginManager, pluginsConfigPath) {
|
|
13
|
+
const { plugin, updates, reason } = input;
|
|
14
|
+
// Validate plugin name
|
|
15
|
+
if (!CONFIGURABLE_PLUGINS.includes(plugin)) {
|
|
16
|
+
return {
|
|
17
|
+
success: false,
|
|
18
|
+
message: `Unknown plugin: ${plugin}`,
|
|
19
|
+
plugin,
|
|
20
|
+
error: `Valid plugins are: ${CONFIGURABLE_PLUGINS.join(", ")}`,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// Check if plugins config file exists
|
|
24
|
+
if (!fs.existsSync(pluginsConfigPath)) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
message: `Plugin configuration file not found`,
|
|
28
|
+
plugin,
|
|
29
|
+
error: `Expected file at: ${pluginsConfigPath}`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
// Read current config
|
|
34
|
+
const currentConfigContent = fs.readFileSync(pluginsConfigPath, "utf-8");
|
|
35
|
+
const currentConfig = PluginConfigFileSchema.parse(JSON.parse(currentConfigContent));
|
|
36
|
+
// Initialize plugin config if it doesn't exist
|
|
37
|
+
if (!currentConfig[plugin]) {
|
|
38
|
+
currentConfig[plugin] = {
|
|
39
|
+
enabled: false,
|
|
40
|
+
config: {},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// Merge updates into existing config
|
|
44
|
+
const existingPluginConfig = currentConfig[plugin].config || {};
|
|
45
|
+
const mergedConfig = {
|
|
46
|
+
...existingPluginConfig,
|
|
47
|
+
...updates,
|
|
48
|
+
};
|
|
49
|
+
// Update the config
|
|
50
|
+
currentConfig[plugin] = {
|
|
51
|
+
enabled: currentConfig[plugin].enabled,
|
|
52
|
+
config: mergedConfig,
|
|
53
|
+
};
|
|
54
|
+
// Write back to file
|
|
55
|
+
fs.writeFileSync(pluginsConfigPath, JSON.stringify(currentConfig, null, 2), "utf-8");
|
|
56
|
+
// If plugin manager exists and plugin is enabled, also update runtime config
|
|
57
|
+
if (pluginManager) {
|
|
58
|
+
const registeredPlugin = pluginManager.getPlugin(plugin);
|
|
59
|
+
if (registeredPlugin) {
|
|
60
|
+
try {
|
|
61
|
+
await registeredPlugin.updateConfig(updates);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Plugin might not be initialized, that's okay
|
|
65
|
+
// Config file was still updated
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
success: true,
|
|
71
|
+
message: `Successfully updated ${plugin} configuration: ${reason}`,
|
|
72
|
+
plugin,
|
|
73
|
+
changes: updates,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
78
|
+
return {
|
|
79
|
+
success: false,
|
|
80
|
+
message: `Failed to update ${plugin} configuration`,
|
|
81
|
+
plugin,
|
|
82
|
+
error: errorMessage,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Handle the get_plugin_config tool call
|
|
88
|
+
*/
|
|
89
|
+
export async function handleGetPluginConfig(input, pluginsConfigPath) {
|
|
90
|
+
const { plugin } = input;
|
|
91
|
+
// Check if plugins config file exists
|
|
92
|
+
if (!fs.existsSync(pluginsConfigPath)) {
|
|
93
|
+
return {
|
|
94
|
+
success: false,
|
|
95
|
+
message: `Plugin configuration file not found`,
|
|
96
|
+
plugin,
|
|
97
|
+
error: `Expected file at: ${pluginsConfigPath}`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
// Read current config
|
|
102
|
+
const currentConfigContent = fs.readFileSync(pluginsConfigPath, "utf-8");
|
|
103
|
+
const currentConfig = PluginConfigFileSchema.parse(JSON.parse(currentConfigContent));
|
|
104
|
+
if (plugin === "all") {
|
|
105
|
+
return {
|
|
106
|
+
success: true,
|
|
107
|
+
message: "Retrieved all plugin configurations",
|
|
108
|
+
plugin: "all",
|
|
109
|
+
changes: currentConfig,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
// Validate plugin name
|
|
113
|
+
if (!CONFIGURABLE_PLUGINS.includes(plugin)) {
|
|
114
|
+
return {
|
|
115
|
+
success: false,
|
|
116
|
+
message: `Unknown plugin: ${plugin}`,
|
|
117
|
+
plugin,
|
|
118
|
+
error: `Valid plugins are: ${CONFIGURABLE_PLUGINS.join(", ")}`,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const pluginConfig = currentConfig[plugin] || {
|
|
122
|
+
enabled: false,
|
|
123
|
+
config: {},
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
success: true,
|
|
127
|
+
message: `Retrieved ${plugin} configuration`,
|
|
128
|
+
plugin,
|
|
129
|
+
changes: pluginConfig,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
134
|
+
return {
|
|
135
|
+
success: false,
|
|
136
|
+
message: `Failed to read plugin configuration`,
|
|
137
|
+
plugin,
|
|
138
|
+
error: errorMessage,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Validate and parse update_plugin_config input
|
|
144
|
+
*/
|
|
145
|
+
function parseUpdatePluginConfigInput(input) {
|
|
146
|
+
const plugin = input.plugin;
|
|
147
|
+
const updates = input.updates;
|
|
148
|
+
const reason = input.reason;
|
|
149
|
+
if (!plugin || !updates || !reason) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
return { plugin, updates, reason };
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Validate and parse get_plugin_config input
|
|
156
|
+
*/
|
|
157
|
+
function parseGetPluginConfigInput(input) {
|
|
158
|
+
const plugin = input.plugin;
|
|
159
|
+
if (!plugin) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
return { plugin };
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Process a tool call and return the result
|
|
166
|
+
*/
|
|
167
|
+
export async function processToolCall(toolName, toolInput, pluginManager, pluginsConfigPath) {
|
|
168
|
+
switch (toolName) {
|
|
169
|
+
case "update_plugin_config": {
|
|
170
|
+
const parsed = parseUpdatePluginConfigInput(toolInput);
|
|
171
|
+
if (!parsed) {
|
|
172
|
+
return {
|
|
173
|
+
success: false,
|
|
174
|
+
message: "Invalid input for update_plugin_config",
|
|
175
|
+
plugin: "unknown",
|
|
176
|
+
error: "Missing required fields: plugin, updates, reason",
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return handleUpdatePluginConfig(parsed, pluginManager, pluginsConfigPath);
|
|
180
|
+
}
|
|
181
|
+
case "get_plugin_config": {
|
|
182
|
+
const parsed = parseGetPluginConfigInput(toolInput);
|
|
183
|
+
if (!parsed) {
|
|
184
|
+
return {
|
|
185
|
+
success: false,
|
|
186
|
+
message: "Invalid input for get_plugin_config",
|
|
187
|
+
plugin: "unknown",
|
|
188
|
+
error: "Missing required field: plugin",
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
return handleGetPluginConfig(parsed, pluginsConfigPath);
|
|
192
|
+
}
|
|
193
|
+
default:
|
|
194
|
+
return {
|
|
195
|
+
success: false,
|
|
196
|
+
message: `Unknown tool: ${toolName}`,
|
|
197
|
+
plugin: "unknown",
|
|
198
|
+
error: `Tool "${toolName}" is not recognized`,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/tools/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAiB,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAKL,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B;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MAAM,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,qCAAqC;oBAC9C,MAAM,EAAE,SAAS;oBACjB,KAAK,EAAE,gCAAgC;iBACxC,CAAC;YACJ,CAAC;YACD,OAAO,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAC1D,CAAC;QAED;YACE,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,iBAAiB,QAAQ,EAAE;gBACpC,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,SAAS,QAAQ,qBAAqB;aAC9C,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Module
|
|
3
|
+
*
|
|
4
|
+
* Exports tool definitions and handlers for navigator capabilities.
|
|
5
|
+
* Tools use MCP format for integration with Claude Agent SDK.
|
|
6
|
+
*/
|
|
7
|
+
export { createSelfConfigMcpServer, CONFIGURABLE_PLUGINS, type ConfigurablePlugin, type UpdatePluginConfigInput, type GetPluginConfigInput, type SelfConfigResult, } from "./self-config.js";
|
|
8
|
+
export { handleUpdatePluginConfig, handleGetPluginConfig, processToolCall, } from "./handler.js";
|
|
9
|
+
export { createResponseMcpServer, SUBMIT_ANSWER_TOOL, type SubmitAnswerResult, } from "./response.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Module
|
|
3
|
+
*
|
|
4
|
+
* Exports tool definitions and handlers for navigator capabilities.
|
|
5
|
+
* Tools use MCP format for integration with Claude Agent SDK.
|
|
6
|
+
*/
|
|
7
|
+
export { createSelfConfigMcpServer, CONFIGURABLE_PLUGINS, } from "./self-config.js";
|
|
8
|
+
export { handleUpdatePluginConfig, handleGetPluginConfig, processToolCall, } from "./handler.js";
|
|
9
|
+
export { createResponseMcpServer, SUBMIT_ANSWER_TOOL, } from "./response.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GAKrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GAEnB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response Tools for Autonav Navigators
|
|
3
|
+
*
|
|
4
|
+
* These tools allow navigators to submit structured responses
|
|
5
|
+
* using Zod-validated schemas, providing the benefits of
|
|
6
|
+
* Claude's Structured Outputs through tool use.
|
|
7
|
+
*
|
|
8
|
+
* Uses MCP format for integration with Claude Agent SDK.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Result type returned when submit_answer tool is called
|
|
12
|
+
*/
|
|
13
|
+
export interface SubmitAnswerResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create an MCP server with response tools
|
|
19
|
+
*
|
|
20
|
+
* The submit_answer tool allows Claude to submit structured responses
|
|
21
|
+
* that are validated against the NavigatorResponse schema.
|
|
22
|
+
* This achieves the same result as Claude's Structured Outputs
|
|
23
|
+
* but works within the Claude Agent SDK's tool use flow.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createResponseMcpServer(): import("@anthropic-ai/claude-agent-sdk").McpSdkServerConfigWithInstance;
|
|
26
|
+
/**
|
|
27
|
+
* Tool name constant for detection in ClaudeAdapter
|
|
28
|
+
*/
|
|
29
|
+
export declare const SUBMIT_ANSWER_TOOL = "submit_answer";
|
|
30
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/tools/response.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,4EAyDtC;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC"}
|