@keemakr/agent-sdk 0.3.0 → 0.4.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 +19 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.js +8 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,6 +82,25 @@ await kee.connections.get("hunter").call("email-finder", { ... }); // equivalent
|
|
|
82
82
|
const { access_token } = await kee.connections.hunter.token();
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
### Memory (cross-session, tenant-shared)
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
await kee.memory.set("prefs", "tone", { tone: "formal" });
|
|
89
|
+
await kee.memory.get("prefs", "tone"); // → { tone: "formal" }
|
|
90
|
+
await kee.memory.list("prefs"); // → entries in the namespace
|
|
91
|
+
await kee.memory.delete("prefs", "tone");
|
|
92
|
+
// Semantic search by meaning (embeddings):
|
|
93
|
+
const hits = await kee.memory.search("how should I speak to the user?", { limit: 5 });
|
|
94
|
+
// → [{ namespace, key, value, score, … }] (score 0–1, nearest first)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Platform tools
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
await kee.tools.list(); // tools this grant is entitled to
|
|
101
|
+
await kee.tools.run("current-time"); // run one in keemakr-core
|
|
102
|
+
```
|
|
103
|
+
|
|
85
104
|
A call whose grant lacks the required scope returns a `KeeError` with `status: 403`; an expired/invalid grant returns `status: 401`.
|
|
86
105
|
|
|
87
106
|
## Security model
|
package/dist/client.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export interface MemoryEntry {
|
|
|
35
35
|
* memory use eve's defineState instead — this is for state that must outlive the
|
|
36
36
|
* session. Requires the `memory:rw` scope.
|
|
37
37
|
*/
|
|
38
|
+
/** A semantic-search hit — a memory entry with its similarity score. */
|
|
39
|
+
export interface MemorySearchHit extends MemoryEntry {
|
|
40
|
+
/** Cosine similarity in [0,1] (1 = identical). */
|
|
41
|
+
score: number;
|
|
42
|
+
}
|
|
38
43
|
export interface KeeMemory {
|
|
39
44
|
/** Read a key's value, or null if absent. */
|
|
40
45
|
get(namespace: string, key: string): Promise<unknown | null>;
|
|
@@ -46,6 +51,11 @@ export interface KeeMemory {
|
|
|
46
51
|
delete(namespace: string, key: string): Promise<boolean>;
|
|
47
52
|
/** List every entry in a namespace (tenant-wide). */
|
|
48
53
|
list(namespace: string): Promise<MemoryEntry[]>;
|
|
54
|
+
/** Semantic search by meaning. Optionally scope to a namespace. */
|
|
55
|
+
search(query: string, opts?: {
|
|
56
|
+
namespace?: string;
|
|
57
|
+
limit?: number;
|
|
58
|
+
}): Promise<MemorySearchHit[]>;
|
|
49
59
|
}
|
|
50
60
|
/** Platform registry tools (Shape B) — defined in core, run server-side. */
|
|
51
61
|
export interface KeeTools {
|
package/dist/client.js
CHANGED
|
@@ -104,6 +104,14 @@ export function useKee(ctx) {
|
|
|
104
104
|
const json = (await capabilityFetch(grant, `memory/${enc(namespace)}`, undefined, 'GET'));
|
|
105
105
|
return json.entries ?? [];
|
|
106
106
|
},
|
|
107
|
+
async search(query, opts) {
|
|
108
|
+
const json = (await capabilityFetch(grant, 'memory/search', {
|
|
109
|
+
query,
|
|
110
|
+
namespace: opts?.namespace,
|
|
111
|
+
limit: opts?.limit,
|
|
112
|
+
}));
|
|
113
|
+
return json.hits ?? [];
|
|
114
|
+
},
|
|
107
115
|
};
|
|
108
116
|
const tools = {
|
|
109
117
|
async list() {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { grantAuth } from './grant-auth.js';
|
|
2
|
-
export { useKee, type Kee, type KeeConnection, type KeeContext, type KeeError, type KeeMemory, type KeeTools, type MemoryEntry, } from './client.js';
|
|
2
|
+
export { useKee, type Kee, type KeeConnection, type KeeContext, type KeeError, type KeeMemory, type KeeTools, type MemoryEntry, type MemorySearchHit, } from './client.js';
|
|
3
3
|
export { keemakrToolDirectory } from './tool-directory.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keemakr/agent-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The floor for keemakr marketplace agents: verify the capability grant and reach tenant connections, memory, and shared platform tools through keemakr-core — without holding raw secrets or resolving the tenant yourself.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|