@jini-ai/agent-runtime 0.7.1 → 0.7.3-next.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 (397) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/README.md +1 -0
  3. package/dist/acp-model-probe.d.ts +2 -3
  4. package/dist/acp-model-probe.js +1 -1
  5. package/dist/agent-protocol/acp/account-failure.d.ts +3 -1
  6. package/dist/agent-protocol/acp/account-failure.js +1 -1
  7. package/dist/agent-protocol/acp/constants.d.ts +3 -1
  8. package/dist/agent-protocol/acp/constants.js +2 -0
  9. package/dist/agent-protocol/acp/index.d.ts +2 -1
  10. package/dist/agent-protocol/acp/index.js +2 -1
  11. package/dist/agent-protocol/acp/json.d.ts +26 -7
  12. package/dist/agent-protocol/acp/json.js +11 -11
  13. package/dist/agent-protocol/acp/models.d.ts +26 -6
  14. package/dist/agent-protocol/acp/models.js +157 -129
  15. package/dist/agent-protocol/acp/rpc.d.ts +37 -9
  16. package/dist/agent-protocol/acp/rpc.js +19 -16
  17. package/dist/agent-protocol/acp/session-params.d.ts +4 -1
  18. package/dist/agent-protocol/acp/session-params.js +1 -1
  19. package/dist/agent-protocol/acp/session-permission.d.ts +13 -0
  20. package/dist/agent-protocol/acp/session-permission.js +110 -0
  21. package/dist/agent-protocol/acp/session-results.d.ts +61 -0
  22. package/dist/agent-protocol/acp/session-results.js +226 -0
  23. package/dist/agent-protocol/acp/session-run.d.ts +92 -0
  24. package/dist/agent-protocol/acp/session-run.js +555 -0
  25. package/dist/agent-protocol/acp/session-state.d.ts +9 -0
  26. package/dist/agent-protocol/acp/session-state.js +29 -0
  27. package/dist/agent-protocol/acp/session-text-updates.d.ts +56 -0
  28. package/dist/agent-protocol/acp/session-text-updates.js +119 -0
  29. package/dist/agent-protocol/acp/session-tool-updates.d.ts +21 -0
  30. package/dist/agent-protocol/acp/session-tool-updates.js +90 -0
  31. package/dist/agent-protocol/acp/session-types.d.ts +166 -0
  32. package/dist/agent-protocol/acp/session-types.js +4 -0
  33. package/dist/agent-protocol/acp/session.d.ts +4 -280
  34. package/dist/agent-protocol/acp/session.js +65 -998
  35. package/dist/agent-protocol/acp/text-suppression.d.ts +5 -1
  36. package/dist/agent-protocol/acp/text-suppression.js +1 -1
  37. package/dist/agent-protocol/acp/updates.d.ts +43 -12
  38. package/dist/agent-protocol/acp/updates.js +34 -34
  39. package/dist/agent-protocol/core/json-line-stream.d.ts +133 -36
  40. package/dist/agent-protocol/core/json-line-stream.js +62 -62
  41. package/dist/agent-protocol/pi-rpc/events.d.ts +14 -4
  42. package/dist/agent-protocol/pi-rpc/events.js +14 -14
  43. package/dist/agent-protocol/pi-rpc/internal.d.ts +9 -3
  44. package/dist/agent-protocol/pi-rpc/internal.js +3 -3
  45. package/dist/agent-protocol/pi-rpc/models.d.ts +3 -17
  46. package/dist/agent-protocol/pi-rpc/models.js +1 -45
  47. package/dist/agent-protocol/pi-rpc/session.d.ts +36 -12
  48. package/dist/agent-protocol/pi-rpc/session.js +134 -122
  49. package/dist/amr-model-cache.d.ts +1 -1
  50. package/dist/anthropic-live-models.d.ts +8 -3
  51. package/dist/anthropic-live-models.js +0 -0
  52. package/dist/auth-common.d.ts +2 -0
  53. package/dist/auth-common.js +2 -0
  54. package/dist/auth.d.ts +7 -34
  55. package/dist/auth.js +25 -139
  56. package/dist/capabilities.d.ts +1 -1
  57. package/dist/claude-code-models.d.ts +13 -5
  58. package/dist/claude-code-models.js +12 -10
  59. package/dist/claude-filesystem-policy.d.ts +1 -1
  60. package/dist/claude-stream-frames.d.ts +125 -0
  61. package/dist/claude-stream-frames.js +327 -0
  62. package/dist/claude-stream-handler.d.ts +19 -0
  63. package/dist/claude-stream-handler.js +480 -0
  64. package/dist/claude-stream.d.ts +3 -72
  65. package/dist/claude-stream.js +2 -801
  66. package/dist/core/model-discovery-shared.d.ts +14 -8
  67. package/dist/core/model-discovery-shared.js +6 -9
  68. package/dist/core/omit-keys.d.ts +4 -1
  69. package/dist/core/omit-keys.js +1 -1
  70. package/dist/defs/aider/executable.d.ts +2 -0
  71. package/dist/defs/aider/executable.js +2 -0
  72. package/dist/defs/aider/model-discovery.d.ts +3 -0
  73. package/dist/defs/aider/model-discovery.js +6 -0
  74. package/dist/defs/aider.d.ts +10 -10
  75. package/dist/defs/amp/index.d.ts +35 -0
  76. package/dist/defs/amp/index.js +75 -0
  77. package/dist/defs/amp.d.ts +1 -34
  78. package/dist/defs/amp.js +1 -74
  79. package/dist/defs/amr/executable-resolution.d.ts +7 -0
  80. package/dist/defs/amr/executable-resolution.js +50 -0
  81. package/dist/defs/amr/executable.d.ts +2 -0
  82. package/dist/defs/amr/executable.js +2 -0
  83. package/dist/defs/amr/index.d.ts +69 -0
  84. package/dist/defs/amr/index.js +279 -0
  85. package/dist/defs/amr/model-discovery.d.ts +3 -0
  86. package/dist/defs/amr/model-discovery.js +4 -0
  87. package/dist/defs/amr.d.ts +1 -68
  88. package/dist/defs/amr.js +1 -291
  89. package/dist/defs/antigravity/auth.d.ts +14 -0
  90. package/dist/defs/antigravity/auth.js +47 -0
  91. package/dist/defs/antigravity/index.d.ts +9 -9
  92. package/dist/defs/antigravity/index.js +3 -3
  93. package/dist/defs/antigravity/model-discovery.d.ts +3 -0
  94. package/dist/defs/antigravity/model-discovery.js +5 -0
  95. package/dist/defs/auggie/executable.d.ts +2 -0
  96. package/dist/defs/auggie/executable.js +2 -0
  97. package/dist/defs/auggie.d.ts +13 -13
  98. package/dist/defs/auggie.js +2 -9
  99. package/dist/defs/claude/auth.d.ts +15 -0
  100. package/dist/defs/claude/auth.js +47 -0
  101. package/dist/defs/claude/executable.d.ts +2 -0
  102. package/dist/defs/claude/executable.js +2 -0
  103. package/dist/defs/claude/model-discovery.d.ts +3 -0
  104. package/dist/defs/claude/model-discovery.js +20 -0
  105. package/dist/defs/claude-compatible-args.d.ts +10 -6
  106. package/dist/defs/claude-compatible-args.js +5 -5
  107. package/dist/defs/claude.d.ts +11 -11
  108. package/dist/defs/claude.js +5 -4
  109. package/dist/defs/cline/executable.d.ts +2 -0
  110. package/dist/defs/cline/executable.js +2 -0
  111. package/dist/defs/cline.d.ts +13 -13
  112. package/dist/defs/cline.js +2 -9
  113. package/dist/defs/codebuddy/executable.d.ts +2 -0
  114. package/dist/defs/codebuddy/executable.js +2 -0
  115. package/dist/defs/codebuddy/index.d.ts +48 -0
  116. package/dist/defs/codebuddy/index.js +121 -0
  117. package/dist/defs/codebuddy/model-discovery.d.ts +3 -0
  118. package/dist/defs/codebuddy/model-discovery.js +5 -0
  119. package/dist/defs/codebuddy.d.ts +1 -47
  120. package/dist/defs/codebuddy.js +1 -120
  121. package/dist/defs/codex/auth.d.ts +4 -0
  122. package/dist/defs/codex/auth.js +2 -0
  123. package/dist/defs/codex/event-stream.d.ts +10 -0
  124. package/dist/defs/codex/event-stream.js +353 -0
  125. package/dist/defs/codex/executable-resolution.d.ts +7 -0
  126. package/dist/defs/codex/executable-resolution.js +37 -0
  127. package/dist/defs/codex/executable.d.ts +2 -0
  128. package/dist/defs/codex/executable.js +2 -0
  129. package/dist/defs/codex/launch.d.ts +3 -0
  130. package/dist/defs/codex/launch.js +155 -0
  131. package/dist/defs/codex/model-discovery.d.ts +3 -0
  132. package/dist/defs/codex/model-discovery.js +11 -0
  133. package/dist/defs/codex/options.d.ts +11 -0
  134. package/dist/defs/codex/options.js +5 -0
  135. package/dist/defs/codex.d.ts +18 -11
  136. package/dist/defs/codex.js +32 -29
  137. package/dist/defs/crush/executable.d.ts +2 -0
  138. package/dist/defs/crush/executable.js +2 -0
  139. package/dist/defs/crush/model-discovery.d.ts +3 -0
  140. package/dist/defs/crush/model-discovery.js +6 -0
  141. package/dist/defs/crush.d.ts +10 -10
  142. package/dist/defs/cursor-agent/auth.d.ts +13 -0
  143. package/dist/defs/cursor-agent/auth.js +22 -0
  144. package/dist/defs/cursor-agent/event-stream.d.ts +8 -0
  145. package/dist/defs/cursor-agent/event-stream.js +104 -0
  146. package/dist/defs/cursor-agent/executable.d.ts +2 -0
  147. package/dist/defs/cursor-agent/executable.js +2 -0
  148. package/dist/defs/cursor-agent/model-discovery.d.ts +3 -0
  149. package/dist/defs/cursor-agent/model-discovery.js +5 -0
  150. package/dist/defs/cursor-agent.d.ts +11 -13
  151. package/dist/defs/cursor-agent.js +1 -1
  152. package/dist/defs/deepseek/auth.d.ts +13 -0
  153. package/dist/defs/deepseek/auth.js +18 -0
  154. package/dist/defs/deepseek/executable.d.ts +2 -0
  155. package/dist/defs/deepseek/executable.js +2 -0
  156. package/dist/defs/deepseek/model-discovery.d.ts +3 -0
  157. package/dist/defs/deepseek/model-discovery.js +5 -0
  158. package/dist/defs/deepseek.d.ts +10 -10
  159. package/dist/defs/devin/executable.d.ts +2 -0
  160. package/dist/defs/devin/executable.js +2 -0
  161. package/dist/defs/devin.d.ts +15 -15
  162. package/dist/defs/devin.js +3 -10
  163. package/dist/defs/droid/executable.d.ts +2 -0
  164. package/dist/defs/droid/executable.js +2 -0
  165. package/dist/defs/droid/model-discovery.d.ts +3 -0
  166. package/dist/defs/droid/model-discovery.js +5 -0
  167. package/dist/defs/droid.d.ts +10 -10
  168. package/dist/defs/gemini/event-stream.d.ts +14 -0
  169. package/dist/defs/gemini/event-stream.js +193 -0
  170. package/dist/defs/goose/executable.d.ts +2 -0
  171. package/dist/defs/goose/executable.js +2 -0
  172. package/dist/defs/goose.d.ts +13 -13
  173. package/dist/defs/goose.js +2 -9
  174. package/dist/defs/grok-build/model-discovery.d.ts +3 -0
  175. package/dist/defs/grok-build/model-discovery.js +5 -0
  176. package/dist/defs/grok-build.d.ts +10 -10
  177. package/dist/defs/hermes/executable.d.ts +2 -0
  178. package/dist/defs/hermes/executable.js +2 -0
  179. package/dist/defs/hermes/index.d.ts +34 -0
  180. package/dist/defs/hermes/index.js +57 -0
  181. package/dist/defs/hermes.d.ts +1 -33
  182. package/dist/defs/hermes.js +1 -56
  183. package/dist/defs/index.d.ts +1 -0
  184. package/dist/defs/index.js +1 -0
  185. package/dist/defs/kilo/executable.d.ts +2 -0
  186. package/dist/defs/kilo/executable.js +2 -0
  187. package/dist/defs/kilo.d.ts +13 -13
  188. package/dist/defs/kilo.js +2 -9
  189. package/dist/defs/kimi/event-stream.d.ts +3 -0
  190. package/dist/defs/kimi/event-stream.js +46 -0
  191. package/dist/defs/kimi/executable.d.ts +2 -0
  192. package/dist/defs/kimi/executable.js +2 -0
  193. package/dist/defs/kimi.d.ts +13 -13
  194. package/dist/defs/kimi.js +2 -9
  195. package/dist/defs/kiro/executable.d.ts +2 -0
  196. package/dist/defs/kiro/executable.js +2 -0
  197. package/dist/defs/kiro.d.ts +13 -13
  198. package/dist/defs/kiro.js +2 -9
  199. package/dist/defs/mimo/executable.d.ts +2 -0
  200. package/dist/defs/mimo/executable.js +2 -0
  201. package/dist/defs/mimo/model-discovery.d.ts +3 -0
  202. package/dist/defs/mimo/model-discovery.js +7 -0
  203. package/dist/defs/mimo.d.ts +10 -10
  204. package/dist/defs/opencode/event-stream.d.ts +8 -0
  205. package/dist/defs/opencode/event-stream.js +108 -0
  206. package/dist/defs/opencode/executable.d.ts +2 -0
  207. package/dist/defs/opencode/executable.js +2 -0
  208. package/dist/defs/opencode/model-discovery.d.ts +4 -0
  209. package/dist/defs/opencode/model-discovery.js +14 -0
  210. package/dist/defs/opencode-acp.d.ts +42 -0
  211. package/dist/defs/opencode-acp.js +23 -0
  212. package/dist/defs/opencode.d.ts +9 -9
  213. package/dist/defs/pi/executable.d.ts +2 -0
  214. package/dist/defs/pi/executable.js +2 -0
  215. package/dist/defs/pi/model-discovery.d.ts +4 -0
  216. package/dist/defs/pi/model-discovery.js +16 -0
  217. package/dist/defs/pi/options.d.ts +11 -0
  218. package/dist/defs/pi/options.js +5 -0
  219. package/dist/defs/pi.d.ts +10 -10
  220. package/dist/defs/qoder/executable.d.ts +2 -0
  221. package/dist/defs/qoder/executable.js +2 -0
  222. package/dist/defs/qoder/model-discovery.d.ts +3 -0
  223. package/dist/defs/qoder/model-discovery.js +7 -0
  224. package/dist/defs/qoder.d.ts +9 -9
  225. package/dist/defs/qwen/executable.d.ts +2 -0
  226. package/dist/defs/qwen/executable.js +2 -0
  227. package/dist/defs/qwen/model-discovery.d.ts +3 -0
  228. package/dist/defs/qwen/model-discovery.js +7 -0
  229. package/dist/defs/qwen.d.ts +10 -10
  230. package/dist/defs/reasonix/auth.d.ts +13 -0
  231. package/dist/defs/reasonix/auth.js +18 -0
  232. package/dist/defs/reasonix/executable.d.ts +2 -0
  233. package/dist/defs/reasonix/executable.js +2 -0
  234. package/dist/defs/reasonix.d.ts +13 -13
  235. package/dist/defs/reasonix.js +2 -9
  236. package/dist/defs/shared.d.ts +10 -2
  237. package/dist/defs/shared.js +5 -1
  238. package/dist/defs/trae-cli/executable.d.ts +2 -0
  239. package/dist/defs/trae-cli/executable.js +2 -0
  240. package/dist/defs/trae-cli.d.ts +15 -15
  241. package/dist/defs/trae-cli.js +2 -9
  242. package/dist/defs/vibe/executable.d.ts +2 -0
  243. package/dist/defs/vibe/executable.js +2 -0
  244. package/dist/defs/vibe.d.ts +13 -13
  245. package/dist/defs/vibe.js +2 -9
  246. package/dist/detection.d.ts +4 -3
  247. package/dist/detection.js +22 -22
  248. package/dist/diagnostics.d.ts +4 -4
  249. package/dist/diagnostics.js +2 -2
  250. package/dist/env.js +2 -1
  251. package/dist/executable-helpers.d.ts +21 -0
  252. package/dist/executable-helpers.js +2 -0
  253. package/dist/executables.d.ts +2 -2
  254. package/dist/executables.js +68 -114
  255. package/dist/index.d.ts +6 -2
  256. package/dist/index.js +5 -1
  257. package/dist/invocation.d.ts +22 -6
  258. package/dist/invocation.js +19 -17
  259. package/dist/json-event-stream-shared.d.ts +81 -0
  260. package/dist/json-event-stream-shared.js +147 -0
  261. package/dist/json-event-stream.d.ts +2 -4
  262. package/dist/json-event-stream.js +15 -940
  263. package/dist/launch.d.ts +1 -9
  264. package/dist/launch.js +6 -155
  265. package/dist/log-file.d.ts +2 -8
  266. package/dist/log-file.js +1 -1
  267. package/dist/mcp.d.ts +2 -2
  268. package/dist/mcp.js +1 -1
  269. package/dist/mmd-routes.d.ts +7 -7
  270. package/dist/mmd-routes.js +19 -27
  271. package/dist/model-discovery-adapters.d.ts +47 -11
  272. package/dist/model-discovery-adapters.js +47 -41
  273. package/dist/model-discovery-config-types.d.ts +44 -0
  274. package/dist/model-discovery-config-types.js +20 -0
  275. package/dist/model-discovery-config.d.ts +19 -11
  276. package/dist/model-discovery-config.js +64 -87
  277. package/dist/model-discovery-native.d.ts +2 -1
  278. package/dist/model-discovery-native.js +3 -3
  279. package/dist/model-discovery-sdk.d.ts +6 -2
  280. package/dist/model-discovery-sdk.js +2 -2
  281. package/dist/model-discovery-types.d.ts +1 -138
  282. package/dist/model-discovery-yaml.d.ts +3 -1
  283. package/dist/model-discovery-yaml.js +1 -1
  284. package/dist/model-discovery.d.ts +15 -5
  285. package/dist/model-discovery.js +119 -105
  286. package/dist/model-loading-state.d.ts +1 -1
  287. package/dist/model-loading-state.js +1 -1
  288. package/dist/model-registry.d.ts +5 -5
  289. package/dist/model-registry.js +7 -6
  290. package/dist/models.d.ts +4 -3
  291. package/dist/models.js +2 -2
  292. package/dist/native-permissions.d.ts +47 -0
  293. package/dist/native-permissions.js +80 -0
  294. package/dist/native-runtime.d.ts +11 -8
  295. package/dist/native-runtime.js +8 -4
  296. package/dist/native-tool-policy.d.ts +1 -40
  297. package/dist/opencode-log.d.ts +3 -3
  298. package/dist/opencode-log.js +5 -3
  299. package/dist/paths.d.ts +1 -1
  300. package/dist/paths.js +1 -1
  301. package/dist/pi-models.d.ts +12 -2
  302. package/dist/pi-models.js +11 -1
  303. package/dist/prompt-augmenter.d.ts +1 -37
  304. package/dist/prompt-augmenter.js +0 -6
  305. package/dist/prompt-budget.d.ts +3 -3
  306. package/dist/prompt-budget.js +2 -2
  307. package/dist/prompt-file.d.ts +2 -6
  308. package/dist/prompt-file.js +1 -1
  309. package/dist/providers/aihubmix.d.ts +8 -8
  310. package/dist/providers/aihubmix.js +8 -8
  311. package/dist/providers/anthropic-messages.d.ts +22 -23
  312. package/dist/providers/anthropic-messages.js +26 -53
  313. package/dist/providers/azure-chat.d.ts +7 -6
  314. package/dist/providers/azure-chat.js +9 -6
  315. package/dist/providers/connection-guard.d.ts +3 -9
  316. package/dist/providers/connection-guard.js +6 -14
  317. package/dist/providers/connection-test.d.ts +1 -2
  318. package/dist/providers/connection-test.js +51 -51
  319. package/dist/providers/credentials.d.ts +59 -0
  320. package/dist/providers/credentials.js +80 -0
  321. package/dist/providers/elevenlabs.d.ts +2 -6
  322. package/dist/providers/elevenlabs.js +2 -31
  323. package/dist/providers/google-messages.d.ts +11 -10
  324. package/dist/providers/google-messages.js +16 -35
  325. package/dist/providers/google-schema.d.ts +1 -1
  326. package/dist/providers/google-schema.js +1 -1
  327. package/dist/providers/google.d.ts +6 -6
  328. package/dist/providers/google.js +6 -6
  329. package/dist/providers/index.d.ts +5 -2
  330. package/dist/providers/index.js +5 -2
  331. package/dist/providers/model-catalog.d.ts +4 -9
  332. package/dist/providers/model-catalog.js +3 -11
  333. package/dist/providers/oauth-callback-server.js +93 -87
  334. package/dist/providers/oauth-provider.d.ts +1 -1
  335. package/dist/providers/oauth-provider.js +1 -1
  336. package/dist/providers/oauth-tokens.d.ts +5 -5
  337. package/dist/providers/oauth-tokens.js +8 -9
  338. package/dist/providers/ollama-chat.d.ts +13 -12
  339. package/dist/providers/ollama-chat.js +15 -24
  340. package/dist/providers/openai-chat-request.d.ts +34 -0
  341. package/dist/providers/openai-chat-request.js +152 -0
  342. package/dist/providers/openai-chat-stream.d.ts +48 -0
  343. package/dist/providers/openai-chat-stream.js +89 -0
  344. package/dist/providers/openai-chat-tool-results.d.ts +81 -0
  345. package/dist/providers/openai-chat-tool-results.js +124 -0
  346. package/dist/providers/openai-chat-types.d.ts +180 -0
  347. package/dist/providers/openai-chat-types.js +3 -0
  348. package/dist/providers/openai-chat.d.ts +5 -405
  349. package/dist/providers/openai-chat.js +9 -388
  350. package/dist/providers/pkce.d.ts +1 -1
  351. package/dist/providers/pkce.js +1 -1
  352. package/dist/providers/provider-url.d.ts +6 -0
  353. package/dist/providers/provider-url.js +9 -0
  354. package/dist/providers/response-text.d.ts +4 -0
  355. package/dist/providers/response-text.js +16 -0
  356. package/dist/providers/sse-decode.d.ts +4 -0
  357. package/dist/providers/sse-decode.js +11 -0
  358. package/dist/providers/token-params.d.ts +5 -5
  359. package/dist/providers/token-params.js +5 -5
  360. package/dist/providers/tool-loop-verdict.d.ts +1 -1
  361. package/dist/providers/tool-loop-verdict.js +1 -1
  362. package/dist/providers/tool-turn-types.d.ts +2 -1
  363. package/dist/providers/tool-turn.js +30 -50
  364. package/dist/providers/turn-end-guard.d.ts +4 -1
  365. package/dist/providers/turn-end-guard.js +1 -1
  366. package/dist/qoder-stream.d.ts +1 -1
  367. package/dist/qoder-stream.js +1 -1
  368. package/dist/registry.d.ts +5 -5
  369. package/dist/registry.js +4 -4
  370. package/dist/role-marker-guard.d.ts +13 -1
  371. package/dist/role-marker-guard.js +15 -1
  372. package/dist/runtime-def-binding.d.ts +15 -0
  373. package/dist/runtime-def-binding.js +19 -0
  374. package/dist/runtime-port-bindings.d.ts +181 -0
  375. package/dist/runtime-port-bindings.js +95 -0
  376. package/dist/runtime-state.d.ts +2 -11
  377. package/dist/runtime-state.js +0 -13
  378. package/dist/types.d.ts +1 -454
  379. package/package.json +27 -15
  380. package/dist/ai-trace/capture.d.ts +0 -17
  381. package/dist/ai-trace/capture.js +0 -43
  382. package/dist/ai-trace/classify.d.ts +0 -12
  383. package/dist/ai-trace/classify.js +0 -16
  384. package/dist/ai-trace/index.d.ts +0 -13
  385. package/dist/ai-trace/index.js +0 -6
  386. package/dist/ai-trace/recorder.d.ts +0 -64
  387. package/dist/ai-trace/recorder.js +0 -258
  388. package/dist/ai-trace/sinks.d.ts +0 -51
  389. package/dist/ai-trace/sinks.js +0 -153
  390. package/dist/ai-trace/types.d.ts +0 -123
  391. package/dist/ai-trace/types.js +0 -17
  392. package/dist/ai-trace/usage.d.ts +0 -13
  393. package/dist/ai-trace/usage.js +0 -45
  394. package/dist/model-contracts.d.ts +0 -29
  395. package/dist/model-contracts.js +0 -2
  396. package/dist/providers/types.d.ts +0 -36
  397. package/dist/providers/types.js +0 -13
