@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.
- package/CHANGELOG.md +3 -3
- package/README.md +1 -0
- package/dist/acp-model-probe.d.ts +2 -3
- package/dist/acp-model-probe.js +1 -1
- package/dist/agent-protocol/acp/account-failure.d.ts +3 -1
- package/dist/agent-protocol/acp/account-failure.js +1 -1
- package/dist/agent-protocol/acp/constants.d.ts +3 -1
- package/dist/agent-protocol/acp/constants.js +2 -0
- package/dist/agent-protocol/acp/index.d.ts +2 -1
- package/dist/agent-protocol/acp/index.js +2 -1
- package/dist/agent-protocol/acp/json.d.ts +26 -7
- package/dist/agent-protocol/acp/json.js +11 -11
- package/dist/agent-protocol/acp/models.d.ts +26 -6
- package/dist/agent-protocol/acp/models.js +157 -129
- package/dist/agent-protocol/acp/rpc.d.ts +37 -9
- package/dist/agent-protocol/acp/rpc.js +19 -16
- package/dist/agent-protocol/acp/session-params.d.ts +4 -1
- package/dist/agent-protocol/acp/session-params.js +1 -1
- package/dist/agent-protocol/acp/session-permission.d.ts +13 -0
- package/dist/agent-protocol/acp/session-permission.js +110 -0
- package/dist/agent-protocol/acp/session-results.d.ts +61 -0
- package/dist/agent-protocol/acp/session-results.js +226 -0
- package/dist/agent-protocol/acp/session-run.d.ts +92 -0
- package/dist/agent-protocol/acp/session-run.js +555 -0
- package/dist/agent-protocol/acp/session-state.d.ts +9 -0
- package/dist/agent-protocol/acp/session-state.js +29 -0
- package/dist/agent-protocol/acp/session-text-updates.d.ts +56 -0
- package/dist/agent-protocol/acp/session-text-updates.js +119 -0
- package/dist/agent-protocol/acp/session-tool-updates.d.ts +21 -0
- package/dist/agent-protocol/acp/session-tool-updates.js +90 -0
- package/dist/agent-protocol/acp/session-types.d.ts +166 -0
- package/dist/agent-protocol/acp/session-types.js +4 -0
- package/dist/agent-protocol/acp/session.d.ts +4 -280
- package/dist/agent-protocol/acp/session.js +65 -998
- package/dist/agent-protocol/acp/text-suppression.d.ts +5 -1
- package/dist/agent-protocol/acp/text-suppression.js +1 -1
- package/dist/agent-protocol/acp/updates.d.ts +43 -12
- package/dist/agent-protocol/acp/updates.js +34 -34
- package/dist/agent-protocol/core/json-line-stream.d.ts +133 -36
- package/dist/agent-protocol/core/json-line-stream.js +62 -62
- package/dist/agent-protocol/pi-rpc/events.d.ts +14 -4
- package/dist/agent-protocol/pi-rpc/events.js +14 -14
- package/dist/agent-protocol/pi-rpc/internal.d.ts +9 -3
- package/dist/agent-protocol/pi-rpc/internal.js +3 -3
- package/dist/agent-protocol/pi-rpc/models.d.ts +3 -17
- package/dist/agent-protocol/pi-rpc/models.js +1 -45
- package/dist/agent-protocol/pi-rpc/session.d.ts +36 -12
- package/dist/agent-protocol/pi-rpc/session.js +134 -122
- package/dist/amr-model-cache.d.ts +1 -1
- package/dist/anthropic-live-models.d.ts +8 -3
- package/dist/anthropic-live-models.js +0 -0
- package/dist/auth-common.d.ts +2 -0
- package/dist/auth-common.js +2 -0
- package/dist/auth.d.ts +7 -34
- package/dist/auth.js +25 -139
- package/dist/capabilities.d.ts +1 -1
- package/dist/claude-code-models.d.ts +13 -5
- package/dist/claude-code-models.js +12 -10
- package/dist/claude-filesystem-policy.d.ts +1 -1
- package/dist/claude-stream-frames.d.ts +125 -0
- package/dist/claude-stream-frames.js +327 -0
- package/dist/claude-stream-handler.d.ts +19 -0
- package/dist/claude-stream-handler.js +480 -0
- package/dist/claude-stream.d.ts +3 -72
- package/dist/claude-stream.js +2 -801
- package/dist/core/model-discovery-shared.d.ts +14 -8
- package/dist/core/model-discovery-shared.js +6 -9
- package/dist/core/omit-keys.d.ts +4 -1
- package/dist/core/omit-keys.js +1 -1
- package/dist/defs/aider/executable.d.ts +2 -0
- package/dist/defs/aider/executable.js +2 -0
- package/dist/defs/aider/model-discovery.d.ts +3 -0
- package/dist/defs/aider/model-discovery.js +6 -0
- package/dist/defs/aider.d.ts +10 -10
- package/dist/defs/amp/index.d.ts +35 -0
- package/dist/defs/amp/index.js +75 -0
- package/dist/defs/amp.d.ts +1 -34
- package/dist/defs/amp.js +1 -74
- package/dist/defs/amr/executable-resolution.d.ts +7 -0
- package/dist/defs/amr/executable-resolution.js +50 -0
- package/dist/defs/amr/executable.d.ts +2 -0
- package/dist/defs/amr/executable.js +2 -0
- package/dist/defs/amr/index.d.ts +69 -0
- package/dist/defs/amr/index.js +279 -0
- package/dist/defs/amr/model-discovery.d.ts +3 -0
- package/dist/defs/amr/model-discovery.js +4 -0
- package/dist/defs/amr.d.ts +1 -68
- package/dist/defs/amr.js +1 -291
- package/dist/defs/antigravity/auth.d.ts +14 -0
- package/dist/defs/antigravity/auth.js +47 -0
- package/dist/defs/antigravity/index.d.ts +9 -9
- package/dist/defs/antigravity/index.js +3 -3
- package/dist/defs/antigravity/model-discovery.d.ts +3 -0
- package/dist/defs/antigravity/model-discovery.js +5 -0
- package/dist/defs/auggie/executable.d.ts +2 -0
- package/dist/defs/auggie/executable.js +2 -0
- package/dist/defs/auggie.d.ts +13 -13
- package/dist/defs/auggie.js +2 -9
- package/dist/defs/claude/auth.d.ts +15 -0
- package/dist/defs/claude/auth.js +47 -0
- package/dist/defs/claude/executable.d.ts +2 -0
- package/dist/defs/claude/executable.js +2 -0
- package/dist/defs/claude/model-discovery.d.ts +3 -0
- package/dist/defs/claude/model-discovery.js +20 -0
- package/dist/defs/claude-compatible-args.d.ts +10 -6
- package/dist/defs/claude-compatible-args.js +5 -5
- package/dist/defs/claude.d.ts +11 -11
- package/dist/defs/claude.js +5 -4
- package/dist/defs/cline/executable.d.ts +2 -0
- package/dist/defs/cline/executable.js +2 -0
- package/dist/defs/cline.d.ts +13 -13
- package/dist/defs/cline.js +2 -9
- package/dist/defs/codebuddy/executable.d.ts +2 -0
- package/dist/defs/codebuddy/executable.js +2 -0
- package/dist/defs/codebuddy/index.d.ts +48 -0
- package/dist/defs/codebuddy/index.js +121 -0
- package/dist/defs/codebuddy/model-discovery.d.ts +3 -0
- package/dist/defs/codebuddy/model-discovery.js +5 -0
- package/dist/defs/codebuddy.d.ts +1 -47
- package/dist/defs/codebuddy.js +1 -120
- package/dist/defs/codex/auth.d.ts +4 -0
- package/dist/defs/codex/auth.js +2 -0
- package/dist/defs/codex/event-stream.d.ts +10 -0
- package/dist/defs/codex/event-stream.js +353 -0
- package/dist/defs/codex/executable-resolution.d.ts +7 -0
- package/dist/defs/codex/executable-resolution.js +37 -0
- package/dist/defs/codex/executable.d.ts +2 -0
- package/dist/defs/codex/executable.js +2 -0
- package/dist/defs/codex/launch.d.ts +3 -0
- package/dist/defs/codex/launch.js +155 -0
- package/dist/defs/codex/model-discovery.d.ts +3 -0
- package/dist/defs/codex/model-discovery.js +11 -0
- package/dist/defs/codex/options.d.ts +11 -0
- package/dist/defs/codex/options.js +5 -0
- package/dist/defs/codex.d.ts +18 -11
- package/dist/defs/codex.js +32 -29
- package/dist/defs/crush/executable.d.ts +2 -0
- package/dist/defs/crush/executable.js +2 -0
- package/dist/defs/crush/model-discovery.d.ts +3 -0
- package/dist/defs/crush/model-discovery.js +6 -0
- package/dist/defs/crush.d.ts +10 -10
- package/dist/defs/cursor-agent/auth.d.ts +13 -0
- package/dist/defs/cursor-agent/auth.js +22 -0
- package/dist/defs/cursor-agent/event-stream.d.ts +8 -0
- package/dist/defs/cursor-agent/event-stream.js +104 -0
- package/dist/defs/cursor-agent/executable.d.ts +2 -0
- package/dist/defs/cursor-agent/executable.js +2 -0
- package/dist/defs/cursor-agent/model-discovery.d.ts +3 -0
- package/dist/defs/cursor-agent/model-discovery.js +5 -0
- package/dist/defs/cursor-agent.d.ts +11 -13
- package/dist/defs/cursor-agent.js +1 -1
- package/dist/defs/deepseek/auth.d.ts +13 -0
- package/dist/defs/deepseek/auth.js +18 -0
- package/dist/defs/deepseek/executable.d.ts +2 -0
- package/dist/defs/deepseek/executable.js +2 -0
- package/dist/defs/deepseek/model-discovery.d.ts +3 -0
- package/dist/defs/deepseek/model-discovery.js +5 -0
- package/dist/defs/deepseek.d.ts +10 -10
- package/dist/defs/devin/executable.d.ts +2 -0
- package/dist/defs/devin/executable.js +2 -0
- package/dist/defs/devin.d.ts +15 -15
- package/dist/defs/devin.js +3 -10
- package/dist/defs/droid/executable.d.ts +2 -0
- package/dist/defs/droid/executable.js +2 -0
- package/dist/defs/droid/model-discovery.d.ts +3 -0
- package/dist/defs/droid/model-discovery.js +5 -0
- package/dist/defs/droid.d.ts +10 -10
- package/dist/defs/gemini/event-stream.d.ts +14 -0
- package/dist/defs/gemini/event-stream.js +193 -0
- package/dist/defs/goose/executable.d.ts +2 -0
- package/dist/defs/goose/executable.js +2 -0
- package/dist/defs/goose.d.ts +13 -13
- package/dist/defs/goose.js +2 -9
- package/dist/defs/grok-build/model-discovery.d.ts +3 -0
- package/dist/defs/grok-build/model-discovery.js +5 -0
- package/dist/defs/grok-build.d.ts +10 -10
- package/dist/defs/hermes/executable.d.ts +2 -0
- package/dist/defs/hermes/executable.js +2 -0
- package/dist/defs/hermes/index.d.ts +34 -0
- package/dist/defs/hermes/index.js +57 -0
- package/dist/defs/hermes.d.ts +1 -33
- package/dist/defs/hermes.js +1 -56
- package/dist/defs/index.d.ts +1 -0
- package/dist/defs/index.js +1 -0
- package/dist/defs/kilo/executable.d.ts +2 -0
- package/dist/defs/kilo/executable.js +2 -0
- package/dist/defs/kilo.d.ts +13 -13
- package/dist/defs/kilo.js +2 -9
- package/dist/defs/kimi/event-stream.d.ts +3 -0
- package/dist/defs/kimi/event-stream.js +46 -0
- package/dist/defs/kimi/executable.d.ts +2 -0
- package/dist/defs/kimi/executable.js +2 -0
- package/dist/defs/kimi.d.ts +13 -13
- package/dist/defs/kimi.js +2 -9
- package/dist/defs/kiro/executable.d.ts +2 -0
- package/dist/defs/kiro/executable.js +2 -0
- package/dist/defs/kiro.d.ts +13 -13
- package/dist/defs/kiro.js +2 -9
- package/dist/defs/mimo/executable.d.ts +2 -0
- package/dist/defs/mimo/executable.js +2 -0
- package/dist/defs/mimo/model-discovery.d.ts +3 -0
- package/dist/defs/mimo/model-discovery.js +7 -0
- package/dist/defs/mimo.d.ts +10 -10
- package/dist/defs/opencode/event-stream.d.ts +8 -0
- package/dist/defs/opencode/event-stream.js +108 -0
- package/dist/defs/opencode/executable.d.ts +2 -0
- package/dist/defs/opencode/executable.js +2 -0
- package/dist/defs/opencode/model-discovery.d.ts +4 -0
- package/dist/defs/opencode/model-discovery.js +14 -0
- package/dist/defs/opencode-acp.d.ts +42 -0
- package/dist/defs/opencode-acp.js +23 -0
- package/dist/defs/opencode.d.ts +9 -9
- package/dist/defs/pi/executable.d.ts +2 -0
- package/dist/defs/pi/executable.js +2 -0
- package/dist/defs/pi/model-discovery.d.ts +4 -0
- package/dist/defs/pi/model-discovery.js +16 -0
- package/dist/defs/pi/options.d.ts +11 -0
- package/dist/defs/pi/options.js +5 -0
- package/dist/defs/pi.d.ts +10 -10
- package/dist/defs/qoder/executable.d.ts +2 -0
- package/dist/defs/qoder/executable.js +2 -0
- package/dist/defs/qoder/model-discovery.d.ts +3 -0
- package/dist/defs/qoder/model-discovery.js +7 -0
- package/dist/defs/qoder.d.ts +9 -9
- package/dist/defs/qwen/executable.d.ts +2 -0
- package/dist/defs/qwen/executable.js +2 -0
- package/dist/defs/qwen/model-discovery.d.ts +3 -0
- package/dist/defs/qwen/model-discovery.js +7 -0
- package/dist/defs/qwen.d.ts +10 -10
- package/dist/defs/reasonix/auth.d.ts +13 -0
- package/dist/defs/reasonix/auth.js +18 -0
- package/dist/defs/reasonix/executable.d.ts +2 -0
- package/dist/defs/reasonix/executable.js +2 -0
- package/dist/defs/reasonix.d.ts +13 -13
- package/dist/defs/reasonix.js +2 -9
- package/dist/defs/shared.d.ts +10 -2
- package/dist/defs/shared.js +5 -1
- package/dist/defs/trae-cli/executable.d.ts +2 -0
- package/dist/defs/trae-cli/executable.js +2 -0
- package/dist/defs/trae-cli.d.ts +15 -15
- package/dist/defs/trae-cli.js +2 -9
- package/dist/defs/vibe/executable.d.ts +2 -0
- package/dist/defs/vibe/executable.js +2 -0
- package/dist/defs/vibe.d.ts +13 -13
- package/dist/defs/vibe.js +2 -9
- package/dist/detection.d.ts +4 -3
- package/dist/detection.js +22 -22
- package/dist/diagnostics.d.ts +4 -4
- package/dist/diagnostics.js +2 -2
- package/dist/env.js +2 -1
- package/dist/executable-helpers.d.ts +21 -0
- package/dist/executable-helpers.js +2 -0
- package/dist/executables.d.ts +2 -2
- package/dist/executables.js +68 -114
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -1
- package/dist/invocation.d.ts +22 -6
- package/dist/invocation.js +19 -17
- package/dist/json-event-stream-shared.d.ts +81 -0
- package/dist/json-event-stream-shared.js +147 -0
- package/dist/json-event-stream.d.ts +2 -4
- package/dist/json-event-stream.js +15 -940
- package/dist/launch.d.ts +1 -9
- package/dist/launch.js +6 -155
- package/dist/log-file.d.ts +2 -8
- package/dist/log-file.js +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/mmd-routes.d.ts +7 -7
- package/dist/mmd-routes.js +19 -27
- package/dist/model-discovery-adapters.d.ts +47 -11
- package/dist/model-discovery-adapters.js +47 -41
- package/dist/model-discovery-config-types.d.ts +44 -0
- package/dist/model-discovery-config-types.js +20 -0
- package/dist/model-discovery-config.d.ts +19 -11
- package/dist/model-discovery-config.js +64 -87
- package/dist/model-discovery-native.d.ts +2 -1
- package/dist/model-discovery-native.js +3 -3
- package/dist/model-discovery-sdk.d.ts +6 -2
- package/dist/model-discovery-sdk.js +2 -2
- package/dist/model-discovery-types.d.ts +1 -138
- package/dist/model-discovery-yaml.d.ts +3 -1
- package/dist/model-discovery-yaml.js +1 -1
- package/dist/model-discovery.d.ts +15 -5
- package/dist/model-discovery.js +119 -105
- package/dist/model-loading-state.d.ts +1 -1
- package/dist/model-loading-state.js +1 -1
- package/dist/model-registry.d.ts +5 -5
- package/dist/model-registry.js +7 -6
- package/dist/models.d.ts +4 -3
- package/dist/models.js +2 -2
- package/dist/native-permissions.d.ts +47 -0
- package/dist/native-permissions.js +80 -0
- package/dist/native-runtime.d.ts +11 -8
- package/dist/native-runtime.js +8 -4
- package/dist/native-tool-policy.d.ts +1 -40
- package/dist/opencode-log.d.ts +3 -3
- package/dist/opencode-log.js +5 -3
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/pi-models.d.ts +12 -2
- package/dist/pi-models.js +11 -1
- package/dist/prompt-augmenter.d.ts +1 -37
- package/dist/prompt-augmenter.js +0 -6
- package/dist/prompt-budget.d.ts +3 -3
- package/dist/prompt-budget.js +2 -2
- package/dist/prompt-file.d.ts +2 -6
- package/dist/prompt-file.js +1 -1
- package/dist/providers/aihubmix.d.ts +8 -8
- package/dist/providers/aihubmix.js +8 -8
- package/dist/providers/anthropic-messages.d.ts +22 -23
- package/dist/providers/anthropic-messages.js +26 -53
- package/dist/providers/azure-chat.d.ts +7 -6
- package/dist/providers/azure-chat.js +9 -6
- package/dist/providers/connection-guard.d.ts +3 -9
- package/dist/providers/connection-guard.js +6 -14
- package/dist/providers/connection-test.d.ts +1 -2
- package/dist/providers/connection-test.js +51 -51
- package/dist/providers/credentials.d.ts +59 -0
- package/dist/providers/credentials.js +80 -0
- package/dist/providers/elevenlabs.d.ts +2 -6
- package/dist/providers/elevenlabs.js +2 -31
- package/dist/providers/google-messages.d.ts +11 -10
- package/dist/providers/google-messages.js +16 -35
- package/dist/providers/google-schema.d.ts +1 -1
- package/dist/providers/google-schema.js +1 -1
- package/dist/providers/google.d.ts +6 -6
- package/dist/providers/google.js +6 -6
- package/dist/providers/index.d.ts +5 -2
- package/dist/providers/index.js +5 -2
- package/dist/providers/model-catalog.d.ts +4 -9
- package/dist/providers/model-catalog.js +3 -11
- package/dist/providers/oauth-callback-server.js +93 -87
- package/dist/providers/oauth-provider.d.ts +1 -1
- package/dist/providers/oauth-provider.js +1 -1
- package/dist/providers/oauth-tokens.d.ts +5 -5
- package/dist/providers/oauth-tokens.js +8 -9
- package/dist/providers/ollama-chat.d.ts +13 -12
- package/dist/providers/ollama-chat.js +15 -24
- package/dist/providers/openai-chat-request.d.ts +34 -0
- package/dist/providers/openai-chat-request.js +152 -0
- package/dist/providers/openai-chat-stream.d.ts +48 -0
- package/dist/providers/openai-chat-stream.js +89 -0
- package/dist/providers/openai-chat-tool-results.d.ts +81 -0
- package/dist/providers/openai-chat-tool-results.js +124 -0
- package/dist/providers/openai-chat-types.d.ts +180 -0
- package/dist/providers/openai-chat-types.js +3 -0
- package/dist/providers/openai-chat.d.ts +5 -405
- package/dist/providers/openai-chat.js +9 -388
- package/dist/providers/pkce.d.ts +1 -1
- package/dist/providers/pkce.js +1 -1
- package/dist/providers/provider-url.d.ts +6 -0
- package/dist/providers/provider-url.js +9 -0
- package/dist/providers/response-text.d.ts +4 -0
- package/dist/providers/response-text.js +16 -0
- package/dist/providers/sse-decode.d.ts +4 -0
- package/dist/providers/sse-decode.js +11 -0
- package/dist/providers/token-params.d.ts +5 -5
- package/dist/providers/token-params.js +5 -5
- package/dist/providers/tool-loop-verdict.d.ts +1 -1
- package/dist/providers/tool-loop-verdict.js +1 -1
- package/dist/providers/tool-turn-types.d.ts +2 -1
- package/dist/providers/tool-turn.js +30 -50
- package/dist/providers/turn-end-guard.d.ts +4 -1
- package/dist/providers/turn-end-guard.js +1 -1
- package/dist/qoder-stream.d.ts +1 -1
- package/dist/qoder-stream.js +1 -1
- package/dist/registry.d.ts +5 -5
- package/dist/registry.js +4 -4
- package/dist/role-marker-guard.d.ts +13 -1
- package/dist/role-marker-guard.js +15 -1
- package/dist/runtime-def-binding.d.ts +15 -0
- package/dist/runtime-def-binding.js +19 -0
- package/dist/runtime-port-bindings.d.ts +181 -0
- package/dist/runtime-port-bindings.js +95 -0
- package/dist/runtime-state.d.ts +2 -11
- package/dist/runtime-state.js +0 -13
- package/dist/types.d.ts +1 -454
- package/package.json +27 -15
- package/dist/ai-trace/capture.d.ts +0 -17
- package/dist/ai-trace/capture.js +0 -43
- package/dist/ai-trace/classify.d.ts +0 -12
- package/dist/ai-trace/classify.js +0 -16
- package/dist/ai-trace/index.d.ts +0 -13
- package/dist/ai-trace/index.js +0 -6
- package/dist/ai-trace/recorder.d.ts +0 -64
- package/dist/ai-trace/recorder.js +0 -258
- package/dist/ai-trace/sinks.d.ts +0 -51
- package/dist/ai-trace/sinks.js +0 -153
- package/dist/ai-trace/types.d.ts +0 -123
- package/dist/ai-trace/types.js +0 -17
- package/dist/ai-trace/usage.d.ts +0 -13
- package/dist/ai-trace/usage.js +0 -45
- package/dist/model-contracts.d.ts +0 -29
- package/dist/model-contracts.js +0 -2
- package/dist/providers/types.d.ts +0 -36
- package/dist/providers/types.js +0 -13
package/dist/ai-trace/types.d.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module ai-trace/types
|
|
3
|
-
*
|
|
4
|
-
* Vendor-neutral AI-run trace contract: run → model turns → tool calls → outcome.
|
|
5
|
-
*
|
|
6
|
-
* Why a sibling port and not more `RunLifecycleEvent` variants: `TelemetrySink` is the
|
|
7
|
-
* product-analytics port and its `data` is deliberately opaque so the engine never installs a
|
|
8
|
-
* product's event schema. A trace is the opposite — a typed, hierarchical span tree that every
|
|
9
|
-
* backend (Langfuse, Phoenix, Helicone, OTel GenAI) maps field-for-field. Widening the analytics
|
|
10
|
-
* union would force every existing analytics sink to understand spans; a sibling port keeps both
|
|
11
|
-
* contracts small and lets a host install either, both, or neither.
|
|
12
|
-
*
|
|
13
|
-
* Honesty rule: a field a provider stream cannot supply is `null`, never estimated in place.
|
|
14
|
-
* Cost a host prices itself is marked `costSource: 'estimated'`.
|
|
15
|
-
*/
|
|
16
|
-
/** How much prompt/response/tool text leaves the process. `off`: none; `metadata`: char counts only; `full`: redacted text. */
|
|
17
|
-
export type AiContentCapture = 'off' | 'metadata' | 'full';
|
|
18
|
-
/** Why a tool call failed — the split that tells "the model called it wrong" apart from "the tool broke". */
|
|
19
|
-
export type AiToolErrorClass = 'input_validation' | 'execution' | 'denied' | 'timeout';
|
|
20
|
-
export type AiRunOutcome = 'succeeded' | 'failed' | 'cancelled';
|
|
21
|
-
/** Captured text after the capture mode and redaction ran. `text` is present only in `full` mode. */
|
|
22
|
-
export interface AiCapturedText {
|
|
23
|
-
readonly chars: number;
|
|
24
|
-
readonly text?: string;
|
|
25
|
-
readonly truncated?: boolean;
|
|
26
|
-
/** Per-category redaction counts (`{ email: 1 }`), so a reviewer sees what was stripped. */
|
|
27
|
-
readonly redactions?: Readonly<Record<string, number>>;
|
|
28
|
-
}
|
|
29
|
-
/** Token counters; `null` means the provider did not report that counter, not zero. */
|
|
30
|
-
export interface AiTokenUsage {
|
|
31
|
-
readonly inputTokens: number | null;
|
|
32
|
-
readonly outputTokens: number | null;
|
|
33
|
-
readonly cacheReadTokens: number | null;
|
|
34
|
-
readonly cacheWriteTokens: number | null;
|
|
35
|
-
readonly reasoningTokens: number | null;
|
|
36
|
-
}
|
|
37
|
-
export type AiCostSource = 'provider' | 'estimated';
|
|
38
|
-
export interface AiTraceRunStarted {
|
|
39
|
-
readonly kind: 'run_started';
|
|
40
|
-
readonly traceId: string;
|
|
41
|
-
readonly runId: string;
|
|
42
|
-
readonly at: number;
|
|
43
|
-
readonly agentId: string;
|
|
44
|
-
readonly provider: string | null;
|
|
45
|
-
readonly model: string | null;
|
|
46
|
-
/** Host conversation/chat id, so a backend can group runs into sessions. */
|
|
47
|
-
readonly sessionId: string | null;
|
|
48
|
-
readonly input: AiCapturedText | null;
|
|
49
|
-
readonly tags: readonly string[];
|
|
50
|
-
}
|
|
51
|
-
/** One explicit provider request, or a run-level window when the stream supplies no request boundaries. */
|
|
52
|
-
export interface AiTraceModelTurn {
|
|
53
|
-
readonly kind: 'model_turn';
|
|
54
|
-
readonly traceId: string;
|
|
55
|
-
readonly turnId: string;
|
|
56
|
-
readonly index: number;
|
|
57
|
-
readonly startedAt: number;
|
|
58
|
-
readonly endedAt: number;
|
|
59
|
-
readonly model: string | null;
|
|
60
|
-
readonly input: AiCapturedText | null;
|
|
61
|
-
readonly output: AiCapturedText | null;
|
|
62
|
-
readonly reasoning: AiCapturedText | null;
|
|
63
|
-
readonly usage: AiTokenUsage | null;
|
|
64
|
-
readonly costUsd: number | null;
|
|
65
|
-
readonly costSource: AiCostSource | null;
|
|
66
|
-
readonly ttftMs: number | null;
|
|
67
|
-
readonly stopReason: string | null;
|
|
68
|
-
readonly error: string | null;
|
|
69
|
-
/** Error text follows the same capture policy as prompts; `error` is a safe label outside full mode. */
|
|
70
|
-
readonly errorContent?: AiCapturedText | null;
|
|
71
|
-
readonly errorCode?: string | null;
|
|
72
|
-
/** Calls requested by this generation, including tools still pending when the turn closes. */
|
|
73
|
-
readonly toolCallCount?: number;
|
|
74
|
-
}
|
|
75
|
-
export interface AiTraceToolCall {
|
|
76
|
-
readonly kind: 'tool_call';
|
|
77
|
-
readonly traceId: string;
|
|
78
|
-
/** Request-scoped trace identity; provider ids may repeat on the next request. */
|
|
79
|
-
readonly toolCallId: string;
|
|
80
|
-
/** The model turn that requested the call. */
|
|
81
|
-
readonly turnId: string;
|
|
82
|
-
readonly name: string;
|
|
83
|
-
readonly input: AiCapturedText | null;
|
|
84
|
-
readonly output: AiCapturedText | null;
|
|
85
|
-
readonly isError: boolean;
|
|
86
|
-
readonly errorClass: AiToolErrorClass | null;
|
|
87
|
-
readonly startedAt: number;
|
|
88
|
-
/** `null` when the run ended before the tool reported a result. */
|
|
89
|
-
readonly endedAt: number | null;
|
|
90
|
-
}
|
|
91
|
-
export interface AiTraceTotals {
|
|
92
|
-
readonly turns: number;
|
|
93
|
-
readonly toolCalls: number;
|
|
94
|
-
readonly toolErrors: number;
|
|
95
|
-
readonly inputTokens: number | null;
|
|
96
|
-
readonly outputTokens: number | null;
|
|
97
|
-
readonly costUsd: number | null;
|
|
98
|
-
}
|
|
99
|
-
export interface AiTraceRunFinished {
|
|
100
|
-
readonly kind: 'run_finished';
|
|
101
|
-
readonly traceId: string;
|
|
102
|
-
readonly at: number;
|
|
103
|
-
readonly outcome: AiRunOutcome;
|
|
104
|
-
readonly error: {
|
|
105
|
-
readonly message: string;
|
|
106
|
-
readonly code: string | null;
|
|
107
|
-
readonly content?: AiCapturedText | null;
|
|
108
|
-
} | null;
|
|
109
|
-
readonly totals: AiTraceTotals;
|
|
110
|
-
}
|
|
111
|
-
export type AiTraceEvent = AiTraceRunStarted | AiTraceModelTurn | AiTraceToolCall | AiTraceRunFinished;
|
|
112
|
-
/**
|
|
113
|
-
* Backend port. `record` must not throw into the run (the recorder guards it anyway) and must not
|
|
114
|
-
* block: adapters buffer and send in `flush`. Hosts call `shutdown` once on process exit.
|
|
115
|
-
*/
|
|
116
|
-
export interface AiTraceSink {
|
|
117
|
-
/** Requested content policy. Absent means metadata; fan-out preserves each sink's policy. */
|
|
118
|
-
readonly capture?: AiContentCapture;
|
|
119
|
-
record(event: AiTraceEvent): void;
|
|
120
|
-
flush?(): Promise<void>;
|
|
121
|
-
shutdown?(): Promise<void>;
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/ai-trace/types.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module ai-trace/types
|
|
3
|
-
*
|
|
4
|
-
* Vendor-neutral AI-run trace contract: run → model turns → tool calls → outcome.
|
|
5
|
-
*
|
|
6
|
-
* Why a sibling port and not more `RunLifecycleEvent` variants: `TelemetrySink` is the
|
|
7
|
-
* product-analytics port and its `data` is deliberately opaque so the engine never installs a
|
|
8
|
-
* product's event schema. A trace is the opposite — a typed, hierarchical span tree that every
|
|
9
|
-
* backend (Langfuse, Phoenix, Helicone, OTel GenAI) maps field-for-field. Widening the analytics
|
|
10
|
-
* union would force every existing analytics sink to understand spans; a sibling port keeps both
|
|
11
|
-
* contracts small and lets a host install either, both, or neither.
|
|
12
|
-
*
|
|
13
|
-
* Honesty rule: a field a provider stream cannot supply is `null`, never estimated in place.
|
|
14
|
-
* Cost a host prices itself is marked `costSource: 'estimated'`.
|
|
15
|
-
*/
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=types.js.map
|
package/dist/ai-trace/usage.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module ai-trace/usage
|
|
3
|
-
* Folds every provider's usage spelling into {@link AiTokenUsage}. Each counter takes the first
|
|
4
|
-
* alias the provider actually reported; a counter no alias matched stays `null` (never `0`).
|
|
5
|
-
*/
|
|
6
|
-
import type { AiTokenUsage } from './types.js';
|
|
7
|
-
/** Returns `null` when the input is not a usage object or carries no recognised counter. */
|
|
8
|
-
export declare function normalizeAiUsage({ usage }: {
|
|
9
|
-
usage: unknown;
|
|
10
|
-
}, _options?: Record<string, never>): AiTokenUsage | null;
|
|
11
|
-
/** Adds two nullable counters; `null + null` stays `null` so "never reported" survives totals. */
|
|
12
|
-
export declare function addNullable(a: number | null, b: number | null): number | null;
|
|
13
|
-
//# sourceMappingURL=usage.d.ts.map
|
package/dist/ai-trace/usage.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Dotted paths reach OpenAI's nested `*_details` objects. Order matters only when a provider
|
|
2
|
-
// reports two spellings of the same counter, which none of the normalizers do today.
|
|
3
|
-
const USAGE_ALIASES = {
|
|
4
|
-
inputTokens: ['input_tokens', 'inputTokens', 'prompt_tokens', 'promptTokenCount'],
|
|
5
|
-
outputTokens: ['output_tokens', 'outputTokens', 'completion_tokens', 'candidatesTokenCount'],
|
|
6
|
-
cacheReadTokens: ['cache_read_input_tokens', 'cached_read_tokens', 'cachedReadTokens', 'cacheReadTokens', 'prompt_tokens_details.cached_tokens', 'cachedContentTokenCount'],
|
|
7
|
-
cacheWriteTokens: ['cache_creation_input_tokens', 'cached_write_tokens', 'cacheWriteTokens'],
|
|
8
|
-
reasoningTokens: ['thought_tokens', 'thoughtTokens', 'reasoningTokens', 'completion_tokens_details.reasoning_tokens', 'thoughtsTokenCount', 'reasoning_tokens'],
|
|
9
|
-
};
|
|
10
|
-
function isRecord(value) {
|
|
11
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
12
|
-
}
|
|
13
|
-
function readPath(source, path) {
|
|
14
|
-
let current = source;
|
|
15
|
-
for (const part of path.split('.'))
|
|
16
|
-
current = isRecord(current) ? current[part] : undefined;
|
|
17
|
-
return current;
|
|
18
|
-
}
|
|
19
|
-
function firstNumber(source, aliases) {
|
|
20
|
-
for (const alias of aliases) {
|
|
21
|
-
const value = readPath(source, alias);
|
|
22
|
-
if (typeof value === 'number' && Number.isFinite(value))
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
/** Returns `null` when the input is not a usage object or carries no recognised counter. */
|
|
28
|
-
export function normalizeAiUsage({ usage }, _options = {}) {
|
|
29
|
-
if (!isRecord(usage))
|
|
30
|
-
return null;
|
|
31
|
-
const out = {};
|
|
32
|
-
let found = false;
|
|
33
|
-
for (const key of Object.keys(USAGE_ALIASES)) {
|
|
34
|
-
out[key] = firstNumber(usage, USAGE_ALIASES[key]);
|
|
35
|
-
found ||= out[key] !== null;
|
|
36
|
-
}
|
|
37
|
-
return found ? out : null;
|
|
38
|
-
}
|
|
39
|
-
/** Adds two nullable counters; `null + null` stays `null` so "never reported" survives totals. */
|
|
40
|
-
export function addNullable(a, b) {
|
|
41
|
-
if (a === null && b === null)
|
|
42
|
-
return null;
|
|
43
|
-
return (a ?? 0) + (b ?? 0);
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=usage.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type ModelIdentityKind = 'concrete' | 'alias' | 'routing-mode';
|
|
2
|
-
export type RuntimeEnv = NodeJS.ProcessEnv | Record<string, string>;
|
|
3
|
-
export type RuntimeModelOption = {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
identityKind?: ModelIdentityKind;
|
|
7
|
-
resolvedId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The reasoning-effort levels THIS model supports, when the runtime's own catalog reports them
|
|
10
|
-
* per model rather than per agent.
|
|
11
|
-
*
|
|
12
|
-
* Present only where a live source actually carries the data — Codex's `debug models` catalog
|
|
13
|
-
* does (`supported_reasoning_levels`), and the levels genuinely differ between models on the same
|
|
14
|
-
* CLI: verified live against codex-cli 0.153.4, where `gpt-6-astra` offers
|
|
15
|
-
* low/medium/high/xhigh/max/ultra while `gpt-5.5` stops at `xhigh`. A single agent-level
|
|
16
|
-
* `RuntimeAgentDef.reasoningOptions` list cannot be correct for both, which is why this is a
|
|
17
|
-
* property of the model row rather than of the def.
|
|
18
|
-
*
|
|
19
|
-
* Consumed by `RuntimeAgentDef.deriveReasoningOptions` to compute the agent-level list a picker
|
|
20
|
-
* renders. Left `undefined` by every runtime whose effort vocabulary really is uniform, and by
|
|
21
|
-
* every static fallback list — an absent value means "nothing catalog-specific to say", never
|
|
22
|
-
* "this model supports no effort levels".
|
|
23
|
-
*/
|
|
24
|
-
reasoning?: readonly RuntimeReasoningOption[];
|
|
25
|
-
};
|
|
26
|
-
/** A reasoning-effort choice; same shape as a model option. */
|
|
27
|
-
export interface RuntimeReasoningOption extends RuntimeModelOption {
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=model-contracts.d.ts.map
|
package/dist/model-contracts.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module providers/types
|
|
3
|
-
*
|
|
4
|
-
* Vendored subset of OD's upstream contracts-package provider-connectivity
|
|
5
|
-
* shapes needed by this package's own provider modules. `@jini-ai/agent-runtime`
|
|
6
|
-
* has zero OD workspace-package imports (same policy as `types.ts`'s vendored
|
|
7
|
-
* `AgentDiagnostic`/`AgentFixIntent`) — only the fields this package's own
|
|
8
|
-
* code actually reads/writes are kept; the daemon-only surface (agent
|
|
9
|
-
* connection-test request/response shapes, reasoning-execution fields) is
|
|
10
|
-
* not ported.
|
|
11
|
-
*/
|
|
12
|
-
/** Category of outcome a provider model/connection probe can report. */
|
|
13
|
-
export type ConnectionTestKind = 'success' | 'auth_failed' | 'forbidden' | 'not_found_model' | 'invalid_model_id' | 'invalid_base_url' | 'rate_limited' | 'upstream_unavailable' | 'timeout' | 'unknown';
|
|
14
|
-
/** Wire protocol family a BYOK provider speaks. */
|
|
15
|
-
export type ConnectionTestProtocol = 'anthropic' | 'openai' | 'azure' | 'google' | 'ollama' | 'senseaudio' | 'aihubmix' | 'bedrock';
|
|
16
|
-
export interface ProviderModelOption {
|
|
17
|
-
id: string;
|
|
18
|
-
label: string;
|
|
19
|
-
}
|
|
20
|
-
export interface ProviderModelsRequest {
|
|
21
|
-
protocol: ConnectionTestProtocol;
|
|
22
|
-
baseUrl: string;
|
|
23
|
-
apiKey: string;
|
|
24
|
-
/** Azure only. Kept for shape parity with a provider-test request. */
|
|
25
|
-
apiVersion?: string;
|
|
26
|
-
}
|
|
27
|
-
export type ProviderModelsKind = ConnectionTestKind | 'no_models' | 'unsupported_protocol';
|
|
28
|
-
export interface ProviderModelsResponse {
|
|
29
|
-
ok: boolean;
|
|
30
|
-
kind: ProviderModelsKind;
|
|
31
|
-
latencyMs: number;
|
|
32
|
-
models?: ProviderModelOption[];
|
|
33
|
-
status?: number;
|
|
34
|
-
detail?: string;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/providers/types.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module providers/types
|
|
3
|
-
*
|
|
4
|
-
* Vendored subset of OD's upstream contracts-package provider-connectivity
|
|
5
|
-
* shapes needed by this package's own provider modules. `@jini-ai/agent-runtime`
|
|
6
|
-
* has zero OD workspace-package imports (same policy as `types.ts`'s vendored
|
|
7
|
-
* `AgentDiagnostic`/`AgentFixIntent`) — only the fields this package's own
|
|
8
|
-
* code actually reads/writes are kept; the daemon-only surface (agent
|
|
9
|
-
* connection-test request/response shapes, reasoning-execution fields) is
|
|
10
|
-
* not ported.
|
|
11
|
-
*/
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=types.js.map
|