@jini-ai/agent-runtime 0.6.12 → 0.6.15-rc.1

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/agent-protocol/acp/json.d.ts +1 -1
  3. package/dist/agent-protocol/acp/json.js +6 -3
  4. package/dist/agent-protocol/acp/models.js +53 -15
  5. package/dist/agent-protocol/acp/rpc.js +1 -1
  6. package/dist/agent-protocol/acp/session.d.ts +1 -1
  7. package/dist/agent-protocol/acp/session.js +25 -8
  8. package/dist/agent-protocol/acp/text-suppression.js +2 -1
  9. package/dist/ai-trace/capture.d.ts +17 -0
  10. package/dist/ai-trace/capture.js +43 -0
  11. package/dist/ai-trace/classify.d.ts +12 -0
  12. package/dist/ai-trace/classify.js +13 -0
  13. package/dist/ai-trace/index.d.ts +13 -0
  14. package/dist/ai-trace/index.js +6 -0
  15. package/dist/ai-trace/recorder.d.ts +65 -0
  16. package/dist/ai-trace/recorder.js +259 -0
  17. package/dist/ai-trace/sinks.d.ts +51 -0
  18. package/dist/ai-trace/sinks.js +137 -0
  19. package/dist/ai-trace/types.d.ts +123 -0
  20. package/dist/ai-trace/types.js +17 -0
  21. package/dist/ai-trace/usage.d.ts +13 -0
  22. package/dist/ai-trace/usage.js +43 -0
  23. package/dist/claude-filesystem-policy.d.ts +25 -3
  24. package/dist/claude-filesystem-policy.js +104 -14
  25. package/dist/core/model-discovery-shared.d.ts +28 -0
  26. package/dist/core/model-discovery-shared.js +88 -0
  27. package/dist/defs/antigravity.js +10 -2
  28. package/dist/defs/claude.js +2 -1
  29. package/dist/defs/codex.js +13 -2
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +1 -0
  32. package/dist/model-discovery-adapters.js +1 -1
  33. package/dist/model-discovery-shared.d.ts +2 -27
  34. package/dist/model-discovery-shared.js +2 -87
  35. package/dist/model-discovery.d.ts +1 -1
  36. package/dist/model-discovery.js +2 -2
  37. package/dist/models.js +1 -1
  38. package/dist/providers/anthropic-messages.d.ts +1 -1
  39. package/dist/providers/anthropic-messages.js +10 -4
  40. package/dist/types.d.ts +4 -0
  41. package/package.json +16 -10
@@ -285,8 +285,8 @@ export function handleMessageDelta({ state, data, onEvent }) {
285
285
  state.stopReason = data.delta.stop_reason;
286
286
  }
287
287
  if (isRecord(data.usage)) {
288
- state.usage = data.usage;
289
- onEvent({ type: 'usage', usage: data.usage });
288
+ state.usage = { ...state.usage, ...data.usage };
289
+ onEvent({ type: 'usage', usage: state.usage });
290
290
  }
291
291
  }
