Commit graph

47 commits

Author SHA1 Message Date
eec312dcb4
feat(http_server): add section headers to _payload_to_text for model parsing
The flattened text output now uses markdown headers so the model can
distinguish L0 identity from L1 summary from L2 episodes from handles.
This replaces undifferentiated newline-separated text with structured
sections: ## L0 Identity, ## L1 Recent Summary, ## Rich Club,
## L2 Episode, ## Handles.
2026-06-03 16:50:02 +02:00
7559bac57f
fix(opencode): fix memory-inject race condition, empty-memory ban, add turn limit
Three critical fixes to the iai-mcp-memory-inject.js plugin:

- Race condition: inflight is now a Map<sessionID, Promise> so concurrent
  callers (warm-on-create event + first transform hook) await the same
  fetch instead of getting empty string. First turn now gets memory.
- Empty-memory ban: fetchMemory returns {ok, text} tuple. HTTP 200 with
  empty body is memoized as valid (new user, minimal mode). Only actual
  network errors count against the retry budget.
- Turn-limited injection: new INJECT_MAX_TURNS (default 3) stops injecting
  after N turns. Memory was already in system prompt; the model has seen
  it. Controls per-turn token cost that was 50x the old approach.

Also: README now documents memory-inject.js (not session-init), and
session-init.js is marked @deprecated.
2026-06-03 16:47:55 +02:00
4f6b91aef8
feat: adding http-mcp and opencode plugin extension for seamless integration 2026-05-28 10:38:10 +02:00
5da28062b9
feat: works, but no title gen in opencode 2026-05-27 18:50:08 +02:00
37ee97b8ec
Add session_id param to memory_session_context tool; finalize session-init plugin 2026-05-27 18:26:10 +02:00
4ba8e3fc19
Document SDK message tradeoff in README 2026-05-27 16:59:11 +02:00
a6d6e46b4c
Simplify session-init: only send SDK prompt, accept session title tradeoff 2026-05-27 16:58:50 +02:00
87c43219d7
fix(qdrant_store): close all 7 LanceDB↔Qdrant implementation gaps
- _TableShim.add(): route by table name to dedicated upsert methods for all 5 tables
- _TableShim.to_pandas(): full DataFrame construction for edges/events/budget/ratelimit
- _parse_where: full parser with >, >=, <, <= (→Range), = (→MatchValue), AND splitting
- records_as_dataframe: include provenance_json, created_at, schema_version columns
- iter_records: wire columns parameter to Qdrant with_payload
- iter_record_columns: stop forcing 'id' into every yielded row
- events_query: scroll all events + Python-side since filter (handles missing ts_epoch)
- events_add: store ts_epoch alongside ts for numeric range filtering
- Module docstring: document _TableShim interface
2026-05-27 13:03:15 +02:00
31a69186a3
Add iai-mcp-session-init plugin for automatic memory loading in OpenCode 2026-05-26 09:48:46 +02:00
ebe7ebf17a
feat(mcp): add memory_session_context tool for opencode session recall 2026-05-25 15:41:03 +02:00
865d46bc78 Merge pull request 'chore(deps): update dependency typescript to v6' (#6) from renovate/typescript-6.x into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/6
2026-05-22 14:34:51 +02:00
ce34a995e1 chore(deps): update dependency typescript to v6 2026-05-22 12:29:23 +00:00
8f4dfa098c Merge pull request 'chore(deps): update dependency @types/node to v25' (#5) from renovate/node-25.x into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/5
2026-05-22 14:28:45 +02:00
a823edcc93 chore(deps): update dependency @types/node to v25 2026-05-22 12:05:57 +00:00
b8e989c819 Merge pull request 'chore(deps): update dependency @types/node to v22.19.19' (#2) from renovate/node-22.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/2
2026-05-22 14:03:56 +02:00
48c690031d chore(deps): update dependency @types/node to v22.19.19 2026-05-22 12:02:04 +00:00
512dab9f4e Merge pull request 'Removed 4 orphaned deps' (#9) from opencode/issue8-20260522085810 into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/9
2026-05-22 13:59:21 +02:00
opencode-agent[bot]
7d77cf0632 Removed 4 orphaned deps
Co-authored-by: apunkt <apunkt@users.noreply.bitfreedom.net>
2026-05-22 09:02:17 +00:00
a5d9112b8a Merge pull request 'chore(deps): update dependency zod to v4' (#7) from renovate/zod-4.x into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/7
2026-05-22 10:54:53 +02:00
690d3dc92b Merge pull request 'chore(deps): update dependency tsx to v4.22.3' (#4) from renovate/tsx-4.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/4
2026-05-22 10:37:12 +02:00
0cce8f957e chore(deps): update dependency tsx to v4.22.3 2026-05-22 08:05:26 +00:00
8116a5643f
feat: ship OpenCode capture plugin in deploy/opencode/ 2026-05-22 10:03:16 +02:00
ade1d2696f chore(deps): update dependency zod to v4 2026-05-22 08:02:16 +00:00
47c4c760be add /oc bot 2026-05-22 09:41:45 +02:00
ff6196421d Merge pull request 'chore(deps): update dependency numpy to >=2.4.6,<3.0.0' (#3) from renovate/numpy-2.x into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/3
2026-05-22 09:39:58 +02:00
ff7d9e98f3 chore(deps): update dependency numpy to >=2.4.6,<3.0.0 2026-05-22 06:11:36 +00:00
0e9f86566f Merge pull request 'chore: Configure Renovate' (#1) from renovate/configure into main
Reviewed-on: https://bitfreedom.net/code/code/apunkt/iai-mcp-opencode/pulls/1
2026-05-22 08:09:56 +02:00
0f4e4cc7ee Add renovate.json 2026-05-22 06:08:24 +00:00
46a2de0787
feat: add monitor.sh — daemon health, topology, sleep cycles, edge health 2026-05-21 10:35:07 +02:00
7f01b8824e
fix(systemd): Restart=always so daemon restarts after HIBERNATION clean exit
The daemon exits with status 0 on HIBERNATION (by design, to drop RSS).
Restart=on-failure only restarts on non-zero exits, so the daemon
stayed dead. Change to Restart=always.
2026-05-19 10:32:06 +02:00
382b411133
feat(maintenance): add dedup-edges subcommand to clean Qdrant duplicates
Cleans up duplicate edge points left by the boost_edges() bug (fixed
in previous commit). Each unique (src, dst, edge_type) keeps the
highest-weight point; duplicates are deleted. Default --dry-run.
2026-05-16 12:08:28 +02:00
e2883cceaa
fix: prevent duplicate edges in Qdrant and fix sigma floor check
Duplicate edges root cause — critical logic bug in QdrantStore:
boost_edges() and add_contradicts_edge() always created new points with
random UUIDs instead of reusing existing point IDs. Each boost call
added a duplicate point rather than updating in-place, causing 190
duplicate edge rows for 73 unique edges.

Sigma fix — compute_sigma() checked total node count (311 >= 200 floor)
but the largest connected component had only 2 nodes. Now checks the
largest CC size, which is the correct semantic for Humphries-Gurney
sigma validity.
2026-05-16 12:02:49 +02:00
7eea3ced28
fix: _decay_edges — handle string updated_at from Qdrant and add TableShim delete/update
The Qdrant _TableShim returned updated_at as ISO strings (not datetime
objects), causing str.replace(tzinfo=...) to fail with
"str.replace() takes no keyword arguments". Parse strings via
datetime.fromisoformat() before timezone handling.

Also add missing delete(where) and update(where=, values=) methods to
_TableShim so the LanceDB-compatible shim works with Qdrant's payload
collection, plus a _parse_where() helper to convert where clauses to
Qdrant Filters.
2026-05-15 16:59:02 +02:00
6bd479b137
fix: Qdrant edge creation — use UUID string IDs and empty vectors for payload-only points 2026-05-15 10:29:23 +02:00
7173a446a6
feat(wrapper): spawn daemon on Linux when hibernated
On non-darwin platforms, the wrapper now attempts to spawn the daemon
via 'iai-mcp daemon start' (which uses systemctl --user start) when
the daemon socket is unreachable. This allows the daemon to wake from
hibernation automatically instead of only writing wake.signal as a
passive marker.

If spawn fails (binary not found, systemd unavailable), falls back to
writing wake.signal for future daemon boots.
2026-05-14 18:05:05 +02:00
a31bbd7f58
fix: Qdrant backend support — topology, doctor, and community detection
- Fix build_runtime_graph to use backend-agnostic records_as_dataframe()
  and edges_as_dataframe() instead of LanceDB-specific open_table()
- Fix CLI topology command: JSON-RPC envelope + result extraction
- Fix community.py KeyError when graph has nodes but no edges
- Update doctor check (i) to report Qdrant collection counts when
  Qdrant is active, LanceDB versions when LanceDB is active
- Fix HIBERNATION startup exit: dispatch REQUEST_ARRIVED on boot
- Fix systemd unit: StartLimit* keys in [Unit] section
- Broaden capture.py exception handler for deferred capture failures
- Add records_as_dataframe() and edges_as_dataframe() to MemoryStore
2026-05-14 16:20:54 +02:00
8492719735
fix: support Qdrant backend on non-AVX CPUs
- doctor: skip LanceDB check when qdrant_storage/ dir detected
- topology: use daemon socket instead of local store (avoids lancedb crash)
- qdrant_store: add records_as_dataframe() + wire into _TableShim
  so build_runtime_graph() works with Qdrant (was returning empty)
2026-05-12 18:14:03 +02:00
01e5903035
docs: update README for Linux support, Qdrant backend, and portable systemd unit 2026-05-12 16:58:32 +02:00
8a116d270c
update gitignore 2026-05-12 16:47:31 +02:00
91d67b2e12
refactor: opencode 2026-05-12 16:45:15 +02:00
Areg Noya
09c5b30f15 Update 2026-05-10 20:42:02 -07:00
Areg Noya
739ff9dc27 Update README
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: XNLLLLH <XNLLLLH@users.noreply.github.com>
2026-05-10 01:00:04 -07:00
Areg Noya
9f678bfe4d Update README
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: XNLLLLH <XNLLLLH@users.noreply.github.com>
2026-05-10 00:50:31 -07:00
Areg Noya
3094a2b81f Update README
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: XNLLLLH <XNLLLLH@users.noreply.github.com>
2026-05-10 00:48:47 -07:00
Areg Noya
5e2c9fa9ca Update README badges
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: XNLLLLH <XNLLLLH@users.noreply.github.com>
2026-05-10 00:37:00 -07:00
Areg Noya
2ecdc10a5e Improve README structure: add badges, TOC, reorder sections
Move Quick start above Usage/How it works for faster onboarding.
Move About the name to end. Add license, platform, and benchmark
badges. Add table of contents for navigation.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: XNLLLLH <XNLLLLH@users.noreply.github.com>
2026-05-10 00:27:06 -07:00
Areg Noya
f6b876fbe7 Initial release: iai-mcp v0.1.0
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: XNLLLLH <XNLLLLH@users.noreply.github.com>
2026-05-06 01:04:47 -07:00