@@ -21,17 +21,4 @@ export function createAgentRuntimeState(_required, _optional = {}) {
21
21
  return state;
22
22
  }
23
23
  export const defaultRuntimeState = createAgentRuntimeState({});
24
- /** Bind model probes and the argument builder to the host transport, capability state and plugin policy.
25
- * Returns a definition copy without mutating the registry. @complexity O(1). */
26
- export function bindRuntimeAgentDef({ def, state }, { codexDisablePlugins } = {}) {
27
- const fetchModels = def.fetchModels;
28
- const boundFetchModels = fetchModels
29
- ? (required, optional = {}) => fetchModels(required, {
30
- ...optional, ...(state.acpModelProbe ? { acpModelProbe: state.acpModelProbe } : {}),
31
- }) : undefined;
32
- return { ...def, ...(boundFetchModels ? { fetchModels: boundFetchModels } : {}), buildArgs: (required, optional = {}) => def.buildArgs(required, {
33
- ...optional, options: { ...optional.options, capabilities: state.capabilities.get(def.id) ?? {},
34
- ...(codexDisablePlugins !== undefined ? { codexDisablePlugins } : {}) },
35
- }) };
36
- }
37
24
  //# sourceMappingURL=runtime-state.js.map
package/dist/types.d.ts CHANGED
@@ -11,437 +11,9 @@
11
11
  * Ported from OD's `apps/daemon/src/runtimes/types.ts`. Product-neutral
