@nanobpm/nano-agent-graph-engine 0.0.0-stage → 0.17.1
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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +21 -0
- package/.mcp.json +8 -0
- package/README.md +525 -2
- package/dist/cli.js +55815 -0
- package/dist/explorer-app.html +196 -0
- package/dist/explorer.html +196 -0
- package/dist/guide.md +147 -0
- package/dist/index.js +1256 -0
- package/dist/layout-thread.js +12806 -0
- package/dist/nanobpmn_engine_bg.wasm +0 -0
- package/dist/step-thread.js +55 -0
- package/dist/typecheck/agent-graph-engine/agents.d.ts +120 -0
- package/dist/typecheck/agent-graph-engine/index.d.ts +124 -0
- package/dist/typecheck/agent-graph-engine/input.d.ts +57 -0
- package/dist/typecheck/agent-graph-engine/paths.d.ts +35 -0
- package/dist/typecheck/lib.decorators.d.ts +384 -0
- package/dist/typecheck/lib.decorators.legacy.d.ts +22 -0
- package/dist/typecheck/lib.es2015.collection.d.ts +147 -0
- package/dist/typecheck/lib.es2015.core.d.ts +597 -0
- package/dist/typecheck/lib.es2015.d.ts +28 -0
- package/dist/typecheck/lib.es2015.generator.d.ts +77 -0
- package/dist/typecheck/lib.es2015.iterable.d.ts +605 -0
- package/dist/typecheck/lib.es2015.promise.d.ts +81 -0
- package/dist/typecheck/lib.es2015.proxy.d.ts +128 -0
- package/dist/typecheck/lib.es2015.reflect.d.ts +144 -0
- package/dist/typecheck/lib.es2015.symbol.d.ts +46 -0
- package/dist/typecheck/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/dist/typecheck/lib.es2016.array.include.d.ts +116 -0
- package/dist/typecheck/lib.es2016.d.ts +21 -0
- package/dist/typecheck/lib.es2016.full.d.ts +23 -0
- package/dist/typecheck/lib.es2016.intl.d.ts +31 -0
- package/dist/typecheck/lib.es2017.arraybuffer.d.ts +21 -0
- package/dist/typecheck/lib.es2017.d.ts +26 -0
- package/dist/typecheck/lib.es2017.date.d.ts +31 -0
- package/dist/typecheck/lib.es2017.full.d.ts +23 -0
- package/dist/typecheck/lib.es2017.intl.d.ts +44 -0
- package/dist/typecheck/lib.es2017.object.d.ts +49 -0
- package/dist/typecheck/lib.es2017.sharedmemory.d.ts +135 -0
- package/dist/typecheck/lib.es2017.string.d.ts +45 -0
- package/dist/typecheck/lib.es2017.typedarrays.d.ts +53 -0
- package/dist/typecheck/lib.es2018.asyncgenerator.d.ts +77 -0
- package/dist/typecheck/lib.es2018.asynciterable.d.ts +53 -0
- package/dist/typecheck/lib.es2018.d.ts +24 -0
- package/dist/typecheck/lib.es2018.full.d.ts +24 -0
- package/dist/typecheck/lib.es2018.intl.d.ts +83 -0
- package/dist/typecheck/lib.es2018.promise.d.ts +30 -0
- package/dist/typecheck/lib.es2018.regexp.d.ts +37 -0
- package/dist/typecheck/lib.es2019.array.d.ts +79 -0
- package/dist/typecheck/lib.es2019.d.ts +24 -0
- package/dist/typecheck/lib.es2019.full.d.ts +24 -0
- package/dist/typecheck/lib.es2019.intl.d.ts +23 -0
- package/dist/typecheck/lib.es2019.object.d.ts +33 -0
- package/dist/typecheck/lib.es2019.string.d.ts +37 -0
- package/dist/typecheck/lib.es2019.symbol.d.ts +24 -0
- package/dist/typecheck/lib.es2020.bigint.d.ts +765 -0
- package/dist/typecheck/lib.es2020.d.ts +27 -0
- package/dist/typecheck/lib.es2020.date.d.ts +42 -0
- package/dist/typecheck/lib.es2020.full.d.ts +24 -0
- package/dist/typecheck/lib.es2020.intl.d.ts +474 -0
- package/dist/typecheck/lib.es2020.number.d.ts +28 -0
- package/dist/typecheck/lib.es2020.promise.d.ts +47 -0
- package/dist/typecheck/lib.es2020.sharedmemory.d.ts +99 -0
- package/dist/typecheck/lib.es2020.string.d.ts +44 -0
- package/dist/typecheck/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/dist/typecheck/lib.es2021.d.ts +23 -0
- package/dist/typecheck/lib.es2021.full.d.ts +24 -0
- package/dist/typecheck/lib.es2021.intl.d.ts +166 -0
- package/dist/typecheck/lib.es2021.promise.d.ts +48 -0
- package/dist/typecheck/lib.es2021.string.d.ts +33 -0
- package/dist/typecheck/lib.es2021.weakref.d.ts +78 -0
- package/dist/typecheck/lib.es2022.array.d.ts +121 -0
- package/dist/typecheck/lib.es2022.d.ts +25 -0
- package/dist/typecheck/lib.es2022.error.d.ts +75 -0
- package/dist/typecheck/lib.es2022.full.d.ts +24 -0
- package/dist/typecheck/lib.es2022.intl.d.ts +145 -0
- package/dist/typecheck/lib.es2022.object.d.ts +26 -0
- package/dist/typecheck/lib.es2022.regexp.d.ts +39 -0
- package/dist/typecheck/lib.es2022.string.d.ts +25 -0
- package/dist/typecheck/lib.es2023.array.d.ts +924 -0
- package/dist/typecheck/lib.es2023.collection.d.ts +21 -0
- package/dist/typecheck/lib.es2023.d.ts +22 -0
- package/dist/typecheck/lib.es2023.full.d.ts +24 -0
- package/dist/typecheck/lib.es2023.intl.d.ts +56 -0
- package/dist/typecheck/lib.es2024.arraybuffer.d.ts +65 -0
- package/dist/typecheck/lib.es2024.collection.d.ts +29 -0
- package/dist/typecheck/lib.es2024.d.ts +26 -0
- package/dist/typecheck/lib.es2024.full.d.ts +24 -0
- package/dist/typecheck/lib.es2024.object.d.ts +29 -0
- package/dist/typecheck/lib.es2024.promise.d.ts +35 -0
- package/dist/typecheck/lib.es2024.regexp.d.ts +25 -0
- package/dist/typecheck/lib.es2024.sharedmemory.d.ts +68 -0
- package/dist/typecheck/lib.es2024.string.d.ts +29 -0
- package/dist/typecheck/lib.es5.d.ts +4601 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/client.d.ts +169 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/declarative.d.ts +366 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/envelope.d.ts +77 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/imperative.d.ts +32 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/index.d.ts +14 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/io-mapping.d.ts +32 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/layout.d.ts +22 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/boundary.d.ts +63 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/branch.d.ts +11 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/break.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/continue.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/end.d.ts +40 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/forEach.d.ts +24 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/human.d.ts +44 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/index.d.ts +15 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/loop.d.ts +9 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/parallel.d.ts +9 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/race.d.ts +54 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/registry.d.ts +33 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/run.d.ts +12 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/signal.d.ts +11 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/switch.d.ts +11 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/task.d.ts +82 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/timer.d.ts +9 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/diff.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/index.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/normalize.d.ts +19 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/parity.d.ts +28 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/xml.d.ts +17 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/types.d.ts +146 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/worker.d.ts +92 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/xml.d.ts +14 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/package.json +65 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/src/bpmn-auto-layout.d.ts +10 -0
- package/dist/typecheck/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/dist/typecheck/node_modules/@types/node/assert.d.ts +1077 -0
- package/dist/typecheck/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/dist/typecheck/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/dist/typecheck/node_modules/@types/node/buffer.d.ts +1800 -0
- package/dist/typecheck/node_modules/@types/node/child_process.d.ts +1361 -0
- package/dist/typecheck/node_modules/@types/node/cluster.d.ts +432 -0
- package/dist/typecheck/node_modules/@types/node/console.d.ts +93 -0
- package/dist/typecheck/node_modules/@types/node/constants.d.ts +14 -0
- package/dist/typecheck/node_modules/@types/node/crypto.d.ts +3964 -0
- package/dist/typecheck/node_modules/@types/node/dgram.d.ts +652 -0
- package/dist/typecheck/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/dist/typecheck/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/dist/typecheck/node_modules/@types/node/dns.d.ts +876 -0
- package/dist/typecheck/node_modules/@types/node/domain.d.ts +150 -0
- package/dist/typecheck/node_modules/@types/node/events.d.ts +1008 -0
- package/dist/typecheck/node_modules/@types/node/ffi.d.ts +500 -0
- package/dist/typecheck/node_modules/@types/node/fs/promises.d.ts +1477 -0
- package/dist/typecheck/node_modules/@types/node/fs.d.ts +4803 -0
- package/dist/typecheck/node_modules/@types/node/globals.d.ts +150 -0
- package/dist/typecheck/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/dist/typecheck/node_modules/@types/node/http.d.ts +2218 -0
- package/dist/typecheck/node_modules/@types/node/http2.d.ts +2498 -0
- package/dist/typecheck/node_modules/@types/node/https.d.ts +400 -0
- package/dist/typecheck/node_modules/@types/node/index.d.ts +116 -0
- package/dist/typecheck/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/dist/typecheck/node_modules/@types/node/inspector.d.ts +265 -0
- package/dist/typecheck/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/dist/typecheck/node_modules/@types/node/module.d.ts +726 -0
- package/dist/typecheck/node_modules/@types/node/net.d.ts +1074 -0
- package/dist/typecheck/node_modules/@types/node/os.d.ts +498 -0
- package/dist/typecheck/node_modules/@types/node/package.json +140 -0
- package/dist/typecheck/node_modules/@types/node/path/posix.d.ts +8 -0
- package/dist/typecheck/node_modules/@types/node/path/win32.d.ts +8 -0
- package/dist/typecheck/node_modules/@types/node/path.d.ts +178 -0
- package/dist/typecheck/node_modules/@types/node/perf_hooks.d.ts +617 -0
- package/dist/typecheck/node_modules/@types/node/process.d.ts +2269 -0
- package/dist/typecheck/node_modules/@types/node/punycode.d.ts +89 -0
- package/dist/typecheck/node_modules/@types/node/querystring.d.ts +139 -0
- package/dist/typecheck/node_modules/@types/node/quic.d.ts +2191 -0
- package/dist/typecheck/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/dist/typecheck/node_modules/@types/node/readline.d.ts +508 -0
- package/dist/typecheck/node_modules/@types/node/repl.d.ts +420 -0
- package/dist/typecheck/node_modules/@types/node/sea.d.ts +47 -0
- package/dist/typecheck/node_modules/@types/node/sqlite.d.ts +1140 -0
- package/dist/typecheck/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/dist/typecheck/node_modules/@types/node/stream/iter.d.ts +449 -0
- package/dist/typecheck/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/dist/typecheck/node_modules/@types/node/stream/web.d.ts +320 -0
- package/dist/typecheck/node_modules/@types/node/stream.d.ts +1806 -0
- package/dist/typecheck/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/dist/typecheck/node_modules/@types/node/test/reporters.d.ts +60 -0
- package/dist/typecheck/node_modules/@types/node/test.d.ts +2558 -0
- package/dist/typecheck/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/dist/typecheck/node_modules/@types/node/timers.d.ts +149 -0
- package/dist/typecheck/node_modules/@types/node/tls.d.ts +1232 -0
- package/dist/typecheck/node_modules/@types/node/trace_events.d.ts +103 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/index.d.ts +118 -0
- package/dist/typecheck/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/dist/typecheck/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/dist/typecheck/node_modules/@types/node/tty.d.ts +226 -0
- package/dist/typecheck/node_modules/@types/node/url.d.ts +556 -0
- package/dist/typecheck/node_modules/@types/node/util/types.d.ts +558 -0
- package/dist/typecheck/node_modules/@types/node/util.d.ts +1680 -0
- package/dist/typecheck/node_modules/@types/node/v8.d.ts +1059 -0
- package/dist/typecheck/node_modules/@types/node/vfs.d.ts +211 -0
- package/dist/typecheck/node_modules/@types/node/vm.d.ts +1137 -0
- package/dist/typecheck/node_modules/@types/node/wasi.d.ts +131 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/streams.d.ts +119 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/dist/typecheck/node_modules/@types/node/worker_threads.d.ts +672 -0
- package/dist/typecheck/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/dist/typecheck/node_modules/@types/node/zlib.d.ts +1364 -0
- package/dist/typecheck/node_modules/undici-types/agent.d.ts +30 -0
- package/dist/typecheck/node_modules/undici-types/api.d.ts +43 -0
- package/dist/typecheck/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/dist/typecheck/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/dist/typecheck/node_modules/undici-types/cache.d.ts +36 -0
- package/dist/typecheck/node_modules/undici-types/client-stats.d.ts +15 -0
- package/dist/typecheck/node_modules/undici-types/client.d.ts +134 -0
- package/dist/typecheck/node_modules/undici-types/connector.d.ts +37 -0
- package/dist/typecheck/node_modules/undici-types/content-type.d.ts +21 -0
- package/dist/typecheck/node_modules/undici-types/cookies.d.ts +30 -0
- package/dist/typecheck/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/dist/typecheck/node_modules/undici-types/dispatcher.d.ts +253 -0
- package/dist/typecheck/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/dist/typecheck/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/dist/typecheck/node_modules/undici-types/errors.d.ts +187 -0
- package/dist/typecheck/node_modules/undici-types/eventsource.d.ts +66 -0
- package/dist/typecheck/node_modules/undici-types/fetch.d.ts +235 -0
- package/dist/typecheck/node_modules/undici-types/formdata.d.ts +108 -0
- package/dist/typecheck/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/dist/typecheck/node_modules/undici-types/global-origin.d.ts +7 -0
- package/dist/typecheck/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/dist/typecheck/node_modules/undici-types/handlers.d.ts +16 -0
- package/dist/typecheck/node_modules/undici-types/header.d.ts +165 -0
- package/dist/typecheck/node_modules/undici-types/index.d.ts +93 -0
- package/dist/typecheck/node_modules/undici-types/interceptors.d.ts +80 -0
- package/dist/typecheck/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/dist/typecheck/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/dist/typecheck/node_modules/undici-types/mock-client.d.ts +27 -0
- package/dist/typecheck/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/dist/typecheck/node_modules/undici-types/mock-interceptor.d.ts +98 -0
- package/dist/typecheck/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/dist/typecheck/node_modules/undici-types/package.json +55 -0
- package/dist/typecheck/node_modules/undici-types/patch.d.ts +29 -0
- package/dist/typecheck/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/dist/typecheck/node_modules/undici-types/pool.d.ts +39 -0
- package/dist/typecheck/node_modules/undici-types/proxy-agent.d.ts +36 -0
- package/dist/typecheck/node_modules/undici-types/readable.d.ts +68 -0
- package/dist/typecheck/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/dist/typecheck/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/dist/typecheck/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/dist/typecheck/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/dist/typecheck/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/dist/typecheck/node_modules/undici-types/util.d.ts +18 -0
- package/dist/typecheck/node_modules/undici-types/utility.d.ts +7 -0
- package/dist/typecheck/node_modules/undici-types/webidl.d.ts +346 -0
- package/dist/typecheck/node_modules/undici-types/websocket.d.ts +188 -0
- package/dist/typecheck/ts.cjs +446 -0
- package/hooks/hooks.json +30 -0
- package/hooks/mod.js +461 -0
- package/package.json +80 -4
- package/skills/agent-graph/SKILL.md +47 -0
- package/skills/agent-graph-authoring/SKILL.md +147 -0
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/step-thread.ts
|
|
4
|
+
import { parentPort } from "node:worker_threads";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
|
|
8
|
+
// src/resolve-hook.ts
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import module from "node:module";
|
|
11
|
+
var ENGINE_SPECIFIERS = ["@nanobpm/nano-agent-graph-engine", "nano-agent-graph-engine", "agent-graph-engine"];
|
|
12
|
+
var installed = false;
|
|
13
|
+
function installResolveHook() {
|
|
14
|
+
if (installed) return;
|
|
15
|
+
installed = true;
|
|
16
|
+
const js = new URL("./index.js", import.meta.url);
|
|
17
|
+
const target = fs.existsSync(js) ? js.href : new URL("./index.ts", import.meta.url).href;
|
|
18
|
+
module.registerHooks({
|
|
19
|
+
resolve(specifier, context, next) {
|
|
20
|
+
if (ENGINE_SPECIFIERS.includes(specifier)) return { url: target, shortCircuit: true };
|
|
21
|
+
return next(specifier, context);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/step-thread.ts
|
|
27
|
+
installResolveHook();
|
|
28
|
+
var api = import("@nanobpm/nano-agent-graph-engine");
|
|
29
|
+
var current;
|
|
30
|
+
async function handlerFor(r) {
|
|
31
|
+
const mod = await import(`${pathToFileURL(path.resolve(r.file)).href}?v=${r.stamp}`);
|
|
32
|
+
const flow = Object.values(mod).find((v) => v && v.kind === "declarative" && v.id === r.flowId);
|
|
33
|
+
const name = r.type.startsWith(r.flowKey + ":") ? r.type.slice(r.flowKey.length + 1) : r.type;
|
|
34
|
+
const h = flow?.handlers?.[name] ?? mod.workers?.[r.type];
|
|
35
|
+
if (typeof h !== "function") throw new Error(`no handler for ${r.type} in ${path.basename(r.file)}`);
|
|
36
|
+
return h;
|
|
37
|
+
}
|
|
38
|
+
parentPort.on("message", async (msg) => {
|
|
39
|
+
if ("abort" in msg) return current?.abort();
|
|
40
|
+
const r = msg;
|
|
41
|
+
current = new AbortController();
|
|
42
|
+
let reply;
|
|
43
|
+
try {
|
|
44
|
+
const h = await handlerFor(r);
|
|
45
|
+
const { runInProject } = await api;
|
|
46
|
+
const out = await runInProject(r.project, () => h(r.job), current.signal);
|
|
47
|
+
const variables = out && typeof out === "object" ? JSON.parse(JSON.stringify(out)) : {};
|
|
48
|
+
reply = { id: r.id, ok: true, variables };
|
|
49
|
+
} catch (e) {
|
|
50
|
+
reply = { id: r.id, ok: false, error: String(e?.message ?? e) };
|
|
51
|
+
}
|
|
52
|
+
current = void 0;
|
|
53
|
+
parentPort.postMessage(reply);
|
|
54
|
+
});
|
|
55
|
+
process.on("unhandledRejection", (e) => console.error(`[step thread] unhandled rejection: ${e?.stack ?? e}`));
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export interface AgentProfile {
|
|
2
|
+
/** "acp": Agent Client Protocol over stdio. "claude": `claude -p` print mode. */
|
|
3
|
+
/** "exec": any CLI — the prompt replaces "{prompt}" in args (else goes to stdin) and stdout is the result. */
|
|
4
|
+
protocol: "acp" | "claude" | "exec";
|
|
5
|
+
command: string;
|
|
6
|
+
args?: string[];
|
|
7
|
+
env?: Record<string, string>;
|
|
8
|
+
/** Default model for this profile ("provider/model" for nano-coder and OpenCode). */
|
|
9
|
+
model?: string;
|
|
10
|
+
/** How the model is passed: a flag (e.g. "--model") … */
|
|
11
|
+
modelArg?: string;
|
|
12
|
+
/** Put the model flag before args rather than after (kimi: `kimi -m <model> acp`). */
|
|
13
|
+
modelArgFirst?: boolean;
|
|
14
|
+
/** … or env vars, with "{model}" replaced (OpenCode: OPENCODE_CONFIG_CONTENT). */
|
|
15
|
+
modelEnv?: Record<string, string>;
|
|
16
|
+
/** Shown in `nage agents` and the explorer. */
|
|
17
|
+
description?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const BUILTIN_PROFILES: Record<string, AgentProfile>;
|
|
20
|
+
/** When nothing picks a CLI, the first of these that's installed runs the step. */
|
|
21
|
+
export declare const AUTO_ORDER: string[];
|
|
22
|
+
/** The CLI each host runs on: a run started from that host defaults to it. */
|
|
23
|
+
export declare const HOST_PROFILE: Record<string, string>;
|
|
24
|
+
/** A choice of CLI and/or model for an agent step. */
|
|
25
|
+
export interface AgentChoice {
|
|
26
|
+
use?: string;
|
|
27
|
+
model?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Your assignments for one flow (by flow id, so they follow the flow across projects). */
|
|
30
|
+
export interface FlowAssignment extends AgentChoice {
|
|
31
|
+
steps?: Record<string, AgentChoice>;
|
|
32
|
+
}
|
|
33
|
+
export interface AgentsFile {
|
|
34
|
+
default?: string;
|
|
35
|
+
profiles?: Record<string, AgentProfile>;
|
|
36
|
+
/** Rank → profile: who serves `<rank>:*` agent steps (e.g. { senior: "claude", junior: "nano-coder" }). */
|
|
37
|
+
ranks?: Record<string, string>;
|
|
38
|
+
flows?: Record<string, FlowAssignment>;
|
|
39
|
+
}
|
|
40
|
+
/** Per-run overrides: by step name, or "*" for every agent step of the run. */
|
|
41
|
+
export type RunAgents = Record<string, AgentChoice>;
|
|
42
|
+
/** The rank of a nano-workforce agent job type (`senior:feature` → senior). Same grammar as
|
|
43
|
+
* nano-workforce's jobTypeToRoutingToken: one colon, rank a bare `[a-z][a-z0-9-]*` segment. */
|
|
44
|
+
export declare function rankOf(jobType: string): string | undefined;
|
|
45
|
+
export declare function agentsFile(): string;
|
|
46
|
+
export declare function readAgentsFile(): AgentsFile;
|
|
47
|
+
export declare function writeAgentsFile(f: AgentsFile): void;
|
|
48
|
+
/** All profiles a flow can use, with where each came from. */
|
|
49
|
+
export declare function allProfiles(flowProfiles?: Record<string, AgentProfile>, file?: AgentsFile): Record<string, AgentProfile & {
|
|
50
|
+
source: string;
|
|
51
|
+
}>;
|
|
52
|
+
/** Absolute path of a command, looking past the minimal PATH Desktop starts us with. A
|
|
53
|
+
* relative path ("./ask.sh") is relative to `cwd` (the step's working directory). Only hits
|
|
54
|
+
* are cached: a CLI installed after an incident is found when the step is retried. */
|
|
55
|
+
export declare function which(command: string, cwd?: string): string | undefined;
|
|
56
|
+
export interface ResolvedAgent {
|
|
57
|
+
name: string;
|
|
58
|
+
profile: AgentProfile;
|
|
59
|
+
/** The model to run with (undefined: the CLI's own default). */
|
|
60
|
+
model?: string;
|
|
61
|
+
/** Why this profile, e.g. "run override", "your step assignment", "rank senior", "author (step)", "host". */
|
|
62
|
+
reason: string;
|
|
63
|
+
/** The author's suggestion that was skipped (unknown or not installed here), if any. */
|
|
64
|
+
skipped?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ResolveInput {
|
|
67
|
+
flowId?: string;
|
|
68
|
+
step?: string;
|
|
69
|
+
jobType?: string;
|
|
70
|
+
/** The author's choices from the flow file. */
|
|
71
|
+
use?: string;
|
|
72
|
+
model?: string;
|
|
73
|
+
flowDefault?: string;
|
|
74
|
+
flowProfiles?: Record<string, AgentProfile>;
|
|
75
|
+
/** Overrides for this run. */
|
|
76
|
+
run?: RunAgents;
|
|
77
|
+
host?: string;
|
|
78
|
+
/** Read instead of ~/.agent-graph/agents.json (tests, previews). */
|
|
79
|
+
file?: AgentsFile;
|
|
80
|
+
/** The step's working directory, for profiles whose command is a relative path. */
|
|
81
|
+
cwd?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Pick the profile and model for an agent step. Undefined when nothing usable is installed.
|
|
84
|
+
* The user's own choices (run, step, flow, rank, default) must name a known profile whose CLI
|
|
85
|
+
* is installed — a typo or a missing CLI there is an error, not a silent fallback. The author's suggestions only apply when that
|
|
86
|
+
* CLI is known and installed here, so a flow from someone on another CLI just runs on yours. */
|
|
87
|
+
export declare function resolveAgent(opts: ResolveInput): ResolvedAgent | undefined;
|
|
88
|
+
/** Pull `--agent [step=]profile` and `--model [step=]model` (repeatable) out of CLI args:
|
|
89
|
+
* per-run overrides, "*" = every agent step. Returns the remaining args. */
|
|
90
|
+
export declare function takeRunAgents(args: string[]): {
|
|
91
|
+
agents?: RunAgents;
|
|
92
|
+
rest: string[];
|
|
93
|
+
};
|
|
94
|
+
/** `nage agent add <name> --acp|--claude|--exec [options] -- <command> [args…]` → a profile. */
|
|
95
|
+
export declare function parseAgentAdd(argv: string[]): {
|
|
96
|
+
name: string;
|
|
97
|
+
profile: AgentProfile;
|
|
98
|
+
};
|
|
99
|
+
/** Add (or replace) a profile in agents.json. Returns a note when it shadows a preset. */
|
|
100
|
+
export declare function addProfile(name: string, profile: AgentProfile): string | undefined;
|
|
101
|
+
/** Remove a profile from agents.json; says what still points at it. */
|
|
102
|
+
export declare function removeProfile(name: string): string;
|
|
103
|
+
/** Set (or clear, with use/model null) an assignment in agents.json. No step: the whole flow. */
|
|
104
|
+
export declare function assignAgent(a: {
|
|
105
|
+
flowId?: string;
|
|
106
|
+
step?: string;
|
|
107
|
+
rank?: string;
|
|
108
|
+
use?: string | null;
|
|
109
|
+
model?: string | null;
|
|
110
|
+
}): AgentsFile;
|
|
111
|
+
/** The binary a profile runs. AGE_CLAUDE_CMD still swaps the built-in claude (tests). */
|
|
112
|
+
export declare function commandOf(name: string, p: AgentProfile): string;
|
|
113
|
+
/** Is any agent CLI usable here (else agent steps go to the chat assistant)? */
|
|
114
|
+
export declare function anyAgentInstalled(): boolean;
|
|
115
|
+
/** Command line + env for a profile run with a model. */
|
|
116
|
+
export declare function launch(name: string, p: AgentProfile, model?: string, cwd?: string): {
|
|
117
|
+
command: string;
|
|
118
|
+
args: string[];
|
|
119
|
+
env: Record<string, string>;
|
|
120
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export { defineFlow, envelope, validateEnvelope } from "@nanobpm/workflow";
|
|
2
|
+
export type { Envelope, EnvelopeProblem, FlowBuilder, Job, JsonObject, StartVars } from "@nanobpm/workflow";
|
|
3
|
+
export type { StartFormHints } from "./input.ts";
|
|
4
|
+
/** Display hints for the start form of a flow with an input (`{ Start: { in: Input } }`):
|
|
5
|
+
* a title, a description, and per field a title, description, choices (`enum`) or default.
|
|
6
|
+
* The fields come from the input, which this takes so field names are type-checked.
|
|
7
|
+
* Export the result as `startForm`. */
|
|
8
|
+
export declare function defineStartForm<E extends import("@nanobpm/workflow").Envelope<any>>(_input: E, hints: Omit<import("./input.ts").StartFormHints, "fields"> & {
|
|
9
|
+
fields?: {
|
|
10
|
+
[K in keyof E["type"] & string]?: NonNullable<import("./input.ts").StartFormHints["fields"]>[string];
|
|
11
|
+
};
|
|
12
|
+
}): import("./input.ts").StartFormHints;
|
|
13
|
+
/** A field of a human-task form. Mirrors the MCP elicitation primitive schema, so a
|
|
14
|
+
* form can be asked in Claude Code (elicitation dialog) and in the web explorer. */
|
|
15
|
+
export type FormField = {
|
|
16
|
+
type: "string";
|
|
17
|
+
title?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
enum?: string[];
|
|
20
|
+
enumNames?: string[];
|
|
21
|
+
default?: string;
|
|
22
|
+
format?: "uri" | "email" | "date" | "date-time";
|
|
23
|
+
} | {
|
|
24
|
+
type: "boolean";
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
default?: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
type: "number" | "integer";
|
|
30
|
+
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
minimum?: number;
|
|
33
|
+
maximum?: number;
|
|
34
|
+
default?: number;
|
|
35
|
+
};
|
|
36
|
+
export interface FormDef {
|
|
37
|
+
title?: string;
|
|
38
|
+
/** Shown above the fields. `{{var}}` is replaced with the instance variable. */
|
|
39
|
+
description?: string;
|
|
40
|
+
fields: Record<string, FormField>;
|
|
41
|
+
required?: string[];
|
|
42
|
+
}
|
|
43
|
+
/** The project folder of the run this job belongs to: sh() and claude() run there. */
|
|
44
|
+
export declare function jobProject(): string | undefined;
|
|
45
|
+
/** Aborts when the current job times out or the engine stops. sh() and claude() stop
|
|
46
|
+
* their process on it; pass it to fetch() and other long calls in a handler. */
|
|
47
|
+
export declare function jobSignal(): AbortSignal | undefined;
|
|
48
|
+
/** A path in the project the current run belongs to. Use it for files a step reads or
|
|
49
|
+
* writes: the engine serves every project, so its working directory is not yours. */
|
|
50
|
+
export declare function projectPath(...parts: string[]): string;
|
|
51
|
+
/** Run fn as part of a job for `project` (the engine wraps every handler in this). */
|
|
52
|
+
export declare function runInProject<T>(project: string, fn: () => T, signal?: AbortSignal): T;
|
|
53
|
+
/** Declare the forms the flow's `w.human(name, { form })` steps refer to. Export the
|
|
54
|
+
* result as `forms` from the flow file. */
|
|
55
|
+
export declare function defineForms<T extends Record<string, FormDef>>(forms: T): T;
|
|
56
|
+
/** Options for agent tasks — `w.task(name, { jobType: "senior:<task>", prompt })` — keyed
|
|
57
|
+
* by step name. Export the result as `agents` from the flow file.
|
|
58
|
+
*
|
|
59
|
+
* Agent steps follow the nano-workforce convention: the job type names a rank and a task
|
|
60
|
+
* (`senior:review`, `junior:triage`), never a CLI, so the flow runs on anyone's machine.
|
|
61
|
+
* Who runs it is the user's choice (`nage agent assign`, flow_agents, the explorer);
|
|
62
|
+
* `use`/`model` here are only the author's suggestion. ("claude" is the legacy job type.) */
|
|
63
|
+
export interface AgentOptions extends Omit<ClaudeOptions, "cwd" | "timeoutMs"> {
|
|
64
|
+
/** Variables to append to the prompt as JSON (default: all instance variables; `[]`:
|
|
65
|
+
* none — use when the prompt file pulls in what it needs with {{name}} placeholders). */
|
|
66
|
+
context?: string[];
|
|
67
|
+
/** Working directory for the agent, absolute or relative to the run's project; may use
|
|
68
|
+
* {{name}} placeholders, e.g. "{{workDir}}". Default: the run's project. */
|
|
69
|
+
cwd?: string;
|
|
70
|
+
/** Extra environment variables for the agent process; values may use {{name}}
|
|
71
|
+
* placeholders, e.g. { AGENT_WORKSPACE: "{{workDir}}", PR_URL: "{{prUrl}}" }. */
|
|
72
|
+
env?: Record<string, string>;
|
|
73
|
+
/** Give the agent a way to notice the run was cancelled: sets AGE_JOB_STATUS_URL and appends
|
|
74
|
+
* an "Abort if this run was cancelled" section telling it to `curl -fsS` that URL before
|
|
75
|
+
* pushing or other irreversible actions (the URL 404s once the step is cancelled). */
|
|
76
|
+
abortCheck?: boolean;
|
|
77
|
+
/** Suggested agent profile: "claude", "opencode", "nano-coder", "gemini", "qwen", "kimi", "copilot", or one from
|
|
78
|
+
* `agentProfiles`. Applies only where that CLI is installed and the user hasn't assigned
|
|
79
|
+
* this flow, step or rank to something else; otherwise the user's default runs it. */
|
|
80
|
+
use?: string;
|
|
81
|
+
}
|
|
82
|
+
export type { AgentProfile } from "./agents.ts";
|
|
83
|
+
/** Agent profiles this flow file offers (~/.agent-graph/agents.json wins on a name clash). */
|
|
84
|
+
export declare function defineAgentProfiles<T extends Record<string, import("./agents.ts").AgentProfile>>(profiles: T): T;
|
|
85
|
+
export declare function defineAgents<T extends Record<string, AgentOptions>>(agents: T): T;
|
|
86
|
+
export interface ShResult {
|
|
87
|
+
stdout: string;
|
|
88
|
+
stderr: string;
|
|
89
|
+
code: number;
|
|
90
|
+
}
|
|
91
|
+
/** Run a shell command (bash -c). Throws on a non-zero exit unless `allowFail`. The
|
|
92
|
+
* job's variables are NOT interpolated for you — pass them via `env` to avoid
|
|
93
|
+
* quoting bugs: sh('gh issue view "$N"', { env: { N: String(job.variables.n) } }). */
|
|
94
|
+
export declare function sh(command: string, opts?: {
|
|
95
|
+
cwd?: string;
|
|
96
|
+
env?: Record<string, string>;
|
|
97
|
+
input?: string;
|
|
98
|
+
allowFail?: boolean;
|
|
99
|
+
timeoutMs?: number;
|
|
100
|
+
}): Promise<ShResult>;
|
|
101
|
+
export interface ClaudeOptions {
|
|
102
|
+
/** JSON schema the answer must match; the parsed object is returned. */
|
|
103
|
+
schema?: Record<string, unknown>;
|
|
104
|
+
/** Claude Code `--allowedTools` (headless runs never prompt, so list what it needs). */
|
|
105
|
+
allowedTools?: string[];
|
|
106
|
+
/** Claude Code `--permission-mode` (default: "dontAsk" — anything not allowed is denied). */
|
|
107
|
+
permissionMode?: string;
|
|
108
|
+
model?: string;
|
|
109
|
+
cwd?: string;
|
|
110
|
+
/** Append to the system prompt. */
|
|
111
|
+
system?: string;
|
|
112
|
+
timeoutMs?: number;
|
|
113
|
+
}
|
|
114
|
+
export interface ClaudeResult<T = unknown> {
|
|
115
|
+
/** Parsed structured output when `schema` was given, else the final text. */
|
|
116
|
+
result: T;
|
|
117
|
+
costUsd?: number;
|
|
118
|
+
sessionId?: string;
|
|
119
|
+
turns?: number;
|
|
120
|
+
}
|
|
121
|
+
/** Run a headless Claude Code agent (`claude -p`) and return its answer. The command
|
|
122
|
+
* can be swapped with AGE_CLAUDE_CMD (e.g. a wrapper or another harness that
|
|
123
|
+
* speaks the same flags). */
|
|
124
|
+
export declare function claude<T = string>(prompt: string, opts?: ClaudeOptions): Promise<ClaudeResult<T>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FormDef } from "./index.ts";
|
|
2
|
+
export interface InputField {
|
|
3
|
+
name: string;
|
|
4
|
+
type: "string" | "integer" | "number" | "boolean" | "datetime";
|
|
5
|
+
optional: boolean;
|
|
6
|
+
list: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** What a host knows about a flow's input: the envelope, flattened. */
|
|
9
|
+
export interface FlowInput {
|
|
10
|
+
name: string;
|
|
11
|
+
fields: InputField[];
|
|
12
|
+
}
|
|
13
|
+
/** Display hints for a flow's start form, keyed by input field. Hints decorate the
|
|
14
|
+
* fields the input declares; they can't add fields. */
|
|
15
|
+
export interface StartFormHints {
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
fields?: Record<string, {
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
enum?: string[];
|
|
22
|
+
enumNames?: string[];
|
|
23
|
+
default?: string | number | boolean;
|
|
24
|
+
minimum?: number;
|
|
25
|
+
maximum?: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export interface InputProblem {
|
|
29
|
+
field: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
32
|
+
/** The start form for an input: one form field per input field. A list field is a
|
|
33
|
+
* text field taking comma- or newline-separated values; a datetime is a date-time
|
|
34
|
+
* string. Hints add titles, descriptions, choices and defaults. */
|
|
35
|
+
export declare function inputForm(input: FlowInput, hints?: StartFormHints): FormDef;
|
|
36
|
+
/** Problems with the hints themselves, for the authoring check. */
|
|
37
|
+
export declare function hintProblems(input: FlowInput | undefined, hints: StartFormHints | undefined): string[];
|
|
38
|
+
export declare function describeType(f: InputField): string;
|
|
39
|
+
/** Turn text from a form, a CLI flag or a prompt argument into the declared type:
|
|
40
|
+
* "42" → 42, "yes"/"true" → true, "a, b" → ["a", "b"]. Values already of the right
|
|
41
|
+
* kind pass through; what can't be converted is left as is for validation to report.
|
|
42
|
+
* Empty text for an optional field counts as absent. */
|
|
43
|
+
export declare function coerceInput(input: FlowInput, raw: Record<string, unknown>): Record<string, unknown>;
|
|
44
|
+
/** Coerce then check start variables against a flow's input. */
|
|
45
|
+
export declare function checkInput(input: FlowInput, raw: Record<string, unknown>): {
|
|
46
|
+
variables: Record<string, unknown>;
|
|
47
|
+
problems: InputProblem[];
|
|
48
|
+
};
|
|
49
|
+
export declare function formatInputProblems(flowId: string, problems: InputProblem[]): string;
|
|
50
|
+
/** A one-line description of the input, for agents: `pr: integer, note?: string`. */
|
|
51
|
+
export declare function describeInput(input: FlowInput): string;
|
|
52
|
+
/** `--pr 42 --repo=x note="a b" {"extra":1}` → variables (the engine converts the text to
|
|
53
|
+
* the input's types). A bare `--flag` is true. */
|
|
54
|
+
export declare function parseStartArgs(args: string[]): {
|
|
55
|
+
variables: Record<string, unknown>;
|
|
56
|
+
title?: string;
|
|
57
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface DaemonInfo {
|
|
2
|
+
pid: number;
|
|
3
|
+
port: number;
|
|
4
|
+
url: string;
|
|
5
|
+
/** The project this client acts on (the engine itself serves every project). */
|
|
6
|
+
project: string;
|
|
7
|
+
startedAt: string;
|
|
8
|
+
}
|
|
9
|
+
/** The engine's home: one engine per user, for every project (AGE_STATE_DIR moves it). */
|
|
10
|
+
export declare function engineDir(): string;
|
|
11
|
+
/** Before 0.5 each project had its own engine in <project>/.agent-graph. */
|
|
12
|
+
export declare function legacyStateDir(project: string): string;
|
|
13
|
+
/** A short, stable, BPMN-id-safe name for a project: "<folder>-<hash>". It prefixes the
|
|
14
|
+
* process ids of the project's flows, so two repos can both have a "release" flow. */
|
|
15
|
+
export declare function projectSlug(project: string): string;
|
|
16
|
+
/** Home for flows when there is no project (Claude Desktop chat starts servers in /). */
|
|
17
|
+
export declare function defaultHome(): string;
|
|
18
|
+
/** The project a client acts on: AGE_PROJECT, else the nearest ancestor with flows/,
|
|
19
|
+
* else the git repo root, else cwd — or the library (~/AgentGraph) when cwd is / or
|
|
20
|
+
* the home dir itself. */
|
|
21
|
+
export declare function resolveProject(start?: string): string;
|
|
22
|
+
/** The user's running engine, if any (never starts one). `project` is recorded on the
|
|
23
|
+
* returned info for the caller's convenience. */
|
|
24
|
+
export declare function findDaemon(project?: string): Promise<DaemonInfo | undefined>;
|
|
25
|
+
/** The engine's single-writer guarantee: one process owns ~/.agent-graph (its journal).
|
|
26
|
+
* Held for the process's life via engine.lock (pid). A lock left by a dead process is
|
|
27
|
+
* taken over. Throws if another live engine holds it. */
|
|
28
|
+
export declare function acquireEngineLock(dir?: string): () => void;
|
|
29
|
+
/** Find the user's engine or start it detached (it outlives the Claude session, so
|
|
30
|
+
* timers and long agent jobs keep running), and make sure it knows `project`. */
|
|
31
|
+
export declare function ensureDaemon(project: string): Promise<DaemonInfo>;
|
|
32
|
+
export declare function api<T = any>(info: DaemonInfo, p: string, body?: unknown): Promise<T>;
|
|
33
|
+
/** A prompt's file for a `prompt: { resourceId }` binding: flows/prompts/<id>, or, for ids
|
|
34
|
+
* that carry their folder as nano-workforce's do ("prompts/fix-ci.md"), flows/<id>. */
|
|
35
|
+
export declare function promptFile(projectDir: string, resourceId: string): string;
|