@jini-ai/agent-runtime 0.7.3-next.1 → 0.7.3-next.2
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
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** ACP JSON-RPC protocol version sent in every `initialize` handshake. */
|
|
7
7
|
export declare const ACP_PROTOCOL_VERSION = 1;
|
|
8
|
+
export declare function unsupportedAcpProtocolVersionMessage({ protocolVersion }: {
|
|
9
|
+
protocolVersion: unknown;
|
|
10
|
+
}): string | undefined;
|
|
8
11
|
/** ACP's auth_required error code */
|
|
9
12
|
export declare const ACP_AUTH_REQUIRED_ERROR_CODE = -32000;
|
|
10
13
|
/** Default timeout in milliseconds for short-lived ACP operations such as model detection. */
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** ACP JSON-RPC protocol version sent in every `initialize` handshake. */
|
|
7
7
|
export const ACP_PROTOCOL_VERSION = 1;
|
|
8
|
+
export function unsupportedAcpProtocolVersionMessage({ protocolVersion }) {
|
|
9
|
+
if (protocolVersion === undefined || protocolVersion === ACP_PROTOCOL_VERSION)
|
|
10
|
+
return undefined;
|
|
11
|
+
return `This agent did not negotiate ACP protocol version ${ACP_PROTOCOL_VERSION}.`;
|
|
12
|
+
}
|
|
8
13
|
/** ACP's auth_required error code */
|
|
9
14
|
export const ACP_AUTH_REQUIRED_ERROR_CODE = -32000;
|
|
10
15
|
/** Default timeout in milliseconds for short-lived ACP operations such as model detection. */
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { spawn } from 'node:child_process';
|
|
10
10
|
import { createJsonLineStream } from '../core/index.js';
|
|
11
|
-
import { ACP_PROTOCOL_VERSION, DEFAULT_TIMEOUT_MS, MODEL_CONFIG_OPTION_IDS } from './constants.js';
|
|
11
|
+
import { ACP_PROTOCOL_VERSION, DEFAULT_TIMEOUT_MS, MODEL_CONFIG_OPTION_IDS, unsupportedAcpProtocolVersionMessage } from './constants.js';
|
|
12
12
|
import { errorMessage, resolveAcpTimeoutMs, asObject } from './json.js';
|
|
13
13
|
import { sendRpc, rpcErrorMessage } from './rpc.js';
|
|
14
14
|
import { buildAcpSessionNewParams } from './session-params.js';
|
|
@@ -271,6 +271,11 @@ function handleProbeRpcError({ run, obj, rpcErr }) {
|
|
|
271
271
|
function handleProbeResult(run, result) {
|
|
272
272
|
const { config } = run;
|
|
273
273
|
if (run.expectedId === 1) {
|
|
274
|
+
const message = unsupportedAcpProtocolVersionMessage({ protocolVersion: result.protocolVersion });
|
|
275
|
+
if (message) {
|
|
276
|
+
failProbe({ run, message });
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
274
279
|
run.expectedId = 2;
|
|
275
280
|
writeProbeRpc(run, { id: 2, method: 'session/new', params: buildAcpSessionNewParams({ cwd: config.cwd }) });
|
|
276
281
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { asObject } from './json.js';
|
|
2
|
-
import { ACP_AUTH_REQUIRED_ERROR_CODE } from './constants.js';
|
|
2
|
+
import { ACP_AUTH_REQUIRED_ERROR_CODE, unsupportedAcpProtocolVersionMessage } from './constants.js';
|
|
3
3
|
import { accountFailureDetails } from './account-failure.js';
|
|
4
4
|
import { rpcErrorData, rpcErrorRetryable, promotedOpenCodeSessionErrorPayload, formatUsage } from './rpc.js';
|
|
5
5
|
import { findEffortConfigOption, findModelConfigOption, currentModelFromSessionResult, modelSelectionErrorIsRecoverable } from './models.js';
|
|
@@ -66,6 +66,11 @@ function failWithRpcError({ effects, obj, rpcErr, }) {
|
|
|
66
66
|
}
|
|
67
67
|
/** Handles the `initialize` ack: sends `session/load` (resume) or `session/new` (fresh). */
|
|
68
68
|
export function handleInitializeAck({ state, effects, result }, _optional = {}) {
|
|
69
|
+
const message = unsupportedAcpProtocolVersionMessage({ protocolVersion: result.protocolVersion });
|
|
70
|
+
if (message) {
|
|
71
|
+
effects.fail(message);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
69
74
|
if (effects.resumeSessionId && asObject({ value: result.agentCapabilities })?.loadSession !== true) {
|
|
70
75
|
effects.fail('This agent cannot reopen a saved conversation (it does not offer session/load); a new conversation is needed.', { details: { reason: 'load_session_unsupported' } });
|
|
71
76
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/agent-runtime",
|
|
3
|
-
"version": "0.7.3-next.
|
|
3
|
+
"version": "0.7.3-next.2",
|
|
4
4
|
"description": "Coding-agent runtime adapters: runtime registry, detection, launch, stream parsers, and the ACP/pi-rpc subprocess transport.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -130,17 +130,17 @@
|
|
|
130
130
|
"registry": "https://registry.npmjs.org"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
|
-
"@vitest/coverage-v8": "^2.
|
|
134
|
-
"@jini-ai/
|
|
135
|
-
"@jini-ai/
|
|
136
|
-
"@jini-ai/core": "^0.7.3-next.
|
|
133
|
+
"@vitest/coverage-v8": "^3.2.6",
|
|
134
|
+
"@jini-ai/platform": "^0.7.3-next.2",
|
|
135
|
+
"@jini-ai/integrations": "^0.7.3-next.2",
|
|
136
|
+
"@jini-ai/core": "^0.7.3-next.2"
|
|
137
137
|
},
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@jini-ai/
|
|
140
|
-
"@jini-ai/
|
|
141
|
-
"@jini-ai/
|
|
142
|
-
"@jini-ai/
|
|
143
|
-
"@jini-ai/
|
|
139
|
+
"@jini-ai/oauth": "^0.7.3-next.2",
|
|
140
|
+
"@jini-ai/integrations": "^0.7.3-next.2",
|
|
141
|
+
"@jini-ai/platform": "^0.7.3-next.2",
|
|
142
|
+
"@jini-ai/core": "^0.7.3-next.2",
|
|
143
|
+
"@jini-ai/protocol": "^0.7.3-next.2"
|
|
144
144
|
},
|
|
145
145
|
"scripts": {
|
|
146
146
|
"build": "tsc -p tsconfig.json",
|