12
12
  * as found — see `archived provenance ledger` for the full provenance table.
13
13
  */
14
- import type { AgentModelDiscoveryPort, ModelCatalogSnapshot, DefaultModelResolution } from './model-discovery-types.js';
14
+ import type { DefaultModelResolution, ModelCatalogSnapshot, RuntimeAgentDef, RuntimeModelOption, RuntimeModelSource } from '@jini-ai/core/contracts/agents';
15
15
  import type { ExecFileOptions } from 'node:child_process';
16
16
  import type { AgentDiagnostic } from '@jini-ai/protocol';
17
- import type { RuntimeEnv, RuntimeModelOption, RuntimeReasoningOption } from './model-contracts.js';
18
- export type { RuntimeEnv, RuntimeModelOption, RuntimeReasoningOption } from './model-contracts.js';
19
- export type RuntimeModelSource = 'live' | 'fallback';
20
- /**
21
- * Declares that a runtime carries its reasoning-effort choice INSIDE the model
22
- * id — as a trailing `-<level>` on the slug — rather than in a flag of its own.
23
- *
24
- * The distinction is not cosmetic, and it is why this is a separate field from
25
- * `RuntimeAgentDef.reasoningOptions` rather than another shape of it:
26
- *
27
- * - A `reasoningOptions` def (claude, codex) has ONE effort vocabulary that
28
- * applies to every model it can run, and the chosen level travels to the
29
- * CLI as its own argv (`--effort high`, `-c model_reasoning_effort="high"`)
30
- * via `RuntimeBuildOptions.reasoning`.
31
- * - A `reasoningInModelId` def (antigravity) has NO effort flag at all. Its
32
- * level is already part of `--model`'s value, so `buildArgs` emits nothing
33
- * extra, and — critically — **the available levels differ per base model**.
34
- * Verified live against `agy models` (v1.1.25): `gemini-3.8-flash` has
35
- * high/medium/low, `gemini-3.1-pro` has ONLY high and low,
36
- * `gpt-oss-120b` has only medium, and `claude-sonnet-4-6` has none.
37
- * `agy --model gemini-3.1-pro-medium` is rejected outright.
38
- *
39
- * So this field declares only the suffix VOCABULARY — which trailing tokens
40
- * are effort levels at all, in the order a picker should offer them. Which of
41
- * them exist for a given base model is DERIVED from that runtime's own model
42
- * list (live or fallback), never listed here: a hand-written per-model table
43
- * would be a second copy of the CLI's catalog, free to drift the moment
44
- * upstream adds a variant.
45
- *
46
- * `levels` doubles as the guard against over-parsing: `claude-opus-4-6-thinking`
47
- * ends in `-thinking`, which is NOT an effort level, so it must stay part of
48
- * the base id. Only a trailing token that appears in `levels` is a level.
49
- */
50
- export type RuntimeReasoningInModelId = {
51
- /** The recognized effort suffixes, in picker display order. */
52
- levels: readonly RuntimeReasoningOption[];
53
- };
54
- export type RuntimeBuildOptions = {
55
- /** Host folder boundary, independent of native grants; unsupported providers disclose the exception. */
56
- filesystemRoot?: string;
57
- /** Executor-created private temporary directory inside the host root; never a shared temp root. */
58
- filesystemTempDir?: string;
59
- /** Shared host/login temp roots denied even when child TMPDIR is replaced. */
60
- filesystemSharedTempRoots?: readonly string[];
61
- /** Executor-created per-run CLAUDE_CODE_TMPDIR; its /claude-<uid> child must fit 44 bytes. Absent grants no runtime scratch. */
62
- filesystemRuntimeTempBase?: string;
63
- /** Executor-resolved CLI/runtime files; read-only exceptions for sandboxed commands. */
64
- filesystemRuntimeReadPaths?: readonly string[];
65
- /** Host-validated owner-picked folders outside filesystemRoot: natively readable, never writable. */
66
- filesystemReadOnlyDirs?: readonly string[];
67
- /** Host-verified per-run overrides; false dimensions must be enforced or launch refused. */
68
- nativeCapabilities?: Partial<import('./native-tool-policy.js').NativeCapabilities>;
69
- /** Explicit host grant for shell/direct edits. false must be enforced or launch refused.
70
- * Does not lift environment, MCP, path, approval or sandbox security controls. */
71
- nativeToolAccess?: boolean;
72
- /** Explicit trusted-host grant for hand-run CLI configuration and capabilities. */
73
- cliParity?: boolean;
74
- /** Explicit host/run policy; environment defaults belong to native composition. */
75
- codexDisablePlugins?: boolean;
76
- /** Host-scoped capability flags; absent retains the published compatibility cache. */
77
- capabilities?: RuntimeCapabilityMap;
78
- model?: string | null;
79
- reasoning?: string | null;
80
- permissionMode?: 'bypass' | 'restricted';
81
- systemPromptOverlay?: string | null;
82
- /**
83
- * Tool names this run's CLI should refuse to execute, forwarded to whichever def-native flag
84
- * expresses a deny-list — today, `claude`'s own `--disallowedTools` (verified against installed
85
- * Claude Code 2.1.263: `--disallowedTools, --disallowed-tools <tools...>`, "Comma or
86
- * space-separated list of tool names to deny"). This is a `@jini-ai/agent-runtime`-level
87
- * *mechanism* only: no product's tool policy is baked in here (not one host's Bash-forbid opinion,
88
- * not anyone else's) — the caller decides which names to pass. A def whose CLI has no equivalent
89
- * flag simply ignores this field, same as `systemPromptOverlay` on a def with no overlay
90
- * delivery. `undefined`/empty means no restriction — byte-identical to today's behavior (every
91
- * tool the CLI's own grant already allows stays allowed).
92
- */
93
- disallowedTools?: readonly string[];
94
- /**
95
- * Same mechanism as {@link disallowedTools}, for a def-native explicit allow-list flag — today,
96
- * `claude`'s own `--allowedTools`. Rarely set alongside `disallowedTools` at once; the underlying
97
- * CLI decides how an allow-list and a deny-list interact when both are present.
98
- * `undefined`/empty means no restriction, same as today.
99
- */
100
- allowedTools?: readonly string[];
101
- /**
102
- * Which of the CLI's own settings layers to load — today `claude`'s `--setting-sources`
103
- * (`user`, `project`, `local`). An EMPTY list loads none: no settings-file hooks, no plugins the
104
- * operator enabled for themselves, no personal model/effort defaults. For a host that embeds the
105
- * CLI as a product assistant, so the operator's personal setup (e.g. SessionStart hooks that
106
- * inject their own instructions) never reaches the product's runs. Unlike staging a separate
107
- * `CLAUDE_CONFIG_DIR`, this keeps the CLI's Keychain login. `undefined` = the CLI's default (all).
108
- */
109
- settingSources?: readonly string[];
110
- /**
111
- * Extra settings for this run — today `claude`'s `--settings <file-or-json>`, which the CLI applies
112
- * on top of (and independently of) {@link settingSources}. Lets a host that loads no settings layers
113
- * still hand the run the few it wants, e.g. one PreToolUse hook. `undefined`/empty = no flag.
114
- */
115
- settings?: string;
116
- /**
117
- * Browser integration for this run — today `claude`'s `--chrome` (true) / `--no-chrome` (false),
118
- * "Enable/Disable Claude in Chrome integration" in Claude Code 2.1.307's `-p --help`. A mechanism
119
- * only: the host decides. Probe-gated like `--effort`, so a CLI without the flag gets neither.
120
- * `undefined` = no flag, byte-identical to before; defs without `supportsChromeIntegration` ignore it.
121
- */
122
- chromeIntegration?: boolean;
123
- };
124
- export type RuntimeContext = {
125
- cwd?: string;
126
- hasPriorAssistantTurn?: boolean;
127
- agentLogFilePath?: string;
128
- promptFilePath?: string;
129
- resumeSessionId?: string | null;
130
- newSessionId?: string;
131
- mcpJsonPath?: string;
132
- };
133
- export type RuntimeCapabilityMap = Record<string, boolean>;
134
- export type RuntimeListModels = {
135
- args: string[];
136
- timeoutMs: number;
137
- parse: (requiredArgs: {
138
- stdout: string;
139
- }) => RuntimeModelOption[] | null;
140
- };
141
- export type RuntimePromptBudgetError = {
142
- code: 'AGENT_PROMPT_TOO_LARGE';
143
- message: string;
144
- bytes?: number;
145
- commandLineLength?: number;
146
- limit: number;
147
- };
148
- /**
149
- * How the caller should treat an adapter's raw stdout before text forwarding or structured parsing.
150
- *
151
- * Declared as a discriminated union rather than two independent flags
152
- * (`stdoutBuffering` + `sanitizeStdout`) on purpose: a sanitizer is only
153
- * *meaningful* on the buffered path, because a pattern to be redacted can
154
- * straddle two `'data'` chunks — the exact case that motivates buffering at
155
- * all. Two flat fields would let a def declare `sanitize` alongside live
156
- * streaming, where the caller could not honor it; the confidentiality gap
157
- * would then *look* closed in the def while leaking at runtime. The union
158
- * makes that combination unrepresentable.
159
- *
160
- * `undefined` on a def means `{buffering: 'live'}` — today's behavior for
161
- * every adapter, and the only sane default: a CLI that streams tokens should
162
- * reach the user as it streams.
163
- */
164
- export type RuntimeStdoutPolicy =
165
- /**
166
- * Forward every stdout chunk to the client as it arrives. The default;
167
- * what a streaming CLI's own output cadence implies.
168
- */
169
- {
170
- readonly buffering: 'live';
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
- }
179
- /**
180
- * Accumulate every stdout chunk and forward the whole thing exactly once,
181
- * after the child process closes. For adapters that can print a secret
182
- * (e.g. an interactive OAuth URL) to stdout and *still exit 0*, where the
183
- * only safe moment to decide what the user sees is after the output is
184
- * complete.
185
- */
186
- | {
187
- readonly buffering: 'until-close';
188
- /**
189
- * Last transform applied to the fully-accumulated stdout before it is
190
- * emitted. Receives the concatenation of every chunk; returns what the
191
- * client may see. Must be pure and must not throw — the caller has
192
- * nothing better to fall back on than the unsanitized text, so a
193
- * throwing sanitizer is the leak it was added to prevent.
194
- */
195
- readonly sanitize?: (requiredArgs: {
196
- fullText: string;
197
- }) => string;
198
- };
199
- /**
200
- * Context for {@link RuntimeLock.acquire}, so a def can decide whether the
201
- * side effect its lock guards will happen for *this* spawn at all — and skip
202
- * serializing when it will not.
203
- */
204
- export type RuntimeLockAcquireContext = {
205
- /**
206
- * The model id the caller is about to pass to `buildArgs` as
207
- * `RuntimeBuildOptions.model`; `undefined` when the caller selected none.
208
- */
209
- readonly model: string | undefined;
210
- };
211
- /**
212
- * Context for {@link RuntimeLockHold.waitForHandoff} — everything a def needs
213
- * to observe the spawned process confirming it consumed the guarded side
214
- * effect, without the caller handing over a `ChildProcess` (which would couple
215
- * `RuntimeAgentDef` to `node:child_process`'s process model for a concern that
216
- * is really just "did the child read the file yet").
217
- */
218
- export type RuntimeLockHandoffContext = {
219
- /**
220
- * The temp path the caller staged into `RuntimeContext.agentLogFilePath`
221
- * for this spawn — `undefined` when the def did not declare
222
- * `needsAgentLogFile`, or the caller could not stage one.
223
- */
224
- readonly logFilePath: string | undefined;
225
- /** The same value {@link RuntimeLockAcquireContext.model} carried. */
226
- readonly model: string | undefined;
227
- /**
228
- * Aborts once the spawned process has exited. A def that polls for its
229
- * handoff signal should pass this straight into its poller so the poll
230
- * stops promptly instead of running out its own timeout against a log file
231
- * that will never grow again.
232
- */
233
- readonly processExited: AbortSignal;
234
- };
235
- /** A held {@link RuntimeLock}. See that type's doc for the release contract. */
236
- export type RuntimeLockHold = {
237
- /**
238
- * Releases the lock. **Must be idempotent** — the caller invokes it on
239
- * whichever of `waitForHandoff` settling or process exit happens first, and
240
- * makes no attempt to suppress the second.
241
- */
242
- readonly release: () => void;
243
- /**
244
- * Resolves once the spawned process has demonstrably consumed the guarded
245
- * side effect, at which point the caller releases. Rejecting is treated
246
- * exactly like resolving (the caller releases either way — a lock held
247
- * forever because a watcher threw is worse than an early release).
248
- *
249
- * Omit it to hold the lock for the child's entire lifetime: the caller then
250
- * releases only on process exit.
251
- */
252
- readonly waitForHandoff?: (context: RuntimeLockHandoffContext) => Promise<void>;
253
- };
254
- /**
255
- * A def-declared mutex around a *process-global* side effect its `buildArgs`
256
- * performs — the case that exists today being an adapter with no `--model`
257
- * flag, whose model choice must instead be written into a single shared
258
- * settings file that the spawned CLI reads on its own startup. Two concurrent
259
- * runs of such an adapter race: run A writes model A, A spawns, B writes
260
- * model B, and *then* A's CLI reads the file — so A silently executes on B's
261
- * model.
262
- *
263
- * The caller's contract, in order:
264
- * 1. `acquire(...)` before `buildArgs` runs (which is what performs the
265
- * side effect), awaiting the returned hold.
266
- * 2. spawn.
267
- * 3. `hold.waitForHandoff?.(...)` — and `hold.release()` on whichever of
268
- * that settling or process exit comes first.
269
- *
270
- * Releasing on process exit is not a fallback, it is load-bearing: a
271
- * `waitForHandoff` that gives up polling means "I stopped watching", never
272
- * "the child definitely didn't read the file". Only exit proves the child can
273
- * no longer read it.
274
- */
275
- export type RuntimeLock = {
276
- readonly acquire: (context: RuntimeLockAcquireContext) => Promise<RuntimeLockHold>;
277
- };
278
- export type RuntimeAgentDef = Partial<AgentModelDiscoveryPort> & {
279
- /** This adapter enforces nativeToolAccess and emits normalized shell/edit tool_use events.
280
- * A host requesting the policy must fail closed when this capability is absent. */
281
- supportsNativeToolAccess?: boolean;
282
- /** Missing/unknown isolation needs consent. A per-run claim must identify a verified CLI version and date. */
283
- mcpIsolation?: 'none' | 'no-client' | {
284
- readonly perRun: string;
285
- };
286
- /** Native tools cannot be limited per run; the host must obtain explicit consent. */
287
- fullCliAccessOnly?: boolean;
288
- /** Translation key explaining this runtime’s full-access requirement to the user. */
289
- fullCliAccessNote?: string;
290
- /** The CLI ships a native subagent tool (e.g. Claude Code's Task/Agent) a run can delegate to.
291
- * Declarative only: hosts read it through `runtimeSupportsSubagents`, never by model name.
292
- * Absent = no native subagents. */
293
- supportsSubagents?: boolean;
294
- /** `buildArgs` honors `RuntimeBuildOptions.chromeIntegration` (today Claude Code's
295
- * `--chrome`/`--no-chrome`). Read through `runtimeSupportsChromeIntegration`; absent = unsupported. */
296
- supportsChromeIntegration?: boolean;
297
- id: string;
298
- name: string;
299
- bin: string;
300
- versionArgs: string[];
301
- fallbackModels: RuntimeModelOption[];
302
- /** False when the native CLI exposes only routing modes and cannot pin a concrete ID. */
303
- supportsConcreteModelSelection?: boolean;
304
- /**
305
- * `YYYY-MM-DD` — when this def's hardcoded `fallbackModels` list was last checked against the
306
- * vendor's own current list.
307
- *
308
- * Required (by `scripts/check-model-fallback-freshness.ts`, not by this type) of any def whose
309
- * fallback array is what a picker RENDERS when no live source answers. It exists because a
310
- * hand-written list of vendor model ids has no other way to fail: it drifts from reality the day
311
- * a model ships, and before this marker nothing anywhere went red when it did.
312
- *
313
- * Bump it only after actually comparing the list against a live source — the guard's MF3 rule
314
- * does that comparison for you whenever the relevant CLI is installed.
315
- */
316
- fallbackModelsAssertedAt?: string;
317
- buildArgs: (requiredArgs: {
318
- prompt: string;
319
- imagePaths: string[];
320
- }, optionalArgs?: {
321
- extraAllowedDirs?: string[];
322
- options?: RuntimeBuildOptions;
323
- runtimeContext?: RuntimeContext;
324
- }) => string[];
325
- streamFormat: string;
326
- /** Reported money spans a session or one run; absent preserves per-run adapter behavior. */
327
- usageCostBasis?: 'session' | 'run';
328
- fallbackBins?: string[];
329
- versionProbeTimeoutMs?: number;
330
- helpArgs?: string[];
331
- capabilityFlags?: Record<string, string>;
332
- promptViaFile?: boolean;
333
- promptViaStdin?: boolean;
334
- promptInputFormat?: 'text' | 'stream-json';
335
- eventParser?: string;
336
- env?: Record<string, string>;
337
- listModels?: RuntimeListModels;
338
- fetchModels?: (requiredArgs: {
339
- resolvedBin: string;
340
- env: RuntimeEnv;
341
- }, optionalArgs?: {
342
- acpModelProbe?: AcpModelProbe;
343
- }) => Promise<RuntimeModelOption[] | null>;
344
- reasoningOptions?: RuntimeReasoningOption[];
345
- /**
346
- * Narrows `reasoningOptions` to what the runtime's LIVE model list actually supports.
347
- *
348
- * Pure, and deliberately a function of the fetched models rather than a second network/CLI probe:
349
- * the data it reads (`RuntimeModelOption.reasoning`) was already parsed out of the same catalog
350
- * response `listModels`/`fetchModels` produced, so there is no extra I/O and no second source that
351
- * could disagree with the first.
352
- *
353
- * `detection.ts` calls it once per probe and, when it returns a non-empty list, that list replaces
354
- * the def's static `reasoningOptions` on the resulting `DetectedAgent`. Returning `null` (no live
355
- * model carried levels — an older CLI, a fallback list, an offline probe) leaves the static list
356
- * exactly as declared, so this can only ever ADD accuracy, never take the picker's effort choices
357
- * away.
358
- *
359
- * Stripped from `DetectedAgent` alongside the other closures — see `detection.ts#stripFns`.
360
- */
361
- deriveReasoningOptions?: (requiredArgs: {
362
- models: readonly RuntimeModelOption[];
363
- }) => RuntimeReasoningOption[] | null;
364
- /**
365
- * See {@link RuntimeReasoningInModelId}. Mutually exclusive with
366
- * `reasoningOptions` in practice: a def declaring both would tell a picker
367
- * that the same choice lives in two different places at once.
368
- *
369
- * Survives `detection.ts#stripFns` (plain data, no closure), so a UI reading
370
- * a `DetectedAgent` off the wire gets the vocabulary it needs to do the
371
- * per-base-model derivation itself.
372
- */
373
- reasoningInModelId?: RuntimeReasoningInModelId;
374
- /**
375
- * How this def's CLI/protocol receives user-supplied image attachments.
376
- * Supersedes the old `supportsImagePaths: boolean` field (which was never
377
- * actually read anywhere outside its own two defs' tests — a pure
378
- * documentation flag, not a gate on any real behavior): that boolean could
379
- * not express *how* a def receives an image, so a caller had no way to
380
- * apply the right mechanism per def, or to avoid applying two at once.
381
- *
382
- * 'native' — the def's own protocol/CLI already carries the image
383
- * reference or bytes directly (an ACP `resource_link`
384
- * prompt block, pi-rpc's base64 `images` field, a
385
- * dedicated CLI flag like qoder's `--attachment`, …).
386
- * The daemon must NOT also augment the prompt text or
387
- * widen `extraAllowedDirs` for these — the def's own
388
- * code path already delivers the image, and doing both
389
- * would deliver the same image twice.
390
- * 'prompt-path' — the CLI has no dedicated image mechanism, but CAN
391
- * read a local file once its path is named in the
392
- * prompt text (confirmed for Claude Code by a live
393
- * `claude -p` probe — see `defs/claude.ts`'s module
394
- * doc). The caller (`@jini-ai/daemon`'s
395
- * `image-prompt-delivery.ts`) appends an
396
- * attachment-naming section to the prompt and widens
397
- * `extraAllowedDirs` with each image's containing
398
- * directory before `buildArgs` runs.
399
- * 'unsupported' — the CLI has no way to receive an image at all.
400
- * Distinct from `undefined` on purpose: `undefined`
401
- * means "not yet audited for image support", not "this
402
- * CLI genuinely cannot do it" — a caller must not treat
403
- * the two as equivalent.
404
- *
405
- * `undefined` (the default for most defs today) is the same as before this
406
- * field existed: no def-specific image handling is applied, and images are
407
- * silently dropped exactly as they were previously — unchanged behavior.
408
- */
409
- imageDelivery?: 'native' | 'prompt-path' | 'unsupported';
410
- maxPromptArgBytes?: number;
411
- mcpDiscovery?: string;
412
- externalMcpInjection?: 'claude-mcp-json' | 'acp-merge' | 'opencode-env-content' | 'mimo-env-content' | 'codex-toml' | 'env-passthrough';
413
- /** CLI explicitly supports authenticated Streamable HTTP MCP; independent of stdio delivery. */
414
- mcpHttp?: boolean;
415
- systemPromptDelivery?: {
416
- readonly strategy: 'append-flag';
417
- readonly flag: string;
418
- readonly capabilityKey?: string;
419
- } | {
420
- readonly strategy: 'env-var';
421
- readonly varName: string;
422
- } | {
423
- readonly strategy: 'config-instructions-file';
424
- readonly varName: string;
425
- };
426
- /** Supports a command hook supplying short child startup context. */
427
- subagentStartHook?: boolean;
428
- installUrl?: string;
429
- docsUrl?: string;
430
- supportsCustomModel?: boolean;
431
- resumesSessionViaCli?: boolean;
432
- capturesSessionIdFromStream?: boolean;
433
- resumesSessionViaAcpLoad?: boolean;
434
- defaultModelEnvVar?: string;
435
- inactivityTimeoutMs?: number;
436
- authProbe?: {
437
- args: string[];
438
- timeoutMs?: number;
439
- };
440
- acpMcpEnvFormat?: 'array' | 'map';
441
- needsAgentLogFile?: boolean;
442
- stdoutPolicy?: RuntimeStdoutPolicy;
443
- runtimeLock?: RuntimeLock;
444
- };
445
17
  export type DetectedAgent = Omit<RuntimeAgentDef, 'discoverModels' | 'resolveDefaultModel' | 'buildArgs' | 'listModels' | 'fetchModels' | 'deriveReasoningOptions' | 'fallbackModels' | 'fallbackModelsAssertedAt' | 'helpArgs' | 'capabilityFlags' | 'fallbackBins' | 'versionProbeTimeoutMs' | 'maxPromptArgBytes' | 'env' | 'inactivityTimeoutMs' | 'authProbe' | 'needsAgentLogFile' | 'stdoutPolicy' | 'runtimeLock'> & {
446
18
  models: RuntimeModelOption[];
447
19
  modelsSource: RuntimeModelSource;
@@ -457,29 +29,4 @@ export type DetectedAgent = Omit<RuntimeAgentDef, 'discoverModels' | 'resolveDef
457
29
  export type RuntimeExecOptions = ExecFileOptions & {
458
30
  env?: NodeJS.ProcessEnv;
459
31
  };
460
- /**
461
- * Agent unavailability/fix-affordance vocabulary. Moved to `@jini-ai/protocol` on 2026-07-29 (see
462
- * that package's `agent-catalog.ts`) so a browser package can consume it without depending on this
463
- * Node-only runtime. Re-exported here so every existing import keeps working unchanged.
464
- */
465
- export type { AgentDiagnostic, AgentDiagnosticReason, AgentDiagnosticSeverity, AgentFixIntent, } from '@jini-ai/protocol';
466
- export interface AcpModelProbeRequest {
467
- bin: string;
468
- args: string[];
469
- cwd?: string;
470
- env?: RuntimeEnv;
471
- timeoutMs?: number;
472
- signal?: AbortSignal;
473
- clientName?: string;
474
- clientVersion?: string;
475
- defaultModelOption?: RuntimeModelOption;
476
- }
477
- export interface AcpModelProbe {
478
- detectModels(requiredArgs: Pick<AcpModelProbeRequest, 'bin' | 'args'>, optionalArgs?: Omit<AcpModelProbeRequest, 'bin' | 'args'>): Promise<RuntimeModelOption[]>;
479
- /** Optional metadata capability preserves a native current selection without guessing from order. */
480
- detectMetadata?(requiredArgs: Pick<AcpModelProbeRequest, 'bin' | 'args'>, optionalArgs?: Omit<AcpModelProbeRequest, 'bin' | 'args'>): Promise<{
481
- models: RuntimeModelOption[];
482
- currentModelId: string | null;
483
- }>;
484
- }
485
32
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/agent-runtime",
3
- "version": "0.7.1",
3
+ "version": "0.7.3-next.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": {
@@ -17,10 +17,11 @@
17
17
  "./providers/tool-turn": "node",
18
18
  "./model-catalog/cache": "universal",
19
19
  "./providers/sse-decode": "universal",
20
+ "./providers/credentials": "universal",
20
21
  "./model-discovery": "node",
21
22
  "./model-selection": "universal",
22
23
  "./native-tool-policy": "universal",
23
- "./ai-trace": "universal"
24
+ "./native-permissions": "universal"
24
25
  },
25
26
  "isolation": {
26
27
  "forbidden": {
@@ -41,6 +42,11 @@
41
42
  "main": "./dist/index.js",
42
43
  "types": "./dist/index.d.ts",
43
44
  "exports": {
45
+ "./native-permissions": {
46
+ "types": "./dist/native-permissions.d.ts",
47
+ "import": "./dist/native-permissions.js",
48
+ "default": "./dist/native-permissions.js"
49
+ },
44
50
  "./native-tool-policy": {
45
51
  "types": "./dist/native-tool-policy.d.ts",
46
52
  "import": "./dist/native-tool-policy.js",
@@ -66,6 +72,11 @@
66
72
  "import": "./dist/providers/sse-decode.js",
67
73
  "default": "./dist/providers/sse-decode.js"
68
74
  },
75
+ "./providers/credentials": {
76
+ "types": "./dist/providers/credentials.d.ts",
77
+ "import": "./dist/providers/credentials.js",
78
+ "default": "./dist/providers/credentials.js"
79
+ },
69
80
  "./model-selection": {
70
81
  "types": "./dist/model-discovery-shared.d.ts",
71
82
  "import": "./dist/model-discovery-shared.js",
@@ -75,15 +86,13 @@
75
86
  "types": "./dist/model-discovery.d.ts",
76
87
  "import": "./dist/model-discovery.js",
77
88
  "default": "./dist/model-discovery.js"
78
- },
79
- "./ai-trace": {
80
- "types": "./dist/ai-trace/index.d.ts",
81
- "import": "./dist/ai-trace/index.js",
82
- "default": "./dist/ai-trace/index.js"
83
89
  }
84
90
  },
85
91
  "typesVersions": {
86
92
  "*": {
93
+ "native-permissions": [
94
+ "./dist/native-permissions.d.ts"
95
+ ],
87
96
  "providers/tool-turn": [
88
97
  "./dist/providers/tool-turn.d.ts"
89
98
  ],
@@ -93,6 +102,9 @@
93
102
  "providers/sse-decode": [
94
103
  "./dist/providers/sse-decode.d.ts"
95
104
  ],
105
+ "providers/credentials": [
106
+ "./dist/providers/credentials.d.ts"
107
+ ],
96
108
  "model-selection": [
97
109
  "./dist/model-discovery-shared.d.ts"
98
110
  ],
@@ -119,16 +131,16 @@
119
131
  },
120
132
  "devDependencies": {
121
133
  "@vitest/coverage-v8": "^2.1.9",
122
- "@jini-ai/core": "^0.7.1",
123
- "@jini-ai/integrations": "^0.7.1",
124
- "@jini-ai/platform": "^0.7.1"
134
+ "@jini-ai/integrations": "^0.7.3-next.1",
135
+ "@jini-ai/platform": "^0.7.3-next.1",
136
+ "@jini-ai/core": "^0.7.3-next.1"
125
137
  },
126
138
  "dependencies": {
127
- "@jini-ai/protocol": "^0.7.1",
128
- "@jini-ai/integrations": "^0.7.1",
129
- "@jini-ai/oauth": "^0.7.1",
130
- "@jini-ai/core": "^0.7.1",
131
- "@jini-ai/platform": "^0.7.1"
139
+ "@jini-ai/core": "^0.7.3-next.1",
140
+ "@jini-ai/oauth": "^0.7.3-next.1",
141
+ "@jini-ai/protocol": "^0.7.3-next.1",
142
+ "@jini-ai/integrations": "^0.7.3-next.1",
143
+ "@jini-ai/platform": "^0.7.3-next.1"
132
144
  },
133
145
  "scripts": {
134
146
  "build": "tsc -p tsconfig.json",
@@ -1,17 +0,0 @@
1
- import type { AiCapturedText, AiContentCapture } from './types.js';
2
- export declare const DEFAULT_MAX_CAPTURED_CHARS = 16000;
3
- export interface CaptureTextOptions {
4
- readonly mode?: AiContentCapture | undefined;
5
- readonly maxChars?: number | undefined;
6
- /** Host-known secrets (API keys in env, tokens) masked exactly before the lexical rules run. */
7
- readonly exactSecrets?: ReadonlyArray<string | undefined | null> | undefined;
8
- }
9
- /** `off` → `null`; `metadata` → `{ chars }`; `full` → redacted (then truncated) text plus counts. */
10
- export declare function captureText({ text }: {
11
- text: string | null | undefined;
12
- }, { mode, maxChars, exactSecrets }?: CaptureTextOptions): AiCapturedText | null;
13
- /** Tool inputs arrive as objects; stringify once so capture/redaction sees the same text a backend would. */
14
- export declare function stringifyForCapture({ value }: {
15
- value: unknown;
16
- }): string | null;
17
- //# sourceMappingURL=capture.d.ts.map
@@ -1,43 +0,0 @@
1
- /**
2
- * @module ai-trace/capture
3
- * Applies the capture mode and redaction before any text reaches a sink. Redaction reuses the
4
- * engine's lexical scrubber (`@jini-ai/core` `redactSecretsWithCounts`): credential shapes,
5
- * emails, phones, Luhn-valid cards. It does NOT detect names, addresses or business secrets —
6
- * that is why `metadata` (char counts only) exists and is the recommended default for prompts
7
- * that may hold customer data.
8
- */
9
- import { redactSecretsWithCounts } from '@jini-ai/core';
10
- export const DEFAULT_MAX_CAPTURED_CHARS = 16_000;
11
- /** `off` → `null`; `metadata` → `{ chars }`; `full` → redacted (then truncated) text plus counts. */
12
- export function captureText({ text }, { mode = 'metadata', maxChars = DEFAULT_MAX_CAPTURED_CHARS, exactSecrets = [] } = {}) {
13
- if (mode === 'off' || text === null || text === undefined)
14
- return null;
15
- if (mode === 'metadata')
16
- return { chars: text.length };
17
- return captureFullText({ text, maxChars, exactSecrets });
18
- }
19
- // Redact before truncating: a cut through a secret would leave a prefix no rule matches.
20
- function captureFullText({ text, maxChars, exactSecrets }) {
21
- const { redacted, counts } = redactSecretsWithCounts({ input: text }, { exactSecrets });
22
- const truncated = redacted.length > maxChars;
23
- return {
24
- chars: text.length,
25
- text: truncated ? redacted.slice(0, maxChars) : redacted,
26
- ...(truncated ? { truncated } : {}),
27
- ...(Object.keys(counts).length ? { redactions: counts } : {}),
28
- };
29
- }
30
- /** Tool inputs arrive as objects; stringify once so capture/redaction sees the same text a backend would. */
31
- export function stringifyForCapture({ value }) {
32
- if (value === undefined || value === null)
33
- return null;
34
- if (typeof value === 'string')
35
- return value;
36
- try {
37
- return JSON.stringify(value);
38
- }
39
- catch {
40
- return String(value);
41
- }
42
- }
43
- //# sourceMappingURL=capture.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * @module ai-trace/classify
3
- * Lexical tool-failure classifier. Order matters: "permission denied … timed out" is a denial,
4
- * and a schema rejection is checked before the generic execution bucket. It reads only the
5
- * result text the provider surfaced, so a tool that fails with an unhelpful message lands in
6
- * `execution` — the safe default, since that bucket means "look at the tool".
7
- */
8
- import type { AiToolErrorClass } from './types.js';
9
- export declare function classifyToolError({ content }: {
10
- content: string;
11
- }): AiToolErrorClass;
12
- //# sourceMappingURL=classify.d.ts.map