@getenki/ai-darwin-arm64 0.4.0 → 0.5.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 +128 -1
- package/enki-ai.darwin-arm64.node +0 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,12 +16,18 @@ The package ships prebuilt native binaries for:
|
|
|
16
16
|
|
|
17
17
|
## What It Exports
|
|
18
18
|
|
|
19
|
-
The current package surface is
|
|
19
|
+
The current package surface is:
|
|
20
20
|
|
|
21
21
|
- `NativeEnkiAgent`
|
|
22
|
+
- `NativeMultiAgentRuntime`
|
|
23
|
+
- `NativeWorkflowRuntime`
|
|
24
|
+
- `JsAgentStatus`
|
|
22
25
|
- `JsMemoryKind`
|
|
23
26
|
- `JsMemoryModule`
|
|
24
27
|
- `JsMemoryEntry`
|
|
28
|
+
- `JsAgentCard`
|
|
29
|
+
- `JsAgentRunResult`
|
|
30
|
+
- `JsExecutionStep`
|
|
25
31
|
|
|
26
32
|
`NativeEnkiAgent` is the main entrypoint. It can be created in four modes:
|
|
27
33
|
|
|
@@ -30,6 +36,24 @@ The current package surface is intentionally small:
|
|
|
30
36
|
- `NativeEnkiAgent.withMemory(...)`
|
|
31
37
|
- `NativeEnkiAgent.withToolsAndMemory(...)`
|
|
32
38
|
|
|
39
|
+
`NativeMultiAgentRuntime` supports:
|
|
40
|
+
|
|
41
|
+
- `new(...)`
|
|
42
|
+
- `process(...)`
|
|
43
|
+
- `processWithTrace(...)`
|
|
44
|
+
- `registry(...)`
|
|
45
|
+
- `discover(...)`
|
|
46
|
+
|
|
47
|
+
`NativeWorkflowRuntime` supports:
|
|
48
|
+
|
|
49
|
+
- `new(...)`
|
|
50
|
+
- `listWorkflowsJson(...)`
|
|
51
|
+
- `listRunsJson(...)`
|
|
52
|
+
- `inspectJson(...)`
|
|
53
|
+
- `startJson(...)`
|
|
54
|
+
- `resumeJson(...)`
|
|
55
|
+
- `submitInterventionJson(...)`
|
|
56
|
+
|
|
33
57
|
## Basic Agent
|
|
34
58
|
|
|
35
59
|
Use the constructor when you only need a session-based agent backed by the native runtime.
|
|
@@ -279,6 +303,107 @@ const recordHandler = (
|
|
|
279
303
|
}
|
|
280
304
|
```
|
|
281
305
|
|
|
306
|
+
## Workflow Runtime
|
|
307
|
+
|
|
308
|
+
Use `NativeWorkflowRuntime` when you want to register workflow agents plus JSON task and workflow definitions directly from Node.js.
|
|
309
|
+
|
|
310
|
+
```js
|
|
311
|
+
const { NativeEnkiAgent, NativeWorkflowRuntime } = require('@getenki/ai')
|
|
312
|
+
|
|
313
|
+
const researcher = new NativeEnkiAgent(
|
|
314
|
+
'Researcher',
|
|
315
|
+
'Return short factual notes.',
|
|
316
|
+
'ollama::qwen3.5:latest',
|
|
317
|
+
4,
|
|
318
|
+
'./.enki',
|
|
319
|
+
)
|
|
320
|
+
researcher.configureWorkflow('researcher', ['research'])
|
|
321
|
+
|
|
322
|
+
const writer = new NativeEnkiAgent(
|
|
323
|
+
'Writer',
|
|
324
|
+
'Turn notes into a concise summary.',
|
|
325
|
+
'ollama::qwen3.5:latest',
|
|
326
|
+
4,
|
|
327
|
+
'./.enki',
|
|
328
|
+
)
|
|
329
|
+
writer.configureWorkflow('writer', ['writing'])
|
|
330
|
+
|
|
331
|
+
const runtime = new NativeWorkflowRuntime(
|
|
332
|
+
[researcher, writer],
|
|
333
|
+
[
|
|
334
|
+
JSON.stringify({
|
|
335
|
+
id: 'research_topic',
|
|
336
|
+
target: { type: 'capabilities', value: ['research'] },
|
|
337
|
+
prompt: 'Research {{topic}} and return 3 concise bullet points.',
|
|
338
|
+
input_bindings: { topic: 'input.topic' },
|
|
339
|
+
}),
|
|
340
|
+
JSON.stringify({
|
|
341
|
+
id: 'write_summary',
|
|
342
|
+
target: { type: 'agent_id', value: 'writer' },
|
|
343
|
+
prompt: 'Write a short summary for {{topic}} using {{research.content}}',
|
|
344
|
+
input_bindings: {
|
|
345
|
+
topic: 'input.topic',
|
|
346
|
+
research: 'research',
|
|
347
|
+
},
|
|
348
|
+
}),
|
|
349
|
+
],
|
|
350
|
+
[
|
|
351
|
+
JSON.stringify({
|
|
352
|
+
id: 'research-to-summary',
|
|
353
|
+
name: 'Research To Summary',
|
|
354
|
+
nodes: [
|
|
355
|
+
{ id: 'research', kind: 'task', task_id: 'research_topic', output_key: 'research' },
|
|
356
|
+
{ id: 'summary', kind: 'task', task_id: 'write_summary', output_key: 'summary' },
|
|
357
|
+
],
|
|
358
|
+
edges: [{ from: 'research', to: 'summary', transition: { type: 'always' } }],
|
|
359
|
+
}),
|
|
360
|
+
],
|
|
361
|
+
'./.enki',
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
const response = JSON.parse(
|
|
365
|
+
await runtime.startJson(
|
|
366
|
+
JSON.stringify({
|
|
367
|
+
workflow_id: 'research-to-summary',
|
|
368
|
+
input: { topic: 'workflow bindings in enki-js' },
|
|
369
|
+
}),
|
|
370
|
+
),
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
const persisted = JSON.parse(await runtime.inspectJson(response.run_id))
|
|
374
|
+
console.log(persisted.status)
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Human Intervention
|
|
378
|
+
|
|
379
|
+
Workflow runs persist pending interventions as part of the run state, so approvals and failure escalations can pause and resume without moving state into a separate coordinator service.
|
|
380
|
+
|
|
381
|
+
Each pending intervention includes:
|
|
382
|
+
|
|
383
|
+
- `workflow_id`
|
|
384
|
+
- `run_id`
|
|
385
|
+
- `node_id`
|
|
386
|
+
- `prompt`
|
|
387
|
+
- `reason`
|
|
388
|
+
- `response`
|
|
389
|
+
- `created_at` and `resolved_at`
|
|
390
|
+
|
|
391
|
+
Two built-in patterns are supported:
|
|
392
|
+
|
|
393
|
+
- `human_gate` nodes pause immediately and wait for a human response
|
|
394
|
+
- task nodes with `failure_policy: "pause_for_intervention"` convert a terminal failure into an intervention asking the human to `retry`, `skip`, `continue`, or `fail`
|
|
395
|
+
|
|
396
|
+
The runnable TypeScript example is [`example/basic-ts/human-intervention-workflow.ts`](/I:/projects/enki/core-next/example/basic-ts/human-intervention-workflow.ts). It demonstrates:
|
|
397
|
+
|
|
398
|
+
- a `human_gate` approval flow that pauses, resolves, and resumes to `approval.approved = true`
|
|
399
|
+
- a missing-agent failure that pauses for intervention and resumes after a `skip` response
|
|
400
|
+
|
|
401
|
+
The runtime interaction loop is:
|
|
402
|
+
|
|
403
|
+
1. `startJson(...)` returns a paused workflow response
|
|
404
|
+
2. `inspectJson(runId)` exposes `pending_interventions`
|
|
405
|
+
3. `submitInterventionJson(runId, interventionId, response)` resolves the intervention
|
|
406
|
+
4. `resumeJson(runId)` continues the persisted run
|
|
282
407
|
## Tools And Memory Example
|
|
283
408
|
|
|
284
409
|
The repository examples in [`example/basic-js/index.js`](/I:/projects/enki/core-next/example/basic-js/index.js) and [`example/basic-ts/index.ts`](/I:/projects/enki/core-next/example/basic-ts/index.ts) use `NativeEnkiAgent.withToolsAndMemory(...)` with:
|
|
@@ -448,3 +573,5 @@ Useful scripts:
|
|
|
448
573
|
- `npm test`: run the AVA test suite
|
|
449
574
|
- `npm run lint`: run `oxlint`
|
|
450
575
|
- `npm run format`: run Prettier, `cargo fmt`, and `taplo format`
|
|
576
|
+
|
|
577
|
+
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getenki/ai-darwin-arm64",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"cpu": [
|
|
5
5
|
"arm64"
|
|
6
6
|
],
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"enki-ai.darwin-arm64.node"
|
|
10
10
|
],
|
|
11
|
-
"description": "Node.js bindings for Enki
|
|
11
|
+
"description": "Node.js bindings for Enki's Rust agent runtime.",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"napi-rs",
|
|
14
14
|
"napi-rs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"name": "Enki AI Team",
|
|
24
24
|
"url": "https://getenki.com"
|
|
25
25
|
},
|
|
26
|
-
"license": "
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
29
29
|
},
|