@jini-ai/daemon 0.6.1 → 0.6.3
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.3 — 2026-10-13
|
|
2
|
+
|
|
3
|
+
- `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`.
|
|
4
|
+
|
|
5
|
+
## 0.6.2 — 2026-10-13
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
1
9
|
## 0.5.4 — pending release
|
|
2
10
|
|
|
3
11
|
- Re-export the canonical core surface-exchange contracts and parameter constants. Store and ask/report behavior are unchanged; requires core 0.4.2.
|
|
@@ -3,7 +3,8 @@ import type { spawn as nodeSpawn, ChildProcess } from 'node:child_process';
|
|
|
3
3
|
import type { Principal } from '@jini-ai/core';
|
|
4
4
|
import type { RunAgentPayload, RunErrorPayload } from '@jini-ai/protocol';
|
|
5
5
|
import type { AgentRuntimeState, applyAgentLaunchEnv, ensureAgentCapabilities, resolveModelForLaunch, getAgentDef, resolveAgentLaunch, attachAcpSession, attachPiRpcSession, prepareAgentLogFile, preparePromptFileForAgent, AcpMcpServerInput, AcpPermissionHandler, PromptAugmenter } from '@jini-ai/agent-runtime';
|
|
6
|
-
import type { createCommandInvocation
|
|
6
|
+
import type { createCommandInvocation } from '@jini-ai/platform/command';
|
|
7
|
+
import type { listProcessSnapshots, ProcessSnapshot, StopProcessesResult } from '@jini-ai/platform/process';
|
|
7
8
|
import type { RunByteJournal } from '../continuation/journal.js';
|
|
8
9
|
import type { RunRetrySideEffectState } from '../run/core/index.js';
|
|
9
10
|
import type { ToolExecutor } from '../tool-executor.js';
|
|
@@ -574,6 +575,10 @@ export interface CreateAgentExecutorOptions {
|
|
|
574
575
|
/** Host environment snapshot; baseline spawn keys and source config paths are allowlisted. */
|
|
575
576
|
readonly hostEnv?: NodeJS.ProcessEnv;
|
|
576
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;
|
|
577
582
|
readonly lifecycle: RunLifecycle;
|
|
578
583
|
/** Resolves/pins the concrete starting model against the actual launch scope. */
|
|
579
584
|
readonly resolveModelForLaunch?: typeof resolveModelForLaunch;
|
|
@@ -3,7 +3,7 @@ import { createModelReceiptTracker } from './model-receipts.js';
|
|
|
3
3
|
import { messageContentWithImages } from '../attachment-content.js';
|
|
4
4
|
import { redactSecrets, } from '@jini-ai/core';
|
|
5
5
|
import { createClaudeStreamHandler, createCopilotStreamHandler, createJsonEventStreamHandler, createQoderStreamHandler, attachAcpSession, attachPiRpcSession, } from '@jini-ai/agent-runtime';
|
|
6
|
-
import { collectProcessTreePids, listProcessSnapshots, stopProcesses, } from '@jini-ai/platform';
|
|
6
|
+
import { collectProcessTreePids, listProcessSnapshots, stopProcesses, } from '@jini-ai/platform/process';
|
|
7
7
|
import { classifyRunCloseStatus, } from '../close-status.js';
|
|
8
8
|
import { resolveContinuationTransport, } from '../continuation/continuation-transport.js';
|
|
9
9
|
import { resultContent, } from '../delegated-tool-bridge.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn as nodeSpawn, type ChildProcess } from 'node:child_process';
|
|
2
2
|
import { type AgentRuntimeState, getAgentDef, resolveAgentLaunch, prepareAgentLogFile, preparePromptFileForAgent, type AgentLaunchResolution, type PreparedAgentLogFile, type PreparedPromptFile, type RuntimeAgentDef, type RuntimeBuildOptions, type RuntimeContext } from '@jini-ai/agent-runtime';
|
|
3
|
-
import { createCommandInvocation } from '@jini-ai/platform';
|
|
3
|
+
import { createCommandInvocation } from '@jini-ai/platform/command';
|
|
4
4
|
import { type ImagePromptDelivery } from '../image-prompt-delivery.js';
|
|
5
5
|
import { type SupportedStreamFormat, type ChildDrivenStreamFormat, type AgentExecutorCompatibility, type AgentExecutorRunInput, type AgentExecutor, type McpBridgeDelivery, type CreateAgentExecutorOptions, type FailBeforeSpawn, type SystemPromptOverlayDelivery, type PreparedSystemPromptOverlayFile, type SpawnAgentChildProcessResult } from './contracts.js';
|
|
6
6
|
/**
|
|
@@ -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
|
|
@@ -3,7 +3,8 @@ import { promises as fsPromises, } from 'node:fs';
|
|
|
3
3
|
import { tmpdir, } from 'node:os';
|
|
4
4
|
import { join, } from 'node:path';
|
|
5
5
|
import { agentCapabilities, bindRuntimeAgentDef, defaultRuntimeState, getRuntimeModelDiscoveryDeps, userToolchainBinDirs, applyAgentLaunchEnv, ensureAgentCapabilities, resolveModelForLaunch, getAgentDef, resolveAgentLaunch, attachAcpSession, attachPiRpcSession, checkPromptArgvBudget, checkWindowsCmdShimCommandLineBudget, checkWindowsDirectExeCommandLineBudget, prepareAgentLogFile, preparePromptFileForAgent, } from '@jini-ai/agent-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { createCommandInvocation } from '@jini-ai/platform/command';
|
|
7
|
+
import { collectProcessTreePids, listProcessSnapshots, stopProcesses, } from '@jini-ai/platform/process';
|
|
7
8
|
import { applyImagePromptDelivery, } from '../image-prompt-delivery.js';
|
|
8
9
|
import { SUPPORTED_STREAM_FORMATS, AgentExecutorError, } from './contracts.js';
|
|
9
10
|
import { errorMessage, } from './values.js';
|
|
@@ -178,13 +179,18 @@ function resolveAgentRuntimeDeps(options) {
|
|
|
178
179
|
return {
|
|
179
180
|
getAgentDef: (input) => {
|
|
180
181
|
const def = lookupDef(input);
|
|
181
|
-
|
|
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 } : {});
|
|
182
186
|
},
|
|
183
187
|
resolveAgentLaunch: options.resolveAgentLaunch ?? ((input, optional = {}) => resolveAgentLaunch(input, { ...optional, ...runtimeOptions, ...envOptions })),
|
|
184
188
|
ensureAgentCapabilities: options.ensureAgentCapabilities ?? ((input) => ensureAgentCapabilities(input, runtimeOptions)),
|
|
185
189
|
applyAgentLaunchEnv: options.applyAgentLaunchEnv ?? ((input, optional = {}) => applyAgentLaunchEnv(input, { appendPathDirs: userToolchainBinDirs({}, { ...runtimeOptions, ...envOptions }), ...optional })),
|
|
186
190
|
attachAcpSession: options.attachAcpSession ?? attachAcpSession,
|
|
187
|
-
attachPiRpcSession: options.attachPiRpcSession ?? attachPiRpcSession,
|
|
191
|
+
attachPiRpcSession: (required, optional = {}) => (options.attachPiRpcSession ?? attachPiRpcSession)(required, {
|
|
192
|
+
...optional, ...(options.piGracefulShutdownMs !== undefined ? { gracefulShutdownMs: options.piGracefulShutdownMs } : {}),
|
|
193
|
+
}),
|
|
188
194
|
preparePromptFileForAgent: options.preparePromptFileForAgent ?? preparePromptFileForAgent,
|
|
189
195
|
prepareAgentLogFile: options.prepareAgentLogFile ?? prepareAgentLogFile,
|
|
190
196
|
};
|
|
@@ -627,7 +633,12 @@ export async function confirmChildSpawned({ input, deps }) {
|
|
|
627
633
|
* @overallScore 100/100
|
|
628
634
|
*/
|
|
629
635
|
export function createAgentExecutor(requiredArgs, optionalArgs = {}) {
|
|
630
|
-
|
|
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
|
+
};
|
|
631
642
|
const lifecycle = options.lifecycle;
|
|
632
643
|
const hostEnv = selectAgentExecutorHostEnv({ env: options.hostEnv ?? process.env }, options.runtimeState ? { runtimeState: options.runtimeState } : {});
|
|
633
644
|
const { getAgentDef: getAgentDefFn, resolveAgentLaunch: resolveAgentLaunchFn, ensureAgentCapabilities: ensureAgentCapabilitiesFn, applyAgentLaunchEnv: applyAgentLaunchEnvFn, attachAcpSession: attachAcpSessionFn, attachPiRpcSession: attachPiRpcSessionFn, preparePromptFileForAgent: preparePromptFileForAgentFn, prepareAgentLogFile: prepareAgentLogFileFn, } = resolveAgentRuntimeDeps({ ...options, hostEnv });
|
package/dist/http/host-tools.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { spawn as nodeSpawn } from 'node:child_process';
|
|
21
21
|
import { access as fsAccess, constants as fsConstants } from 'node:fs/promises';
|
|
22
|
-
import { createCommandInvocation } from '@jini-ai/platform';
|
|
22
|
+
import { createCommandInvocation } from '@jini-ai/platform/command';
|
|
23
23
|
import { createApiError } from '@jini-ai/protocol';
|
|
24
24
|
import { defineJsonRoute, mountJsonRoute } from '@jini-ai/http-kit';
|
|
25
25
|
import { validationError } from '@jini-ai/http-kit';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/daemon",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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,16 +139,16 @@
|
|
|
139
139
|
"@types/pg": "8.23.1",
|
|
140
140
|
"express": "^4.21.0",
|
|
141
141
|
"@types/express": "^4.17.21",
|
|
142
|
+
"@jini-ai/http-kit": "0.4.1",
|
|
143
|
+
"@jini-ai/agent-runtime": "^0.4.7",
|
|
142
144
|
"@jini-ai/chat": "0.5.8",
|
|
143
|
-
"@jini-ai/
|
|
144
|
-
"@jini-ai/
|
|
145
|
+
"@jini-ai/core": "^0.4.4",
|
|
146
|
+
"@jini-ai/platform": "^0.5.5",
|
|
145
147
|
"@jini-ai/protocol": "^0.4.4",
|
|
146
|
-
"@jini-ai/
|
|
147
|
-
"@jini-ai/platform": "^0.5.3",
|
|
148
|
-
"@jini-ai/http-kit": "0.4.1"
|
|
148
|
+
"@jini-ai/db": "0.3.3"
|
|
149
149
|
},
|
|
150
150
|
"dependencies": {
|
|
151
|
-
"@jini-ai/core": "^0.4.
|
|
151
|
+
"@jini-ai/core": "^0.4.4",
|
|
152
152
|
"@jini-ai/protocol": "^0.4.4"
|
|
153
153
|
},
|
|
154
154
|
"peerDependencies": {
|
|
@@ -160,8 +160,8 @@
|
|
|
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.
|
|
164
|
-
"@jini-ai/platform": "^0.5.
|
|
163
|
+
"@jini-ai/agent-runtime": "^0.4.7",
|
|
164
|
+
"@jini-ai/platform": "^0.5.5"
|
|
165
165
|
},
|
|
166
166
|
"peerDependenciesMeta": {
|
|
167
167
|
"node-pty": {
|