@jini-ai/agent-runtime 0.6.17 → 0.6.22
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 +9 -0
- package/dist/defs/{antigravity-event-stream.d.ts → antigravity/event-stream.d.ts} +1 -1
- package/dist/defs/{antigravity-event-stream.js → antigravity/event-stream.js} +1 -1
- package/dist/defs/{antigravity.d.ts → antigravity/index.d.ts} +20 -11
- package/dist/defs/{antigravity.js → antigravity/index.js} +24 -7
- package/dist/defs/claude.d.ts +1 -0
- package/dist/defs/claude.js +1 -0
- package/dist/defs/codex.d.ts +1 -0
- package/dist/defs/codex.js +1 -0
- package/dist/defs/index.d.ts +1 -1
- package/dist/defs/index.js +1 -1
- package/dist/defs/opencode.d.ts +1 -0
- package/dist/defs/opencode.js +1 -0
- package/dist/json-event-stream.js +6 -4
- package/dist/providers/oauth-callback-server.js +3 -1
- package/dist/providers/oauth-tokens.js +4 -2
- package/dist/types.d.ts +9 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 0.6.22
|
|
2
|
+
|
|
3
|
+
- Antigravity moved to its own `defs/antigravity/` folder, with card order and streaming fixes. A runtime can ask for complete stdout lines to be sanitized before live delivery.
|
|
4
|
+
|
|
5
|
+
## 0.6.19
|
|
6
|
+
|
|
7
|
+
- Redact OAuth callback, token parsing and file-permission failure diagnostics.
|
|
8
|
+
- Codex names a Jini MCP call `mcp__jini__X`, as Claude Code does, so the chat folds it with the daemon bridge's `X` row and a direct call shows once, not twice.
|
|
9
|
+
|
|
1
10
|
## 0.6.17
|
|
2
11
|
|
|
3
12
|
### Patch Changes
|
|
@@ -16,4 +16,4 @@ export declare function handleAntigravityEvent({ frame, emit, state }: {
|
|
|
16
16
|
state: AntigravityStreamState;
|
|
17
17
|
}, _options?: Record<string, never>): boolean;
|
|
18
18
|
export {};
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=event-stream.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuntimeBuildOptions, RuntimeContext, RuntimeModelOption } from '
|
|
1
|
+
import type { RuntimeBuildOptions, RuntimeContext, RuntimeModelOption } from '../../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Redacts any OAuth sign-in URL from agy's buffered print-mode stdout,
|
|
4
4
|
* leaving all other output byte-identical.
|
|
@@ -18,6 +18,15 @@ import type { RuntimeBuildOptions, RuntimeContext, RuntimeModelOption } from '..
|
|
|
18
18
|
export declare function redactAntigravityAuthUrls({ fullText }: {
|
|
19
19
|
fullText: string;
|
|
20
20
|
}): string;
|
|
21
|
+
/** Redact JSON string values before parsing/delivery, preserving escaped quotes and line framing.
|
|
22
|
+
* Plain auth prompts use the same URL redactor; no raw sign-in URL reaches the event stream.
|
|
23
|
+
* @returns A sanitized complete wire line; never throws for malformed CLI output.
|
|
24
|
+
* @complexity O(n) time/space for n line characters; no I/O or retained state.
|
|
25
|
+
* @example sanitizeAntigravityWireLine({ fullText: '{"event":"init"}\n' });
|
|
26
|
+
*/
|
|
27
|
+
export declare function sanitizeAntigravityWireLine({ fullText }: {
|
|
28
|
+
fullText: string;
|
|
29
|
+
}, _options?: Record<string, never>): string;
|
|
21
30
|
/**
|
|
22
31
|
* Parses `agy models`' stdout into the shared `RuntimeModelOption[]` shape.
|
|
23
32
|
*
|
|
@@ -73,26 +82,26 @@ export declare const antigravityAgentDef: {
|
|
|
73
82
|
supportsNativeToolAccess: false;
|
|
74
83
|
needsAgentLogFile: true;
|
|
75
84
|
stdoutPolicy: {
|
|
76
|
-
buffering: "
|
|
77
|
-
sanitize: typeof
|
|
85
|
+
buffering: "line";
|
|
86
|
+
sanitize: typeof sanitizeAntigravityWireLine;
|
|
78
87
|
};
|
|
79
88
|
installUrl: string;
|
|
80
89
|
docsUrl: string;
|
|
81
90
|
externalMcpInjection: "env-passthrough";
|
|
82
91
|
discoverModels(requiredArgs: {
|
|
83
|
-
context: import("
|
|
92
|
+
context: import("../../model-discovery-types.js").ModelDiscoveryContext;
|
|
84
93
|
}, optionalArgs?: {
|
|
85
94
|
signal?: AbortSignal;
|
|
86
95
|
force?: boolean;
|
|
87
96
|
staleWhileRevalidate?: boolean;
|
|
88
|
-
deps?: import("
|
|
89
|
-
}): Promise<import("
|
|
97
|
+
deps?: import("../../model-discovery-types.js").ModelDiscoveryDeps;
|
|
98
|
+
}): Promise<import("../../model-discovery-types.js").ModelCatalogSnapshot>;
|
|
90
99
|
resolveDefaultModel(requiredArgs: {
|
|
91
|
-
context: import("
|
|
92
|
-
catalog: import("
|
|
100
|
+
context: import("../../model-discovery-types.js").ModelDiscoveryContext;
|
|
101
|
+
catalog: import("../../model-discovery-types.js").ModelCatalogSnapshot;
|
|
93
102
|
}, optionalArgs?: {
|
|
94
103
|
signal?: AbortSignal;
|
|
95
|
-
deps?: import("
|
|
96
|
-
}): Promise<import("
|
|
104
|
+
deps?: import("../../model-discovery-types.js").ModelDiscoveryDeps;
|
|
105
|
+
}): Promise<import("../../model-discovery-types.js").DefaultModelResolution>;
|
|
97
106
|
};
|
|
98
|
-
//# sourceMappingURL=
|
|
107
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createAgentModelDiscovery } from '
|
|
1
|
+
import { createAgentModelDiscovery } from '../../model-discovery-native.js';
|
|
2
2
|
import { redactOAuthUrls } from '@jini-ai/oauth';
|
|
3
|
-
import { DEFAULT_MODEL_OPTION } from '
|
|
3
|
+
import { DEFAULT_MODEL_OPTION } from '../shared.js';
|
|
4
4
|
// `agy` v1.1.24 has a real `--model <id>` flag (`agy --help`: "Model for the current CLI
|
|
5
5
|
// session") plus a machine-readable `agy models` subcommand that lists every selectable model as
|
|
6
6
|
// a stable `<slug>\t<label>` pair — both verified live, neither true of the v1.0.3 this file used
|
|
@@ -38,7 +38,7 @@ import { DEFAULT_MODEL_OPTION } from './shared.js';
|
|
|
38
38
|
// - it is also useless to click: `-p` print mode has no field to paste the
|
|
39
39
|
// resulting auth code back into (see `auth.ts`'s
|
|
40
40
|
// `antigravityAuthGuidance`), so the only outcome is a leaked URL.
|
|
41
|
-
//
|
|
41
|
+
// Complete stdout lines must be redacted before delivery, including a URL split across chunks.
|
|
42
42
|
//
|
|
43
43
|
// The shape being matched is real, not guessed — it is the same text this
|
|
44
44
|
// package's own `isAntigravityAuthFailureText` already classifies, captured
|
|
@@ -79,6 +79,23 @@ const OAUTH_URL_PLACEHOLDER = '[redacted sign-in URL]';
|
|
|
79
79
|
export function redactAntigravityAuthUrls({ fullText }) {
|
|
80
80
|
return redactOAuthUrls({ text: fullText, pattern: OAUTH_URL_PATTERN, replacement: OAUTH_URL_PLACEHOLDER });
|
|
81
81
|
}
|
|
82
|
+
/** Redact JSON string values before parsing/delivery, preserving escaped quotes and line framing.
|
|
83
|
+
* Plain auth prompts use the same URL redactor; no raw sign-in URL reaches the event stream.
|
|
84
|
+
* @returns A sanitized complete wire line; never throws for malformed CLI output.
|
|
85
|
+
* @complexity O(n) time/space for n line characters; no I/O or retained state.
|
|
86
|
+
* @example sanitizeAntigravityWireLine({ fullText: '{"event":"init"}\n' });
|
|
87
|
+
*/
|
|
88
|
+
export function sanitizeAntigravityWireLine({ fullText }, _options = {}) {
|
|
89
|
+
let frame;
|
|
90
|
+
try {
|
|
91
|
+
frame = JSON.parse(fullText);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return redactAntigravityAuthUrls({ fullText });
|
|
95
|
+
}
|
|
96
|
+
const safe = JSON.stringify(frame, (_key, value) => typeof value === 'string' ? redactAntigravityAuthUrls({ fullText: value }) : value);
|
|
97
|
+
return safe + (fullText.endsWith('\n') ? '\n' : '');
|
|
98
|
+
}
|
|
82
99
|
/**
|
|
83
100
|
* Parses `agy models`' stdout into the shared `RuntimeModelOption[]` shape.
|
|
84
101
|
*
|
|
@@ -256,13 +273,13 @@ export const antigravityAgentDef = {
|
|
|
256
273
|
// only way to tell those two apart — see server.ts's empty-output guard
|
|
257
274
|
// for the consumer.
|
|
258
275
|
needsAgentLogFile: true,
|
|
259
|
-
//
|
|
276
|
+
// Sanitize each complete wire line before live parsing/diagnostics — see
|
|
260
277
|
// `redactAntigravityAuthUrls`'s comment for the OAuth-URL-on-stdout-plus-
|
|
261
|
-
// exit-0 behavior that
|
|
278
|
+
// exit-0 behavior that requires redaction. Every other `streamFormat: 'plain'`
|
|
262
279
|
// adapter (grok-build, aider, deepseek, qwen) leaves `stdoutPolicy` unset
|
|
263
280
|
// and keeps streaming per chunk; aider's and deepseek's own comments call
|
|
264
281
|
// that live cadence out as deliberate.
|
|
265
|
-
stdoutPolicy: { buffering: '
|
|
282
|
+
stdoutPolicy: { buffering: 'line', sanitize: sanitizeAntigravityWireLine },
|
|
266
283
|
installUrl: 'https://antigravity.google/cli',
|
|
267
284
|
docsUrl: 'https://antigravity.google/docs/cli-overview',
|
|
268
285
|
// `externalMcpInjection: 'env-passthrough'` — the prior verdict here ("no safe, run-scoped
|
|
@@ -340,4 +357,4 @@ function antigravityModelRow(line) {
|
|
|
340
357
|
// side: neither the id nor the label can come out empty here.
|
|
341
358
|
return { id: line.slice(0, tabIndex).trim(), label: line.slice(tabIndex + 1).trim() };
|
|
342
359
|
}
|
|
343
|
-
//# sourceMappingURL=
|
|
360
|
+
//# sourceMappingURL=index.js.map
|
package/dist/defs/claude.d.ts
CHANGED
package/dist/defs/claude.js
CHANGED
|
@@ -283,6 +283,7 @@ export const claudeAgentDef = {
|
|
|
283
283
|
// Claude Code auto-loads `.mcp.json` from the project cwd at spawn,
|
|
284
284
|
// so the daemon writes the user's external MCP servers there before
|
|
285
285
|
// launching (server.ts handles the cwd guard).
|
|
286
|
+
mcpHttp: true,
|
|
286
287
|
externalMcpInjection: 'claude-mcp-json',
|
|
287
288
|
// Load MCP tools up front instead of deferring them behind the CLI's ToolSearch tool.
|
|
288
289
|
// Deferral cost every run one extra model round (a `select:` ToolSearch call, ~3 s) before its
|
package/dist/defs/codex.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export declare const codexAgentDef: {
|
|
|
72
72
|
streamFormat: string;
|
|
73
73
|
eventParser: string;
|
|
74
74
|
imageDelivery: "native";
|
|
75
|
+
mcpHttp: true;
|
|
75
76
|
externalMcpInjection: "codex-toml";
|
|
76
77
|
discoverModels(requiredArgs: {
|
|
77
78
|
context: import("../model-discovery-types.js").ModelDiscoveryContext;
|
package/dist/defs/codex.js
CHANGED
|
@@ -410,6 +410,7 @@ export const codexAgentDef = {
|
|
|
410
410
|
// prompt. Missing credentials fail observably through turn.failed instead of blocking a run.
|
|
411
411
|
// The staged shape includes command, args and a nested env table. Staging and cleanup belong
|
|
412
412
|
// to daemon's prepareCodexHomeForRun/buildCodexHomeConfigToml.
|
|
413
|
+
mcpHttp: true,
|
|
413
414
|
externalMcpInjection: 'codex-toml',
|
|
414
415
|
};
|
|
415
416
|
//# sourceMappingURL=codex.js.map
|
package/dist/defs/index.d.ts
CHANGED
package/dist/defs/index.js
CHANGED
package/dist/defs/opencode.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const opencodeAgentDef: {
|
|
|
30
30
|
capturesSessionIdFromStream: true;
|
|
31
31
|
streamFormat: string;
|
|
32
32
|
eventParser: string;
|
|
33
|
+
mcpHttp: true;
|
|
33
34
|
externalMcpInjection: "opencode-env-content";
|
|
34
35
|
systemPromptDelivery: {
|
|
35
36
|
strategy: "config-instructions-file";
|
package/dist/defs/opencode.js
CHANGED
|
@@ -88,6 +88,7 @@ export const opencodeAgentDef = {
|
|
|
88
88
|
// user-configured external MCP servers to a single `opencode run`
|
|
89
89
|
// invocation without polluting the user's saved config files. See
|
|
90
90
|
// <https://opencode.ai/docs/config> and issue #2142.
|
|
91
|
+
mcpHttp: true,
|
|
91
92
|
externalMcpInjection: 'opencode-env-content',
|
|
92
93
|
// `instructions` (an array of file paths or remote URLs — confirmed live an inline string is
|
|
93
94
|
// silently ignored, never honored) is OpenCode's real, native system-prompt-append mechanism.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @module json-event-stream
|
|
2
2
|
* Multi-CLI JSON event parsing with per-handler stream state. */
|
|
3
3
|
import { sanitizeUntrustedText } from '@jini-ai/core/text';
|
|
4
|
-
import { handleAntigravityEvent } from './defs/antigravity
|
|
4
|
+
import { handleAntigravityEvent } from './defs/antigravity/event-stream.js';
|
|
5
5
|
function isRecord(value) {
|
|
6
6
|
return value != null && typeof value === 'object' && !Array.isArray(value);
|
|
7
7
|
}
|
|
@@ -574,8 +574,9 @@ function emitCodexErrorOnce(message, onEvent, state) {
|
|
|
574
574
|
function codexMcpToolName(item) {
|
|
575
575
|
const tool = nonEmptyString(item.tool);
|
|
576
576
|
// Preserve the bridge's catalog names; external MCP must never masquerade as Bash/Edit.
|
|
577
|
-
|
|
578
|
-
|
|
577
|
+
// A Jini call is named `mcp__jini__X` exactly as Claude Code names it: the daemon bridge also
|
|
578
|
+
// reports a direct call as its own `X` row, and @jini-ai/chat folds the pair into one row only
|
|
579
|
+
// when the CLI row carries the MCP prefix (a bare `X` drew every Codex direct call twice).
|
|
579
580
|
const server = typeof item.server === 'string' ? item.server : 'external';
|
|
580
581
|
return `mcp__${server}__${tool ?? 'call'}`;
|
|
581
582
|
}
|
|
@@ -585,7 +586,8 @@ function codexMcpToolName(item) {
|
|
|
585
586
|
* `item.completed` — already rely on, since Codex reports both frames for one call).
|
|
586
587
|
*
|
|
587
588
|
* `item.tool` — the literal MCP tool name Codex called (`search_tools`, `describe_tool`,
|
|
588
|
-
* `execute_delegated_tool`) — is used verbatim
|
|
589
|
+
* `execute_delegated_tool`) — is used verbatim (behind the `mcp__jini__` prefix, see
|
|
590
|
+
* {@link codexMcpToolName}) as the emitted `name`, never unwrapped to the
|
|
589
591
|
* delegated `toolId` inside `item.arguments`: `@jini-ai/chat`'s `ToolCard`/`DelegatedToolCard`
|
|
590
592
|
* already recover that id from `{toolId, input}` for `execute_delegated_tool` specifically (see that
|
|
591
593
|
* component's own doc), so duplicating the unwrap here would be a second, driftable copy of the same
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { redactSecrets } from '@jini-ai/core';
|
|
1
3
|
/**
|
|
2
4
|
* @module providers/oauth-callback-server
|
|
3
5
|
*
|
|
@@ -111,7 +113,7 @@ export async function startOAuthCallbackListener(requiredArgs, optionalArgs = {}
|
|
|
111
113
|
await input.onCallback(outcome);
|
|
112
114
|
}
|
|
113
115
|
catch (err) {
|
|
114
|
-
console.error('[oauth-callback-server] onCallback failed:', err);
|
|
116
|
+
console.error('[oauth-callback-server] onCallback failed:', redactSecrets({ input: inspect(err) }, { redactPii: false }));
|
|
115
117
|
}
|
|
116
118
|
finally {
|
|
117
119
|
void stop();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { redactSecrets } from '@jini-ai/core';
|
|
1
3
|
/**
|
|
2
4
|
* @module providers/oauth-tokens
|
|
3
5
|
*
|
|
@@ -60,7 +62,7 @@ export async function readOAuthTokenFile({ dataDir, fileName }) {
|
|
|
60
62
|
if (e.code === 'ENOENT')
|
|
61
63
|
return {};
|
|
62
64
|
if (e.name === 'SyntaxError') {
|
|
63
|
-
console.error('[oauth-tokens] Corrupted JSON, returning empty:', e
|
|
65
|
+
console.error('[oauth-tokens] Corrupted JSON, returning empty:', redactSecrets({ input: inspect(e) }, { redactPii: false }));
|
|
64
66
|
return {};
|
|
65
67
|
}
|
|
66
68
|
throw err;
|
|
@@ -94,7 +96,7 @@ async function writeTokenFile(dataDir, fileName, next) {
|
|
|
94
96
|
catch (err) {
|
|
95
97
|
const e = err;
|
|
96
98
|
if (e.code !== 'ENOTSUP' && e.code !== 'EPERM') {
|
|
97
|
-
console.warn('[oauth-tokens] could not chmod 0600', file,
|
|
99
|
+
console.warn('[oauth-tokens] could not chmod 0600', file, redactSecrets({ input: inspect(err) }, { redactPii: false }));
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
return next;
|
package/dist/types.d.ts
CHANGED
|
@@ -169,6 +169,13 @@ export type RuntimeStdoutPolicy =
|
|
|
169
169
|
{
|
|
170
170
|
readonly buffering: 'live';
|
|
171
171
|
}
|
|
172
|
+
/** Sanitize complete stdout lines before live delivery; partial lines remain bounded by the host. */
|
|
173
|
+
| {
|
|
174
|
+
readonly buffering: 'line';
|
|
175
|
+
readonly sanitize: (requiredArgs: {
|
|
176
|
+
fullText: string;
|
|
177
|
+
}) => string;
|
|
178
|
+
}
|
|
172
179
|
/**
|
|
173
180
|
* Accumulate every stdout chunk and forward the whole thing exactly once,
|
|
174
181
|
* after the child process closes. For adapters that can print a secret
|
|
@@ -399,6 +406,8 @@ export type RuntimeAgentDef = Partial<AgentModelDiscoveryPort> & {
|
|
|
399
406
|
maxPromptArgBytes?: number;
|
|
400
407
|
mcpDiscovery?: string;
|
|
401
408
|
externalMcpInjection?: 'claude-mcp-json' | 'acp-merge' | 'opencode-env-content' | 'mimo-env-content' | 'codex-toml' | 'env-passthrough';
|
|
409
|
+
/** CLI explicitly supports authenticated Streamable HTTP MCP; independent of stdio delivery. */
|
|
410
|
+
mcpHttp?: boolean;
|
|
402
411
|
systemPromptDelivery?: {
|
|
403
412
|
readonly strategy: 'append-flag';
|
|
404
413
|
readonly flag: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/agent-runtime",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.22",
|
|
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": {
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@vitest/coverage-v8": "^2.1.9",
|
|
122
122
|
"@jini-ai/core": "^0.6.13",
|
|
123
|
-
"@jini-ai/
|
|
124
|
-
"@jini-ai/
|
|
123
|
+
"@jini-ai/integrations": "^0.6.19",
|
|
124
|
+
"@jini-ai/platform": "^0.6.22"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
|
-
"@jini-ai/
|
|
128
|
-
"@jini-ai/
|
|
129
|
-
"@jini-ai/
|
|
130
|
-
"@jini-ai/
|
|
131
|
-
"@jini-ai/
|
|
127
|
+
"@jini-ai/core": "^0.6.22",
|
|
128
|
+
"@jini-ai/protocol": "^0.6.19",
|
|
129
|
+
"@jini-ai/platform": "^0.6.22",
|
|
130
|
+
"@jini-ai/integrations": "^0.6.19",
|
|
131
|
+
"@jini-ai/oauth": "^0.6.19"
|
|
132
132
|
},
|
|
133
133
|
"scripts": {
|
|
134
134
|
"build": "tsc -p tsconfig.json",
|