agentikit 0.0.7 → 0.0.9
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 +215 -76
- package/dist/index.d.ts +17 -3
- package/dist/index.js +10 -2
- package/dist/src/asset-spec.d.ts +14 -0
- package/dist/src/asset-spec.js +46 -0
- package/dist/src/cli.js +268 -57
- package/dist/src/common.d.ts +8 -0
- package/dist/src/common.js +46 -0
- package/dist/src/config.d.ts +37 -0
- package/dist/src/config.js +124 -0
- package/dist/src/embedder.d.ts +10 -0
- package/dist/src/embedder.js +87 -0
- package/dist/src/frontmatter.d.ts +30 -0
- package/dist/src/frontmatter.js +86 -0
- package/dist/src/indexer.d.ts +20 -2
- package/dist/src/indexer.js +212 -80
- package/dist/src/init.d.ts +19 -0
- package/dist/src/init.js +87 -0
- package/dist/src/llm.d.ts +15 -0
- package/dist/src/llm.js +91 -0
- package/dist/src/markdown.d.ts +18 -0
- package/dist/src/markdown.js +77 -0
- package/dist/src/metadata.d.ts +11 -2
- package/dist/src/metadata.js +161 -29
- package/dist/src/registry-install.d.ts +11 -0
- package/dist/src/registry-install.js +208 -0
- package/dist/src/registry-resolve.d.ts +3 -0
- package/dist/src/registry-resolve.js +231 -0
- package/dist/src/registry-search.d.ts +5 -0
- package/dist/src/registry-search.js +129 -0
- package/dist/src/registry-types.d.ts +55 -0
- package/dist/src/registry-types.js +1 -0
- package/dist/src/ripgrep-install.d.ts +12 -0
- package/dist/src/ripgrep-install.js +169 -0
- package/dist/src/ripgrep-resolve.d.ts +13 -0
- package/dist/src/ripgrep-resolve.js +68 -0
- package/dist/src/ripgrep.d.ts +3 -36
- package/dist/src/ripgrep.js +2 -262
- package/dist/src/similarity.d.ts +1 -2
- package/dist/src/similarity.js +11 -0
- package/dist/src/stash-add.d.ts +4 -0
- package/dist/src/stash-add.js +59 -0
- package/dist/src/stash-ref.d.ts +7 -0
- package/dist/src/stash-ref.js +33 -0
- package/dist/src/stash-registry.d.ts +18 -0
- package/dist/src/stash-registry.js +221 -0
- package/dist/src/stash-resolve.d.ts +2 -0
- package/dist/src/stash-resolve.js +45 -0
- package/dist/src/stash-search.d.ts +8 -0
- package/dist/src/stash-search.js +484 -0
- package/dist/src/stash-show.d.ts +5 -0
- package/dist/src/stash-show.js +114 -0
- package/dist/src/stash-types.d.ts +217 -0
- package/dist/src/stash-types.js +1 -0
- package/dist/src/stash.d.ts +10 -63
- package/dist/src/stash.js +6 -633
- package/dist/src/tool-runner.d.ts +35 -0
- package/dist/src/tool-runner.js +100 -0
- package/dist/src/walker.d.ts +19 -0
- package/dist/src/walker.js +47 -0
- package/package.json +8 -14
- package/src/asset-spec.ts +69 -0
- package/src/cli.ts +282 -46
- package/src/common.ts +58 -0
- package/src/config.ts +183 -0
- package/src/embedder.ts +117 -0
- package/src/frontmatter.ts +95 -0
- package/src/indexer.ts +244 -84
- package/src/init.ts +106 -0
- package/src/llm.ts +124 -0
- package/src/markdown.ts +106 -0
- package/src/metadata.ts +171 -27
- package/src/registry-install.ts +245 -0
- package/src/registry-resolve.ts +272 -0
- package/src/registry-search.ts +145 -0
- package/src/registry-types.ts +64 -0
- package/src/ripgrep-install.ts +200 -0
- package/src/ripgrep-resolve.ts +72 -0
- package/src/ripgrep.ts +3 -315
- package/src/similarity.ts +13 -1
- package/src/stash-add.ts +66 -0
- package/src/stash-ref.ts +41 -0
- package/src/stash-registry.ts +259 -0
- package/src/stash-resolve.ts +47 -0
- package/src/stash-search.ts +595 -0
- package/src/stash-show.ts +112 -0
- package/src/stash-types.ts +221 -0
- package/src/stash.ts +31 -760
- package/src/tool-runner.ts +129 -0
- package/src/walker.ts +53 -0
- package/.claude-plugin/plugin.json +0 -21
- package/commands/open.md +0 -11
- package/commands/run.md +0 -11
- package/commands/search.md +0 -11
- package/dist/src/plugin.d.ts +0 -2
- package/dist/src/plugin.js +0 -55
- package/skills/stash/SKILL.md +0 -73
- package/src/plugin.ts +0 -56
package/README.md
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# agentikit
|
|
2
2
|
|
|
3
|
-
Agentikit is a stash
|
|
3
|
+
Agentikit is a CLI tool and library for managing a stash of extension assets for AI coding assistants. It lets you **search** and **show** tools, skills, commands, and agents from a stash directory.
|
|
4
|
+
|
|
5
|
+
The CLI is called **akm** (Agentikit Manager).
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
### npm / bun
|
|
8
10
|
|
|
9
11
|
```sh
|
|
10
|
-
npm install
|
|
12
|
+
npm install -g agentikit
|
|
11
13
|
# or
|
|
12
|
-
bun add
|
|
14
|
+
bun add -g agentikit
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
### Standalone binary
|
|
@@ -17,131 +19,268 @@ bun add @itlackey/agentikit
|
|
|
17
19
|
Use the install scripts for a copy/paste install:
|
|
18
20
|
|
|
19
21
|
```sh
|
|
20
|
-
# macOS / Linux
|
|
22
|
+
# macOS / Linux
|
|
23
|
+
curl -fsSL https://raw.githubusercontent.com/itlackey/agentikit/main/install.sh | bash
|
|
24
|
+
# pin a release tag)
|
|
21
25
|
curl -fsSL https://raw.githubusercontent.com/itlackey/agentikit/main/install.sh | bash -s -- v1.2.3
|
|
22
|
-
```
|
|
23
26
|
|
|
24
|
-
```sh
|
|
25
27
|
# PowerShell (Windows)
|
|
26
|
-
irm https://raw.githubusercontent.com/itlackey/agentikit/main/install.ps1 -OutFile install.ps1; ./install.ps1
|
|
28
|
+
irm https://raw.githubusercontent.com/itlackey/agentikit/main/install.ps1 -OutFile install.ps1; ./install.ps1
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
The shell installer verifies the downloaded binary against release `checksums.txt` before installing it.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
## Stash model
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
Set a stash path via `AGENTIKIT_STASH_DIR`, or run `akm init` to create one automatically.
|
|
34
36
|
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
"plugin": ["@itlackey/agentikit"]
|
|
38
|
-
}
|
|
37
|
+
```sh
|
|
38
|
+
export AGENTIKIT_STASH_DIR=/abs/path/to/your-stash
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Expected stash layout:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
$AGENTIKIT_STASH_DIR/
|
|
45
|
+
├── tools/ # recursive files (.sh, .ts, .js, .ps1, .cmd, .bat)
|
|
46
|
+
├── skills/ # skill directories containing SKILL.md
|
|
47
|
+
├── commands/ # markdown files
|
|
48
|
+
├── agents/ # markdown files
|
|
49
|
+
└── knowledge/ # markdown files
|
|
50
|
+
```
|
|
42
51
|
|
|
43
|
-
|
|
52
|
+
## CLI usage
|
|
44
53
|
|
|
45
54
|
```sh
|
|
46
|
-
|
|
55
|
+
akm init # Initialize stash directory and set AGENTIKIT_STASH_DIR
|
|
56
|
+
akm index [--full] # Build search index (incremental by default)
|
|
57
|
+
akm add <ref> # Install a registry kit by npm/GitHub ref
|
|
58
|
+
akm list # List installed registry kits from config.registry.installed
|
|
59
|
+
akm remove <target> # Remove installed kit by id/ref (or parsed ref id)
|
|
60
|
+
akm update [target] [--all] # Fresh install from current ref(s), report changed revision/version
|
|
61
|
+
akm reinstall [target] [--all] # Reinstall from stored refs
|
|
62
|
+
akm search [query] # Search local stash and/or registry
|
|
63
|
+
akm show <type:name> # Read a stash asset by ref
|
|
47
64
|
```
|
|
48
65
|
|
|
49
|
-
|
|
66
|
+
### add
|
|
50
67
|
|
|
51
|
-
|
|
68
|
+
Install a registry reference and make it searchable immediately.
|
|
52
69
|
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
```sh
|
|
71
|
+
akm add @scope/kit
|
|
72
|
+
akm add npm:@scope/kit@latest
|
|
73
|
+
akm add owner/repo
|
|
74
|
+
akm add github:owner/repo#v1.2.3
|
|
75
|
+
```
|
|
55
76
|
|
|
56
|
-
|
|
77
|
+
- Uses registry resolution + install helpers (`npm` and `github` refs)
|
|
78
|
+
- Updates `config.json` registry install records and syncs `additionalStashDirs`
|
|
79
|
+
- If an existing install with the same id is replaced, old cache directories are cleaned up (best effort)
|
|
80
|
+
- Triggers an incremental index build
|
|
81
|
+
- Returns JSON with install details and index stats
|
|
57
82
|
|
|
58
|
-
|
|
83
|
+
### list
|
|
84
|
+
|
|
85
|
+
Show installed entries from `config.registry.installed`.
|
|
86
|
+
|
|
87
|
+
- Source of truth is config, not cache directory discovery
|
|
88
|
+
- Each entry includes status flags:
|
|
89
|
+
- `status.cacheDirExists`
|
|
90
|
+
- `status.stashRootExists`
|
|
91
|
+
|
|
92
|
+
### remove
|
|
93
|
+
|
|
94
|
+
Remove a single installed entry and reindex incrementally.
|
|
59
95
|
|
|
60
96
|
```sh
|
|
61
|
-
|
|
97
|
+
akm remove npm:@scope/kit
|
|
98
|
+
akm remove github:owner/repo
|
|
99
|
+
akm remove owner/repo
|
|
62
100
|
```
|
|
63
101
|
|
|
64
|
-
|
|
102
|
+
- Target resolution order: exact `id`, exact stored `ref`, then parsed ref `id`
|
|
103
|
+
- Removes entry via config helper (also syncs `additionalStashDirs`)
|
|
104
|
+
- Deletes prior `cacheDir` best effort
|
|
105
|
+
- Runs one incremental reindex
|
|
65
106
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
107
|
+
### reinstall
|
|
108
|
+
|
|
109
|
+
Reinstall one entry or all entries from stored refs.
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
akm reinstall npm:@scope/kit
|
|
113
|
+
akm reinstall --all
|
|
72
114
|
```
|
|
73
115
|
|
|
74
|
-
|
|
116
|
+
- Uses the same registry install flow as `akm add`
|
|
117
|
+
- Upserts config entries + `additionalStashDirs`
|
|
118
|
+
- Cleans up replaced cache directories best effort
|
|
119
|
+
- Runs one incremental reindex after all installs
|
|
75
120
|
|
|
76
|
-
|
|
121
|
+
### update
|
|
77
122
|
|
|
78
|
-
|
|
79
|
-
- `agentikit_open({ ref })`
|
|
80
|
-
- `agentikit_run({ ref })`
|
|
123
|
+
Update one entry or all entries by doing a fresh resolve/install from each current ref.
|
|
81
124
|
|
|
82
|
-
|
|
125
|
+
```sh
|
|
126
|
+
akm update npm:@scope/kit
|
|
127
|
+
akm update --all
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- Same target selection rules as `reinstall`
|
|
131
|
+
- Floating refs (for example `@latest` or default branch) resolve to newest available artifact
|
|
132
|
+
- Reports per-entry change flags for version/revision (`changed.version`, `changed.revision`, `changed.any`)
|
|
133
|
+
- Runs one incremental reindex after all installs
|
|
83
134
|
|
|
84
|
-
|
|
135
|
+
### search
|
|
136
|
+
|
|
137
|
+
Search local stash assets, registry entries, or both.
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
akm search "deploy" --type tool --limit 10 --usage both
|
|
141
|
+
akm search "lint" --source registry
|
|
142
|
+
akm search "docker" --source both
|
|
143
|
+
```
|
|
85
144
|
|
|
86
145
|
- `query`: case-insensitive substring over stable names (relative paths)
|
|
87
|
-
-
|
|
88
|
-
-
|
|
146
|
+
- `--type`: `tool | skill | command | agent | knowledge | any` (default: `any`)
|
|
147
|
+
- `--limit`: defaults to `20`
|
|
148
|
+
- `--usage`: `none | both | item | guide` (default: `both`)
|
|
149
|
+
- `--source`: `local | registry | both` (default: `local`)
|
|
150
|
+
|
|
151
|
+
By default (`--source local`), results are the existing stash hits with `openRef`, score/explainability details (`score`, `whyMatched`), and, for tools, execution-ready `runCmd`.
|
|
89
152
|
|
|
90
|
-
|
|
153
|
+
When registry results are included (`--source registry|both`), each registry hit includes explicit install guidance:
|
|
91
154
|
|
|
92
|
-
|
|
155
|
+
- `installRef` (normalized ref for install)
|
|
156
|
+
- `installCmd` (ready-to-run command, e.g. `akm add npm:@scope/kit`)
|
|
93
157
|
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
- `.cmd`/`.bat` → `cmd /c "<absolute-file>"`
|
|
97
|
-
- `.ts`/`.js`:
|
|
98
|
-
- find nearest `package.json` from script dir upward to stash `tools/` root
|
|
99
|
-
- if found: `cd "<pkgDir>" && bun "<absolute-file>"`
|
|
100
|
-
- else: `bun "<absolute-file>"`
|
|
101
|
-
- optional: set `AGENTIKIT_BUN_INSTALL=true` to include `bun install` before running
|
|
158
|
+
- `usageGuide` is included by default (`--usage both`) and explains how to use each hit type.
|
|
159
|
+
- Per-hit `usage` is optional metadata from `.stash.json` and is included when present.
|
|
102
160
|
|
|
103
|
-
###
|
|
161
|
+
### show
|
|
104
162
|
|
|
105
|
-
|
|
163
|
+
Show a hit using `openRef` from search results.
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
akm show skill:code-review
|
|
167
|
+
akm show knowledge:guide.md --view toc
|
|
168
|
+
akm show knowledge:guide.md --view section --heading "Getting Started"
|
|
169
|
+
akm show knowledge:guide.md --view lines --start 10 --end 30
|
|
170
|
+
```
|
|
106
171
|
|
|
107
172
|
Returns full payload by type:
|
|
108
173
|
|
|
109
|
-
- `skill`
|
|
110
|
-
- `command`
|
|
111
|
-
- `agent`
|
|
112
|
-
- `tool`
|
|
174
|
+
- `skill` — full `SKILL.md` content
|
|
175
|
+
- `command` — full markdown body as `template` (+ best-effort `description`)
|
|
176
|
+
- `agent` — full markdown body as `prompt` (+ best-effort `description`, `toolPolicy`, `modelHint`)
|
|
177
|
+
- `tool` — `runCmd`/`kind` (the agent uses the host's shell to execute `runCmd`)
|
|
178
|
+
- `knowledge` — content with optional view modes (`full`, `toc`, `frontmatter`, `section`, `lines`)
|
|
179
|
+
|
|
180
|
+
## Library API
|
|
181
|
+
|
|
182
|
+
Agentikit also exports its core functions for use as a library:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
import {
|
|
186
|
+
agentikitAdd,
|
|
187
|
+
agentikitList,
|
|
188
|
+
agentikitRemove,
|
|
189
|
+
agentikitReinstall,
|
|
190
|
+
agentikitUpdate,
|
|
191
|
+
agentikitSearch,
|
|
192
|
+
agentikitShow,
|
|
193
|
+
agentikitInit,
|
|
194
|
+
agentikitIndex,
|
|
195
|
+
} from "agentikit"
|
|
196
|
+
```
|
|
113
197
|
|
|
114
|
-
|
|
198
|
+
- `agentikitAdd({ ref })` — install a registry reference and index it
|
|
199
|
+
- `agentikitList()` — list installed registry entries and filesystem status flags
|
|
200
|
+
- `agentikitRemove({ target })` — remove one installed entry and reindex incrementally
|
|
201
|
+
- `agentikitReinstall({ target? , all? })` — reinstall one/all installed entries
|
|
202
|
+
- `agentikitUpdate({ target? , all? })` — fresh resolve/install one/all installed entries with change reporting
|
|
203
|
+
- `agentikitSearch({ query, type?, limit?, usage?, source? })` — search local stash and/or registry
|
|
204
|
+
- `agentikitShow({ ref, view? })` — show a stash asset
|
|
205
|
+
- `agentikitInit()` — initialize stash directory
|
|
206
|
+
- `agentikitIndex()` — build/rebuild search index
|
|
115
207
|
|
|
116
|
-
|
|
208
|
+
## Configuration
|
|
117
209
|
|
|
118
|
-
|
|
210
|
+
Agentikit stores configuration in `config.json` inside the stash directory.
|
|
119
211
|
|
|
120
|
-
|
|
212
|
+
```sh
|
|
213
|
+
akm config # Show current config
|
|
214
|
+
akm config --set key=value # Update a config key
|
|
215
|
+
```
|
|
121
216
|
|
|
122
|
-
|
|
217
|
+
### Embedding connection
|
|
123
218
|
|
|
124
|
-
|
|
125
|
-
2. `agentikit_run({ ref: "<openRef from search>" })`
|
|
219
|
+
By default, agentikit uses the local `@xenova/transformers` library for embeddings. You can configure an OpenAI-compatible embedding endpoint instead:
|
|
126
220
|
|
|
127
|
-
|
|
221
|
+
```sh
|
|
222
|
+
akm config --set 'embedding={"endpoint":"http://localhost:11434/v1/embeddings","model":"nomic-embed-text"}'
|
|
223
|
+
```
|
|
128
224
|
|
|
129
|
-
|
|
130
|
-
2. `agentikit_open({ ref: "<openRef from search>" })`
|
|
131
|
-
3. Apply returned template in-session
|
|
225
|
+
To clear the custom embedding config and revert to local embeddings:
|
|
132
226
|
|
|
133
|
-
|
|
227
|
+
```sh
|
|
228
|
+
akm config --set 'embedding=null'
|
|
229
|
+
```
|
|
134
230
|
|
|
135
|
-
|
|
136
|
-
- `agentikitSearch` / `agentikitOpen` / `agentikitRun` — direct library APIs
|
|
231
|
+
### LLM connection
|
|
137
232
|
|
|
138
|
-
|
|
233
|
+
When configured, agentikit uses an OpenAI-compatible LLM to generate richer metadata (descriptions, intents, tags) during indexing:
|
|
139
234
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
235
|
+
```sh
|
|
236
|
+
akm config --set 'llm={"endpoint":"http://localhost:11434/v1/chat/completions","model":"llama3.2"}'
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
To clear:
|
|
240
|
+
|
|
241
|
+
```sh
|
|
242
|
+
akm config --set 'llm=null'
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Using a local Ollama instance
|
|
246
|
+
|
|
247
|
+
[Ollama](https://ollama.com) provides local models with an OpenAI-compatible API. After installing Ollama and pulling your models:
|
|
248
|
+
|
|
249
|
+
```sh
|
|
250
|
+
# Pull models
|
|
251
|
+
ollama pull nomic-embed-text
|
|
252
|
+
ollama pull llama3.2
|
|
253
|
+
|
|
254
|
+
# Configure agentikit to use Ollama for both embeddings and metadata generation
|
|
255
|
+
akm config --set 'embedding={"endpoint":"http://localhost:11434/v1/embeddings","model":"nomic-embed-text"}'
|
|
256
|
+
akm config --set 'llm={"endpoint":"http://localhost:11434/v1/chat/completions","model":"llama3.2"}'
|
|
143
257
|
|
|
144
|
-
|
|
258
|
+
# Rebuild the index — embeddings use Ollama, metadata is LLM-enhanced
|
|
259
|
+
akm index --full
|
|
260
|
+
```
|
|
145
261
|
|
|
146
|
-
|
|
147
|
-
|
|
262
|
+
Both `embedding` and `llm` accept an optional `apiKey` field for authenticated endpoints:
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"endpoint": "https://api.openai.com/v1/embeddings",
|
|
267
|
+
"model": "text-embedding-3-small",
|
|
268
|
+
"apiKey": "sk-..."
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Config reference
|
|
273
|
+
|
|
274
|
+
| Key | Type | Default | Description |
|
|
275
|
+
|-----|------|---------|-------------|
|
|
276
|
+
| `semanticSearch` | `boolean` | `true` | Enable semantic search ranking |
|
|
277
|
+
| `additionalStashDirs` | `string[]` | `[]` | Extra stash directories to search |
|
|
278
|
+
| `embedding` | `object` | not set | OpenAI-compatible embedding endpoint (`endpoint`, `model`, `apiKey?`) |
|
|
279
|
+
| `llm` | `object` | not set | OpenAI-compatible LLM endpoint (`endpoint`, `model`, `apiKey?`) |
|
|
280
|
+
|
|
281
|
+
## Notes
|
|
282
|
+
|
|
283
|
+
- `akm add` installs registry kits into the local cache and adds discovered stash roots to `additionalStashDirs`.
|
|
284
|
+
- Registry lifecycle commands (`list`, `remove`, `reinstall`, `update`) use `config.registry.installed` as the source of truth.
|
|
285
|
+
- When commands fail, CLI errors are returned as structured JSON with `error` and `hint` fields.
|
|
286
|
+
- Missing or unreadable stash paths return friendly errors.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
1
|
+
export { agentikitAdd, agentikitList, agentikitRemove, agentikitReinstall, agentikitSearch, agentikitShow, agentikitUpdate, } from "./src/stash";
|
|
2
|
+
export { agentikitInit } from "./src/init";
|
|
3
|
+
export type { InitResponse } from "./src/init";
|
|
4
|
+
export type { AgentikitAssetType, AgentikitSearchType, AddResponse, LocalSearchHit, RegistrySearchResultHit, SearchSource, SearchHit, SearchResponse, ShowResponse, KnowledgeView, ListResponse, RemoveResponse, ReinstallResponse, UpdateResponse, RegistryListEntry, RegistryInstallStatus, ReinstallResultItem, UpdateResultItem, } from "./src/stash";
|
|
5
|
+
export type { ToolKind } from "./src/tool-runner";
|
|
4
6
|
export { agentikitIndex } from "./src/indexer";
|
|
5
7
|
export type { IndexResponse } from "./src/indexer";
|
|
6
8
|
export type { StashEntry, StashFile, StashIntent } from "./src/metadata";
|
|
7
9
|
export { resolveRg, isRgAvailable, ensureRg } from "./src/ripgrep";
|
|
8
10
|
export type { EnsureRgResult } from "./src/ripgrep";
|
|
11
|
+
export { parseMarkdownToc, extractSection, extractLineRange, extractFrontmatterOnly, formatToc } from "./src/markdown";
|
|
12
|
+
export type { TocHeading, KnowledgeToc } from "./src/markdown";
|
|
13
|
+
export { parseFrontmatter } from "./src/frontmatter";
|
|
14
|
+
export { loadConfig, saveConfig, updateConfig } from "./src/config";
|
|
15
|
+
export type { AgentikitConfig, EmbeddingConnectionConfig, LlmConnectionConfig, RegistryConfig } from "./src/config";
|
|
16
|
+
export { parseRegistryRef, resolveRegistryArtifact } from "./src/registry-resolve";
|
|
17
|
+
export { searchRegistry } from "./src/registry-search";
|
|
18
|
+
export { installRegistryRef, upsertInstalledRegistryEntry, removeInstalledRegistryEntry, getRegistryCacheRootDir, detectStashRoot, } from "./src/registry-install";
|
|
19
|
+
export type { RegistrySource, ParsedRegistryRef, ParsedNpmRef, ParsedGithubRef, ResolvedRegistryArtifact, RegistryInstalledEntry, RegistryInstallResult, RegistrySearchHit, RegistrySearchResponse, } from "./src/registry-types";
|
|
20
|
+
export { enhanceMetadata, isLlmAvailable } from "./src/llm";
|
|
21
|
+
export { embed, cosineSimilarity, isEmbeddingAvailable } from "./src/embedder";
|
|
22
|
+
export type { EmbeddingVector } from "./src/embedder";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { agentikitAdd, agentikitList, agentikitRemove, agentikitReinstall, agentikitSearch, agentikitShow, agentikitUpdate, } from "./src/stash";
|
|
2
|
+
export { agentikitInit } from "./src/init";
|
|
3
3
|
export { agentikitIndex } from "./src/indexer";
|
|
4
4
|
export { resolveRg, isRgAvailable, ensureRg } from "./src/ripgrep";
|
|
5
|
+
export { parseMarkdownToc, extractSection, extractLineRange, extractFrontmatterOnly, formatToc } from "./src/markdown";
|
|
6
|
+
export { parseFrontmatter } from "./src/frontmatter";
|
|
7
|
+
export { loadConfig, saveConfig, updateConfig } from "./src/config";
|
|
8
|
+
export { parseRegistryRef, resolveRegistryArtifact } from "./src/registry-resolve";
|
|
9
|
+
export { searchRegistry } from "./src/registry-search";
|
|
10
|
+
export { installRegistryRef, upsertInstalledRegistryEntry, removeInstalledRegistryEntry, getRegistryCacheRootDir, detectStashRoot, } from "./src/registry-install";
|
|
11
|
+
export { enhanceMetadata, isLlmAvailable } from "./src/llm";
|
|
12
|
+
export { embed, cosineSimilarity, isEmbeddingAvailable } from "./src/embedder";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentikitAssetType } from "./common";
|
|
2
|
+
export declare const SCRIPT_EXTENSIONS: Set<string>;
|
|
3
|
+
export interface AssetSpec {
|
|
4
|
+
stashDir: string;
|
|
5
|
+
isRelevantFile: (fileName: string) => boolean;
|
|
6
|
+
toCanonicalName: (typeRoot: string, filePath: string) => string | undefined;
|
|
7
|
+
toAssetPath: (typeRoot: string, name: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ASSET_SPECS: Record<AgentikitAssetType, AssetSpec>;
|
|
10
|
+
export declare const ASSET_TYPES: AgentikitAssetType[];
|
|
11
|
+
export declare const TYPE_DIRS: Record<AgentikitAssetType, string>;
|
|
12
|
+
export declare function isRelevantAssetFile(assetType: AgentikitAssetType, fileName: string): boolean;
|
|
13
|
+
export declare function deriveCanonicalAssetName(assetType: AgentikitAssetType, typeRoot: string, filePath: string): string | undefined;
|
|
14
|
+
export declare function resolveAssetPathFromName(assetType: AgentikitAssetType, typeRoot: string, name: string): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
export const SCRIPT_EXTENSIONS = new Set([".sh", ".ts", ".js", ".ps1", ".cmd", ".bat"]);
|
|
3
|
+
const markdownSpec = {
|
|
4
|
+
isRelevantFile: (fileName) => path.extname(fileName).toLowerCase() === ".md",
|
|
5
|
+
toCanonicalName: (typeRoot, filePath) => toPosix(path.relative(typeRoot, filePath)),
|
|
6
|
+
toAssetPath: (typeRoot, name) => path.join(typeRoot, name),
|
|
7
|
+
};
|
|
8
|
+
export const ASSET_SPECS = {
|
|
9
|
+
tool: {
|
|
10
|
+
stashDir: "tools",
|
|
11
|
+
isRelevantFile: (fileName) => SCRIPT_EXTENSIONS.has(path.extname(fileName).toLowerCase()),
|
|
12
|
+
toCanonicalName: (typeRoot, filePath) => toPosix(path.relative(typeRoot, filePath)),
|
|
13
|
+
toAssetPath: (typeRoot, name) => path.join(typeRoot, name),
|
|
14
|
+
},
|
|
15
|
+
skill: {
|
|
16
|
+
stashDir: "skills",
|
|
17
|
+
isRelevantFile: (fileName) => fileName === "SKILL.md",
|
|
18
|
+
toCanonicalName: (typeRoot, filePath) => {
|
|
19
|
+
const relDir = toPosix(path.dirname(path.relative(typeRoot, filePath)));
|
|
20
|
+
if (!relDir || relDir === ".")
|
|
21
|
+
return undefined;
|
|
22
|
+
return relDir;
|
|
23
|
+
},
|
|
24
|
+
toAssetPath: (typeRoot, name) => path.join(typeRoot, name, "SKILL.md"),
|
|
25
|
+
},
|
|
26
|
+
command: { stashDir: "commands", ...markdownSpec },
|
|
27
|
+
agent: { stashDir: "agents", ...markdownSpec },
|
|
28
|
+
knowledge: { stashDir: "knowledge", ...markdownSpec },
|
|
29
|
+
};
|
|
30
|
+
export const ASSET_TYPES = Object.keys(ASSET_SPECS);
|
|
31
|
+
export const TYPE_DIRS = ASSET_TYPES.reduce((acc, type) => {
|
|
32
|
+
acc[type] = ASSET_SPECS[type].stashDir;
|
|
33
|
+
return acc;
|
|
34
|
+
}, {});
|
|
35
|
+
export function isRelevantAssetFile(assetType, fileName) {
|
|
36
|
+
return ASSET_SPECS[assetType].isRelevantFile(fileName);
|
|
37
|
+
}
|
|
38
|
+
export function deriveCanonicalAssetName(assetType, typeRoot, filePath) {
|
|
39
|
+
return ASSET_SPECS[assetType].toCanonicalName(typeRoot, filePath);
|
|
40
|
+
}
|
|
41
|
+
export function resolveAssetPathFromName(assetType, typeRoot, name) {
|
|
42
|
+
return ASSET_SPECS[assetType].toAssetPath(typeRoot, name);
|
|
43
|
+
}
|
|
44
|
+
function toPosix(input) {
|
|
45
|
+
return input.replace(/\\/g, "/");
|
|
46
|
+
}
|