292
292
  export function handleAnthropicErrorFrame({ data, onEvent, apiKey }) {
@@ -294,7 +294,7 @@ export function handleAnthropicErrorFrame({ data, onEvent, apiKey }) {
294
294
  const errorType = isRecord(data.error) && typeof data.error.type === 'string' ? data.error.type : undefined;
295
295
  onEvent({ type: 'error', message: redactSecrets({ input: errorDetail }, { exactSecrets: [apiKey] }), ...(errorType ? { code: errorType } : {}) });
296
296
  }
297
- /** The SSE event's dispatch key: `data.type` when present (every real Anthropic frame carries one), else the record's `event:` line, else `''` — a key that intentionally matches no entry in {@link ANTHROPIC_FRAME_HANDLERS} (`message_start`/`message_stop`/`ping`/future event types fall through as no-ops, same as before this frame was a lookup table). */
297
+ /** The SSE event's dispatch key: `data.type` when present (every real Anthropic frame carries one), else the record's `event:` line, else `''` — a key that intentionally matches no entry in {@link ANTHROPIC_FRAME_HANDLERS} (`message_stop`/`ping`/future event types fall through as no-ops, same as before this frame was a lookup table). */
298
298
  export function anthropicFrameKind({ data, frameEvent }) {
299
299
  if (typeof data.type === 'string')
300
300
  return data.type;
@@ -302,6 +302,12 @@ export function anthropicFrameKind({ data, frameEvent }) {
302
302
  }
303
303
  /** One entry per SSE event kind this adapter reacts to. Replaces a sequential if-chain over `kind` — every branch below is now a single object-key lookup instead of N nesting-penalized `if` statements (see `runSingleAnthropicRequest`'s doc for the resulting flat loop). */
304
304
  const ANTHROPIC_FRAME_HANDLERS = {
305
+ message_start: (state, data) => {
306
+ // Input usage arrives at message_start; message_delta supplies cumulative output usage.
307
+ if (isRecord(data.message) && isRecord(data.message.usage))
308
+ state.usage = data.message.usage;
309
+ return { action: 'continue' };
310
+ },
305
311
  content_block_start: (state, data) => {
306
312
  handleContentBlockStart({ state: state, data: data });
307
313
  return { action: 'continue' };
@@ -420,7 +426,7 @@ async function runSingleAnthropicRequest(options, messages, emitEnd, retry) {
420
426
  continue; // malformed/empty keep-alive frame, or a non-object payload
421
427
  const handler = ANTHROPIC_FRAME_HANDLERS[anthropicFrameKind({ data: data, frameEvent: frame.event })];
422
428
  if (!handler)
423
- continue; // `message_start`, `message_stop`, `ping`, or a future event type — nothing to do
429
+ continue; // `message_stop`, `ping`, or a future event type — nothing to do
424
430
  const outcome = handler(state, data, onEvent, options.apiKey);
425
431
  if (outcome.action === 'end') {
426
432
  emitEnd(outcome.reason);
package/dist/types.d.ts CHANGED
@@ -81,8 +81,12 @@ export type RuntimeBuildOptions = {
81
81
  filesystemTempDir?: string;
82
82
  /** Shared host/login temp roots denied even when child TMPDIR is replaced. */
83
83
  filesystemSharedTempRoots?: readonly string[];
84
+ /** Executor-created per-run CLAUDE_CODE_TMPDIR; its /claude-<uid> child must fit 44 bytes. Absent grants no runtime scratch. */
85
+ filesystemRuntimeTempBase?: string;
84
86
  /** Executor-resolved CLI/runtime files; read-only exceptions for sandboxed commands. */
85
87
  filesystemRuntimeReadPaths?: readonly string[];
88
+ /** Host-validated owner-picked folders outside filesystemRoot: natively readable, never writable. */
89
+ filesystemReadOnlyDirs?: readonly string[];
86
90
  /** Host-verified per-run overrides; false dimensions must be enforced or launch refused. */
87
91
  nativeCapabilities?: Partial<import('./native-tool-policy.js').NativeCapabilities>;
88
92
  /** Explicit host grant for shell/direct edits. false must be enforced or launch refused.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/agent-runtime",
3
- "version": "0.6.12",
3
+ "version": "0.6.15-rc.1",
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": {
@@ -18,7 +18,8 @@
18
18
  "./model-catalog/cache": "universal",
19
19
  "./providers/sse-decode": "universal",
20
20
  "./model-discovery": "node",
21
- "./model-selection": "universal"
21
+ "./model-selection": "universal",
22
+ "./ai-trace": "universal"
22
23
  },
23
24
  "isolation": {
24
25
  "forbidden": {
@@ -68,6 +69,11 @@
68
69
  "types": "./dist/model-discovery.d.ts",
69
70
  "import": "./dist/model-discovery.js",
70
71
  "default": "./dist/model-discovery.js"
72
+ },
73
+ "./ai-trace": {
74
+ "types": "./dist/ai-trace/index.d.ts",
75
+ "import": "./dist/ai-trace/index.js",
76
+ "default": "./dist/ai-trace/index.js"
71
77
  }
72
78
  },
73
79
  "typesVersions": {
@@ -107,19 +113,19 @@
107
113
  },
108
114
  "devDependencies": {
109
115
  "@vitest/coverage-v8": "^2.1.9",
110
- "@jini-ai/core": "^0.6.12",
111
- "@jini-ai/integrations": "^0.6.12",
112
- "@jini-ai/platform": "^0.6.12"
116
+ "@jini-ai/core": "^0.6.13",
117
+ "@jini-ai/platform": "^0.6.15-rc.1",
118
+ "@jini-ai/integrations": "^0.6.15-rc.1"
113
119
  },
114
120
  "dependencies": {
115
- "@jini-ai/core": "^0.6.12",
116
- "@jini-ai/oauth": "^0.6.12",
117
- "@jini-ai/protocol": "^0.6.12"
121
+ "@jini-ai/oauth": "^0.6.15-rc.1",
122
+ "@jini-ai/protocol": "^0.6.15-rc.1",
123
+ "@jini-ai/core": "^0.6.15-rc.1"
118
124
  },
119
125
  "peerDependencies": {
120
- "@jini-ai/integrations": "^0.6.10",
126
+ "@jini-ai/integrations": "^0.6.15-rc.1",
121
127
  "@github/copilot-sdk": "*",
122
- "@jini-ai/platform": "^0.6.10"
128
+ "@jini-ai/platform": "^0.6.15-rc.1"
123
129
  },
124
130
  "peerDependenciesMeta": {
125
131
  "@jini-ai/integrations": {