@jini-ai/daemon 0.6.2 → 0.6.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.6.4 — 2026-10-13
2
+
3
+ - ACP runs forward the run's `permissionMode` to `attachAcpSession`, so a `bypass` run allows each ACP tool request once and a restricted run rejects it, instead of failing on the first permission request. Peer `@jini-ai/agent-runtime` floor is now `^0.4.10`.
4
+
5
+ ## 0.6.3 — 2026-10-13
6
+
7
+ - `createAgentExecutor` accepts `codexDisablePlugins` and `piGracefulShutdownMs`; absent, they resolve once from `hostEnv` (`CODEX_DISABLE_PLUGINS`, `PI_GRACEFUL_SHUTDOWN_MS`). Peer `@jini-ai/agent-runtime` floor is now `^0.4.7`.
8
+
1
9
  ## 0.6.2 — 2026-10-13
2
10
 
3
11
  - Agent executor and host tools import `@jini-ai/platform/command` and `/process` instead of the platform root; peer `@jini-ai/platform` floor is now `^0.5.5`. No behavior change.
@@ -575,6 +575,10 @@ export interface CreateAgentExecutorOptions {
575
575
  /** Host environment snapshot; baseline spawn keys and source config paths are allowlisted. */
576
576
  readonly hostEnv?: NodeJS.ProcessEnv;
577
577
  readonly runtimeState?: AgentRuntimeState;
578
+ /** Host policy; native executor composition resolves its env default when absent. */
579
+ readonly codexDisablePlugins?: boolean;
580
+ /** Post-completion pi RPC grace period, resolved once at native composition. */
581
+ readonly piGracefulShutdownMs?: number;
578
582
  readonly lifecycle: RunLifecycle;
579
583
  /** Resolves/pins the concrete starting model against the actual launch scope. */
580
584
  readonly resolveModelForLaunch?: typeof resolveModelForLaunch;
@@ -158,6 +158,7 @@ interface RunAcpDispatchInput {
158
158
  readonly child: ChildProcess;
159
159
  readonly prompt: string;
160
160
  readonly cwd: string;
161
+ readonly permissionMode: 'bypass' | 'restricted' | undefined;
161
162
  readonly model: string | undefined;
162
163
  readonly modelCatalog?: ModelCatalogSnapshot;
163
164
  readonly imagePaths: readonly string[];
@@ -892,7 +892,7 @@ function wireAcpLifecycle(ctx) {
892
892
  if (event === 'error') {
893
893
  enqueueEmit(() => lifecycle.emit({ runId: runId, input: { event: 'error', data: translateAcpError(payload) } }));
894
894
  }
895
- } }, { cwd: ctx.cwd, ...(ctx.model !== undefined ? { model: ctx.model } : {}), ...(ctx.imagePaths.length > 0 ? { imagePaths: [...ctx.imagePaths] } : {}), ...(ctx.envFormat !== undefined ? { envFormat: ctx.envFormat } : {}),
895
+ } }, { cwd: ctx.cwd, ...(ctx.permissionMode !== undefined ? { permissionMode: ctx.permissionMode } : {}), ...(ctx.model !== undefined ? { model: ctx.model } : {}), ...(ctx.imagePaths.length > 0 ? { imagePaths: [...ctx.imagePaths] } : {}), ...(ctx.envFormat !== undefined ? { envFormat: ctx.envFormat } : {}),
896
896
  // Spread-when-present rather than always: passing `mcpServers: []` is not the same as passing
897
897
  // nothing for every downstream ACP agent, and "no bridge configured" must stay byte-identical
898
898
  // to before this field existed.
@@ -1045,6 +1045,7 @@ export async function runAcpDispatch({ input, deps }) {
1045
1045
  lifecycle: deps.lifecycle,
1046
1046
  prompt: input.prompt,
1047
1047
  cwd: input.cwd,
1048
+ permissionMode: input.permissionMode,
1048
1049
  model: input.model,
1049
1050
  ...(input.modelCatalog ? { modelCatalog: input.modelCatalog } : {}),
1050
1051
  imagePaths: input.imagePaths,
@@ -379,6 +379,6 @@ export declare function confirmChildSpawned({ input, deps }: {
379
379
  * @complexity `run()`'s own setup is O(1); steady-state cost is the chosen stream parser's.
380
380
  * @overallScore 100/100
381
381
  */
382
- export declare function createAgentExecutor(requiredArgs: Pick<CreateAgentExecutorOptions, "lifecycle">, optionalArgs?: Pick<CreateAgentExecutorOptions, "runtimeState" | "hostEnv" | "getAgentDef" | "resolveAgentLaunch" | "resolveModelForLaunch" | "ensureAgentCapabilities" | "applyAgentLaunchEnv" | "createCommandInvocation" | "spawn" | "attachAcpSession" | "acpPermissionHandler" | "attachPiRpcSession" | "preparePromptFileForAgent" | "prepareAgentLogFile" | "listProcessSnapshots" | "collectProcessTreePids" | "stopProcesses" | "onCleanupFailure" | "journal" | "continuation" | "classifyFailure" | "mcpJsonInjection" | "claudeConfigDirIsolation" | "claudeConfigDirIsolationEnabled" | "bufferedStdoutMaxBytes" | "promptAugmenter">): AgentExecutor;
382
+ export declare function createAgentExecutor(requiredArgs: Pick<CreateAgentExecutorOptions, "lifecycle">, optionalArgs?: Pick<CreateAgentExecutorOptions, "runtimeState" | "codexDisablePlugins" | "piGracefulShutdownMs" | "hostEnv" | "getAgentDef" | "resolveAgentLaunch" | "resolveModelForLaunch" | "ensureAgentCapabilities" | "applyAgentLaunchEnv" | "createCommandInvocation" | "spawn" | "attachAcpSession" | "acpPermissionHandler" | "attachPiRpcSession" | "preparePromptFileForAgent" | "prepareAgentLogFile" | "listProcessSnapshots" | "collectProcessTreePids" | "stopProcesses" | "onCleanupFailure" | "journal" | "continuation" | "classifyFailure" | "mcpJsonInjection" | "claudeConfigDirIsolation" | "claudeConfigDirIsolationEnabled" | "bufferedStdoutMaxBytes" | "promptAugmenter">): AgentExecutor;
383
383
  export {};
384
384
  //# sourceMappingURL=launch.d.ts.map
@@ -179,13 +179,18 @@ function resolveAgentRuntimeDeps(options) {
179
179
  return {
180
180
  getAgentDef: (input) => {
181
181
  const def = lookupDef(input);
182
- return def && options.runtimeState ? bindRuntimeAgentDef({ def, state: options.runtimeState }) : def;
182
+ // Without owned state, only an enabled plugin policy needs binding; otherwise keep the published definition.
183
+ if (!def || (!options.runtimeState && !options.codexDisablePlugins))
184
+ return def;
185
+ return bindRuntimeAgentDef({ def, state: options.runtimeState ?? defaultRuntimeState }, options.codexDisablePlugins ? { codexDisablePlugins: true } : {});
183
186
  },
184
187
  resolveAgentLaunch: options.resolveAgentLaunch ?? ((input, optional = {}) => resolveAgentLaunch(input, { ...optional, ...runtimeOptions, ...envOptions })),
185
188
  ensureAgentCapabilities: options.ensureAgentCapabilities ?? ((input) => ensureAgentCapabilities(input, runtimeOptions)),
186
189
  applyAgentLaunchEnv: options.applyAgentLaunchEnv ?? ((input, optional = {}) => applyAgentLaunchEnv(input, { appendPathDirs: userToolchainBinDirs({}, { ...runtimeOptions, ...envOptions }), ...optional })),
187
190
  attachAcpSession: options.attachAcpSession ?? attachAcpSession,
188
- attachPiRpcSession: options.attachPiRpcSession ?? attachPiRpcSession,
191
+ attachPiRpcSession: (required, optional = {}) => (options.attachPiRpcSession ?? attachPiRpcSession)(required, {
192
+ ...optional, ...(options.piGracefulShutdownMs !== undefined ? { gracefulShutdownMs: options.piGracefulShutdownMs } : {}),
193
+ }),
189
194
  preparePromptFileForAgent: options.preparePromptFileForAgent ?? preparePromptFileForAgent,
190
195
  prepareAgentLogFile: options.prepareAgentLogFile ?? prepareAgentLogFile,
191
196
  };
@@ -628,7 +633,12 @@ export async function confirmChildSpawned({ input, deps }) {
628
633
  * @overallScore 100/100
629
634
  */
630
635
  export function createAgentExecutor(requiredArgs, optionalArgs = {}) {
631
- const options = { ...requiredArgs, ...optionalArgs };
636
+ // This native composition boundary resolves ambient defaults once, before allowlisting child env.
637
+ const env = optionalArgs.hostEnv ?? process.env;
638
+ const options = { ...requiredArgs, ...optionalArgs,
639
+ codexDisablePlugins: optionalArgs.codexDisablePlugins ?? (env.CODEX_DISABLE_PLUGINS === '1'),
640
+ piGracefulShutdownMs: optionalArgs.piGracefulShutdownMs ?? (Number(env.PI_GRACEFUL_SHUTDOWN_MS) || 5000),
641
+ };
632
642
  const lifecycle = options.lifecycle;
633
643
  const hostEnv = selectAgentExecutorHostEnv({ env: options.hostEnv ?? process.env }, options.runtimeState ? { runtimeState: options.runtimeState } : {});
634
644
  const { getAgentDef: getAgentDefFn, resolveAgentLaunch: resolveAgentLaunchFn, ensureAgentCapabilities: ensureAgentCapabilitiesFn, applyAgentLaunchEnv: applyAgentLaunchEnvFn, attachAcpSession: attachAcpSessionFn, attachPiRpcSession: attachPiRpcSessionFn, preparePromptFileForAgent: preparePromptFileForAgentFn, prepareAgentLogFile: prepareAgentLogFileFn, } = resolveAgentRuntimeDeps({ ...options, hostEnv });
@@ -1003,6 +1013,7 @@ export function createAgentExecutor(requiredArgs, optionalArgs = {}) {
1003
1013
  // sending byte-identical text and never receive the overlay twice.
1004
1014
  prompt: `${overlayDelivery.promptPrefix}${input.prompt}`,
1005
1015
  cwd: input.cwd,
1016
+ permissionMode: input.permissionMode,
1006
1017
  model: input.model,
1007
1018
  modelCatalog,
1008
1019
  imagePaths: input.imagePaths ?? [],
@@ -24,7 +24,7 @@
24
24
  * for why only the VALUE is ever blanked, never the surrounding text.
25
25
  *
26
26
  * Architectural role: `src/assistant` composition-layer adapter, same layer as
27
- * `tool-executor-audit.ts` and `tool-failure-recovery.ts`. Depends only on the Tovu policy
27
+ * `tool-executor-audit.ts` and `tool-failure-recovery.ts`. Depends only on the host policy
28
28
  * adapter over `@jini-ai/diagnostics/redaction/secrets-only` and `@jini-ai/daemon`'s `ToolExecutor` shape.
29
29
  */
30
30
  import type { ToolExecutionResult, ToolExecutor } from "../tool-executor.js";
@@ -24,7 +24,7 @@
24
24
  * for why only the VALUE is ever blanked, never the surrounding text.
25
25
  *
26
26
  * Architectural role: `src/assistant` composition-layer adapter, same layer as
27
- * `tool-executor-audit.ts` and `tool-failure-recovery.ts`. Depends only on the Tovu policy
27
+ * `tool-executor-audit.ts` and `tool-failure-recovery.ts`. Depends only on the host policy
28
28
  * adapter over `@jini-ai/diagnostics/redaction/secrets-only` and `@jini-ai/daemon`'s `ToolExecutor` shape.
29
29
  */
30
30
  /** Matches a minted error ID anywhere in a string — exported for tests and for a later chat-side
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @file The one place Tovu's `ToolExecutor` decorator stack is composed.
2
+ * @file The one place the host's `ToolExecutor` decorator stack is composed.
3
3
  *
4
4
  * The order of these three wrappers is load-bearing in two different directions, and it was
5
5
  * previously spelled out only as an expression inside `agent-daemon-server.ts` — a module that boots
@@ -32,7 +32,7 @@
32
32
  * "completed" row the audit records for the call the transport actually made, losing the remedy
33
33
  * tool's own attempt from the trail entirely.
34
34
  *
35
- * Composed the SAME way for both of Tovu's tool-dispatch surfaces: the agent daemon's delegated-tool
35
+ * Composed the SAME way for both of the host's tool-dispatch surfaces: the agent daemon's delegated-tool
36
36
  * route and BYOK's `byok-tool-surface.ts` (as of 2026-09-06 — previously BYOK hand-assembled its own
37
37
  * second copy of this stack that never wrapped `withReadOnlyToolConstraint`, so a decorator known to
38
38
  * apply to "every read-only gateway" in fact applied to only one of the two; see that file's own
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @file The one place Tovu's `ToolExecutor` decorator stack is composed.
2
+ * @file The one place the host's `ToolExecutor` decorator stack is composed.
3
3
  *
4
4
  * The order of these three wrappers is load-bearing in two different directions, and it was
5
5
  * previously spelled out only as an expression inside `agent-daemon-server.ts` — a module that boots
@@ -32,7 +32,7 @@
32
32
  * "completed" row the audit records for the call the transport actually made, losing the remedy
33
33
  * tool's own attempt from the trail entirely.
34
34
  *
35
- * Composed the SAME way for both of Tovu's tool-dispatch surfaces: the agent daemon's delegated-tool
35
+ * Composed the SAME way for both of the host's tool-dispatch surfaces: the agent daemon's delegated-tool
36
36
  * route and BYOK's `byok-tool-surface.ts` (as of 2026-09-06 — previously BYOK hand-assembled its own
37
37
  * second copy of this stack that never wrapped `withReadOnlyToolConstraint`, so a decorator known to
38
38
  * apply to "every read-only gateway" in fact applied to only one of the two; see that file's own
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/daemon",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "The stateful agent daemon runtime: run lifecycle, durable event-log port, the tool-execution boundary, agent executor, terminal sessions, and routines.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -139,17 +139,17 @@
139
139
  "@types/pg": "8.23.1",
140
140
  "express": "^4.21.0",
141
141
  "@types/express": "^4.17.21",
142
+ "@jini-ai/agent-runtime": "^0.4.10",
143
+ "@jini-ai/core": "^0.4.5",
144
+ "@jini-ai/protocol": "^0.4.4",
145
+ "@jini-ai/platform": "^0.5.6",
142
146
  "@jini-ai/http-kit": "0.4.1",
143
- "@jini-ai/chat": "0.5.8",
144
- "@jini-ai/agent-runtime": "^0.4.6",
145
- "@jini-ai/core": "^0.4.4",
146
- "@jini-ai/db": "0.3.3",
147
- "@jini-ai/platform": "^0.5.5",
148
- "@jini-ai/protocol": "^0.4.4"
147
+ "@jini-ai/chat": "0.6.2",
148
+ "@jini-ai/db": "0.3.4"
149
149
  },
150
150
  "dependencies": {
151
- "@jini-ai/core": "^0.4.4",
152
- "@jini-ai/protocol": "^0.4.4"
151
+ "@jini-ai/protocol": "^0.4.4",
152
+ "@jini-ai/core": "^0.4.5"
153
153
  },
154
154
  "peerDependencies": {
155
155
  "node-pty": "^1.1.0",
@@ -160,7 +160,7 @@
160
160
  "pg": "^8.23.0",
161
161
  "@jini-ai/http-kit": "^0.4.0",
162
162
  "express": "^4.21.0",
163
- "@jini-ai/agent-runtime": "^0.4.5",
163
+ "@jini-ai/agent-runtime": "^0.4.10",
164
164
  "@jini-ai/platform": "^0.5.5"
165
165
  },
166
166
  "peerDependenciesMeta": {