@getenki/ai-darwin-arm64 0.5.41 → 0.5.61

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 CHANGED
@@ -19,6 +19,7 @@ The package ships prebuilt native binaries for:
19
19
  The current package surface is:
20
20
 
21
21
  - `NativeEnkiAgent`
22
+ - `NativeToolRegistry`
22
23
  - `NativeMultiAgentRuntime`
23
24
  - `NativeWorkflowRuntime`
24
25
  - `JsAgentStatus`
@@ -29,13 +30,22 @@ The current package surface is:
29
30
  - `JsAgentRunResult`
30
31
  - `JsExecutionStep`
31
32
 
32
- `NativeEnkiAgent` is the main entrypoint. It can be created in four modes:
33
+ `NativeEnkiAgent` is the main entrypoint. It can be created in five modes:
33
34
 
34
35
  - `new(...)` for a plain agent
35
36
  - `NativeEnkiAgent.withTools(...)`
37
+ - `NativeEnkiAgent.withToolRegistry(...)`
36
38
  - `NativeEnkiAgent.withMemory(...)`
37
39
  - `NativeEnkiAgent.withToolsAndMemory(...)`
38
40
 
41
+ `NativeToolRegistry` supports:
42
+
43
+ - `new(...)`
44
+ - `registerTools(...)`
45
+ - `clear()`
46
+ - `toolNames()`
47
+ - `size`
48
+
39
49
  It also supports two loop customization levels:
40
50
 
41
51
  - `agenticLoop` constructor arguments for prompt-level loop customization
@@ -290,6 +300,79 @@ Instead of putting `execute` on every tool, you can pass a shared `toolHandler`
290
300
  - `workspaceDir`
291
301
  - `sessionsDir`
292
302
 
303
+ ### Reusable Tool Registries
304
+
305
+ If you want to manage a shared pool of tools and attach it to multiple agents later, create a `NativeToolRegistry` and connect it dynamically:
306
+
307
+ ```js
308
+ const { NativeEnkiAgent, NativeToolRegistry } = require('@getenki/ai')
309
+
310
+ const registry = new NativeToolRegistry()
311
+ registry.registerTools(
312
+ [
313
+ {
314
+ name: 'lookup_release',
315
+ description: 'Return a canned release note.',
316
+ parametersJson: JSON.stringify({
317
+ type: 'object',
318
+ properties: {
319
+ version: { type: 'string' },
320
+ },
321
+ required: ['version'],
322
+ }),
323
+ },
324
+ ],
325
+ (toolName, inputJson) => JSON.stringify({ toolName, inputJson }),
326
+ )
327
+
328
+ const agent = new NativeEnkiAgent(
329
+ 'Registry Agent',
330
+ 'Use connected tools when they help.',
331
+ 'ollama::qwen3.5:latest',
332
+ 20,
333
+ process.cwd(),
334
+ )
335
+
336
+ agent.connectToolRegistry(registry)
337
+ ```
338
+
339
+ You can also construct the agent directly from a registry with `NativeEnkiAgent.withToolRegistry(...)`.
340
+
341
+ This is the cleanest path when multiple agents should share the same tool catalog or when tools need to be connected after agent construction.
342
+
343
+ TypeScript uses the same API:
344
+
345
+ ```ts
346
+ import { NativeEnkiAgent, NativeToolRegistry } from '@getenki/ai'
347
+
348
+ const registry = new NativeToolRegistry()
349
+ registry.registerTools(
350
+ [
351
+ {
352
+ name: 'lookup_release',
353
+ description: 'Return a canned release note.',
354
+ parameters: {
355
+ type: 'object',
356
+ properties: {
357
+ version: { type: 'string' },
358
+ },
359
+ required: ['version'],
360
+ },
361
+ },
362
+ ],
363
+ (toolName: string, inputJson: string) => JSON.stringify({ toolName, inputJson }),
364
+ )
365
+
366
+ const agent = NativeEnkiAgent.withToolRegistry(
367
+ 'Registry Agent',
368
+ 'Use connected tools when they help.',
369
+ 'ollama::qwen3.5:latest',
370
+ 20,
371
+ process.cwd(),
372
+ registry,
373
+ )
374
+ ```
375
+
293
376
  ## Memory
294
377
 
295
378
  Memory modules are plain objects:
@@ -608,6 +691,7 @@ JavaScript example:
608
691
  cd example/basic-js
609
692
  npm install
610
693
  npm start
694
+ npm run start:tool-registry
611
695
  npm run start:custom-agent-loop
612
696
  npm run start:react-custom-agent-loop
613
697
  npm run start:multi-agent-tools-memory
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getenki/ai-darwin-arm64",
3
- "version": "0.5.41",
3
+ "version": "0.5.61",
4
4
  "cpu": [
5
5
  "arm64"
6
6
  ],