@bodhi-ventures/aiocs 0.1.2 → 0.3.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 +122 -3
- package/dist/chunk-GX6CZOO7.js +10429 -0
- package/dist/cli.js +352 -2
- package/dist/mcp-server.js +707 -4
- package/docs/README.md +1 -1
- package/docs/codex-integration.md +65 -18
- package/docs/json-contract.md +446 -3
- package/package.json +23 -20
- package/skills/aiocs/SKILL.md +46 -36
- package/skills/aiocs-curation/SKILL.md +145 -0
- package/sources/nktkas-hyperliquid.yaml +30 -0
- package/dist/chunk-CZ6C4YUX.js +0 -4601
- package/docs/2026-03-26-agent-json-and-daemon-design.md +0 -157
- package/docs/2026-03-28-hybrid-search-design.md +0 -423
- package/docs/superpowers/specs/2026-03-29-tag-driven-release-pipeline-design.md +0 -135
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodhi-ventures/aiocs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local-only documentation store, fetcher, and search CLI for AI agents.",
|
|
@@ -48,27 +48,30 @@
|
|
|
48
48
|
"test:watch": "vitest"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
51
|
+
"@lmstudio/sdk": "1.5.0",
|
|
52
|
+
"@modelcontextprotocol/sdk": "1.28.0",
|
|
53
|
+
"@mozilla/readability": "0.6.0",
|
|
53
54
|
"@qdrant/js-client-rest": "1.17.0",
|
|
54
|
-
"better-sqlite3": "
|
|
55
|
-
"commander": "
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
55
|
+
"better-sqlite3": "12.4.1",
|
|
56
|
+
"commander": "14.0.1",
|
|
57
|
+
"csv-parse": "6.2.1",
|
|
58
|
+
"jsdom": "27.0.1",
|
|
59
|
+
"pdf-parse": "2.4.5",
|
|
60
|
+
"playwright": "1.57.0",
|
|
61
|
+
"turndown": "7.2.1",
|
|
62
|
+
"turndown-plugin-gfm": "1.0.2",
|
|
63
|
+
"yaml": "2.8.1",
|
|
64
|
+
"zod": "4.1.12"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
|
-
"@types/better-sqlite3": "
|
|
65
|
-
"@types/jsdom": "
|
|
66
|
-
"@types/node": "
|
|
67
|
-
"@types/turndown": "
|
|
68
|
-
"execa": "
|
|
69
|
-
"tsup": "
|
|
70
|
-
"tsx": "
|
|
71
|
-
"typescript": "
|
|
72
|
-
"vitest": "
|
|
67
|
+
"@types/better-sqlite3": "7.6.13",
|
|
68
|
+
"@types/jsdom": "21.1.7",
|
|
69
|
+
"@types/node": "24.7.2",
|
|
70
|
+
"@types/turndown": "5.0.5",
|
|
71
|
+
"execa": "9.6.0",
|
|
72
|
+
"tsup": "8.5.0",
|
|
73
|
+
"tsx": "4.20.6",
|
|
74
|
+
"typescript": "5.9.3",
|
|
75
|
+
"vitest": "3.2.4"
|
|
73
76
|
}
|
|
74
77
|
}
|
package/skills/aiocs/SKILL.md
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aiocs
|
|
3
|
+
description: Use when authoritative local documentation lookup should come from the shared aiocs catalog under ~/.aiocs instead of live browsing.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# aiocs
|
|
2
7
|
|
|
3
|
-
Use this skill when you need authoritative local documentation
|
|
8
|
+
Use this skill when you need authoritative local documentation lookup through the shared `aiocs` catalog under `~/.aiocs`.
|
|
4
9
|
|
|
5
10
|
## When to use it
|
|
6
11
|
|
|
7
12
|
- The user is asking about exchange or product docs that may already exist in the local `aiocs` catalog.
|
|
8
13
|
- You need authoritative local docs for an exchange, SDK, or product without browsing the live site every time.
|
|
9
|
-
- You
|
|
10
|
-
- You need to
|
|
11
|
-
- You
|
|
12
|
-
- You
|
|
13
|
-
- You
|
|
14
|
-
- You need to
|
|
14
|
+
- You need reusable reference search over a curated external git repository that already lives in `aiocs`.
|
|
15
|
+
- You need to read from a compiled `aiocs` workspace wiki or inspect derived workspace artifacts.
|
|
16
|
+
- You need to inspect workspace status, queued compile health, or raw ingested evidence before deciding whether curation is needed.
|
|
17
|
+
- You want machine-readable search/show/diff/coverage results for an AI agent.
|
|
18
|
+
- You need hybrid docs retrieval with lexical plus semantic/vector recall.
|
|
19
|
+
- You need to validate runtime health before relying on the local docs catalog.
|
|
15
20
|
|
|
16
21
|
## Trigger guidance for Codex
|
|
17
22
|
|
|
18
23
|
- Prefer `aiocs` before live web browsing when the requested docs may already be in the local catalog.
|
|
19
24
|
- Check `source_list` or scoped `search` before assuming a source is missing.
|
|
20
25
|
- Use `aiocs` first for the bundled `hyperliquid` source and for any repo or machine that already relies on `~/.aiocs`.
|
|
21
|
-
- If
|
|
22
|
-
- Prefer `refresh due <source-id>` over force `fetch <source-id>` whenever freshness is the real goal.
|
|
23
|
-
- Do not use `fetch all` as a normal answering path; reserve it for explicit user requests or maintenance flows.
|
|
26
|
+
- This skill is the default read/search path. If the task requires source creation, force fetch, targeted refresh, or canary remediation, also load `aiocs-curation`.
|
|
24
27
|
- Only fall back to live browsing when:
|
|
25
28
|
- the source is not present in `aiocs`
|
|
26
29
|
- the user explicitly wants the live site
|
|
27
|
-
- the local catalog is stale or broken and the answer cannot wait for
|
|
30
|
+
- the local catalog is stale or broken and the answer cannot wait for curation/remediation
|
|
28
31
|
- If you need multiple docs operations in MCP, use `batch` instead of many small round trips.
|
|
29
32
|
|
|
30
33
|
## Preferred interfaces
|
|
@@ -39,6 +42,7 @@ Use this skill when you need authoritative local documentation search, inspectio
|
|
|
39
42
|
|
|
40
43
|
- Default to `search` with `mode=auto`.
|
|
41
44
|
- Use `mode=lexical` for exact identifiers, section titles, endpoint names, and error strings.
|
|
45
|
+
- Use `--path` / `pathPatterns` and `--language` / `languages` when searching repo/code sources.
|
|
42
46
|
- Use `mode=hybrid` for conceptual questions when embeddings are healthy.
|
|
43
47
|
- Use `mode=semantic` only when you explicitly want vector-only recall.
|
|
44
48
|
- When citing results, include `sourceId`, `snapshotId`, and `pageUrl` when they materially help traceability.
|
|
@@ -57,12 +61,6 @@ Bootstrap managed sources from the repo bundle and `~/.aiocs/sources`:
|
|
|
57
61
|
docs --json init --no-fetch
|
|
58
62
|
```
|
|
59
63
|
|
|
60
|
-
User-managed source specs live under:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
~/.aiocs/sources
|
|
64
|
-
```
|
|
65
|
-
|
|
66
64
|
## Core commands
|
|
67
65
|
|
|
68
66
|
Search the shared catalog:
|
|
@@ -72,6 +70,7 @@ docs --json search "maker flow" --source hyperliquid
|
|
|
72
70
|
docs --json search "maker flow" --all
|
|
73
71
|
docs --json search "maker flow" --source hyperliquid --limit 5 --offset 0
|
|
74
72
|
docs --json search "maker flow" --source hyperliquid --mode hybrid
|
|
73
|
+
docs --json search "WebSocketTransport" --source nktkas-hyperliquid --path "src/**" --language typescript --mode lexical
|
|
75
74
|
```
|
|
76
75
|
|
|
77
76
|
Inspect a specific chunk:
|
|
@@ -80,22 +79,24 @@ Inspect a specific chunk:
|
|
|
80
79
|
docs --json show 42
|
|
81
80
|
```
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
Search or inspect a compiled workspace:
|
|
84
83
|
|
|
85
84
|
```bash
|
|
86
|
-
docs --json
|
|
87
|
-
docs --json
|
|
88
|
-
docs --json
|
|
89
|
-
docs --json
|
|
90
|
-
docs --json
|
|
91
|
-
docs --json
|
|
85
|
+
docs --json workspace status market-structure
|
|
86
|
+
docs --json workspace search market-structure "transport design" --scope mixed
|
|
87
|
+
docs --json workspace ingest list market-structure
|
|
88
|
+
docs --json workspace ingest search market-structure "fee tier"
|
|
89
|
+
docs --json workspace artifact list market-structure
|
|
90
|
+
docs --json workspace artifact show market-structure derived/index.md
|
|
91
|
+
docs --json workspace lint market-structure
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
Inspect source availability and health:
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
docs --json
|
|
98
|
-
docs --json
|
|
97
|
+
docs --json source list
|
|
98
|
+
docs --json canary hyperliquid
|
|
99
|
+
docs --json embeddings status
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
Inspect what changed between snapshots:
|
|
@@ -131,11 +132,8 @@ The `aiocs-mcp` server exposes the same core operations without shell parsing:
|
|
|
131
132
|
- `version`
|
|
132
133
|
- `doctor`
|
|
133
134
|
- `init`
|
|
134
|
-
- `source_upsert`
|
|
135
135
|
- `source_list`
|
|
136
136
|
- `canary`
|
|
137
|
-
- `fetch`
|
|
138
|
-
- `refresh_due`
|
|
139
137
|
- `snapshot_list`
|
|
140
138
|
- `diff_snapshots`
|
|
141
139
|
- `project_link`
|
|
@@ -148,17 +146,28 @@ The `aiocs-mcp` server exposes the same core operations without shell parsing:
|
|
|
148
146
|
- `backup_import`
|
|
149
147
|
- `search`
|
|
150
148
|
- `show`
|
|
149
|
+
- `workspace_list`
|
|
150
|
+
- `workspace_status`
|
|
151
|
+
- `workspace_search`
|
|
152
|
+
- `workspace_ingest_list`
|
|
153
|
+
- `workspace_ingest_show`
|
|
154
|
+
- `workspace_ingest_search`
|
|
155
|
+
- `workspace_artifact_list`
|
|
156
|
+
- `workspace_artifact_show`
|
|
157
|
+
- `workspace_lint`
|
|
151
158
|
- `verify_coverage`
|
|
152
159
|
- `batch`
|
|
153
160
|
|
|
161
|
+
Mutation-capable MCP tools such as `source_upsert`, `refresh_due`, and `fetch` belong to `aiocs-curation`.
|
|
162
|
+
|
|
154
163
|
## Recommended Codex workflow
|
|
155
164
|
|
|
156
|
-
1. If runtime health
|
|
157
|
-
2. Run `source_list` to see whether the source already exists
|
|
158
|
-
3.
|
|
159
|
-
4. If the
|
|
160
|
-
5. Use `
|
|
161
|
-
6.
|
|
165
|
+
1. If runtime health is in doubt, run `doctor`.
|
|
166
|
+
2. Run `source_list` to see whether the source already exists.
|
|
167
|
+
3. Use `search` in `auto` mode first, then `show` for the selected chunk.
|
|
168
|
+
4. If the user is asking against a compiled research wiki, prefer `workspace_search` and `workspace_artifact_show`.
|
|
169
|
+
5. Use `canary`, `diff_snapshots`, or `verify_coverage` when the question is about drift, changes, or completeness.
|
|
170
|
+
6. If the source is missing or stale and the next step is to mutate `aiocs`, load `aiocs-curation`.
|
|
162
171
|
7. Use `batch` when combining list/search/show or diff/coverage checks in one pass.
|
|
163
172
|
|
|
164
173
|
## Operational notes
|
|
@@ -168,6 +177,7 @@ The `aiocs-mcp` server exposes the same core operations without shell parsing:
|
|
|
168
177
|
- Use `docs daemon` or the Docker daemon service when the catalog should stay fresh automatically.
|
|
169
178
|
- `docs search --mode auto` is the right default for agents; it uses hybrid retrieval only when embeddings are current and healthy for the requested scope.
|
|
170
179
|
- The Docker Compose stack includes a dedicated `aiocs-qdrant` container and expects Ollama to be reachable separately.
|
|
180
|
+
- Compiled research workspaces use LM Studio as the v1 compiler backend and expect `google/gemma-4-26b-a4b` to be loaded unless the environment overrides it.
|
|
171
181
|
- Canaries are the first place to look when a docs site changed and fetches started degrading.
|
|
172
182
|
- Newly added or changed sources become due immediately, so `refresh due <source-id>` is the safe first refresh path after upsert.
|
|
173
183
|
- CLI failures expose machine-readable `error.code` fields in `--json` mode.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aiocs-curation
|
|
3
|
+
description: Use when aiocs sources or snapshots need mutation, such as source onboarding, targeted refresh, canary remediation, or catalog repair.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# aiocs-curation
|
|
7
|
+
|
|
8
|
+
Use this skill when you need to add, refresh, repair, or otherwise mutate `aiocs` sources under `~/.aiocs`.
|
|
9
|
+
|
|
10
|
+
## When to use it
|
|
11
|
+
|
|
12
|
+
- The requested docs source is missing from the local `aiocs` catalog and is worth curating for reuse.
|
|
13
|
+
- An existing source is stale and should be refreshed instead of bypassed.
|
|
14
|
+
- A source spec needs to be created, updated, or upserted under `~/.aiocs/sources`.
|
|
15
|
+
- A reusable external git repository should be added as a `kind: git` source under `~/.aiocs/sources`.
|
|
16
|
+
- A canary is failing and the source needs remediation or targeted refetch.
|
|
17
|
+
- A research workspace needs to be created, rebound, compiled, or asked to generate a report/slide artifact.
|
|
18
|
+
- A workspace needs raw evidence ingest, auto-compile setup, queued compile processing, or Obsidian sync.
|
|
19
|
+
- The user explicitly wants `aiocs` maintenance, source onboarding, or catalog repair.
|
|
20
|
+
|
|
21
|
+
## Trigger guidance for Codex
|
|
22
|
+
|
|
23
|
+
- Load this skill when the next step requires a mutating `aiocs` operation.
|
|
24
|
+
- Prefer targeted maintenance:
|
|
25
|
+
- `refresh due <source-id>` for existing sources
|
|
26
|
+
- `source_upsert` plus targeted refresh for newly curated sources
|
|
27
|
+
- Avoid `fetch all` unless the user explicitly asks for broad maintenance.
|
|
28
|
+
- If the source is missing, only curate it when it is likely to be reused across sessions or projects.
|
|
29
|
+
- Keep the read/search path in `aiocs`; use this skill only for the curation step.
|
|
30
|
+
|
|
31
|
+
## Preferred interfaces
|
|
32
|
+
|
|
33
|
+
1. Prefer `aiocs-mcp` when an MCP client can use it directly.
|
|
34
|
+
2. Otherwise use the CLI with the root `--json` flag.
|
|
35
|
+
3. Assume `docs` and `aiocs-mcp` come from the globally installed `@bodhi-ventures/aiocs` package unless the user explicitly asks for a checkout-local development build.
|
|
36
|
+
4. Use `npx -y -p @bodhi-ventures/aiocs ...` only as a fallback when the global install is unavailable.
|
|
37
|
+
|
|
38
|
+
## User-managed sources
|
|
39
|
+
|
|
40
|
+
Machine-local source specs live under:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
~/.aiocs/sources
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Create or update source specs there instead of editing the bundled repo sources.
|
|
47
|
+
|
|
48
|
+
## Core commands
|
|
49
|
+
|
|
50
|
+
Validate the machine before curation:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
docs --json doctor
|
|
54
|
+
docs --json source list
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add or update a machine-local source:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
mkdir -p ~/.aiocs/sources
|
|
61
|
+
docs --json source upsert ~/.aiocs/sources/my-source.yaml
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Refresh only what is needed:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
docs --json refresh due my-source
|
|
68
|
+
docs --json refresh due hyperliquid
|
|
69
|
+
docs --json refresh due nktkas-hyperliquid
|
|
70
|
+
docs --json fetch my-source
|
|
71
|
+
docs --json canary my-source
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Compile or regenerate a workspace wiki:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
docs --json workspace create market-structure --label "Market Structure"
|
|
78
|
+
docs --json workspace bind market-structure hyperliquid nktkas-hyperliquid
|
|
79
|
+
docs --json workspace compile market-structure
|
|
80
|
+
docs --json workspace configure market-structure --auto-compile true
|
|
81
|
+
docs --json workspace queue-run
|
|
82
|
+
docs --json workspace ingest add market-structure markdown-dir /absolute/path/to/notes --label "Research notes"
|
|
83
|
+
docs --json workspace ingest add market-structure csv /absolute/path/to/fills.csv --label "Fills CSV"
|
|
84
|
+
docs --json workspace ingest add market-structure json /absolute/path/to/manifest.json --label "Research manifest"
|
|
85
|
+
docs --json workspace ingest add market-structure jsonl /absolute/path/to/events.jsonl --label "Events JSONL"
|
|
86
|
+
docs --json workspace output market-structure report --name weekly-brief
|
|
87
|
+
docs --json workspace output market-structure slides --name weekly-brief
|
|
88
|
+
docs --json workspace answer market-structure note "What changed?" --name quick-note
|
|
89
|
+
docs --json workspace sync obsidian market-structure /absolute/path/to/vault
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Heavy maintenance remains explicit:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
docs --json fetch all
|
|
96
|
+
docs --json embeddings backfill all
|
|
97
|
+
docs --json embeddings run
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## MCP tools
|
|
101
|
+
|
|
102
|
+
The `aiocs-mcp` server exposes the same curation operations without shell parsing:
|
|
103
|
+
|
|
104
|
+
- `doctor`
|
|
105
|
+
- `source_list`
|
|
106
|
+
- `source_upsert`
|
|
107
|
+
- `canary`
|
|
108
|
+
- `fetch`
|
|
109
|
+
- `refresh_due`
|
|
110
|
+
- `embeddings_status`
|
|
111
|
+
- `embeddings_backfill`
|
|
112
|
+
- `embeddings_clear`
|
|
113
|
+
- `embeddings_run`
|
|
114
|
+
- `workspace_create`
|
|
115
|
+
- `workspace_bind`
|
|
116
|
+
- `workspace_unbind`
|
|
117
|
+
- `workspace_update`
|
|
118
|
+
- `workspace_compile`
|
|
119
|
+
- `workspace_queue_run`
|
|
120
|
+
- `workspace_ingest_add`
|
|
121
|
+
- `workspace_ingest_remove`
|
|
122
|
+
- `workspace_output`
|
|
123
|
+
- `workspace_answer`
|
|
124
|
+
- `workspace_sync_obsidian`
|
|
125
|
+
- `batch`
|
|
126
|
+
|
|
127
|
+
## Recommended Codex workflow
|
|
128
|
+
|
|
129
|
+
1. Run `doctor` or `source_list` if runtime health, presence, or freshness is unclear.
|
|
130
|
+
2. If the source already exists and is due, prefer `refresh due <source-id>`.
|
|
131
|
+
3. If the source is missing but worth curating, create a spec under `~/.aiocs/sources`, then `source_upsert` it.
|
|
132
|
+
4. After upsert, use `refresh due <source-id>` as the safe first fetch path.
|
|
133
|
+
5. Use `canary` when the site changed or extraction drift is suspected.
|
|
134
|
+
6. For research workspaces, bind curated sources and/or ingest raw evidence, then run `workspace compile`.
|
|
135
|
+
7. Use `workspace output` and `workspace answer` only after a successful compile so outputs have source-backed provenance.
|
|
136
|
+
8. Prefer `autoCompileEnabled` plus targeted queue processing over broad global rebuilds.
|
|
137
|
+
9. Escalate to `fetch <source-id>` or `fetch all` only for explicit maintenance or when due-based refresh is not enough.
|
|
138
|
+
|
|
139
|
+
## Operational notes
|
|
140
|
+
|
|
141
|
+
- New or changed sources become due immediately after `source_upsert`.
|
|
142
|
+
- `~/.aiocs/sources` and bundled repo sources behave the same once bootstrapped into the catalog.
|
|
143
|
+
- Targeted refresh is the default. Broad refresh is a maintenance task, not a normal answering step.
|
|
144
|
+
- Use `aiocs` for read/search flows and this skill only for catalog mutation.
|
|
145
|
+
- Workspace compilation uses LM Studio and expects the configured model to be loaded before `workspace compile`, `workspace output`, or `workspace answer`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
kind: git
|
|
2
|
+
id: nktkas-hyperliquid
|
|
3
|
+
label: nktkas/hyperliquid Repo
|
|
4
|
+
repo:
|
|
5
|
+
url: https://github.com/nktkas/hyperliquid.git
|
|
6
|
+
ref: main
|
|
7
|
+
include:
|
|
8
|
+
- README.md
|
|
9
|
+
- CONTRIBUTING.md
|
|
10
|
+
- SECURITY.md
|
|
11
|
+
- LICENSE
|
|
12
|
+
- docs/**
|
|
13
|
+
- src/**
|
|
14
|
+
- tests/**
|
|
15
|
+
exclude:
|
|
16
|
+
- .github/**
|
|
17
|
+
- .dev/**
|
|
18
|
+
maxFiles: 1000
|
|
19
|
+
textFileMaxBytes: 262144
|
|
20
|
+
schedule:
|
|
21
|
+
everyHours: 24
|
|
22
|
+
canary:
|
|
23
|
+
everyHours: 6
|
|
24
|
+
checks:
|
|
25
|
+
- path: README.md
|
|
26
|
+
expectedText: Hyperliquid
|
|
27
|
+
minContentLength: 120
|
|
28
|
+
- path: src/mod.ts
|
|
29
|
+
expectedText: export
|
|
30
|
+
minContentLength: 20
|