c8ctl-plugin-nano 1.69.6 → 1.70.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/c8ctl-plugin.js +79 -3
- package/nanobpmn-binary.json +3 -3
- package/package.json +8 -8
package/c8ctl-plugin.js
CHANGED
|
@@ -2702,6 +2702,30 @@ function buildAgenticCapability(profile, host = hostname()) {
|
|
|
2702
2702
|
// that cannot write the file. The harness stays app-agnostic: it merges whatever
|
|
2703
2703
|
// object the agent returns; the *app's prompt* owns the field vocabulary.
|
|
2704
2704
|
const AGENT_RESULT_FILE_ENV = 'AGENT_RESULT_FILE';
|
|
2705
|
+
// #283: an agent run is headless, so any git command that launches an editor
|
|
2706
|
+
// would block until the tool timeout kills the run (which then ends with no
|
|
2707
|
+
// result). Point every editor git might spawn at a non-interactive no-op so
|
|
2708
|
+
// `commit` (no -m), `rebase -i`, `merge`/`revert` (no --no-edit) and `tag -a`
|
|
2709
|
+
// (no -m) return at once instead of hanging. The no-op value is `:` — NOT
|
|
2710
|
+
// `true`. Git's editor launcher (launch_specified_editor in editor.c)
|
|
2711
|
+
// special-cases the exact value `:`: `strcmp(editor, ":")` is 0, so it skips
|
|
2712
|
+
// launching any child process or shell altogether and treats the on-disk
|
|
2713
|
+
// (unchanged) buffer as accepted. Because no process is spawned, the no-op
|
|
2714
|
+
// needs NO executable on PATH and NO shell — which is what keeps it working on
|
|
2715
|
+
// supported Windows host runs and in minimal environments where a standalone
|
|
2716
|
+
// `true` executable may be absent (a bare `true` relies on git exec'ing or
|
|
2717
|
+
// shelling out to a real `true` binary, and can fail with "cannot run true"
|
|
2718
|
+
// where that binary is missing). This is the SINGLE source of truth, applied
|
|
2719
|
+
// unconditionally at the runAgentJob boundary for EVERY job (repo-provisioned
|
|
2720
|
+
// or not) and also folded into provisioning's gitEnv so finalizeGit's own
|
|
2721
|
+
// rebase inherits it.
|
|
2722
|
+
const EDITOR_NOOP_VALUE = ':';
|
|
2723
|
+
const EDITOR_NOOP_ENV = Object.freeze({
|
|
2724
|
+
GIT_EDITOR: EDITOR_NOOP_VALUE,
|
|
2725
|
+
GIT_SEQUENCE_EDITOR: EDITOR_NOOP_VALUE,
|
|
2726
|
+
EDITOR: EDITOR_NOOP_VALUE,
|
|
2727
|
+
VISUAL: EDITOR_NOOP_VALUE,
|
|
2728
|
+
});
|
|
2705
2729
|
const RESULT_SENTINEL = '::nano:result::';
|
|
2706
2730
|
// Completion keys the harness owns — an agent's returned result can never
|
|
2707
2731
|
// overwrite these (nor anything in the reserved `io.nanobpm.*` namespace), so a
|
|
@@ -4983,6 +5007,14 @@ function provisionRepo({ envelope, token, runDir, runId, timeoutMs = 120_000, lo
|
|
|
4983
5007
|
...process.env,
|
|
4984
5008
|
GIT_TERMINAL_PROMPT: '0',
|
|
4985
5009
|
GIT_CONFIG_NOSYSTEM: '1',
|
|
5010
|
+
// #283: the headless editor no-ops (GIT_EDITOR/GIT_SEQUENCE_EDITOR/EDITOR/
|
|
5011
|
+
// VISUAL = `:`). Single source of truth is EDITOR_NOOP_ENV; runAgentJob
|
|
5012
|
+
// also applies it unconditionally at its boundary so repo-less host jobs and
|
|
5013
|
+
// container jobs get it too. Keeping a copy here means finalizeGit's own
|
|
5014
|
+
// rebase (which runs with this gitEnv) stays non-interactive, and an operator
|
|
5015
|
+
// can still override per-run via profile/setup env (those layer on top of the
|
|
5016
|
+
// git base in the harness env).
|
|
5017
|
+
...EDITOR_NOOP_ENV,
|
|
4986
5018
|
};
|
|
4987
5019
|
// Drop any inherited askpass helpers so a no-token ("anonymous") clone can't
|
|
4988
5020
|
// authenticate with host-provided credentials. We re-set GIT_ASKPASS below
|
|
@@ -8271,7 +8303,7 @@ function baseAgentEnv(profile, job) {
|
|
|
8271
8303
|
* Both paths resolve to the same result contract.
|
|
8272
8304
|
*/
|
|
8273
8305
|
function runAgentJob(profile, job, opts = {}) {
|
|
8274
|
-
const { timeoutMs, idleTimeoutMs, recoveryWindowMs, envelope, sandbox = 'none', image, runId, secretEnv = {}, passThroughSecretNames = [], cwd, extraEnv = {}, profileEnv = {}, resultFile, stream = false, streamPrefix = '', onStreamOut, onStreamErr, args: commandArgs, terminal = 'pipe', protocol = 'pipe', permission = 'yolo', relaySession = null, ptyFactory, nudgePayload = null, onAcpUpdate = null, abortSignal = null, onSpawn = null, resumePlan = null } = opts;
|
|
8306
|
+
const { timeoutMs, idleTimeoutMs, recoveryWindowMs, envelope, sandbox = 'none', image, runId, secretEnv = {}, passThroughSecretNames = [], cwd, extraEnv = {}, profileEnv = {}, gitEnv = null, resultFile, stream = false, streamPrefix = '', onStreamOut, onStreamErr, args: commandArgs, terminal = 'pipe', protocol = 'pipe', permission = 'yolo', relaySession = null, ptyFactory, nudgePayload = null, onAcpUpdate = null, abortSignal = null, onSpawn = null, resumePlan = null } = opts;
|
|
8275
8307
|
// #110: `protocol`/`permission` drive the ACP executor branch below. The
|
|
8276
8308
|
// pipe/PTY paths are unchanged, so `protocol === 'pipe'` behaviour is identical.
|
|
8277
8309
|
// A `nudgePayload` (#678) carries the bespoke "re-emit your result" prompt for a
|
|
@@ -8292,6 +8324,30 @@ function runAgentJob(profile, job, opts = {}) {
|
|
|
8292
8324
|
// (job-specific tuning wins over the profile default). Reserved AGENT_* and
|
|
8293
8325
|
// resolved secrets are layered on top so user env can never shadow them.
|
|
8294
8326
|
const staticEnv = { ...normalizeEnvMap(profileEnv), ...normalizeEnvMap(envelope?.setup?.env) };
|
|
8327
|
+
// #283: the provisioning git env (non-interactive editor no-ops,
|
|
8328
|
+
// GIT_TERMINAL_PROMPT=0, GIT_CONFIG_NOSYSTEM=1, …) is the harness env's
|
|
8329
|
+
// BOTTOM layer above process.env — a headless agent's own `git commit` (no
|
|
8330
|
+
// -m) / `git rebase -i` must never open a real editor and hang until the
|
|
8331
|
+
// idle timeout. It sits UNDER staticEnv so an operator's profile/setup.env
|
|
8332
|
+
// override still wins, and under secretEnv/agentEnv/extraEnv so reserved
|
|
8333
|
+
// AGENT_* + the pinned commit identity can never be shadowed by it. The
|
|
8334
|
+
// credential keys are stripped: GIT_ASKPASS/GIT_TOKEN name a worker-private
|
|
8335
|
+
// helper file (and the clone token) that must not leak into the harness,
|
|
8336
|
+
// and GIT_CONFIG_GLOBAL stays provisioning-scoped (the harness keeps the
|
|
8337
|
+
// host's real global git config).
|
|
8338
|
+
const gitBaseEnv = {
|
|
8339
|
+
// #283: editor no-ops apply to EVERY agent harness, unconditionally. For a
|
|
8340
|
+
// repo-provisioned job `gitEnv` already carries them (identical values), but
|
|
8341
|
+
// `provisioned` is null for repo-less host jobs AND all container jobs, so
|
|
8342
|
+
// those agents can still run their own `git init`/`clone` then `commit`/
|
|
8343
|
+
// `rebase -i` and hang on an inherited editor — hence the boundary default
|
|
8344
|
+
// here rather than relying solely on provisioning's copy.
|
|
8345
|
+
...EDITOR_NOOP_ENV,
|
|
8346
|
+
...Object.fromEntries(
|
|
8347
|
+
Object.entries(gitEnv || {})
|
|
8348
|
+
.filter(([k]) => k !== 'GIT_ASKPASS' && k !== 'GIT_TOKEN' && k !== 'GIT_CONFIG_GLOBAL'),
|
|
8349
|
+
),
|
|
8350
|
+
};
|
|
8295
8351
|
|
|
8296
8352
|
// C3 (#42): when a relay session is present, tap the harness terminal onto the
|
|
8297
8353
|
// relay lane (framed + tagged with this job's jobKey) and accept steer-in. The
|
|
@@ -8330,7 +8386,7 @@ function runAgentJob(profile, job, opts = {}) {
|
|
|
8330
8386
|
// (jwulf/c8ctl-plugin-nano#151): the parent's process-wide setDefaultResultOrder
|
|
8331
8387
|
// can't reach the child, so its own Node runtime must read the flag at startup.
|
|
8332
8388
|
// Merges (never clobbers) any inherited/operator NODE_OPTIONS.
|
|
8333
|
-
const harnessEnv = withIpv4FirstNodeOptions({ ...process.env, ...staticEnv, ...secretEnv, ...agentEnv, ...extraEnv, ...resultEnv });
|
|
8389
|
+
const harnessEnv = withIpv4FirstNodeOptions({ ...process.env, ...gitBaseEnv, ...staticEnv, ...secretEnv, ...agentEnv, ...extraEnv, ...resultEnv });
|
|
8334
8390
|
|
|
8335
8391
|
// A role opted into ACP (`protocol: acp`) drives its harness over the Agent
|
|
8336
8392
|
// Client Protocol (JSON-RPC 2.0 over stdio) instead of the stdin/scrape pipe
|
|
@@ -8440,13 +8496,25 @@ function runAgentJob(profile, job, opts = {}) {
|
|
|
8440
8496
|
for (const k of Object.keys(resultEnv)) envArgs.push('-e', k);
|
|
8441
8497
|
for (const n of passThroughSecretNames) envArgs.push('-e', n);
|
|
8442
8498
|
for (const k of Object.keys(staticEnv)) envArgs.push('-e', k);
|
|
8499
|
+
// #283: forward the editor no-ops by NAME so docker actually sets them inside
|
|
8500
|
+
// the container (merely having them in `containerEnv` is inert — docker only
|
|
8501
|
+
// sets vars whose names appear in `-e`). Skipped when an operator already put
|
|
8502
|
+
// the same name in agent/extra/static env (it is forwarded above, with the
|
|
8503
|
+
// operator's overriding value) to avoid a duplicate `-e` flag.
|
|
8504
|
+
for (const k of Object.keys(EDITOR_NOOP_ENV)) {
|
|
8505
|
+
if (!Object.prototype.hasOwnProperty.call(staticEnv, k)
|
|
8506
|
+
&& !Object.prototype.hasOwnProperty.call(agentEnv, k)
|
|
8507
|
+
&& !Object.prototype.hasOwnProperty.call(extraEnv, k)) {
|
|
8508
|
+
envArgs.push('-e', k);
|
|
8509
|
+
}
|
|
8510
|
+
}
|
|
8443
8511
|
|
|
8444
8512
|
// Propagate IPv4-first DNS ordering into the containerised agent's Node runtime
|
|
8445
8513
|
// via NODE_OPTIONS (jwulf/c8ctl-plugin-nano#151), merged (never clobbered) with
|
|
8446
8514
|
// any inherited/operator value. Forwarded by NAME like every other env so the
|
|
8447
8515
|
// value stays out of argv/`docker inspect`; `-e NODE_OPTIONS` is added only when
|
|
8448
8516
|
// it wasn't already forwarded via the static env above (avoid a duplicate flag).
|
|
8449
|
-
const containerEnv = withIpv4FirstNodeOptions({ ...process.env, ...staticEnv, ...secretEnv, ...agentEnv, ...extraEnv, ...resultEnv });
|
|
8517
|
+
const containerEnv = withIpv4FirstNodeOptions({ ...process.env, ...gitBaseEnv, ...staticEnv, ...secretEnv, ...agentEnv, ...extraEnv, ...resultEnv });
|
|
8450
8518
|
if (!Object.prototype.hasOwnProperty.call(staticEnv, 'NODE_OPTIONS')) {
|
|
8451
8519
|
envArgs.push('-e', 'NODE_OPTIONS');
|
|
8452
8520
|
}
|
|
@@ -11283,6 +11351,12 @@ async function workAgent(req, flags, ctx) {
|
|
|
11283
11351
|
cwd,
|
|
11284
11352
|
extraEnv,
|
|
11285
11353
|
profileEnv,
|
|
11354
|
+
// #283: the provisioning git env — runAgentJob layers it UNDER
|
|
11355
|
+
// profile/setup env (minus the credential keys) so the harness's
|
|
11356
|
+
// own git commands get the non-interactive editor no-ops while an
|
|
11357
|
+
// operator override still wins. Absent on the repo-less/container
|
|
11358
|
+
// paths (no provisioning ran).
|
|
11359
|
+
gitEnv: provisioned?.gitEnv ?? null,
|
|
11286
11360
|
resultFile,
|
|
11287
11361
|
stream,
|
|
11288
11362
|
streamPrefix: `[${jobType} ${job.jobKey}] `,
|
|
@@ -17895,6 +17969,8 @@ export {
|
|
|
17895
17969
|
RESULT_SENTINEL,
|
|
17896
17970
|
RESERVED_RESULT_KEYS,
|
|
17897
17971
|
SANDBOXES,
|
|
17972
|
+
EDITOR_NOOP_ENV,
|
|
17973
|
+
EDITOR_NOOP_VALUE,
|
|
17898
17974
|
};
|
|
17899
17975
|
export {
|
|
17900
17976
|
reconstructWorkArgs,
|
package/nanobpmn-binary.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c8ctl-plugin-nano",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.70.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "c8ctl plugin to start, inspect, and stop a local Nano BPM (nanobpmn) cluster",
|
|
6
6
|
"main": "c8ctl-plugin.js",
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
},
|
|
77
77
|
"optionalDependencies": {
|
|
78
78
|
"node-pty": "^1.0.0",
|
|
79
|
-
"@nanobpm/c8ctl-plugin-nano-darwin-arm64": "1.
|
|
80
|
-
"@nanobpm/c8ctl-plugin-nano-darwin-x64": "1.
|
|
81
|
-
"@nanobpm/c8ctl-plugin-nano-linux-x64": "1.
|
|
82
|
-
"@nanobpm/c8ctl-plugin-nano-linux-arm64": "1.
|
|
83
|
-
"@nanobpm/c8ctl-plugin-nano-linux-armv7": "1.
|
|
84
|
-
"@nanobpm/c8ctl-plugin-nano-linux-armv6": "1.
|
|
85
|
-
"@nanobpm/c8ctl-plugin-nano-win32-x64": "1.
|
|
79
|
+
"@nanobpm/c8ctl-plugin-nano-darwin-arm64": "1.70.1",
|
|
80
|
+
"@nanobpm/c8ctl-plugin-nano-darwin-x64": "1.70.1",
|
|
81
|
+
"@nanobpm/c8ctl-plugin-nano-linux-x64": "1.70.1",
|
|
82
|
+
"@nanobpm/c8ctl-plugin-nano-linux-arm64": "1.70.1",
|
|
83
|
+
"@nanobpm/c8ctl-plugin-nano-linux-armv7": "1.70.1",
|
|
84
|
+
"@nanobpm/c8ctl-plugin-nano-linux-armv6": "1.70.1",
|
|
85
|
+
"@nanobpm/c8ctl-plugin-nano-win32-x64": "1.70.1"
|
|
86
86
|
}
|
|
87
87
|
}
|