You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Export Interchange defineTool memory tools as HTTP clients
Workflow agents install @corbits/memory/tools with hub credentials
and call the mounted tenant memory routes. Tools never take
model-supplied identity and do not touch the in-process plane.
* Document workflow defineTool install path for memory
README and product docs now lead with mount plus the shipped
@corbits/memory/tools factories instead of OpenAPI-MCP only.
* Harden memory tools: shared HTTP schemas, client, factory
Share AddRequest/SearchRequest (and limit bounds) between routes and
defineTool parsers without importing the plane. Collapse tool factories
through defineMemoryHttpTool; harden the HTTP client (multi-slash base,
empty/invalid JSON); strip adversarial identity args and coerce LLM
string limits. Expand tools tests accordingly.
* Strip nested extras from memory_add share payloads
Arktype keeps undeclared nested keys; rebuild share field-by-field
so model junk under share never rides the wire. Add regression
tests for nested share and search/list identity strip.
* Polish tools surface: shared types, list limits, docs
Derive MemoryAddBody/MemorySearchBody from arktype infer; share ListQuery
and parseListLimitString with the list route; clip long HTTP error bodies;
document host install checklist; fix search wire table and find→search
grant-tag action in IMPLEMENTATION and AUTHZ docs.
|`POST /api/tenants/:tenantId/memory/search`|`search`|`{ query, limit?, kinds?, entity_ids?}` (limit 1–50; `kinds`/`entity_ids` narrow every retrieval channel — lexical and dense — to a document `kind` or linked entity id before fusion; unset or `[]` = unfiltered) |`200 { items[], evidence?, degraded? }`; `400` on bad input |
491
-
|`GET /api/tenants/:tenantId/memory/list`|`search`|—|`200 { events: [{ at, title, source, tenantId, principalId }] }` — durable recent documents for the caller's scope, filtered with grant-tag access (`canAccessDocument`). One event per document (active live version). |
490
+
|`POST /api/tenants/:tenantId/memory/search`|`search`|`{ query, limit?, kinds?, entity_ids?, sources?, includeEvidence? }` (limit 1–50; `kinds`/`entity_ids`/`sources` narrow retrieval before fusion; unset or `[]` = unfiltered; `includeEvidence` adds a short evidence string when true) |`200 { items[], evidence?, degraded? }`; `400` on bad input |
491
+
|`GET /api/tenants/:tenantId/memory/list`|`search`|query `?limit=` (1–100, string on the wire)|`200 { events: [{ at, title, source, tenantId, principalId }] }` — durable recent documents for the caller's scope, filtered with grant-tag access (`canAccessDocument`). One event per document (active live version). |
492
492
493
493
`registerMemoryRoutes` and `createMemory({ app })` register the three HTTP routes.
494
-
Agent tools are a host concern — mount `@corbitsdev/hono-openapi-mcp` (or any
495
-
OpenAPI→tools bridge) against the same app. The plane surface is only
496
-
`add` / `search` / `list` (plus `close`); inference stays on the host.
494
+
Agent tools ship in this package as Interchange `defineTool` factories
495
+
(`@corbits/memory/tools` / `interchange.tools`): thin HTTP clients that call the
496
+
mounted routes with install env (`memoryBaseUrl`, `memoryTenantId`,
497
+
`memoryAuthToken`). They do not import the plane. Host checklist: agent principal
498
+
needs `memory:add` and/or `memory:search` grants; Bearer token only (no session
499
+
cookie path); tool results are JSON strings; pass `AbortSignal` if you need hang
500
+
protection — the client has no default timeout. OpenAPI→MCP remains an optional
501
+
host bridge. The plane surface is only `add` / `search` / `list` (plus `close`);
502
+
inference stays on the host.
497
503
498
504
499
505
@@ -518,8 +524,8 @@ Document access is Interchange authz — **not** a mini-ACL.
518
524
- Write path: `resolveAccessTags` always writes `memory.owner:<caller>` and
@@ -120,7 +120,7 @@ function canSeeDocument(doc, principalId, grantStore, tenantId):
120
120
**SQL / store path:** prefer expand-then-filter:
121
121
122
122
1.`collectGrants(principalId, tenantId)` once per request.
123
-
2. Keep allow-grants whose `action` matches `find` (exact or pattern).
123
+
2. Keep allow-grants whose `action` matches `search` (exact or pattern).
124
124
3. Document is visible if creator **or** any `accessTags[i]` is matched by any allow grant resource pattern (`matchPattern(grant.resource, tag)`), and not denied by a more specific deny.
125
125
126
126
This keeps evaluation inside Interchange authz semantics (specificity, conditions, deny).
0 commit comments