@theoremjs/agents 0.3.0 → 0.3.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/README.md +276 -995
- package/esm/mod.d.ts +33 -19
- package/esm/mod.js +18 -11
- package/esm/src/cli/commands/bench.js +36 -14
- package/esm/src/cli/commands/detect-compile.d.ts +17 -0
- package/esm/src/cli/commands/detect-compile.js +22 -0
- package/esm/src/cli/commands/eval.d.ts +3 -3
- package/esm/src/cli/commands/fuzz-canary.js +55 -16
- package/esm/src/cli/commands/profile.js +4 -4
- package/esm/src/cli/commands/run.d.ts +2 -2
- package/esm/src/cli/commands/run.js +1 -1
- package/esm/src/cli/commands/test.d.ts +4 -3
- package/esm/src/cli/commands/test.js +2 -2
- package/esm/src/cli/index.js +9 -9
- package/esm/src/cli/matrix/fixtures.js +25 -30
- package/esm/src/evals/attachments.d.ts +1 -0
- package/esm/src/evals/attachments.js +4 -2
- package/esm/src/evals/breakdown.d.ts +2 -0
- package/esm/src/evals/breakdown.js +1 -0
- package/esm/src/evals/graders/answer.d.ts +3 -0
- package/esm/src/evals/graders/answer.js +1 -0
- package/esm/src/evals/graders/code.d.ts +7 -31
- package/esm/src/evals/graders/code.js +4 -25
- package/esm/src/evals/graders/judge.d.ts +4 -0
- package/esm/src/evals/graders/judge.js +7 -5
- package/esm/src/evals/graders/latency.d.ts +1 -0
- package/esm/src/evals/graders/latency.js +3 -2
- package/esm/src/evals/graders/live.d.ts +3 -0
- package/esm/src/evals/graders/live.js +2 -0
- package/esm/src/evals/graders/media.js +1 -2
- package/esm/src/evals/graders/shared.js +1 -1
- package/esm/src/evals/graders/transcript.d.ts +2 -0
- package/esm/src/evals/graders/transcript.js +5 -3
- package/esm/src/evals/mod.d.ts +1 -9
- package/esm/src/evals/mod.js +1 -9
- package/esm/src/evals/record.d.ts +6 -0
- package/esm/src/evals/record.js +4 -2
- package/esm/src/evals/rubrics/mod.d.ts +1 -1
- package/esm/src/evals/rubrics/mod.js +1 -1
- package/esm/src/evals/rubrics/mustache.js +1 -1
- package/esm/src/evals/rubrics/types.js +1 -1
- package/esm/src/evals/run.d.ts +9 -52
- package/esm/src/evals/run.js +12 -46
- package/esm/src/evals/suite.d.ts +12 -3
- package/esm/src/evals/suite.js +9 -4
- package/esm/src/evals/summary.d.ts +3 -0
- package/esm/src/evals/summary.js +1 -0
- package/esm/src/evals/trial.d.ts +3 -16
- package/esm/src/evals/trial.js +7 -30
- package/esm/src/evals/types.d.ts +30 -121
- package/esm/src/evals/types.js +3 -16
- package/esm/src/evals/verdict.d.ts +5 -0
- package/esm/src/evals/verdict.js +4 -1
- package/esm/src/guardrails/boundaries.d.ts +41 -0
- package/esm/src/guardrails/boundaries.js +103 -0
- package/esm/src/guardrails/canary-gate.d.ts +1 -0
- package/esm/src/guardrails/canary.d.ts +49 -15
- package/esm/src/guardrails/canary.js +103 -30
- package/esm/src/guardrails/compile-egress.d.ts +6 -5
- package/esm/src/guardrails/compile-egress.js +6 -5
- package/esm/src/guardrails/corpus/canary-egress-attacks.d.ts +3 -1
- package/esm/src/guardrails/corpus/canary-egress-attacks.js +4 -2
- package/esm/src/guardrails/corpus/fuzz-inbound.js +14 -17
- package/esm/src/guardrails/corpus/inbound-payloads.d.ts +2 -0
- package/esm/src/guardrails/corpus/inbound-payloads.js +4 -2
- package/esm/src/guardrails/corpus/live-attacks.d.ts +2 -0
- package/esm/src/guardrails/corpus/live-attacks.js +6 -1
- package/esm/src/guardrails/corpus/mod.d.ts +1 -1
- package/esm/src/guardrails/corpus/secrets.d.ts +3 -3
- package/esm/src/guardrails/corpus/secrets.js +2 -2
- package/esm/src/guardrails/corpus/strings.d.ts +1 -1
- package/esm/src/guardrails/corpus/strings.js +1 -1
- package/esm/src/guardrails/corpus/types.d.ts +5 -1
- package/esm/src/guardrails/credential-rules.d.ts +36 -0
- package/esm/src/guardrails/credential-rules.js +3001 -0
- package/esm/src/guardrails/credential-scan.d.ts +45 -0
- package/esm/src/guardrails/credential-scan.js +172 -0
- package/esm/src/guardrails/destinations.d.ts +45 -0
- package/esm/src/guardrails/destinations.js +234 -0
- package/esm/src/guardrails/detect-at.d.ts +107 -0
- package/esm/src/guardrails/detect-at.js +434 -0
- package/esm/src/guardrails/detect-reply.d.ts +61 -0
- package/esm/src/guardrails/detect-reply.js +95 -0
- package/esm/src/guardrails/detect-stream.d.ts +33 -0
- package/esm/src/guardrails/detect-stream.js +77 -0
- package/esm/src/guardrails/detectors.d.ts +216 -0
- package/esm/src/guardrails/detectors.js +503 -0
- package/esm/src/guardrails/egress-automata.d.ts +4 -6
- package/esm/src/guardrails/egress-automata.js +24095 -4572
- package/esm/src/guardrails/egress-compiler.d.ts +38 -16
- package/esm/src/guardrails/egress-compiler.js +254 -60
- package/esm/src/guardrails/egress-patterns.d.ts +4 -2
- package/esm/src/guardrails/egress-patterns.js +6 -2
- package/esm/src/guardrails/egress-stream.d.ts +54 -36
- package/esm/src/guardrails/egress-stream.js +253 -124
- package/esm/src/guardrails/egress-urls.d.ts +6 -3
- package/esm/src/guardrails/egress-urls.js +14 -22
- package/esm/src/guardrails/egress.d.ts +26 -86
- package/esm/src/guardrails/egress.js +59 -309
- package/esm/src/guardrails/error.d.ts +13 -8
- package/esm/src/guardrails/error.js +23 -18
- package/esm/src/guardrails/event-schemas.d.ts +46 -3
- package/esm/src/guardrails/event-schemas.js +12 -5
- package/esm/src/guardrails/events.d.ts +5 -1
- package/esm/src/guardrails/events.js +4 -1
- package/esm/src/guardrails/hints.d.ts +14 -0
- package/esm/src/guardrails/hints.js +57 -0
- package/esm/src/guardrails/hits.d.ts +7 -1
- package/esm/src/guardrails/hits.js +12 -1
- package/esm/src/guardrails/host-patterns.d.ts +85 -0
- package/esm/src/guardrails/host-patterns.js +173 -0
- package/esm/src/guardrails/injection-patterns.d.ts +6 -1
- package/esm/src/guardrails/injection-patterns.js +33 -1
- package/esm/src/guardrails/injection-reversed.d.ts +9 -0
- package/esm/src/guardrails/injection-reversed.js +49 -0
- package/esm/src/guardrails/injection.d.ts +17 -1
- package/esm/src/guardrails/injection.js +259 -36
- package/esm/src/guardrails/labels.d.ts +40 -0
- package/esm/src/guardrails/labels.js +874 -0
- package/esm/src/guardrails/live-outbound-gate.d.ts +9 -8
- package/esm/src/guardrails/live-outbound-gate.js +100 -107
- package/esm/src/guardrails/mod.d.ts +29 -21
- package/esm/src/guardrails/mod.js +18 -13
- package/esm/src/guardrails/network.d.ts +4 -0
- package/esm/src/guardrails/network.js +21 -19
- package/esm/src/guardrails/normalize.d.ts +15 -1
- package/esm/src/guardrails/normalize.js +34 -1
- package/esm/src/guardrails/policy.d.ts +2 -17
- package/esm/src/guardrails/policy.js +12 -41
- package/esm/src/guardrails/progressive-yield.d.ts +65 -24
- package/esm/src/guardrails/progressive-yield.js +191 -147
- package/esm/src/guardrails/prompt-echo.d.ts +4 -2
- package/esm/src/guardrails/prompt-echo.js +87 -6
- package/esm/src/guardrails/quota.d.ts +1 -0
- package/esm/src/guardrails/quota.js +1 -1
- package/esm/src/guardrails/rules.d.ts +20 -29
- package/esm/src/guardrails/rules.js +23 -30
- package/esm/src/guardrails/sanitize.d.ts +32 -15
- package/esm/src/guardrails/sanitize.js +100 -124
- package/esm/src/guardrails/sensitive-groups.d.ts +21 -0
- package/esm/src/guardrails/sensitive-groups.js +12 -0
- package/esm/src/guardrails/sensitive.d.ts +16 -23
- package/esm/src/guardrails/sensitive.js +168 -47
- package/esm/src/guardrails/serialize.d.ts +1 -0
- package/esm/src/guardrails/testing.d.ts +4 -2
- package/esm/src/guardrails/testing.js +4 -2
- package/esm/src/guardrails/theorem-error.d.ts +4 -1
- package/esm/src/guardrails/theorem-error.js +3 -2
- package/esm/src/guardrails/thought-guard.d.ts +34 -13
- package/esm/src/guardrails/thought-guard.js +264 -64
- package/esm/src/guardrails/tool-directives.d.ts +29 -10
- package/esm/src/guardrails/tool-directives.js +133 -47
- package/esm/src/guardrails/tool-leak.d.ts +26 -0
- package/esm/src/guardrails/tool-leak.js +45 -0
- package/esm/src/guardrails/tool-result.d.ts +45 -14
- package/esm/src/guardrails/tool-result.js +94 -70
- package/esm/src/guardrails/types.d.ts +79 -71
- package/esm/src/guardrails/types.js +11 -7
- package/esm/src/host/client-turn.d.ts +29 -2
- package/esm/src/host/client-turn.js +46 -4
- package/esm/src/host/mint-trace.d.ts +1 -0
- package/esm/src/host/mint-trace.js +3 -2
- package/esm/src/host/mod.d.ts +2 -2
- package/esm/src/host/mod.js +1 -1
- package/esm/src/host/readStreamingJsonStringField.js +2 -43
- package/esm/src/host/reply.d.ts +6 -0
- package/esm/src/host/reply.js +7 -1
- package/esm/src/interface/blocks.d.ts +3 -0
- package/esm/src/interface/blocks.js +84 -14
- package/esm/src/interface/composer-actions.d.ts +4 -0
- package/esm/src/interface/composer-actions.js +5 -3
- package/esm/src/interface/draft.d.ts +6 -0
- package/esm/src/interface/draft.js +22 -11
- package/esm/src/interface/from-profile.d.ts +13 -1
- package/esm/src/interface/from-profile.js +66 -31
- package/esm/src/interface/history.d.ts +9 -3
- package/esm/src/interface/history.js +33 -24
- package/esm/src/interface/inputs.d.ts +1 -0
- package/esm/src/interface/inputs.js +3 -0
- package/esm/src/interface/mod.d.ts +4 -2
- package/esm/src/interface/mod.js +3 -2
- package/esm/src/interface/models.d.ts +7 -0
- package/esm/src/interface/models.js +5 -0
- package/esm/src/interface/pending.d.ts +9 -0
- package/esm/src/interface/pending.js +9 -3
- package/esm/src/interface/profile-interface.js +54 -40
- package/esm/src/interface/session.d.ts +12 -5
- package/esm/src/interface/session.js +17 -10
- package/esm/src/interface/stop.d.ts +13 -0
- package/esm/src/interface/stop.js +28 -0
- package/esm/src/interface/tool-calls.d.ts +14 -2
- package/esm/src/interface/tool-calls.js +64 -10
- package/esm/src/interface/tool-invoke.d.ts +2 -0
- package/esm/src/interface/tool-invoke.js +3 -1
- package/esm/src/interface/tool-media.d.ts +2 -0
- package/esm/src/interface/tool-media.js +2 -1
- package/esm/src/interface/types.d.ts +105 -40
- package/esm/src/interface/types.js +1 -0
- package/esm/src/kernel/api-catalog.d.ts +85 -0
- package/esm/src/kernel/api-catalog.js +229 -0
- package/esm/src/kernel/auth/crypto.d.ts +7 -2
- package/esm/src/kernel/auth/crypto.js +12 -10
- package/esm/src/kernel/auth/oauth.d.ts +2 -1
- package/esm/src/kernel/auth/oauth.js +23 -22
- package/esm/src/kernel/auth/typed-secret.js +2 -2
- package/esm/src/kernel/auth/types.d.ts +13 -0
- package/esm/src/kernel/checkpoint.d.ts +43 -0
- package/esm/src/kernel/checkpoint.js +58 -0
- package/esm/src/kernel/default-scope.d.ts +43 -5
- package/esm/src/kernel/default-scope.js +54 -5
- package/esm/src/kernel/engine/call-trace.d.ts +19 -0
- package/esm/src/kernel/engine/call-trace.js +29 -0
- package/esm/src/kernel/engine/compaction.d.ts +6 -5
- package/esm/src/kernel/engine/compaction.js +12 -11
- package/esm/src/kernel/engine/decision.d.ts +10 -8
- package/esm/src/kernel/engine/decision.js +173 -146
- package/esm/src/kernel/engine/embedding.d.ts +8 -0
- package/esm/src/kernel/engine/embedding.js +118 -0
- package/esm/src/kernel/engine/live-inbound.d.ts +14 -4
- package/esm/src/kernel/engine/live-inbound.js +36 -11
- package/esm/src/kernel/engine/live-ingress.d.ts +6 -0
- package/esm/src/kernel/engine/live-ingress.js +6 -1
- package/esm/src/kernel/engine/repair.js +12 -12
- package/esm/src/kernel/engine/runner/gates.d.ts +2 -2
- package/esm/src/kernel/engine/runner/gates.js +287 -101
- package/esm/src/kernel/engine/runner/mod.d.ts +19 -5
- package/esm/src/kernel/engine/runner/mod.js +107 -56
- package/esm/src/kernel/engine/runner/nested.d.ts +32 -0
- package/esm/src/kernel/engine/runner/nested.js +134 -0
- package/esm/src/kernel/engine/runner/schema-validation.d.ts +24 -3
- package/esm/src/kernel/engine/runner/schema-validation.js +78 -4
- package/esm/src/kernel/engine/runner/stages.d.ts +1 -1
- package/esm/src/kernel/engine/runner/stages.js +1 -8
- package/esm/src/kernel/engine/runner/state.d.ts +33 -12
- package/esm/src/kernel/engine/runner/state.js +11 -1
- package/esm/src/kernel/engine/runner/step-order.d.ts +27 -0
- package/esm/src/kernel/engine/runner/step-order.js +165 -0
- package/esm/src/kernel/engine/runner/steps.d.ts +2 -2
- package/esm/src/kernel/engine/runner/steps.js +328 -169
- package/esm/src/kernel/engine/runner/stream.d.ts +42 -11
- package/esm/src/kernel/engine/runner/stream.js +197 -46
- package/esm/src/kernel/engine/runner/usage.d.ts +5 -5
- package/esm/src/kernel/engine/runner/usage.js +12 -14
- package/esm/src/kernel/engine/session/mod.d.ts +8 -6
- package/esm/src/kernel/engine/session/mod.js +360 -129
- package/esm/src/kernel/engine/session/session-trace.d.ts +10 -10
- package/esm/src/kernel/engine/session/session-trace.js +41 -30
- package/esm/src/kernel/engine/token-estimate.d.ts +10 -64
- package/esm/src/kernel/engine/token-estimate.js +14 -194
- package/esm/src/kernel/engine/tool-trace.d.ts +3 -3
- package/esm/src/kernel/engine/tool-trace.js +2 -1
- package/esm/src/kernel/engine/turn-trace.d.ts +8 -7
- package/esm/src/kernel/engine/turn-trace.js +28 -36
- package/esm/src/kernel/engine/usage.d.ts +6 -0
- package/esm/src/kernel/engine/usage.js +17 -0
- package/esm/src/kernel/interaction-parts.d.ts +3 -0
- package/esm/src/kernel/interaction-parts.js +18 -0
- package/esm/src/kernel/json.d.ts +10 -0
- package/esm/src/kernel/json.js +3 -0
- package/esm/src/kernel/mod.d.ts +38 -11
- package/esm/src/kernel/mod.js +22 -7
- package/esm/src/kernel/profile-graph.d.ts +11 -6
- package/esm/src/kernel/profile-graph.js +14 -7
- package/esm/src/kernel/profile-presence.d.ts +10 -1
- package/esm/src/kernel/profile-presence.js +90 -75
- package/esm/src/kernel/profile-scope.d.ts +7 -3
- package/esm/src/kernel/profile-scope.js +67 -55
- package/esm/src/kernel/protocols/binding.d.ts +65 -0
- package/esm/src/kernel/protocols/binding.js +125 -0
- package/esm/src/kernel/protocols/limits.d.ts +15 -0
- package/esm/src/kernel/protocols/limits.js +28 -0
- package/esm/src/kernel/protocols/mod.d.ts +5 -0
- package/esm/src/kernel/protocols/mod.js +5 -0
- package/esm/src/kernel/protocols/prices.d.ts +36 -0
- package/esm/src/kernel/protocols/prices.js +37 -0
- package/esm/src/kernel/protocols/protocol.d.ts +253 -0
- package/esm/src/kernel/protocols/protocol.js +253 -0
- package/esm/src/kernel/protocols/provider.d.ts +108 -0
- package/esm/src/kernel/protocols/provider.js +143 -0
- package/esm/src/kernel/protocols/runtime.d.ts +55 -0
- package/esm/src/kernel/protocols/runtime.js +534 -0
- package/esm/src/kernel/provider-budget.d.ts +32 -0
- package/esm/src/kernel/provider-budget.js +262 -0
- package/esm/src/kernel/provider-dispatch.d.ts +13 -0
- package/esm/src/kernel/provider-dispatch.js +36 -0
- package/esm/src/kernel/provider-live.d.ts +7 -0
- package/esm/src/kernel/provider-live.js +189 -0
- package/esm/src/kernel/provider-runtime.d.ts +57 -0
- package/esm/src/kernel/provider-runtime.js +524 -0
- package/esm/src/kernel/registry/attachments.d.ts +15 -4
- package/esm/src/kernel/registry/attachments.js +31 -22
- package/esm/src/kernel/registry/catalog.d.ts +6 -0
- package/esm/src/kernel/registry/catalog.js +9 -2
- package/esm/src/kernel/registry/embedding-rules.d.ts +28 -0
- package/esm/src/kernel/registry/embedding-rules.js +66 -0
- package/esm/src/kernel/registry/ingress.d.ts +6 -2
- package/esm/src/kernel/registry/ingress.js +55 -10
- package/esm/src/kernel/registry/kernel-registry.d.ts +3 -0
- package/esm/src/kernel/registry/kernel-registry.js +9 -2
- package/esm/src/kernel/registry/profile-outputs.js +4 -1
- package/esm/src/kernel/registry/profiles.d.ts +38 -14
- package/esm/src/kernel/registry/profiles.js +280 -205
- package/esm/src/kernel/registry/provider-request.d.ts +3 -3
- package/esm/src/kernel/registry/provider-request.js +5 -13
- package/esm/src/kernel/registry/resolve.d.ts +4 -1
- package/esm/src/kernel/registry/resolve.js +59 -58
- package/esm/src/kernel/registry/schemas.d.ts +3 -0
- package/esm/src/kernel/registry/schemas.js +3 -1
- package/esm/src/kernel/registry/slot-fill.d.ts +7 -0
- package/esm/src/kernel/registry/slot-fill.js +22 -0
- package/esm/src/kernel/registry/system-prompt.js +7 -8
- package/esm/src/kernel/registry/vault.d.ts +14 -13
- package/esm/src/kernel/registry/vault.js +1 -14
- package/esm/src/kernel/schema.d.ts +100 -46
- package/esm/src/kernel/schema.js +499 -257
- package/esm/src/kernel/scope.d.ts +12 -5
- package/esm/src/kernel/scope.js +23 -3
- package/esm/src/kernel/stages.d.ts +38 -3
- package/esm/src/kernel/stages.js +82 -39
- package/esm/src/kernel/stop.d.ts +29 -6
- package/esm/src/kernel/stop.js +16 -4
- package/esm/src/kernel/system-parts.js +6 -6
- package/esm/src/kernel/tools/activity-label.d.ts +12 -6
- package/esm/src/kernel/tools/activity-label.js +258 -32
- package/esm/src/kernel/tools/agent.d.ts +66 -0
- package/esm/src/kernel/tools/agent.js +212 -0
- package/esm/src/kernel/tools/coordinate.d.ts +4 -0
- package/esm/src/kernel/tools/coordinate.js +165 -0
- package/esm/src/kernel/tools/events.d.ts +21 -6
- package/esm/src/kernel/tools/events.js +53 -18
- package/esm/src/kernel/tools/execute.d.ts +47 -11
- package/esm/src/kernel/tools/execute.js +508 -136
- package/esm/src/kernel/tools/gate-answer.d.ts +12 -2
- package/esm/src/kernel/tools/gate-answer.js +17 -6
- package/esm/src/kernel/tools/handler-events.d.ts +45 -0
- package/esm/src/kernel/tools/handler-events.js +106 -0
- package/esm/src/kernel/tools/harness.d.ts +1 -0
- package/esm/src/kernel/tools/harness.js +2 -1
- package/esm/src/kernel/tools/http-limit.d.ts +27 -0
- package/esm/src/kernel/tools/http-limit.js +85 -0
- package/esm/src/kernel/tools/invoke.d.ts +27 -5
- package/esm/src/kernel/tools/invoke.js +223 -70
- package/esm/src/kernel/tools/mcp-sessions.d.ts +4 -1
- package/esm/src/kernel/tools/mcp-sessions.js +13 -8
- package/esm/src/kernel/tools/mod.d.ts +4 -3
- package/esm/src/kernel/tools/mod.js +3 -2
- package/esm/src/kernel/tools/model-text.d.ts +10 -5
- package/esm/src/kernel/tools/model-text.js +18 -12
- package/esm/src/kernel/tools/operation.d.ts +76 -0
- package/esm/src/kernel/tools/operation.js +100 -0
- package/esm/src/kernel/tools/page-answer.d.ts +8 -0
- package/esm/src/kernel/tools/page-answer.js +19 -0
- package/esm/src/kernel/tools/permission.d.ts +11 -2
- package/esm/src/kernel/tools/permission.js +12 -12
- package/esm/src/kernel/tools/project.d.ts +4 -1
- package/esm/src/kernel/tools/project.js +32 -2
- package/esm/src/kernel/tools/registry.d.ts +9 -2
- package/esm/src/kernel/tools/registry.js +69 -10
- package/esm/src/kernel/tools/remote.d.ts +40 -6
- package/esm/src/kernel/tools/remote.js +219 -92
- package/esm/src/kernel/tools/resolve.d.ts +3 -0
- package/esm/src/kernel/tools/resolve.js +12 -4
- package/esm/src/kernel/tools/run.d.ts +28 -0
- package/esm/src/kernel/tools/run.js +86 -0
- package/esm/src/kernel/tools/schema.d.ts +3 -3
- package/esm/src/kernel/tools/schema.js +21 -100
- package/esm/src/kernel/tools/signed-in-fetch.d.ts +2 -1
- package/esm/src/kernel/tools/signed-in-fetch.js +3 -3
- package/esm/src/kernel/tools/stage-run.d.ts +27 -4
- package/esm/src/kernel/tools/stage-run.js +75 -17
- package/esm/src/kernel/tools/types.d.ts +235 -25
- package/esm/src/kernel/tools/unchecked-output.d.ts +14 -0
- package/esm/src/kernel/tools/unchecked-output.js +18 -0
- package/esm/src/kernel/turn-events.d.ts +208 -31
- package/esm/src/kernel/turn-events.js +127 -9
- package/esm/src/kernel/types.d.ts +302 -161
- package/esm/src/kernel/util/base64.d.ts +2 -0
- package/esm/src/kernel/util/base64.js +2 -0
- package/esm/src/kernel/util/partial-json.d.ts +23 -0
- package/esm/src/kernel/util/partial-json.js +128 -0
- package/esm/src/kernel/util/record.d.ts +1 -0
- package/esm/src/kernel/util/record.js +1 -0
- package/esm/src/observability/destinations.d.ts +5 -0
- package/esm/src/observability/destinations.js +7 -2
- package/esm/src/observability/jsonl.d.ts +2 -2
- package/esm/src/observability/jsonl.js +15 -22
- package/esm/src/observability/mod.d.ts +3 -3
- package/esm/src/observability/mod.js +2 -2
- package/esm/src/observability/openinference.d.ts +1 -1
- package/esm/src/observability/openinference.js +3 -3
- package/esm/src/observability/otlp.d.ts +3 -0
- package/esm/src/observability/otlp.js +3 -3
- package/esm/src/observability/phoenix.d.ts +1 -0
- package/esm/src/observability/policy.d.ts +3 -0
- package/esm/src/observability/policy.js +5 -1
- package/esm/src/observability/resolve-policy.js +11 -5
- package/esm/src/observability/spans.d.ts +8 -2
- package/esm/src/observability/spans.js +21 -5
- package/esm/src/observability/trace-catalog.d.ts +19 -2
- package/esm/src/observability/trace-catalog.js +128 -87
- package/esm/src/observability/trace-record.js +22 -17
- package/esm/src/observability/trace-schema.d.ts +3 -0
- package/esm/src/observability/trace-schema.js +1 -1
- package/esm/src/observability/trace-sink.d.ts +1 -0
- package/esm/src/observability/trace-sink.js +1 -1
- package/esm/src/observability/trace-span.d.ts +7 -1
- package/esm/src/observability/trace-span.js +3 -1
- package/esm/src/observability/trace.d.ts +2 -0
- package/esm/src/observability/trace.js +4 -2
- package/esm/src/observability/types.d.ts +35 -11
- package/esm/src/observability/types.js +1 -1
- package/esm/src/presets/google/speech-voices.d.ts +1 -0
- package/esm/src/presets/google-limits.d.ts +1 -0
- package/esm/src/presets/google.d.ts +27 -12
- package/esm/src/presets/google.js +34 -25
- package/esm/src/presets/local.d.ts +26 -0
- package/esm/src/presets/local.js +30 -0
- package/esm/src/presets/mod.d.ts +5 -4
- package/esm/src/presets/mod.js +4 -4
- package/esm/src/presets/openrouter.d.ts +14 -1
- package/esm/src/presets/openrouter.js +19 -1
- package/esm/src/providers/embedding-limits.d.ts +7 -0
- package/esm/src/providers/embedding-limits.js +12 -0
- package/esm/src/providers/gemini/embedding-protocol.d.ts +8 -0
- package/esm/src/providers/gemini/embedding-protocol.js +125 -0
- package/esm/src/providers/gemini/interactions-protocol.d.ts +8 -0
- package/esm/src/providers/gemini/interactions-protocol.js +105 -0
- package/esm/src/providers/gemini/live-protocol.d.ts +3 -0
- package/esm/src/providers/gemini/live-protocol.js +191 -0
- package/esm/src/providers/gemini/prices.d.ts +3 -0
- package/esm/src/providers/gemini/prices.js +63 -0
- package/esm/src/providers/gemini/provider.d.ts +7 -0
- package/esm/src/providers/gemini/provider.js +39 -0
- package/esm/src/providers/google/builtins.d.ts +14 -0
- package/esm/src/providers/google/builtins.js +57 -0
- package/esm/src/providers/google/grounding.d.ts +4 -4
- package/esm/src/providers/google/interactions/framing.d.ts +20 -8
- package/esm/src/providers/google/interactions/framing.js +85 -44
- package/esm/src/providers/google/interactions/steps.d.ts +5 -5
- package/esm/src/providers/google/interactions/steps.js +4 -4
- package/esm/src/providers/google/interactions/stream.d.ts +10 -11
- package/esm/src/providers/google/interactions/stream.js +33 -100
- package/esm/src/providers/google/live/framing.d.ts +15 -5
- package/esm/src/providers/google/live/framing.js +25 -25
- package/esm/src/providers/google/live/stream.d.ts +6 -44
- package/esm/src/providers/google/live/stream.js +3 -209
- package/esm/src/providers/google/urls.d.ts +1 -3
- package/esm/src/providers/google/urls.js +1 -3
- package/esm/src/providers/google/usage.js +2 -2
- package/esm/src/providers/live.d.ts +6 -0
- package/esm/src/providers/live.js +6 -0
- package/esm/src/providers/local/embedding-protocol.d.ts +7 -0
- package/esm/src/providers/local/embedding-protocol.js +60 -0
- package/esm/src/providers/local/provider.d.ts +7 -0
- package/esm/src/providers/local/provider.js +28 -0
- package/esm/src/providers/mod.d.ts +28 -7
- package/esm/src/providers/mod.js +19 -3
- package/esm/src/providers/open-ai/protocol.d.ts +3 -0
- package/esm/src/providers/open-ai/protocol.js +189 -0
- package/esm/src/providers/openrouter/embedding-protocol.d.ts +6 -0
- package/esm/src/providers/openrouter/embedding-protocol.js +86 -0
- package/esm/src/providers/openrouter/image.d.ts +0 -9
- package/esm/src/providers/openrouter/image.js +0 -153
- package/esm/src/providers/openrouter/images-protocol.d.ts +3 -0
- package/esm/src/providers/openrouter/images-protocol.js +82 -0
- package/esm/src/providers/openrouter/openai/compat.d.ts +2 -2
- package/esm/src/providers/openrouter/openai/compat.js +6 -6
- package/esm/src/providers/openrouter/openai/image-payload.d.ts +2 -2
- package/esm/src/providers/openrouter/openai/reasoning-state.d.ts +2 -0
- package/esm/src/providers/openrouter/openai/reasoning-state.js +31 -0
- package/esm/src/providers/openrouter/protocol.d.ts +8 -0
- package/esm/src/providers/openrouter/protocol.js +171 -0
- package/esm/src/providers/openrouter/provider.d.ts +10 -0
- package/esm/src/providers/openrouter/provider.js +50 -0
- package/esm/src/providers/shared/carried-tool-files.d.ts +7 -0
- package/esm/src/providers/shared/carried-tool-files.js +43 -0
- package/esm/src/providers/shared/pcm.js +2 -2
- package/esm/src/providers/shared/protocol-events.d.ts +8 -0
- package/esm/src/providers/shared/protocol-events.js +20 -0
- package/esm/src/providers/shared/response-identity.d.ts +2 -2
- package/esm/src/providers/shared/retry.d.ts +17 -0
- package/esm/src/providers/shared/retry.js +90 -0
- package/esm/src/providers/shared/sse.d.ts +0 -4
- package/esm/src/providers/shared/sse.js +50 -36
- package/esm/src/providers/shared/tool-args.d.ts +6 -7
- package/esm/src/providers/shared/tool-args.js +10 -6
- package/esm/src/providers/shared/tool-draft.d.ts +16 -0
- package/esm/src/providers/shared/tool-draft.js +14 -0
- package/esm/src/providers/shared/upstream-tap.d.ts +2 -2
- package/esm/src/providers/shared/upstream-tape.js +1 -1
- package/esm/src/providers/system-one/protocol.d.ts +8 -0
- package/esm/src/providers/system-one/protocol.js +93 -0
- package/esm/src/providers/types.d.ts +48 -16
- package/esm/src/providers/types.js +2 -1
- package/esm/src/providers/typesafe/provider.d.ts +7 -0
- package/esm/src/providers/typesafe/provider.js +24 -0
- package/esm/src/surface/formats.d.ts +19 -1
- package/esm/src/surface/formats.js +68 -29
- package/esm/src/surface/mod.d.ts +4 -2
- package/esm/src/surface/mod.js +4 -2
- package/esm/src/surface/runtime.d.ts +4 -0
- package/esm/src/surface/runtime.js +2 -0
- package/esm/src/surface/tools.d.ts +2 -8
- package/esm/src/surface/tools.js +4 -22
- package/esm/src/surface/types.d.ts +6 -0
- package/package.json +5 -13
- package/esm/src/cli/commands/egress-compile.d.ts +0 -17
- package/esm/src/cli/commands/egress-compile.js +0 -25
- package/esm/src/guardrails/egress-policy.d.ts +0 -27
- package/esm/src/guardrails/egress-policy.js +0 -76
- package/esm/src/guardrails/egress-rules.d.ts +0 -54
- package/esm/src/guardrails/egress-rules.js +0 -49
- package/esm/src/guardrails/lexicon.d.ts +0 -30
- package/esm/src/guardrails/lexicon.js +0 -478
- package/esm/src/kernel/engine/media-probe/audio.d.ts +0 -7
- package/esm/src/kernel/engine/media-probe/audio.js +0 -342
- package/esm/src/kernel/engine/media-probe/bytes.d.ts +0 -6
- package/esm/src/kernel/engine/media-probe/bytes.js +0 -26
- package/esm/src/kernel/engine/media-probe/image.d.ts +0 -5
- package/esm/src/kernel/engine/media-probe/image.js +0 -171
- package/esm/src/kernel/engine/media-probe/iso-bmff.d.ts +0 -19
- package/esm/src/kernel/engine/media-probe/iso-bmff.js +0 -48
- package/esm/src/kernel/engine/media-probe/matroska.d.ts +0 -35
- package/esm/src/kernel/engine/media-probe/matroska.js +0 -226
- package/esm/src/kernel/engine/media-probe/mp4.d.ts +0 -22
- package/esm/src/kernel/engine/media-probe/mp4.js +0 -279
- package/esm/src/kernel/engine/media-probe/opus.d.ts +0 -4
- package/esm/src/kernel/engine/media-probe/opus.js +0 -23
- package/esm/src/kernel/engine/media-probe/pdf.d.ts +0 -5
- package/esm/src/kernel/engine/media-probe/pdf.js +0 -117
- package/esm/src/kernel/engine/media-probe/video.d.ts +0 -15
- package/esm/src/kernel/engine/media-probe/video.js +0 -49
- package/esm/src/presets/typesafe.d.ts +0 -2
- package/esm/src/presets/typesafe.js +0 -2
- package/esm/src/providers/create-provider.d.ts +0 -21
- package/esm/src/providers/create-provider.js +0 -90
- package/esm/src/providers/decision/usage.d.ts +0 -3
- package/esm/src/providers/decision/usage.js +0 -25
- package/esm/src/providers/google/interactions/mod.d.ts +0 -2
- package/esm/src/providers/google/interactions/mod.js +0 -2
- package/esm/src/providers/google/keys.d.ts +0 -20
- package/esm/src/providers/google/keys.js +0 -87
- package/esm/src/providers/google/live/mod.d.ts +0 -7
- package/esm/src/providers/google/live/mod.js +0 -7
- package/esm/src/providers/google/live/openapi-schema.d.ts +0 -1
- package/esm/src/providers/google/live/openapi-schema.js +0 -42
- package/esm/src/providers/google/live/session.d.ts +0 -14
- package/esm/src/providers/google/live/session.js +0 -150
- package/esm/src/providers/local/local.d.ts +0 -12
- package/esm/src/providers/local/local.js +0 -186
- package/esm/src/providers/local/mod.d.ts +0 -8
- package/esm/src/providers/local/mod.js +0 -8
- package/esm/src/providers/openrouter/cache-control.d.ts +0 -5
- package/esm/src/providers/openrouter/cache-control.js +0 -4
- package/esm/src/providers/openrouter/chat.d.ts +0 -64
- package/esm/src/providers/openrouter/chat.js +0 -490
- package/esm/src/providers/openrouter/openai/sdk-messages.d.ts +0 -10
- package/esm/src/providers/openrouter/openai/sdk-messages.js +0 -99
- package/esm/src/providers/openrouter/resolve-api-key.d.ts +0 -3
- package/esm/src/providers/openrouter/resolve-api-key.js +0 -8
- package/esm/src/providers/openrouter/speech.d.ts +0 -18
- package/esm/src/providers/openrouter/speech.js +0 -109
- package/esm/src/providers/probe.d.ts +0 -5
- package/esm/src/providers/probe.js +0 -15
- package/esm/src/providers/shared/builtin-wire.d.ts +0 -4
- package/esm/src/providers/shared/builtin-wire.js +0 -9
- package/esm/src/providers/shared/vault.d.ts +0 -13
- package/esm/src/providers/shared/vault.js +0 -41
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** labels-exempt-file: authoring field-meta presence notes — not runtime user or model copy (P2) */
|
|
2
2
|
export interface ProfileFieldPresence {
|
|
3
3
|
/** The profile must set the field: always (`true`), or only in the case named. */
|
|
4
4
|
required?: true | string;
|
|
5
5
|
/** What leaving the field out does, as a short phrase a blank control can show. */
|
|
6
6
|
unset?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The value leaving the field out stands for, where one value says it: a profile that writes
|
|
9
|
+
* this value and one that leaves the field out are the same profile.
|
|
10
|
+
*/
|
|
11
|
+
value?: unknown;
|
|
7
12
|
}
|
|
13
|
+
/** The most model calls a turn makes when its profile sets no `maxSteps`. */
|
|
14
|
+
export declare const DEFAULT_MAX_STEPS = 20;
|
|
8
15
|
/** Presence for profile paths, keyed like `PROFILE_FIELDS` (`models.*` matches every binding). */
|
|
9
16
|
export declare const PROFILE_FIELD_PRESENCE: Readonly<Record<string, ProfileFieldPresence>>;
|
|
17
|
+
/** The value leaving the field at `path` out stands for, or nothing when no one value says it. */
|
|
18
|
+
export declare function unsetValue(path: readonly string[]): unknown;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** The most model calls a turn makes when its profile sets no `maxSteps`. */
|
|
2
|
+
export const DEFAULT_MAX_STEPS = 20;
|
|
3
3
|
/** Presence for profile paths, keyed like `PROFILE_FIELDS` (`models.*` matches every binding). */
|
|
4
4
|
export const PROFILE_FIELD_PRESENCE = {
|
|
5
|
-
id: { required: true },
|
|
6
|
-
type: { required: true },
|
|
5
|
+
'profile.id': { required: true },
|
|
6
|
+
'profile.type': { required: true },
|
|
7
7
|
identity: { required: true },
|
|
8
8
|
'identity.handle': { required: true },
|
|
9
|
-
'identity.system': { unset:
|
|
9
|
+
'identity.system': { unset: "Only the kernel's notes" },
|
|
10
10
|
tools: { required: true },
|
|
11
11
|
'tools.allow': { required: true },
|
|
12
12
|
image: { required: true },
|
|
@@ -15,15 +15,21 @@ export const PROFILE_FIELD_PRESENCE = {
|
|
|
15
15
|
decision: { required: true },
|
|
16
16
|
'decision.contract': { required: true },
|
|
17
17
|
models: { required: true },
|
|
18
|
-
defaultModel: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
'profile.defaultModel': {
|
|
19
|
+
required: 'when more than one model is declared',
|
|
20
|
+
unset: 'The only model',
|
|
21
|
+
},
|
|
22
|
+
'profile.allowModelSelect': { unset: 'Off', value: false },
|
|
23
|
+
'profile.maxSteps': { unset: `${DEFAULT_MAX_STEPS} model calls`, value: DEFAULT_MAX_STEPS },
|
|
23
24
|
'models.*.protocol': { required: true },
|
|
24
25
|
'models.*.provider': { required: true },
|
|
26
|
+
'models.*.options': { unset: "The protocol's defaults" },
|
|
27
|
+
'models.*.keySlot': { unset: 'Provider primary slot' },
|
|
28
|
+
'models.*.fallbackKeySlot': { unset: 'Provider fallback slot, when configured' },
|
|
29
|
+
providerContinuation: { unset: 'The host keeps the history' },
|
|
30
|
+
'providerContinuation.history': { unset: 'host', value: 'host' },
|
|
25
31
|
'models.*.apiId': { required: true },
|
|
26
|
-
'models.*.builtInTools': { unset: 'None' },
|
|
32
|
+
'models.*.builtInTools': { unset: 'None', value: [] },
|
|
27
33
|
'models.*.maxOutputTokens': { unset: 'Provider default' },
|
|
28
34
|
'models.*.temperature': { unset: 'Provider default' },
|
|
29
35
|
'models.*.summaries': { unset: 'Provider default' },
|
|
@@ -32,24 +38,18 @@ export const PROFILE_FIELD_PRESENCE = {
|
|
|
32
38
|
required: 'when more than one effort is declared',
|
|
33
39
|
unset: 'The only effort',
|
|
34
40
|
},
|
|
35
|
-
'models.*.allowEffortSelect': { unset: 'Off' },
|
|
36
|
-
'models.*.key': { unset: "The profile's key" },
|
|
37
|
-
'models.*.fallbackKey': { unset: "The profile's fallback key" },
|
|
41
|
+
'models.*.allowEffortSelect': { unset: 'Off', value: false },
|
|
38
42
|
'models.*.timeoutMs': { unset: 'No timeout' },
|
|
39
43
|
'models.*.compaction': { unset: 'Off' },
|
|
40
44
|
'models.*.compaction.maxTokens': { required: true },
|
|
41
45
|
'models.*.compaction.compactAt': { required: true },
|
|
42
46
|
'models.*.compaction.previousExchanges': { required: true },
|
|
43
|
-
'models.*.compaction.profile': { unset: 'The agent itself' },
|
|
47
|
+
'models.*.compaction.profile': { unset: 'The agent itself, on a text profile' },
|
|
48
|
+
'models.*.compaction.trigger': { unset: 'compactAt of maxTokens' },
|
|
44
49
|
'models.*.compaction.timing': { required: true },
|
|
45
|
-
'models.*.compaction.meter': { unset: 'history' },
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
'models.*.cache.ttl': { unset: 'Provider default' },
|
|
49
|
-
'models.*.store': { unset: 'Provider default' },
|
|
50
|
-
'models.*.persistViaInteractionId': { required: 'when the protocol is geminiInteractions' },
|
|
51
|
-
inputs: { required: true },
|
|
52
|
-
'inputs.text': { unset: 'Accepted' },
|
|
50
|
+
'models.*.compaction.meter': { unset: 'history', value: 'history' },
|
|
51
|
+
inputs: { required: 'on every type that takes it but live', unset: 'No slots or context' },
|
|
52
|
+
'inputs.text': { unset: 'Accepted', value: true },
|
|
53
53
|
'inputs.attachments.accept': { unset: 'No attachments' },
|
|
54
54
|
'inputs.voice.accept': { unset: 'No voice' },
|
|
55
55
|
'inputs.maxFiles': { required: 'when attachments or voice is set' },
|
|
@@ -59,58 +59,57 @@ export const PROFILE_FIELD_PRESENCE = {
|
|
|
59
59
|
'inputs.maxStateBytes': { unset: 'No cap' },
|
|
60
60
|
'inputs.limitsByMime': { unset: 'maxBytes for every type' },
|
|
61
61
|
'inputs.slots': { unset: 'No slots' },
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
'outputs.
|
|
66
|
-
'
|
|
67
|
-
'
|
|
62
|
+
'inputs.context': { unset: 'No context' },
|
|
63
|
+
'inputs.context.from': { required: true },
|
|
64
|
+
'inputs.context.maxChars': { required: true },
|
|
65
|
+
'outputs.structured': { unset: 'Free text', value: null },
|
|
66
|
+
'outputs.validation.maxRetries': { unset: '0', value: 0 },
|
|
67
|
+
'outputs.streaming.mode': { unset: 'sse', value: 'sse' },
|
|
68
|
+
'outputs.streaming.streamThoughts': { unset: 'On', value: true },
|
|
69
|
+
'turnBehaviour.resumption.allowContinue': {
|
|
70
|
+
unset: 'All three',
|
|
71
|
+
value: ['length', 'stream_incomplete', 'provider_error'],
|
|
72
|
+
},
|
|
73
|
+
'turnBehaviour.resumption.autoContinue': {
|
|
74
|
+
unset: 'length and stream_incomplete',
|
|
75
|
+
value: ['length', 'stream_incomplete'],
|
|
76
|
+
},
|
|
68
77
|
'turnBehaviour.resumption.maxContinues': { unset: 'No cap' },
|
|
69
|
-
'turnBehaviour.allowSteering': { unset: 'On' },
|
|
78
|
+
'turnBehaviour.allowSteering': { unset: 'On', value: true },
|
|
79
|
+
'turnBehaviour.atStepLimit': { unset: 'stop', value: 'stop' },
|
|
70
80
|
'guardrails.quota': { unset: 'No limit' },
|
|
71
|
-
'guardrails.
|
|
72
|
-
'guardrails.
|
|
73
|
-
'guardrails.
|
|
74
|
-
'guardrails.
|
|
75
|
-
'guardrails.
|
|
76
|
-
'guardrails.
|
|
77
|
-
'guardrails.
|
|
78
|
-
'guardrails.
|
|
79
|
-
'guardrails.egress.checks.sensitive.financial': { unset: 'On' },
|
|
80
|
-
'guardrails.egress.checks.sensitive.network': { unset: 'Off' },
|
|
81
|
-
'guardrails.egress.checks.sensitive.credentials': { unset: 'On' },
|
|
82
|
-
'guardrails.egress.checks.boundary': { unset: 'On' },
|
|
83
|
-
'guardrails.egress.checks.injection': { unset: 'On' },
|
|
84
|
-
'guardrails.egress.checks.images': { unset: 'On' },
|
|
85
|
-
'guardrails.egress.checks.images.hosts': { unset: 'None' },
|
|
86
|
-
'guardrails.egress.checks.images.fromTools': { unset: 'On' },
|
|
87
|
-
'guardrails.egress.checks.links': { unset: 'Off' },
|
|
88
|
-
'guardrails.egress.checks.links.hosts': { unset: 'The images hosts' },
|
|
89
|
-
'guardrails.egress.checks.links.fromTools': { unset: 'On' },
|
|
90
|
-
'guardrails.egress.onBlock': { unset: 'reject_to_agent' },
|
|
91
|
-
'guardrails.egress.maxRetries': { unset: '0' },
|
|
92
|
-
'guardrails.egress.holdback': { unset: '256' },
|
|
93
|
-
'guardrails.network.allowPrivateNetworks': { unset: 'Off' },
|
|
94
|
-
'guardrails.network.allowedHosts': { unset: 'None' },
|
|
81
|
+
'guardrails.detect': { unset: 'Redacts what goes to the model' },
|
|
82
|
+
'guardrails.detect.ungiven_images.allow.fromTools': { unset: 'On', value: true },
|
|
83
|
+
'guardrails.detect.ungiven_links.allow.fromTools': { unset: 'On', value: true },
|
|
84
|
+
'guardrails.blockedReply': { unset: 'One rewrite' },
|
|
85
|
+
'guardrails.blockedReply.onBlock': { unset: 'retry', value: 'retry' },
|
|
86
|
+
'guardrails.blockedReply.maxRetries': { unset: '1', value: 1 },
|
|
87
|
+
'guardrails.network.allowPrivateNetworks': { unset: 'Off', value: false },
|
|
88
|
+
'guardrails.network.allowedHosts': { unset: 'None', value: [] },
|
|
95
89
|
'guardrails.network.allowedSchemes': {
|
|
96
90
|
unset: 'https, plus http when allowPrivateNetworks is on',
|
|
97
91
|
},
|
|
98
|
-
'guardrails.taint.afterRemoteRead': { unset: 'off' },
|
|
92
|
+
'guardrails.taint.afterRemoteRead': { unset: 'off', value: 'off' },
|
|
93
|
+
'guardrails.taint.remoteDestination': { unset: 'off', value: 'off' },
|
|
99
94
|
'guardrails.disclosure': { unset: 'No check' },
|
|
100
|
-
'observability.writeTo': { unset: 'No traces' },
|
|
101
|
-
'observability.sampleRate': { unset: '1' },
|
|
102
|
-
'observability.include.upstreamLog': { unset: 'On' },
|
|
103
|
-
'observability.include.outboundWire': {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
'observability.include.
|
|
107
|
-
|
|
95
|
+
'observability.writeTo': { unset: 'No traces, unless runTurn is given a sink' },
|
|
96
|
+
'observability.sampleRate': { unset: '1', value: 1 },
|
|
97
|
+
'observability.include.upstreamLog': { unset: 'On', value: true },
|
|
98
|
+
'observability.include.outboundWire': {
|
|
99
|
+
unset: 'Off; on when the profile has no observability block',
|
|
100
|
+
},
|
|
101
|
+
'observability.include.evidenceRaw': {
|
|
102
|
+
unset: 'Off; on when the profile has no observability block',
|
|
103
|
+
},
|
|
104
|
+
'observability.include.usage': { unset: 'On', value: true },
|
|
105
|
+
'observability.include.guardrailDecisions': { unset: 'On', value: true },
|
|
106
|
+
'observability.include.guardrailMatchPreview': { unset: 'Off', value: false },
|
|
108
107
|
'observability.resource': { unset: 'None' },
|
|
109
|
-
'observability.scrub.sensitive': { unset: 'On' },
|
|
110
|
-
'observability.scrub.injection': { unset: 'On' },
|
|
111
|
-
'observability.scrub.canary': { unset: 'On' },
|
|
112
|
-
'observability.retainForDays': { unset: '14' },
|
|
113
|
-
'observability.rotateAfterMiB': { unset: '32' },
|
|
108
|
+
'observability.scrub.sensitive': { unset: 'On', value: true },
|
|
109
|
+
'observability.scrub.injection': { unset: 'On', value: true },
|
|
110
|
+
'observability.scrub.canary': { unset: 'On', value: true },
|
|
111
|
+
'observability.retainForDays': { unset: '14', value: 14 },
|
|
112
|
+
'observability.rotateAfterMiB': { unset: '32', value: 32 },
|
|
114
113
|
'observability.onWriteError': { unset: 'Errors are dropped' },
|
|
115
114
|
'image.aspectRatio': { unset: 'Provider default' },
|
|
116
115
|
'image.resolution': { unset: 'Provider default' },
|
|
@@ -121,23 +120,39 @@ export const PROFILE_FIELD_PRESENCE = {
|
|
|
121
120
|
'image.seed': { unset: 'Provider default' },
|
|
122
121
|
'image.outputCompression': { unset: 'Provider default' },
|
|
123
122
|
'image.references': { unset: 'None' },
|
|
124
|
-
'image.includeText': { unset: 'Off' },
|
|
125
|
-
'speech.voice': { unset:
|
|
123
|
+
'image.includeText': { unset: 'Off', value: false },
|
|
124
|
+
'speech.voice': { unset: "The turn's speech.voice; Gemini refuses speech without one" },
|
|
125
|
+
'speech.style': { unset: "The turn's speech.style, else no direction" },
|
|
126
|
+
'speech.speed': { unset: "The turn's speech.speed, else the voice's own pace" },
|
|
126
127
|
'speech.format': { unset: 'Provider default' },
|
|
127
|
-
'live.ingress.audio': { unset: 'On' },
|
|
128
|
-
'live.ingress.video': { unset: 'On' },
|
|
129
|
-
'live.ingress.text': { unset: 'Off' },
|
|
128
|
+
'live.ingress.audio': { unset: 'On', value: true },
|
|
129
|
+
'live.ingress.video': { unset: 'On', value: true },
|
|
130
|
+
'live.ingress.text': { unset: 'Off', value: false },
|
|
130
131
|
'live.voice': { unset: 'Provider default' },
|
|
131
132
|
'live.vad.activityHandling': { unset: 'Provider default' },
|
|
132
133
|
'live.vad.startSensitivity': { unset: 'Provider default' },
|
|
133
134
|
'live.vad.endSensitivity': { unset: 'Provider default' },
|
|
134
135
|
'live.vad.prefixPaddingMs': { unset: 'Provider default' },
|
|
135
136
|
'live.vad.silenceDurationMs': { unset: 'Provider default' },
|
|
136
|
-
'live.sessionResumption': { unset: 'Off' },
|
|
137
|
+
'live.sessionResumption': { unset: 'Off', value: false },
|
|
138
|
+
'live.greeting': { unset: 'The agent waits for the visitor' },
|
|
139
|
+
'live.resumed': { unset: 'A resumed call is silent' },
|
|
140
|
+
'live.resumed.prompt': { required: true },
|
|
141
|
+
'live.resumed.afterMs': { unset: '3000' },
|
|
137
142
|
'live.contextCompression': { unset: 'Off' },
|
|
138
143
|
'live.contextCompression.triggerTokens': { unset: 'Provider default' },
|
|
139
144
|
'live.contextCompression.slidingWindow': { required: true },
|
|
140
145
|
'live.contextCompression.slidingWindow.targetTokens': { unset: 'Provider default' },
|
|
141
146
|
'live.transcription.input': { unset: 'Off' },
|
|
142
|
-
'live.transcription.output': {
|
|
147
|
+
'live.transcription.output': {
|
|
148
|
+
unset: 'Off; on with a detector at live_reply',
|
|
149
|
+
},
|
|
143
150
|
};
|
|
151
|
+
/** The value leaving the field at `path` out stands for, or nothing when no one value says it. */
|
|
152
|
+
export function unsetValue(path) {
|
|
153
|
+
const held = Object.entries(PROFILE_FIELD_PRESENCE).find(([known]) => {
|
|
154
|
+
const keys = known.replace(/^profile\./, '').split('.');
|
|
155
|
+
return keys.length === path.length && keys.every((key, at) => key === '*' || key === path[at]);
|
|
156
|
+
});
|
|
157
|
+
return held?.[1].value;
|
|
158
|
+
}
|
|
@@ -9,11 +9,15 @@ export interface ProfileFieldScope {
|
|
|
9
9
|
/** Why other types can't take it — shown in `defineProfile` errors and authoring UIs. */
|
|
10
10
|
reason: string;
|
|
11
11
|
/**
|
|
12
|
-
* The one value other types may still carry: the field's "off" value
|
|
13
|
-
* `
|
|
12
|
+
* The one value other types may still carry: the field's "off" value
|
|
13
|
+
* (`outputs.structured: null` asks for no schema).
|
|
14
14
|
*/
|
|
15
|
-
offValue?:
|
|
15
|
+
offValue?: null;
|
|
16
16
|
}
|
|
17
|
+
/** Whether a top-level profile key is one of the profile's own settings. */
|
|
18
|
+
export declare function isProfileRootField(key: string): boolean;
|
|
19
|
+
/** The keys of the profile object that a catalog path names: `profile.maxSteps` is `maxSteps`. */
|
|
20
|
+
export declare function profileKeysOf(catalogPath: string): string[];
|
|
17
21
|
/** Keyed like `PROFILE_FIELDS`; `models.*` matches every model binding. */
|
|
18
22
|
export declare const PROFILE_FIELD_SCOPE: Readonly<Record<string, ProfileFieldScope>>;
|
|
19
23
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Leaf module: `schema.ts` and `profile-graph.ts` read it at load time.
|
|
2
|
-
/**
|
|
1
|
+
// invariant: Leaf module: `schema.ts` and `profile-graph.ts` read it at load time.
|
|
2
|
+
/** labels-exempt-file: authoring field-meta scope reasons — not runtime user or model copy (P2) */
|
|
3
3
|
import { HOST_GUARDRAIL_FIELDS } from '../guardrails/types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Mirrors `PROFILE_TYPES` — a value import would cycle through `schema.ts`.
|
|
@@ -11,21 +11,49 @@ export const ALL_PROFILE_TYPES = [
|
|
|
11
11
|
'speech',
|
|
12
12
|
'live',
|
|
13
13
|
'decision',
|
|
14
|
+
'embedding',
|
|
14
15
|
'host',
|
|
15
16
|
];
|
|
16
|
-
const MODEL_PROFILE_TYPES = [
|
|
17
|
+
const MODEL_PROFILE_TYPES = [
|
|
18
|
+
'text',
|
|
19
|
+
'image',
|
|
20
|
+
'speech',
|
|
21
|
+
'live',
|
|
22
|
+
'decision',
|
|
23
|
+
'embedding',
|
|
24
|
+
];
|
|
17
25
|
const TURN_TYPES = ['text', 'image', 'speech', 'live'];
|
|
18
26
|
/** Types whose `inputs` are turn inputs (text, files, slots) rather than decision state. */
|
|
19
27
|
const TURN_INPUT_TYPES = ['text', 'image'];
|
|
20
|
-
const TURN_INPUT_REASON = 'a decision takes JSON state, not turn text, files or slots';
|
|
28
|
+
const TURN_INPUT_REASON = 'a decision takes JSON state, not turn text, files, or slots';
|
|
29
|
+
/** Types that take slots and context: the turn types, and a call. */
|
|
30
|
+
const SLOT_TYPES = ['text', 'image', 'live'];
|
|
31
|
+
const SLOT_REASON = 'a decision takes JSON state, and speech reads its transcript only';
|
|
21
32
|
/** Guardrails a host profile may set keep `host`; the rest guard a model turn. */
|
|
22
33
|
function turnGuardrailTypes(key) {
|
|
23
34
|
return HOST_GUARDRAIL_FIELDS.includes(key)
|
|
24
35
|
? [...TURN_TYPES, 'host']
|
|
25
36
|
: TURN_TYPES;
|
|
26
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The profile's own settings, which no section holds. The catalog names each `profile.<key>`, as
|
|
40
|
+
* a section's fields carry their section's name.
|
|
41
|
+
*/
|
|
42
|
+
const PROFILE_ROOT_FIELDS = ['id', 'type', 'defaultModel', 'allowModelSelect', 'maxSteps'];
|
|
43
|
+
/** Whether a top-level profile key is one of the profile's own settings. */
|
|
44
|
+
export function isProfileRootField(key) {
|
|
45
|
+
return PROFILE_ROOT_FIELDS.includes(key);
|
|
46
|
+
}
|
|
47
|
+
/** The keys of the profile object that a catalog path names: `profile.maxSteps` is `maxSteps`. */
|
|
48
|
+
export function profileKeysOf(catalogPath) {
|
|
49
|
+
return catalogPath.replace(/^profile\./, '').split('.');
|
|
50
|
+
}
|
|
27
51
|
/** Keyed like `PROFILE_FIELDS`; `models.*` matches every model binding. */
|
|
28
52
|
export const PROFILE_FIELD_SCOPE = {
|
|
53
|
+
providerContinuation: {
|
|
54
|
+
profileTypes: TURN_TYPES,
|
|
55
|
+
reason: 'only model turns and live sessions use provider continuation',
|
|
56
|
+
},
|
|
29
57
|
...Object.fromEntries([
|
|
30
58
|
'efforts',
|
|
31
59
|
'defaultEffort',
|
|
@@ -34,11 +62,6 @@ export const PROFILE_FIELD_SCOPE = {
|
|
|
34
62
|
'maxOutputTokens',
|
|
35
63
|
'temperature',
|
|
36
64
|
'builtInTools',
|
|
37
|
-
'cache',
|
|
38
|
-
'store',
|
|
39
|
-
'persistViaInteractionId',
|
|
40
|
-
'server',
|
|
41
|
-
'fallbackKey',
|
|
42
65
|
].map((field) => [
|
|
43
66
|
`models.*.${field}`,
|
|
44
67
|
{
|
|
@@ -75,20 +98,15 @@ export const PROFILE_FIELD_SCOPE = {
|
|
|
75
98
|
profileTypes: ['text', 'image', 'speech'],
|
|
76
99
|
reason: 'live compacts with live.contextCompression',
|
|
77
100
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
profileTypes: TURN_TYPES,
|
|
81
|
-
reason: 'a host profile runs no model and a decision makes one call on its key',
|
|
82
|
-
},
|
|
83
|
-
defaultModel: {
|
|
84
|
-
profileTypes: TURN_TYPES,
|
|
101
|
+
'profile.defaultModel': {
|
|
102
|
+
profileTypes: [...TURN_TYPES, 'embedding'],
|
|
85
103
|
reason: 'a host profile runs no model and a decision declares exactly one',
|
|
86
104
|
},
|
|
87
|
-
allowModelSelect: {
|
|
88
|
-
profileTypes: TURN_TYPES,
|
|
105
|
+
'profile.allowModelSelect': {
|
|
106
|
+
profileTypes: [...TURN_TYPES, 'embedding'],
|
|
89
107
|
reason: 'a host profile runs no model and a decision declares exactly one',
|
|
90
108
|
},
|
|
91
|
-
maxSteps: {
|
|
109
|
+
'profile.maxSteps': {
|
|
92
110
|
profileTypes: TURN_TYPES,
|
|
93
111
|
reason: 'only model turns take tool-loop steps',
|
|
94
112
|
},
|
|
@@ -109,48 +127,52 @@ export const PROFILE_FIELD_SCOPE = {
|
|
|
109
127
|
reason: 'live function declarations are fixed at session setup, and a host profile can execute every allowed tool',
|
|
110
128
|
},
|
|
111
129
|
inputs: {
|
|
112
|
-
profileTypes: ['text', 'image', 'decision'],
|
|
113
|
-
reason: 'speech input is the transcript,
|
|
130
|
+
profileTypes: ['text', 'image', 'live', 'decision', 'embedding'],
|
|
131
|
+
reason: 'speech input is the transcript, and a host profile takes no turns',
|
|
114
132
|
},
|
|
115
133
|
'inputs.voice': {
|
|
116
134
|
profileTypes: ['text'],
|
|
117
135
|
reason: 'no image model reads audio, and a decision takes JSON state',
|
|
118
136
|
},
|
|
119
137
|
'inputs.text': {
|
|
120
|
-
profileTypes: TURN_INPUT_TYPES,
|
|
138
|
+
profileTypes: [...TURN_INPUT_TYPES, 'embedding'],
|
|
121
139
|
reason: TURN_INPUT_REASON,
|
|
122
140
|
},
|
|
123
141
|
'inputs.attachments': {
|
|
124
|
-
profileTypes: TURN_INPUT_TYPES,
|
|
142
|
+
profileTypes: [...TURN_INPUT_TYPES, 'embedding'],
|
|
125
143
|
reason: TURN_INPUT_REASON,
|
|
126
144
|
},
|
|
127
145
|
'inputs.maxFiles': {
|
|
128
|
-
profileTypes: TURN_INPUT_TYPES,
|
|
146
|
+
profileTypes: [...TURN_INPUT_TYPES, 'embedding'],
|
|
129
147
|
reason: TURN_INPUT_REASON,
|
|
130
148
|
},
|
|
131
149
|
'inputs.maxBytes': {
|
|
132
|
-
profileTypes: TURN_INPUT_TYPES,
|
|
150
|
+
profileTypes: [...TURN_INPUT_TYPES, 'embedding'],
|
|
133
151
|
reason: TURN_INPUT_REASON,
|
|
134
152
|
},
|
|
135
153
|
'inputs.maxTurnBytes': {
|
|
136
|
-
profileTypes: TURN_INPUT_TYPES,
|
|
154
|
+
profileTypes: [...TURN_INPUT_TYPES, 'embedding'],
|
|
137
155
|
reason: TURN_INPUT_REASON,
|
|
138
156
|
},
|
|
139
157
|
'inputs.limitsByMime': {
|
|
140
|
-
profileTypes: TURN_INPUT_TYPES,
|
|
158
|
+
profileTypes: [...TURN_INPUT_TYPES, 'embedding'],
|
|
141
159
|
reason: TURN_INPUT_REASON,
|
|
142
160
|
},
|
|
143
161
|
'inputs.slots': {
|
|
144
|
-
profileTypes:
|
|
145
|
-
reason:
|
|
162
|
+
profileTypes: SLOT_TYPES,
|
|
163
|
+
reason: SLOT_REASON,
|
|
164
|
+
},
|
|
165
|
+
'inputs.context': {
|
|
166
|
+
profileTypes: SLOT_TYPES,
|
|
167
|
+
reason: SLOT_REASON,
|
|
146
168
|
},
|
|
147
169
|
'inputs.state': {
|
|
148
170
|
profileTypes: ['decision'],
|
|
149
|
-
reason: 'only a decision reads JSON state; a turn takes text, files and slots',
|
|
171
|
+
reason: 'only a decision reads JSON state; a turn takes text, files, and slots',
|
|
150
172
|
},
|
|
151
173
|
'inputs.maxStateBytes': {
|
|
152
174
|
profileTypes: ['decision'],
|
|
153
|
-
reason: 'only a decision reads JSON state; a turn takes text, files and slots',
|
|
175
|
+
reason: 'only a decision reads JSON state; a turn takes text, files, and slots',
|
|
154
176
|
},
|
|
155
177
|
outputs: {
|
|
156
178
|
profileTypes: ['text', 'image', 'speech'],
|
|
@@ -177,39 +199,29 @@ export const PROFILE_FIELD_SCOPE = {
|
|
|
177
199
|
profileTypes: ['text', 'live'],
|
|
178
200
|
reason: 'image and speech turns take no mid-turn input',
|
|
179
201
|
},
|
|
202
|
+
'turnBehaviour.atStepLimit': {
|
|
203
|
+
profileTypes: ['text'],
|
|
204
|
+
reason: 'only a text turn writes an answer after its tools',
|
|
205
|
+
},
|
|
180
206
|
'guardrails.quota': {
|
|
181
207
|
profileTypes: turnGuardrailTypes('quota'),
|
|
182
208
|
reason: 'quota counts model turns',
|
|
183
209
|
},
|
|
184
|
-
'guardrails.
|
|
185
|
-
profileTypes:
|
|
186
|
-
reason: 'the canary is minted into a system prompt, which speech, decision and host profiles lack',
|
|
187
|
-
offValue: false,
|
|
188
|
-
},
|
|
189
|
-
'guardrails.promptEcho': {
|
|
190
|
-
profileTypes: ['text', 'image', 'live'],
|
|
191
|
-
reason: 'the echo is of a system prompt, which speech, decision and host profiles lack',
|
|
192
|
-
offValue: false,
|
|
193
|
-
},
|
|
194
|
-
'guardrails.sanitizeInput': {
|
|
195
|
-
profileTypes: turnGuardrailTypes('sanitizeInput'),
|
|
196
|
-
reason: 'the decision path runs none of the turn guardrails',
|
|
197
|
-
},
|
|
198
|
-
'guardrails.redactSensitive': {
|
|
199
|
-
profileTypes: turnGuardrailTypes('redactSensitive'),
|
|
210
|
+
'guardrails.detect': {
|
|
211
|
+
profileTypes: turnGuardrailTypes('detect'),
|
|
200
212
|
reason: 'the decision path runs none of the turn guardrails',
|
|
201
213
|
},
|
|
202
|
-
'guardrails.
|
|
203
|
-
profileTypes:
|
|
204
|
-
reason: '
|
|
214
|
+
'guardrails.blockedReply': {
|
|
215
|
+
profileTypes: ['text', 'image', 'live'],
|
|
216
|
+
reason: 'only a reply can be blocked, and speech, decision, and host profiles write none',
|
|
205
217
|
},
|
|
206
218
|
'guardrails.network': {
|
|
207
|
-
profileTypes:
|
|
208
|
-
reason: '
|
|
219
|
+
profileTypes: ['text', 'image', 'live', 'host'],
|
|
220
|
+
reason: 'speech and decision profiles call no tools',
|
|
209
221
|
},
|
|
210
222
|
'guardrails.taint': {
|
|
211
|
-
profileTypes:
|
|
212
|
-
reason: '
|
|
223
|
+
profileTypes: ['text', 'image', 'live'],
|
|
224
|
+
reason: 'speech and decision profiles call no tools, and a host profile runs no turn to taint',
|
|
213
225
|
},
|
|
214
226
|
'guardrails.disclosure': {
|
|
215
227
|
profileTypes: ['decision'],
|
|
@@ -252,7 +264,7 @@ export function outOfScopeFields(profile) {
|
|
|
252
264
|
for (const [path, scope] of Object.entries(PROFILE_FIELD_SCOPE)) {
|
|
253
265
|
if (scope.profileTypes.includes(profile.type))
|
|
254
266
|
continue;
|
|
255
|
-
for (const [at, value] of valuesAt(profile, path
|
|
267
|
+
for (const [at, value] of valuesAt(profile, profileKeysOf(path))) {
|
|
256
268
|
if (scope.offValue !== undefined && value === scope.offValue)
|
|
257
269
|
continue;
|
|
258
270
|
out.push({ path: at, scope });
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type JsonObject } from '../json.js';
|
|
3
|
+
import { type KeySlot } from '../schema.js';
|
|
4
|
+
import { type ModelProfileType, type Protocol } from './protocol.js';
|
|
5
|
+
import type { RegisteredProvider } from './provider.js';
|
|
6
|
+
/** A vault slot name. */
|
|
7
|
+
export declare const keySlotSchema: z.ZodString;
|
|
8
|
+
export declare const commonModelSettingsSchema: z.ZodObject<{
|
|
9
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
efforts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
12
|
+
none: 'none';
|
|
13
|
+
minimal: 'minimal';
|
|
14
|
+
low: 'low';
|
|
15
|
+
medium: 'medium';
|
|
16
|
+
high: 'high';
|
|
17
|
+
xhigh: 'xhigh';
|
|
18
|
+
max: 'max';
|
|
19
|
+
}>>>;
|
|
20
|
+
defaultEffort: z.ZodOptional<z.ZodString>;
|
|
21
|
+
allowEffortSelect: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
summaries: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
builtInTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
compaction: z.ZodOptional<z.ZodCustom<import('../types.js').CompactionSpec>>;
|
|
25
|
+
}>;
|
|
26
|
+
/** One entry under a profile's `models`: which protocol, which provider, which model, and its settings. */
|
|
27
|
+
export interface ModelBinding extends z.infer<typeof commonModelSettingsSchema> {
|
|
28
|
+
protocol: string;
|
|
29
|
+
provider: string;
|
|
30
|
+
apiId: string;
|
|
31
|
+
keySlot?: string;
|
|
32
|
+
fallbackKeySlot?: string;
|
|
33
|
+
options?: JsonObject;
|
|
34
|
+
}
|
|
35
|
+
/** A decision profile's model: no generation settings, and a time limit. */
|
|
36
|
+
export interface DecisionModelBinding extends Pick<ModelBinding, 'protocol' | 'provider' | 'apiId' | 'keySlot' | 'fallbackKeySlot' | 'options'> {
|
|
37
|
+
timeoutMs?: number;
|
|
38
|
+
}
|
|
39
|
+
export declare const modelBindingSchema: z.ZodType<ModelBinding>;
|
|
40
|
+
export declare const decisionModelBindingSchema: z.ZodType<DecisionModelBinding>;
|
|
41
|
+
/** What a runtime can do that a sign-in may need. */
|
|
42
|
+
export interface RuntimeAbilities {
|
|
43
|
+
/** Whether a WebSocket can be opened with headers (not in a browser). */
|
|
44
|
+
webSocketHeaders: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** The slots a model reads its key from: the ones it names, else its provider's. */
|
|
47
|
+
export declare function keySlotsOf(provider: {
|
|
48
|
+
keySlot?: KeySlot;
|
|
49
|
+
fallbackKeySlot?: KeySlot;
|
|
50
|
+
}, binding: {
|
|
51
|
+
keySlot?: KeySlot;
|
|
52
|
+
fallbackKeySlot?: KeySlot;
|
|
53
|
+
}): {
|
|
54
|
+
keySlot?: KeySlot;
|
|
55
|
+
fallbackKeySlot?: KeySlot;
|
|
56
|
+
};
|
|
57
|
+
/** The provider's serve of the protocol a binding speaks. */
|
|
58
|
+
export declare function bindingServe(provider: RegisteredProvider, binding: ModelBinding | DecisionModelBinding): RegisteredProvider['serves'][number];
|
|
59
|
+
/** The protocol a binding speaks on its provider. */
|
|
60
|
+
export declare function protocolOf(provider: RegisteredProvider, binding: ModelBinding | DecisionModelBinding): Protocol;
|
|
61
|
+
/**
|
|
62
|
+
* The one place a binding meets its provider, once, at registration, for fit only. Returns the
|
|
63
|
+
* binding with its options parsed; changes nothing in place.
|
|
64
|
+
*/
|
|
65
|
+
export declare function checkBinding<B extends ModelBinding | DecisionModelBinding>(provider: RegisteredProvider, binding: B, profileType: ModelProfileType, runtime?: RuntimeAbilities): B;
|