theorum 0.1.15 → 1.1.3
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 +241 -98
- package/esm/mod.d.ts +57 -28
- package/esm/mod.js +43 -23
- package/esm/src/cli/commands/bench.js +18 -18
- package/esm/src/cli/commands/fuzz-canary.d.ts +13 -0
- package/esm/src/cli/commands/fuzz-canary.js +191 -0
- package/esm/src/cli/commands/fuzz-guardrails.d.ts +3 -5
- package/esm/src/cli/commands/fuzz-guardrails.js +4 -581
- package/esm/src/cli/commands/guardrails-eval.d.ts +14 -0
- package/esm/src/cli/commands/guardrails-eval.js +15 -0
- package/esm/src/cli/commands/profile.js +35 -15
- package/esm/src/cli/commands/run.d.ts +3 -0
- package/esm/src/cli/commands/run.js +23 -32
- package/esm/src/cli/commands/test.d.ts +10 -1
- package/esm/src/cli/commands/test.js +34 -34
- package/esm/src/cli/event-log.d.ts +19 -0
- package/esm/src/cli/event-log.js +147 -0
- package/esm/src/cli/index.js +57 -11
- package/esm/src/cli/matrix/synthesizer.d.ts +10 -12
- package/esm/src/cli/matrix/synthesizer.js +45 -118
- package/esm/src/guardrails/canary-gate.d.ts +21 -0
- package/esm/src/guardrails/canary-gate.js +32 -0
- package/esm/src/guardrails/canary.d.ts +34 -0
- package/esm/src/guardrails/canary.js +150 -0
- package/esm/src/guardrails/corpus/canary-egress-attacks.d.ts +17 -0
- package/esm/src/guardrails/corpus/canary-egress-attacks.js +151 -0
- package/esm/src/guardrails/corpus/fuzz-inbound.d.ts +11 -0
- package/esm/src/guardrails/corpus/fuzz-inbound.js +213 -0
- package/esm/src/guardrails/corpus/inbound-payloads.d.ts +10 -0
- package/esm/src/guardrails/corpus/inbound-payloads.js +125 -0
- package/esm/src/guardrails/corpus/live-attacks.d.ts +20 -0
- package/esm/src/guardrails/corpus/live-attacks.js +231 -0
- package/esm/src/guardrails/corpus/mod.d.ts +14 -0
- package/esm/src/guardrails/corpus/mod.js +11 -0
- package/esm/src/guardrails/corpus/secrets.d.ts +17 -0
- package/esm/src/guardrails/corpus/secrets.js +17 -0
- package/esm/src/guardrails/corpus/strings.d.ts +28 -0
- package/esm/src/guardrails/corpus/strings.js +34 -0
- package/esm/src/guardrails/corpus/types.d.ts +38 -0
- package/esm/src/guardrails/corpus/types.js +6 -0
- package/esm/src/guardrails/egress.d.ts +32 -0
- package/esm/src/guardrails/egress.js +87 -0
- package/esm/src/guardrails/error.d.ts +14 -23
- package/esm/src/guardrails/error.js +87 -76
- package/esm/src/guardrails/eval/corpus.d.ts +108 -0
- package/esm/src/guardrails/eval/corpus.js +978 -0
- package/esm/src/guardrails/eval/mod.d.ts +51 -0
- package/esm/src/guardrails/eval/mod.js +133 -0
- package/esm/src/guardrails/eval/score.d.ts +66 -0
- package/esm/src/guardrails/eval/score.js +114 -0
- package/esm/src/guardrails/events.d.ts +25 -0
- package/esm/src/guardrails/events.js +56 -0
- package/esm/src/guardrails/hits.d.ts +24 -0
- package/esm/src/guardrails/hits.js +45 -0
- package/esm/src/guardrails/injection.js +28 -5
- package/esm/src/guardrails/lexicon.d.ts +39 -0
- package/esm/src/guardrails/lexicon.js +200 -0
- package/esm/src/guardrails/live-outbound-gate.d.ts +41 -0
- package/esm/src/guardrails/live-outbound-gate.js +222 -0
- package/esm/src/guardrails/mod.d.ts +30 -6
- package/esm/src/guardrails/mod.js +20 -5
- package/esm/src/guardrails/network.d.ts +19 -0
- package/esm/src/guardrails/network.js +234 -0
- package/esm/src/guardrails/policy.d.ts +35 -0
- package/esm/src/guardrails/policy.js +50 -0
- package/esm/src/guardrails/progressive-yield.d.ts +51 -0
- package/esm/src/guardrails/progressive-yield.js +98 -0
- package/esm/src/guardrails/quota.d.ts +17 -3
- package/esm/src/guardrails/quota.js +18 -4
- package/esm/src/guardrails/sanitize.d.ts +45 -19
- package/esm/src/guardrails/sanitize.js +177 -94
- package/esm/src/guardrails/sensitive.js +2 -1
- package/esm/src/guardrails/serialize.d.ts +35 -0
- package/esm/src/guardrails/serialize.js +58 -0
- package/esm/src/guardrails/testing.d.ts +17 -0
- package/esm/src/guardrails/testing.js +13 -0
- package/esm/src/guardrails/theorum-error.d.ts +12 -0
- package/esm/src/guardrails/theorum-error.js +15 -0
- package/esm/src/guardrails/tool-directives.d.ts +48 -0
- package/esm/src/guardrails/tool-directives.js +124 -0
- package/esm/src/guardrails/tool-result.d.ts +93 -0
- package/esm/src/guardrails/tool-result.js +276 -0
- package/esm/src/guardrails/types.d.ts +291 -0
- package/esm/src/guardrails/types.js +72 -0
- package/esm/src/host/client-turn.d.ts +19 -0
- package/esm/src/host/client-turn.js +36 -0
- package/esm/src/host/mint-trace.d.ts +1 -1
- package/esm/src/host/mod.d.ts +5 -3
- package/esm/src/host/mod.js +4 -3
- package/esm/src/kernel/auth/crypto.d.ts +42 -0
- package/esm/src/kernel/auth/crypto.js +106 -0
- package/esm/src/kernel/auth/mod.d.ts +11 -0
- package/esm/src/kernel/auth/mod.js +11 -0
- package/esm/src/kernel/auth/oauth.d.ts +47 -0
- package/esm/src/kernel/auth/oauth.js +278 -0
- package/esm/src/kernel/auth/types.d.ts +133 -0
- package/esm/src/kernel/auth/types.js +13 -0
- package/esm/src/kernel/engine/delta.d.ts +24 -2
- package/esm/src/kernel/engine/delta.js +478 -39
- package/esm/src/kernel/engine/live-inbound.d.ts +21 -0
- package/esm/src/kernel/engine/live-inbound.js +31 -0
- package/esm/src/kernel/engine/live-ingress.d.ts +19 -0
- package/esm/src/kernel/engine/live-ingress.js +47 -0
- package/esm/src/kernel/engine/repair.js +13 -12
- package/esm/src/kernel/engine/runner/gates.d.ts +1 -1
- package/esm/src/kernel/engine/runner/gates.js +130 -43
- package/esm/src/kernel/engine/runner/mod.d.ts +6 -4
- package/esm/src/kernel/engine/runner/mod.js +192 -53
- package/esm/src/kernel/engine/runner/schema-validation.js +3 -3
- package/esm/src/kernel/engine/runner/stages.d.ts +39 -0
- package/esm/src/kernel/engine/runner/stages.js +89 -0
- package/esm/src/kernel/engine/runner/state.d.ts +31 -0
- package/esm/src/kernel/engine/runner/steps.d.ts +1 -1
- package/esm/src/kernel/engine/runner/steps.js +244 -43
- package/esm/src/kernel/engine/runner/stream.d.ts +9 -3
- package/esm/src/kernel/engine/runner/stream.js +140 -44
- package/esm/src/kernel/engine/session/mod.d.ts +25 -0
- package/esm/src/kernel/engine/session/mod.js +557 -0
- package/esm/src/kernel/interaction-parts.d.ts +14 -0
- package/esm/src/kernel/interaction-parts.js +23 -0
- package/esm/src/kernel/mod.d.ts +21 -10
- package/esm/src/kernel/mod.js +11 -8
- package/esm/src/kernel/profile-graph.d.ts +159 -0
- package/esm/src/kernel/profile-graph.js +156 -0
- package/esm/src/kernel/registry/attachments.d.ts +12 -10
- package/esm/src/kernel/registry/attachments.js +33 -27
- package/esm/src/kernel/registry/catalog.d.ts +25 -24
- package/esm/src/kernel/registry/catalog.js +60 -101
- package/esm/src/kernel/registry/ingress.d.ts +9 -4
- package/esm/src/kernel/registry/ingress.js +97 -75
- package/esm/src/kernel/registry/profile-outputs.d.ts +4 -0
- package/esm/src/kernel/registry/profile-outputs.js +8 -0
- package/esm/src/kernel/registry/profiles.d.ts +55 -12
- package/esm/src/kernel/registry/profiles.js +413 -73
- package/esm/src/kernel/registry/provider-request.js +13 -7
- package/esm/src/kernel/registry/resolve.d.ts +8 -8
- package/esm/src/kernel/registry/resolve.js +169 -154
- package/esm/src/kernel/registry/schemas.js +1 -1
- package/esm/src/kernel/registry/sole-model.d.ts +8 -0
- package/esm/src/kernel/registry/sole-model.js +10 -0
- package/esm/src/kernel/registry/system-prompt.d.ts +10 -0
- package/esm/src/kernel/registry/system-prompt.js +40 -0
- package/esm/src/kernel/registry/system-role.d.ts +8 -0
- package/esm/src/kernel/registry/system-role.js +14 -0
- package/esm/src/kernel/registry/vault.d.ts +12 -7
- package/esm/src/kernel/registry/vault.js +32 -10
- package/esm/src/kernel/schema.d.ts +231 -0
- package/esm/src/kernel/schema.js +607 -0
- package/esm/src/kernel/stages.d.ts +175 -0
- package/esm/src/kernel/stages.js +476 -0
- package/esm/src/kernel/stop.d.ts +78 -19
- package/esm/src/kernel/stop.js +51 -16
- package/esm/src/kernel/tools/events.d.ts +41 -0
- package/esm/src/kernel/tools/events.js +71 -0
- package/esm/src/kernel/tools/execute.d.ts +84 -0
- package/esm/src/kernel/tools/execute.js +614 -0
- package/esm/src/kernel/tools/harness.d.ts +8 -0
- package/esm/src/kernel/tools/harness.js +46 -0
- package/esm/src/kernel/tools/invoke.d.ts +10 -0
- package/esm/src/kernel/tools/invoke.js +101 -0
- package/esm/src/kernel/tools/mod.d.ts +13 -0
- package/esm/src/kernel/tools/mod.js +11 -0
- package/esm/src/kernel/tools/permission.d.ts +15 -0
- package/esm/src/kernel/tools/permission.js +47 -0
- package/esm/src/kernel/tools/project.d.ts +12 -0
- package/esm/src/kernel/tools/project.js +36 -0
- package/esm/src/kernel/tools/registry.d.ts +23 -0
- package/esm/src/kernel/tools/registry.js +81 -0
- package/esm/src/kernel/tools/remote.d.ts +94 -0
- package/esm/src/kernel/tools/remote.js +577 -0
- package/esm/src/kernel/tools/resolve.d.ts +39 -0
- package/esm/src/kernel/tools/resolve.js +283 -0
- package/esm/src/kernel/tools/schema.d.ts +15 -0
- package/esm/src/kernel/tools/schema.js +176 -0
- package/esm/src/kernel/tools/stage-run.d.ts +105 -0
- package/esm/src/kernel/tools/stage-run.js +155 -0
- package/esm/src/kernel/tools/types.d.ts +394 -0
- package/esm/src/kernel/tools/types.js +9 -0
- package/esm/src/kernel/types.d.ts +540 -256
- package/esm/src/kernel/util/find-last.d.ts +2 -0
- package/esm/src/kernel/util/find-last.js +10 -0
- package/esm/src/observability/destinations.d.ts +31 -0
- package/esm/src/observability/destinations.js +67 -0
- package/esm/src/observability/mod.d.ts +10 -3
- package/esm/src/observability/mod.js +6 -2
- package/esm/src/observability/policy.d.ts +27 -0
- package/esm/src/observability/policy.js +80 -0
- package/esm/src/observability/resolve-policy.d.ts +16 -0
- package/esm/src/observability/resolve-policy.js +64 -0
- package/esm/src/observability/trace-attach.d.ts +8 -4
- package/esm/src/observability/trace-attach.js +50 -29
- package/esm/src/observability/trace-record.d.ts +23 -13
- package/esm/src/observability/trace-record.js +96 -39
- package/esm/src/observability/trace-sink.d.ts +19 -0
- package/esm/src/observability/trace-sink.js +10 -0
- package/esm/src/observability/trace-usage.d.ts +10 -3
- package/esm/src/observability/trace-usage.js +70 -17
- package/esm/src/observability/trace.d.ts +18 -7
- package/esm/src/observability/trace.js +34 -17
- package/esm/src/observability/types.d.ts +113 -0
- package/esm/src/observability/types.js +11 -0
- package/esm/src/presets/google/speech-voices.d.ts +11 -0
- package/esm/src/presets/google/speech-voices.js +41 -0
- package/esm/src/presets/google.d.ts +36 -24
- package/esm/src/presets/google.js +50 -63
- package/esm/src/presets/mod.d.ts +2 -2
- package/esm/src/presets/mod.js +1 -1
- package/esm/src/providers/create-provider.d.ts +20 -17
- package/esm/src/providers/create-provider.js +72 -26
- package/esm/src/providers/google/interactions/framing.d.ts +23 -0
- package/esm/src/providers/google/interactions/framing.js +269 -0
- package/esm/src/providers/google/interactions/mod.d.ts +7 -0
- package/esm/src/providers/google/interactions/mod.js +7 -0
- package/esm/src/providers/google/interactions/stream.d.ts +83 -0
- package/esm/src/providers/google/interactions/stream.js +588 -0
- package/esm/src/providers/google/keys.d.ts +26 -0
- package/esm/src/providers/{keys.js → google/keys.js} +19 -31
- package/esm/src/providers/google/live/framing.d.ts +49 -0
- package/esm/src/providers/google/live/framing.js +552 -0
- package/esm/src/providers/google/live/openapi-schema.d.ts +6 -0
- package/esm/src/providers/google/live/openapi-schema.js +46 -0
- package/esm/src/providers/google/live/session.d.ts +25 -0
- package/esm/src/providers/google/live/session.js +134 -0
- package/esm/src/providers/google/live/stream.d.ts +45 -0
- package/esm/src/providers/google/live/stream.js +214 -0
- package/esm/src/providers/google/urls.d.ts +6 -0
- package/esm/src/providers/google/urls.js +6 -0
- package/esm/src/providers/local/local.d.ts +30 -0
- package/esm/src/providers/{local.js → local/local.js} +66 -126
- package/esm/src/providers/local/mod.d.ts +9 -0
- package/esm/src/providers/local/mod.js +9 -0
- package/esm/src/providers/mod.d.ts +6 -3
- package/esm/src/providers/mod.js +3 -1
- package/esm/src/providers/openrouter/cache-control.d.ts +24 -0
- package/esm/src/providers/openrouter/cache-control.js +23 -0
- package/esm/src/providers/openrouter/chat.d.ts +107 -0
- package/esm/src/providers/{openrouter.js → openrouter/chat.js} +117 -231
- package/esm/src/providers/openrouter/image.d.ts +34 -0
- package/esm/src/providers/openrouter/image.js +275 -0
- package/esm/src/providers/openrouter/openai/chat-payload.d.ts +24 -0
- package/esm/src/providers/openrouter/openai/chat-payload.js +82 -0
- package/esm/src/providers/openrouter/openai/compat.d.ts +53 -0
- package/esm/src/providers/openrouter/openai/compat.js +213 -0
- package/esm/src/providers/openrouter/openai/image-payload.d.ts +18 -0
- package/esm/src/providers/openrouter/openai/image-payload.js +90 -0
- package/esm/src/providers/openrouter/openai/sdk-messages.d.ts +22 -0
- package/esm/src/providers/openrouter/openai/sdk-messages.js +122 -0
- package/esm/src/providers/openrouter/resolve-api-key.d.ts +9 -0
- package/esm/src/providers/openrouter/resolve-api-key.js +24 -0
- package/esm/src/providers/openrouter/speech.d.ts +23 -0
- package/esm/src/providers/{speech.js → openrouter/speech.js} +32 -55
- package/esm/src/providers/probe.d.ts +1 -0
- package/esm/src/providers/probe.js +22 -0
- package/esm/src/providers/shared/pcm.d.ts +12 -0
- package/esm/src/providers/{pcm.js → shared/pcm.js} +16 -3
- package/esm/src/providers/shared/sse.d.ts +18 -0
- package/esm/src/providers/shared/sse.js +87 -0
- package/esm/src/providers/shared/tool-args.d.ts +17 -0
- package/esm/src/providers/shared/tool-args.js +45 -0
- package/esm/src/providers/shared/upstream-tap.d.ts +5 -0
- package/esm/src/providers/{google-tap.js → shared/upstream-tap.js} +4 -7
- package/esm/src/providers/shared/upstream-tape.d.ts +6 -0
- package/esm/src/providers/{gemini-tape.js → shared/upstream-tape.js} +12 -22
- package/esm/src/providers/types.d.ts +27 -0
- package/esm/src/providers/types.js +1 -0
- package/package.json +11 -7
- package/docs/cli.md +0 -97
- package/docs/guardrails.md +0 -178
- package/docs/host.md +0 -97
- package/docs/kernel.md +0 -404
- package/docs/observability.md +0 -105
- package/docs/openrouter.md +0 -125
- package/docs/presets-google.md +0 -91
- package/docs/presets.md +0 -88
- package/docs/providers.md +0 -202
- package/docs/streaming.md +0 -96
- package/esm/src/kernel/engine/boundary.d.ts +0 -10
- package/esm/src/kernel/engine/boundary.js +0 -55
- package/esm/src/kernel/engine/runner/tools.d.ts +0 -13
- package/esm/src/kernel/engine/runner/tools.js +0 -198
- package/esm/src/kernel/registry/tools.d.ts +0 -12
- package/esm/src/kernel/registry/tools.js +0 -36
- package/esm/src/providers/expose-for-tests.d.ts +0 -1
- package/esm/src/providers/expose-for-tests.js +0 -25
- package/esm/src/providers/gemini-tape.d.ts +0 -2
- package/esm/src/providers/google-tap.d.ts +0 -3
- package/esm/src/providers/interactions.d.ts +0 -5
- package/esm/src/providers/interactions.js +0 -169
- package/esm/src/providers/keys.d.ts +0 -19
- package/esm/src/providers/local.d.ts +0 -29
- package/esm/src/providers/openrouter-mod.d.ts +0 -13
- package/esm/src/providers/openrouter-mod.js +0 -12
- package/esm/src/providers/openrouter-payload.d.ts +0 -39
- package/esm/src/providers/openrouter-payload.js +0 -195
- package/esm/src/providers/openrouter.d.ts +0 -15
- package/esm/src/providers/pcm.d.ts +0 -7
- package/esm/src/providers/provider.d.ts +0 -15
- package/esm/src/providers/provider.js +0 -202
- package/esm/src/providers/speech.d.ts +0 -23
- package/esm/src/providers/sse.d.ts +0 -7
- package/esm/src/providers/sse.js +0 -55
- package/esm/src/streaming/mod.d.ts +0 -9
- package/esm/src/streaming/mod.js +0 -8
- /package/esm/src/{streaming → host}/readStreamingJsonStringField.d.ts +0 -0
- /package/esm/src/{streaming → host}/readStreamingJsonStringField.js +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime vocabulary and field catalog for THEORUM profile types.
|
|
3
|
+
*
|
|
4
|
+
* Closed unions live here as `as const` arrays; TypeScript types are derived
|
|
5
|
+
* from those arrays. Host UIs and docs import this module (no Deno APIs) so
|
|
6
|
+
* dropdowns and hover tips stay in lockstep with the kernel.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/** lexicon-exempt-file: authoring field-meta / closed unions — not runtime user or model copy (P2) */
|
|
11
|
+
import { EGRESS_ON_BLOCK, type EgressOnBlock } from '../guardrails/types.js';
|
|
12
|
+
export { EGRESS_ON_BLOCK, type EgressOnBlock };
|
|
13
|
+
/** Primary profile archetype. Discriminated union key for `ProfileDefinition` and `Profile`. */
|
|
14
|
+
export declare const PROFILE_TYPES: readonly ["text", "image", "speech", "live", "host"];
|
|
15
|
+
export type ProfileType = (typeof PROFILE_TYPES)[number];
|
|
16
|
+
/** Model reasoning effort level normalized across provider adapters. */
|
|
17
|
+
export declare const THINKING_LEVELS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
18
|
+
export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
|
|
19
|
+
/** Wire protocol for a profile. */
|
|
20
|
+
export declare const PROTOCOLS: readonly ["geminiInteractions", "geminiLive", "openAi"];
|
|
21
|
+
export type Protocol = (typeof PROTOCOLS)[number];
|
|
22
|
+
/** Transport provider for a profile. */
|
|
23
|
+
export declare const PROVIDERS: readonly ["google", "openrouter", "local"];
|
|
24
|
+
export type Provider = (typeof PROVIDERS)[number];
|
|
25
|
+
/**
|
|
26
|
+
* Legal `createProvider` pairs. Keep this table in lockstep with the factory.
|
|
27
|
+
* Keys are protocols; values are the providers that protocol may bind.
|
|
28
|
+
*/
|
|
29
|
+
export declare const PROTOCOL_PROVIDERS: {
|
|
30
|
+
readonly geminiInteractions: readonly ["google"];
|
|
31
|
+
readonly geminiLive: readonly ["google"];
|
|
32
|
+
readonly openAi: readonly ["openrouter", "local"];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Legal wire protocols for each profile archetype.
|
|
36
|
+
* 'live' profiles require 'geminiLive'; turn-based archetypes require turn protocols;
|
|
37
|
+
* 'host' never runs a model and binds no protocol.
|
|
38
|
+
*/
|
|
39
|
+
export declare const PROFILE_TYPE_PROTOCOLS: {
|
|
40
|
+
readonly text: readonly ["geminiInteractions", "openAi"];
|
|
41
|
+
readonly image: readonly ["geminiInteractions", "openAi"];
|
|
42
|
+
readonly speech: readonly ["geminiInteractions", "openAi"];
|
|
43
|
+
readonly live: readonly ["geminiLive"];
|
|
44
|
+
readonly host: readonly [];
|
|
45
|
+
};
|
|
46
|
+
export type ProfileTypeProtocol<T extends ProfileType> = (typeof PROFILE_TYPE_PROTOCOLS)[T][number];
|
|
47
|
+
/** Protocols allowed for a profile archetype (`type`). */
|
|
48
|
+
export declare function protocolsForProfileType(type: ProfileType): readonly Protocol[];
|
|
49
|
+
/** True when the protocol is valid for the given profile archetype. */
|
|
50
|
+
export declare function isValidProfileProtocol(type: ProfileType, protocol: Protocol): boolean;
|
|
51
|
+
/** Named vault key slots for host-supplied credentials (provider-neutral). */
|
|
52
|
+
export declare const KEY_SLOTS: readonly ["slotA", "slotB", "slotC", "paid"];
|
|
53
|
+
export type KeySlot = (typeof KEY_SLOTS)[number];
|
|
54
|
+
/** Key slots that may overflow to `paid` after quota backoff. */
|
|
55
|
+
export declare const OVERFLOW_KEY_SLOTS: readonly ["slotA", "slotB", "slotC"];
|
|
56
|
+
export type OverflowKeySlot = (typeof OVERFLOW_KEY_SLOTS)[number];
|
|
57
|
+
/** Host vault: one optional credential string per key slot. */
|
|
58
|
+
export type KeyVault = Record<KeySlot, string | undefined>;
|
|
59
|
+
/** Profile-level control a caller may toggle at turn time. */
|
|
60
|
+
/** Normalized multimodal part category. */
|
|
61
|
+
export declare const MEDIA_INPUT_KIND_VALUES: readonly ["image", "audio", "video", "document"];
|
|
62
|
+
export type MediaInputKind = (typeof MEDIA_INPUT_KIND_VALUES)[number];
|
|
63
|
+
/** Provider thinking-summary behavior. */
|
|
64
|
+
export declare const SUMMARY_MODES: readonly ["auto", "none"];
|
|
65
|
+
export type SummaryMode = (typeof SUMMARY_MODES)[number];
|
|
66
|
+
/** Stream delivery mode. */
|
|
67
|
+
export declare const STREAM_MODES: readonly ["sse", "buffered"];
|
|
68
|
+
export type StreamMode = (typeof STREAM_MODES)[number];
|
|
69
|
+
/** Audio container for speech generation output. */
|
|
70
|
+
export declare const SPEECH_AUDIO_FORMATS: readonly ["pcm", "mp3"];
|
|
71
|
+
export type SpeechAudioFormat = (typeof SPEECH_AUDIO_FORMATS)[number];
|
|
72
|
+
/** Speech `format` values legal for a wire protocol (`assertSpeechRole` / UI). */
|
|
73
|
+
export declare function speechFormatsForProtocol(protocol: Protocol): readonly SpeechAudioFormat[];
|
|
74
|
+
export declare function isSpeechFormatAllowedForProtocol(protocol: Protocol, format: SpeechAudioFormat): boolean;
|
|
75
|
+
/** Snap an illegal or omitted format to the first legal value for the protocol. */
|
|
76
|
+
export declare function coerceSpeechFormat(protocol: Protocol, format: SpeechAudioFormat | undefined): SpeechAudioFormat;
|
|
77
|
+
/** Live session activity handling (barge-in behavior). */
|
|
78
|
+
export declare const LIVE_ACTIVITY_HANDLINGS: readonly ["START_OF_ACTIVITY_INTERRUPTS", "NO_INTERRUPTION"];
|
|
79
|
+
export type LiveActivityHandling = (typeof LIVE_ACTIVITY_HANDLINGS)[number];
|
|
80
|
+
/** Live session voice activity detection sensitivity. */
|
|
81
|
+
export declare const LIVE_SPEECH_SENSITIVITIES: readonly ["START_SENSITIVITY_LOW", "START_SENSITIVITY_HIGH", "END_SENSITIVITY_LOW", "END_SENSITIVITY_HIGH"];
|
|
82
|
+
export type LiveSpeechSensitivity = (typeof LIVE_SPEECH_SENSITIVITIES)[number];
|
|
83
|
+
/** Live session context window compression mode. */
|
|
84
|
+
export declare const LIVE_CONTEXT_COMPRESSIONS: readonly ["slidingWindow", "none"];
|
|
85
|
+
export type LiveContextCompression = (typeof LIVE_CONTEXT_COMPRESSIONS)[number];
|
|
86
|
+
/** Structured-output enforcement mode. */
|
|
87
|
+
export declare const SCHEMA_ENFORCEMENTS: readonly ["responseFormat", "prompt"];
|
|
88
|
+
export type SchemaEnforcement = (typeof SCHEMA_ENFORCEMENTS)[number];
|
|
89
|
+
/** Compaction threshold meter. */
|
|
90
|
+
export declare const COMPACTION_METERS: readonly ["history", "input"];
|
|
91
|
+
export type CompactionMeter = (typeof COMPACTION_METERS)[number];
|
|
92
|
+
/** When compaction runs relative to the primary turn. */
|
|
93
|
+
export declare const COMPACTION_TIMINGS: readonly ["before", "after"];
|
|
94
|
+
export type CompactionTiming = (typeof COMPACTION_TIMINGS)[number];
|
|
95
|
+
/** OpenRouter prompt-cache mode (models.*.cache.mode). */
|
|
96
|
+
export declare const CACHE_MODES: readonly ["automatic", "system"];
|
|
97
|
+
export type CacheMode = (typeof CACHE_MODES)[number];
|
|
98
|
+
/** OpenRouter ephemeral cache TTL (models.*.cache.ttl). */
|
|
99
|
+
export declare const CACHE_TTLS: readonly ["5m", "1h"];
|
|
100
|
+
export type CacheTtl = (typeof CACHE_TTLS)[number];
|
|
101
|
+
/** Why a turn ended (provider-neutral). */
|
|
102
|
+
export declare const TURN_STOP_KINDS: readonly ["completed", "length", "tool", "gate", "filtered", "provider_error", "cancelled", "stream_incomplete", "interrupted", "generation_complete"];
|
|
103
|
+
export type TurnStopKind = (typeof TURN_STOP_KINDS)[number];
|
|
104
|
+
/**
|
|
105
|
+
* Stop kinds eligible for `continueFrom` / resumption allowlists.
|
|
106
|
+
* Excludes terminal-success, user abort, tool/gate suspension, filter, and live-only
|
|
107
|
+
* boundaries — those use other host paths (or are not resumeable).
|
|
108
|
+
*/
|
|
109
|
+
export declare const CONTINUE_STOP_KINDS: readonly ["length", "stream_incomplete", "provider_error"];
|
|
110
|
+
export type ContinueStopKind = (typeof CONTINUE_STOP_KINDS)[number];
|
|
111
|
+
/**
|
|
112
|
+
* Turn / utterance-cycle timeline stages (`docs/contracts/stages.md`).
|
|
113
|
+
* Replaces the former steer barriers (`pre_llm` / `pre_tool_followup`).
|
|
114
|
+
*/
|
|
115
|
+
export declare const TURN_STAGES: readonly ["pre_turn", "pre_tool", "post_tool", "before_end", "post_turn"];
|
|
116
|
+
export type TurnStage = (typeof TURN_STAGES)[number];
|
|
117
|
+
/** True when `value` is a known `TurnStage`. */
|
|
118
|
+
export declare function isTurnStage(value: unknown): value is TurnStage;
|
|
119
|
+
/** Stages where inject is physically meaningful (still requires inject gate). */
|
|
120
|
+
export declare const TURN_INJECT_STAGES: readonly ["pre_turn", "post_tool", "before_end"];
|
|
121
|
+
export type TurnInjectStage = (typeof TURN_INJECT_STAGES)[number];
|
|
122
|
+
/** True when inject is physically meaningful at this stage (gate still required). */
|
|
123
|
+
export declare function isTurnInjectStage(value: unknown): value is TurnInjectStage;
|
|
124
|
+
/** `pre_tool` gate kinds — confirm-to-run / permission / auth. Not awaiting. */
|
|
125
|
+
export declare const TOOL_GATE_KINDS: readonly ["confirmation", "permission", "auth"];
|
|
126
|
+
export type ToolGateKind = (typeof TOOL_GATE_KINDS)[number];
|
|
127
|
+
/** True when `value` is a known tool-gate kind. */
|
|
128
|
+
export declare function isToolGateKind(value: unknown): value is ToolGateKind;
|
|
129
|
+
/** `awaiting_user_input.kind` — harness ask_user / human-as-product completions. */
|
|
130
|
+
export declare const AWAITING_USER_INPUT_KINDS: readonly ["confirm", "choice", "text"];
|
|
131
|
+
export type AwaitingUserInputKind = (typeof AWAITING_USER_INPUT_KINDS)[number];
|
|
132
|
+
/** Discriminator on tool output for awaiting completions. */
|
|
133
|
+
export declare const AWAITING_USER_INPUT_STATUS: "awaiting_user_input";
|
|
134
|
+
/** Per-tool visibility tier — enforced by the kernel at resolve time. */
|
|
135
|
+
export declare const TOOL_LOAD_TIERS: readonly ["T0", "T1", "T2"];
|
|
136
|
+
export type ToolLoadTier = (typeof TOOL_LOAD_TIERS)[number];
|
|
137
|
+
/** HTTP verbs supported by declarative HTTP tools. */
|
|
138
|
+
export declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
139
|
+
export type HttpMethod = (typeof HTTP_METHODS)[number];
|
|
140
|
+
/** When remote tool auth is missing or expired. */
|
|
141
|
+
export declare const AUTH_UNAUTHENTICATED_POLICIES: readonly ["pause", "report_to_model"];
|
|
142
|
+
export type AuthUnauthenticatedPolicy = (typeof AUTH_UNAUTHENTICATED_POLICIES)[number];
|
|
143
|
+
/** Registered tool discriminant (`registerTool`). */
|
|
144
|
+
export declare const TOOL_TYPES: readonly ["builtin", "function", "http", "mcp"];
|
|
145
|
+
/** Semantic access level — host policy / UI; not enforced by execute. */
|
|
146
|
+
export declare const TOOL_ACCESS: readonly ["read-only", "read-write", "destructive"];
|
|
147
|
+
export type ToolAccess = (typeof TOOL_ACCESS)[number];
|
|
148
|
+
/** Execution authorization tier for registered tools. */
|
|
149
|
+
export declare const TOOL_PERMISSION: readonly ["auto", "session_consent", "always_confirm"];
|
|
150
|
+
export type ToolPermission = (typeof TOOL_PERMISSION)[number];
|
|
151
|
+
/** Credential attachment modes for HTTP and MCP tools (`auth.type`). */
|
|
152
|
+
export declare const TOOL_AUTH_TYPES: readonly ["bearer", "api_key", "oauth2"];
|
|
153
|
+
export type ToolAuthType = (typeof TOOL_AUTH_TYPES)[number];
|
|
154
|
+
/** Playground auth select — includes UI-only `none` (omits auth at compile time). */
|
|
155
|
+
export declare const PLAYGROUND_AUTH_TYPES: readonly ["none", "bearer", "api_key", "oauth2"];
|
|
156
|
+
export type PlaygroundAuthType = (typeof PLAYGROUND_AUTH_TYPES)[number];
|
|
157
|
+
export type ToolType = (typeof TOOL_TYPES)[number];
|
|
158
|
+
/** Custom registerTool discriminants (excludes provider builtins). */
|
|
159
|
+
export type CustomToolType = Exclude<ToolType, 'builtin'>;
|
|
160
|
+
/**
|
|
161
|
+
* MIME essence → normalized media part category.
|
|
162
|
+
*
|
|
163
|
+
* This table is the complete media-input vocabulary of the package: every MIME
|
|
164
|
+
* any supported transport may carry on a turn appears here exactly once, and
|
|
165
|
+
* nothing else is a media input type. `assertMediaMime` (`registry/ingress.ts`)
|
|
166
|
+
* refuses anything absent from it, so hosts declare what they accept in
|
|
167
|
+
* `inputs.attachments.accept` / `inputs.voice.accept` and keep no second table.
|
|
168
|
+
*
|
|
169
|
+
* Contents are the union of the documented provider input lists:
|
|
170
|
+
* - Google Interactions / Live (image, audio, video, document lists verified
|
|
171
|
+
* 2026-09-12) — the widest of the three and therefore the table's shape. The
|
|
172
|
+
* document row is Google's document-understanding list in full: PDF, plain
|
|
173
|
+
* text, HTML, CSS, Markdown (`text/md`), CSV, XML, RTF, JavaScript
|
|
174
|
+
* (`text/javascript`, `application/x-javascript`) and Python
|
|
175
|
+
* (`text/x-python`, `application/x-python`); `application/json` is an
|
|
176
|
+
* established row alongside it. TypeScript, `application/xml` and
|
|
177
|
+
* `application/rtf` are NOT on Google's list and are therefore not rows.
|
|
178
|
+
* - OpenRouter / OpenAI-compat (`providers/openrouter/openai/compat.ts`,
|
|
179
|
+
* `sdk-messages.ts`): the adapters wire every `MediaInputKind` (image →
|
|
180
|
+
* `image_url`/`image`, audio → `input_audio`, video and document → `file`)
|
|
181
|
+
* and forward the part's MIME verbatim, so their accepted set is open-ended
|
|
182
|
+
* and adds no rows. What they cannot carry — a `uri` reference part — is
|
|
183
|
+
* refused at request time with `TheorumError`, not by a second MIME list.
|
|
184
|
+
*
|
|
185
|
+
* Alias essences that providers also emit (`image/jpg`, `video/mov`,
|
|
186
|
+
* `audio/x-wav`, `video/x-ms-wmv`, …) are rows here; `resolveInputParts`
|
|
187
|
+
* canonicalizes `image/jpg` to `image/jpeg` on the wire.
|
|
188
|
+
*/
|
|
189
|
+
export declare const MEDIA_INPUT_KINDS: Record<string, MediaInputKind>;
|
|
190
|
+
/** Type-prefix wildcards accepted by `mimeAllowed`. */
|
|
191
|
+
export declare const MEDIA_WILDCARDS: readonly ["image/*", "audio/*", "video/*"];
|
|
192
|
+
/** Attachment `accept` values the kernel can classify (wildcards + known types). */
|
|
193
|
+
export declare const ATTACHMENT_ACCEPT_MIMES: readonly string[];
|
|
194
|
+
/** Voice `accept` values the kernel can classify (wildcard + known audio types). */
|
|
195
|
+
export declare const VOICE_ACCEPT_MIMES: readonly string[];
|
|
196
|
+
/** Providers allowed for a protocol. */
|
|
197
|
+
export declare function providersFor(protocol: Protocol): readonly Provider[];
|
|
198
|
+
/** Protocols allowed for a provider. */
|
|
199
|
+
export declare function protocolsFor(provider: Provider): readonly Protocol[];
|
|
200
|
+
/** True when `createProvider` will accept this pair. */
|
|
201
|
+
export declare function isValidPair(protocol: Protocol, provider: Provider): boolean;
|
|
202
|
+
/** When protocol changes, snap provider to a valid partner. */
|
|
203
|
+
export declare function coerceProvider(protocol: Protocol, provider: Provider): Provider;
|
|
204
|
+
/** When provider changes, snap protocol to a valid partner. */
|
|
205
|
+
export declare function coerceProtocol(protocol: Protocol, provider: Provider): Protocol;
|
|
206
|
+
/** Metadata for one profile (or adjacent) field, used by docs/UI hover. */
|
|
207
|
+
export type FieldMeta = {
|
|
208
|
+
type: string;
|
|
209
|
+
doc: string;
|
|
210
|
+
options?: readonly string[];
|
|
211
|
+
optionDescriptions?: Record<string, string>;
|
|
212
|
+
optionNote?: string;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Parents whose next key is a host-owned map key (model id, slot name, …).
|
|
216
|
+
* The annotator substitutes `*` so `models.flash.apiId` → `models.*.apiId`.
|
|
217
|
+
*/
|
|
218
|
+
export declare const DYNAMIC_FIELD_PARENTS: ReadonlySet<string>;
|
|
219
|
+
/** Resolve a key stack from authored source into a catalog path. */
|
|
220
|
+
export declare function catalogPathFor(keys: readonly string[]): string;
|
|
221
|
+
/**
|
|
222
|
+
* Authoring-surface catalog for `Profile` / `defineProfile`.
|
|
223
|
+
* Hover UIs look up dotted paths. Adding a profile field? Add it here.
|
|
224
|
+
*/
|
|
225
|
+
export declare const PROFILE_FIELDS: Record<string, FieldMeta>;
|
|
226
|
+
/** Adjacent tool catalog fields that appear next to profile examples. */
|
|
227
|
+
export declare const EXTRA_FIELDS: Record<string, FieldMeta>;
|
|
228
|
+
/** Look up hover metadata for a dotted path (profile first, then extra). */
|
|
229
|
+
export declare function fieldMeta(path: string): FieldMeta | undefined;
|
|
230
|
+
export type { ProfileGraphEditor, ProfileGraphFacet, ProfileGraphFacetId, ProfileGraphRole, } from './profile-graph.js';
|
|
231
|
+
export { PROFILE_GRAPH, profileGraphFacet, spineFacetsForProfileType, } from './profile-graph.js';
|