@jini-ai/agent-runtime 0.6.19 → 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 +4 -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/index.d.ts +1 -1
- package/dist/defs/index.js +1 -1
- package/dist/json-event-stream.js +1 -1
- package/dist/types.d.ts +7 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
## 0.6.19
|
|
2
6
|
|
|
3
7
|
- Redact OAuth callback, token parsing and file-permission failure diagnostics.
|
|
@@ -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/index.d.ts
CHANGED
package/dist/defs/index.js
CHANGED
|
@@ -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
|
}
|
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
|
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": {
|
|
@@ -121,14 +121,14 @@
|
|
|
121
121
|
"@vitest/coverage-v8": "^2.1.9",
|
|
122
122
|
"@jini-ai/core": "^0.6.13",
|
|
123
123
|
"@jini-ai/integrations": "^0.6.19",
|
|
124
|
-
"@jini-ai/platform": "^0.6.
|
|
124
|
+
"@jini-ai/platform": "^0.6.22"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
|
-
"@jini-ai/core": "^0.6.
|
|
128
|
-
"@jini-ai/platform": "^0.6.19",
|
|
127
|
+
"@jini-ai/core": "^0.6.22",
|
|
129
128
|
"@jini-ai/protocol": "^0.6.19",
|
|
130
|
-
"@jini-ai/
|
|
131
|
-
"@jini-ai/integrations": "^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",
|