@marinoscar/platform-api 0.1.0-next.4 → 0.1.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/ai/core/ai-error.d.ts +15 -158
- package/dist/ai/core/ai-error.d.ts.map +1 -1
- package/dist/ai/core/ai-error.js +58 -221
- package/dist/ai/core/ai-error.js.map +1 -1
- package/dist/ai/core/capabilities.d.ts +3 -126
- package/dist/ai/core/capabilities.d.ts.map +1 -1
- package/dist/ai/core/capabilities.js +13 -109
- package/dist/ai/core/capabilities.js.map +1 -1
- package/dist/ai/core/conversation.d.ts +2 -15
- package/dist/ai/core/conversation.d.ts.map +1 -1
- package/dist/ai/core/conversation.js +9 -54
- package/dist/ai/core/conversation.js.map +1 -1
- package/dist/ai/core/hosted-tools.d.ts +3 -172
- package/dist/ai/core/hosted-tools.d.ts.map +1 -1
- package/dist/ai/core/hosted-tools.js +20 -286
- package/dist/ai/core/hosted-tools.js.map +1 -1
- package/dist/ai/core/provider-adapter.interface.d.ts +3 -260
- package/dist/ai/core/provider-adapter.interface.d.ts.map +1 -1
- package/dist/ai/core/provider-adapter.interface.js +7 -29
- package/dist/ai/core/provider-adapter.interface.js.map +1 -1
- package/dist/ai/core/structured-output.d.ts +3 -49
- package/dist/ai/core/structured-output.d.ts.map +1 -1
- package/dist/ai/core/structured-output.js +9 -80
- package/dist/ai/core/structured-output.js.map +1 -1
- package/dist/ai/core/tools.d.ts +3 -93
- package/dist/ai/core/tools.d.ts.map +1 -1
- package/dist/ai/core/tools.js +9 -73
- package/dist/ai/core/tools.js.map +1 -1
- package/dist/ai/core/types/file-inputs.types.d.ts +3 -102
- package/dist/ai/core/types/file-inputs.types.d.ts.map +1 -1
- package/dist/ai/core/types/file-inputs.types.js +14 -78
- package/dist/ai/core/types/file-inputs.types.js.map +1 -1
- package/dist/ai/core/types/media.types.d.ts +3 -616
- package/dist/ai/core/types/media.types.d.ts.map +1 -1
- package/dist/ai/core/types/media.types.js +33 -203
- package/dist/ai/core/types/media.types.js.map +1 -1
- package/dist/ai/core/types/responses.types.d.ts +3 -619
- package/dist/ai/core/types/responses.types.d.ts.map +1 -1
- package/dist/ai/core/types/responses.types.js +9 -57
- package/dist/ai/core/types/responses.types.js.map +1 -1
- package/dist/ai/http/dto/ai-images.dto.d.ts +4 -4
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +3 -3
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/providers/anthropic/anthropic-client.factory.d.ts +13 -15
- package/dist/ai/providers/anthropic/anthropic-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/anthropic/anthropic-client.factory.js +23 -52
- package/dist/ai/providers/anthropic/anthropic-client.factory.js.map +1 -1
- package/dist/ai/providers/anthropic/anthropic.adapter.d.ts +15 -51
- package/dist/ai/providers/anthropic/anthropic.adapter.d.ts.map +1 -1
- package/dist/ai/providers/anthropic/anthropic.adapter.js +29 -293
- package/dist/ai/providers/anthropic/anthropic.adapter.js.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.d.ts +10 -14
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.js +20 -53
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.js.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai.adapter.d.ts +14 -31
- package/dist/ai/providers/azure-openai/azure-openai.adapter.d.ts.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai.adapter.js +25 -170
- package/dist/ai/providers/azure-openai/azure-openai.adapter.js.map +1 -1
- package/dist/ai/providers/gemini/gemini-client.factory.d.ts +13 -18
- package/dist/ai/providers/gemini/gemini-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/gemini/gemini-client.factory.js +24 -68
- package/dist/ai/providers/gemini/gemini-client.factory.js.map +1 -1
- package/dist/ai/providers/gemini/gemini.adapter.d.ts +15 -58
- package/dist/ai/providers/gemini/gemini.adapter.d.ts.map +1 -1
- package/dist/ai/providers/gemini/gemini.adapter.js +29 -348
- package/dist/ai/providers/gemini/gemini.adapter.js.map +1 -1
- package/dist/ai/providers/openai/openai-client.factory.d.ts +13 -35
- package/dist/ai/providers/openai/openai-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/openai/openai-client.factory.js +25 -64
- package/dist/ai/providers/openai/openai-client.factory.js.map +1 -1
- package/dist/ai/providers/openai/openai.adapter.d.ts +15 -48
- package/dist/ai/providers/openai/openai.adapter.d.ts.map +1 -1
- package/dist/ai/providers/openai/openai.adapter.js +27 -206
- package/dist/ai/providers/openai/openai.adapter.js.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.d.ts +11 -11
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.js +18 -41
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.js.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.d.ts +14 -32
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.d.ts.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.js +25 -149
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.js.map +1 -1
- package/dist/ai/providers/platform-ai-tracer.d.ts +4 -0
- package/dist/ai/providers/platform-ai-tracer.d.ts.map +1 -0
- package/dist/ai/providers/platform-ai-tracer.js +20 -0
- package/dist/ai/providers/platform-ai-tracer.js.map +1 -0
- package/dist/ai/runtime/ai-image-run-request.d.ts +1 -1
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.d.ts +28 -5
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.d.ts.map +1 -1
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.js +54 -9
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.js.map +1 -1
- package/dist/ai/testing/index.d.ts +1 -1
- package/dist/ai/testing/index.d.ts.map +1 -1
- package/dist/ai/testing/index.js +2 -1
- package/dist/ai/testing/index.js.map +1 -1
- package/dist/jobs/rate-limit.error.d.ts +2 -26
- package/dist/jobs/rate-limit.error.d.ts.map +1 -1
- package/dist/jobs/rate-limit.error.js +4 -52
- package/dist/jobs/rate-limit.error.js.map +1 -1
- package/dist/storage/config/storage-config.controller.d.ts +1 -1
- package/package.json +3 -2
- package/dist/ai/providers/anthropic/anthropic-errors.d.ts +0 -16
- package/dist/ai/providers/anthropic/anthropic-errors.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-errors.js +0 -156
- package/dist/ai/providers/anthropic/anthropic-errors.js.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.d.ts +0 -80
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.js +0 -536
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.js.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-model-catalog.d.ts +0 -49
- package/dist/ai/providers/anthropic/anthropic-model-catalog.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-model-catalog.js +0 -198
- package/dist/ai/providers/anthropic/anthropic-model-catalog.js.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.d.ts +0 -35
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.js +0 -203
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.js.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.d.ts +0 -18
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.js +0 -120
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.js.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.d.ts +0 -59
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.js +0 -206
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.js.map +0 -1
- package/dist/ai/providers/azure-openai/azure-openai-settings.d.ts +0 -23
- package/dist/ai/providers/azure-openai/azure-openai-settings.d.ts.map +0 -1
- package/dist/ai/providers/azure-openai/azure-openai-settings.js +0 -54
- package/dist/ai/providers/azure-openai/azure-openai-settings.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-content.mapper.d.ts +0 -98
- package/dist/ai/providers/gemini/gemini-content.mapper.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-content.mapper.js +0 -665
- package/dist/ai/providers/gemini/gemini-content.mapper.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.d.ts +0 -13
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.js +0 -78
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-errors.d.ts +0 -32
- package/dist/ai/providers/gemini/gemini-errors.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-errors.js +0 -191
- package/dist/ai/providers/gemini/gemini-errors.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-model-catalog.d.ts +0 -45
- package/dist/ai/providers/gemini/gemini-model-catalog.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-model-catalog.js +0 -264
- package/dist/ai/providers/gemini/gemini-model-catalog.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-stream.mapper.d.ts +0 -31
- package/dist/ai/providers/gemini/gemini-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-stream.mapper.js +0 -118
- package/dist/ai/providers/gemini/gemini-stream.mapper.js.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-fixtures.d.ts +0 -80
- package/dist/ai/providers/gemini/testing/gemini-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-fixtures.js +0 -118
- package/dist/ai/providers/gemini/testing/gemini-fixtures.js.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.d.ts +0 -82
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.d.ts.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.js +0 -342
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.js.map +0 -1
- package/dist/ai/providers/openai/openai-audio.mapper.d.ts +0 -42
- package/dist/ai/providers/openai/openai-audio.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-audio.mapper.js +0 -266
- package/dist/ai/providers/openai/openai-audio.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-call-telemetry.d.ts +0 -25
- package/dist/ai/providers/openai/openai-call-telemetry.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-call-telemetry.js +0 -93
- package/dist/ai/providers/openai/openai-call-telemetry.js.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.d.ts +0 -41
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.js +0 -173
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.engine.d.ts +0 -33
- package/dist/ai/providers/openai/openai-chat-completions.engine.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.engine.js +0 -165
- package/dist/ai/providers/openai/openai-chat-completions.engine.js.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.mapper.d.ts +0 -42
- package/dist/ai/providers/openai/openai-chat-completions.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.mapper.js +0 -304
- package/dist/ai/providers/openai/openai-chat-completions.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-embeddings.mapper.d.ts +0 -25
- package/dist/ai/providers/openai/openai-embeddings.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-embeddings.mapper.js +0 -81
- package/dist/ai/providers/openai/openai-embeddings.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-errors.d.ts +0 -45
- package/dist/ai/providers/openai/openai-errors.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-errors.js +0 -247
- package/dist/ai/providers/openai/openai-errors.js.map +0 -1
- package/dist/ai/providers/openai/openai-family-guards.d.ts +0 -4
- package/dist/ai/providers/openai/openai-family-guards.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-family-guards.js +0 -19
- package/dist/ai/providers/openai/openai-family-guards.js.map +0 -1
- package/dist/ai/providers/openai/openai-images.mapper.d.ts +0 -23
- package/dist/ai/providers/openai/openai-images.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-images.mapper.js +0 -164
- package/dist/ai/providers/openai/openai-images.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-model-catalog.d.ts +0 -36
- package/dist/ai/providers/openai/openai-model-catalog.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-model-catalog.js +0 -209
- package/dist/ai/providers/openai/openai-model-catalog.js.map +0 -1
- package/dist/ai/providers/openai/openai-realtime.mapper.d.ts +0 -18
- package/dist/ai/providers/openai/openai-realtime.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-realtime.mapper.js +0 -159
- package/dist/ai/providers/openai/openai-realtime.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-redirect-guard.d.ts +0 -9
- package/dist/ai/providers/openai/openai-redirect-guard.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-redirect-guard.js +0 -61
- package/dist/ai/providers/openai/openai-redirect-guard.js.map +0 -1
- package/dist/ai/providers/openai/openai-responses.engine.d.ts +0 -50
- package/dist/ai/providers/openai/openai-responses.engine.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-responses.engine.js +0 -206
- package/dist/ai/providers/openai/openai-responses.engine.js.map +0 -1
- package/dist/ai/providers/openai/openai-responses.mapper.d.ts +0 -64
- package/dist/ai/providers/openai/openai-responses.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-responses.mapper.js +0 -580
- package/dist/ai/providers/openai/openai-responses.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-stream.mapper.d.ts +0 -28
- package/dist/ai/providers/openai/openai-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-stream.mapper.js +0 -139
- package/dist/ai/providers/openai/openai-stream.mapper.js.map +0 -1
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.d.ts +0 -24
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.js +0 -72
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.js.map +0 -1
- package/dist/ai/providers/openai/testing/conformance-responders.d.ts +0 -7
- package/dist/ai/providers/openai/testing/conformance-responders.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/conformance-responders.js +0 -64
- package/dist/ai/providers/openai/testing/conformance-responders.js.map +0 -1
- package/dist/ai/providers/openai/testing/openai-fixtures.d.ts +0 -52
- package/dist/ai/providers/openai/testing/openai-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/openai-fixtures.js +0 -208
- package/dist/ai/providers/openai/testing/openai-fixtures.js.map +0 -1
- package/dist/ai/providers/openai/testing/openai-mock-transport.d.ts +0 -242
- package/dist/ai/providers/openai/testing/openai-mock-transport.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/openai-mock-transport.js +0 -523
- package/dist/ai/providers/openai/testing/openai-mock-transport.js.map +0 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.d.ts +0 -13
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.d.ts.map +0 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.js +0 -29
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.js.map +0 -1
|
@@ -1,127 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* the catalog table and in administrator overrides, so renaming one is a data
|
|
5
|
-
* migration, not a refactor. The vocabulary is OPEN (PP-14.17, #935): an app
|
|
6
|
-
* or package adds its own with `registerAiCapability`; this tuple is only the
|
|
7
|
-
* built-in part, which registers itself through that same function
|
|
8
|
-
* (`./capability-registry.ts`).
|
|
9
|
-
*
|
|
10
|
-
* @stability experimental
|
|
11
|
-
*/
|
|
12
|
-
export declare const BUILTIN_AI_CAPABILITIES: readonly ["responses", "reasoning", "tools", "hosted_tools", "structured_output", "streaming", "vision_input", "file_input", "image_generation", "image_edit", "audio_transcription", "audio_speech", "embeddings", "realtime"];
|
|
13
|
-
/**
|
|
14
|
-
* The capabilities the platform ships.
|
|
15
|
-
*
|
|
16
|
-
* @deprecated Use {@link BUILTIN_AI_CAPABILITIES}. The list is no longer the
|
|
17
|
-
* set of capabilities a deployment knows (PP-14.17, #935); ask
|
|
18
|
-
* `listAiCapabilities()` or `GET /api/admin/ai/capabilities`. Kept as an
|
|
19
|
-
* alias for one release.
|
|
20
|
-
* @stability experimental
|
|
21
|
-
*/
|
|
22
|
-
export declare const AI_CAPABILITIES: readonly ["responses", "reasoning", "tools", "hosted_tools", "structured_output", "streaming", "vision_input", "file_input", "image_generation", "image_edit", "audio_transcription", "audio_speech", "embeddings", "realtime"];
|
|
23
|
-
/**
|
|
24
|
-
* One of {@link BUILTIN_AI_CAPABILITIES}.
|
|
25
|
-
*
|
|
26
|
-
* @stability experimental
|
|
27
|
-
*/
|
|
28
|
-
export type BuiltinAiCapability = (typeof BUILTIN_AI_CAPABILITIES)[number];
|
|
29
|
-
/**
|
|
30
|
-
* A capability id: a built-in one (autocompleted) or any string an app or
|
|
31
|
-
* package registered with `registerAiCapability`. See
|
|
32
|
-
* `AI_CAPABILITY_ID_PATTERN`.
|
|
33
|
-
*
|
|
34
|
-
* @stability experimental
|
|
35
|
-
*/
|
|
36
|
-
export type AiCapability = BuiltinAiCapability | (string & {});
|
|
37
|
-
/**
|
|
38
|
-
* What a model can read.
|
|
39
|
-
*
|
|
40
|
-
* @stability experimental
|
|
41
|
-
*/
|
|
42
|
-
export declare const AI_INPUT_MODALITIES: readonly ["text", "image", "audio", "file"];
|
|
43
|
-
/**
|
|
44
|
-
* What a model can produce.
|
|
45
|
-
*
|
|
46
|
-
* @stability experimental
|
|
47
|
-
*/
|
|
48
|
-
export declare const AI_OUTPUT_MODALITIES: readonly ["text", "image", "audio", "embedding"];
|
|
49
|
-
/**
|
|
50
|
-
* How hard a reasoning model may be asked to think.
|
|
51
|
-
*
|
|
52
|
-
* @stability experimental
|
|
53
|
-
*/
|
|
54
|
-
export declare const AI_REASONING_EFFORTS: readonly ["minimal", "low", "medium", "high"];
|
|
55
|
-
/**
|
|
56
|
-
* One of {@link AI_INPUT_MODALITIES}.
|
|
57
|
-
*
|
|
58
|
-
* @stability experimental
|
|
59
|
-
*/
|
|
60
|
-
export type AiInputModality = (typeof AI_INPUT_MODALITIES)[number];
|
|
61
|
-
/**
|
|
62
|
-
* One of {@link AI_OUTPUT_MODALITIES}.
|
|
63
|
-
*
|
|
64
|
-
* @stability experimental
|
|
65
|
-
*/
|
|
66
|
-
export type AiOutputModality = (typeof AI_OUTPUT_MODALITIES)[number];
|
|
67
|
-
/**
|
|
68
|
-
* One of {@link AI_REASONING_EFFORTS}.
|
|
69
|
-
*
|
|
70
|
-
* @stability experimental
|
|
71
|
-
*/
|
|
72
|
-
export type AiReasoningEffort = (typeof AI_REASONING_EFFORTS)[number];
|
|
73
|
-
/**
|
|
74
|
-
* The entries of the built-in capability enum (`z.enum(BUILTIN_AI_CAPABILITIES)`).
|
|
75
|
-
*
|
|
76
|
-
* @stability experimental
|
|
77
|
-
*/
|
|
78
|
-
export type AiCapabilityEnum = {
|
|
79
|
-
[K in BuiltinAiCapability]: K;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* The entries of the input-modality enum.
|
|
83
|
-
*
|
|
84
|
-
* @stability experimental
|
|
85
|
-
*/
|
|
86
|
-
export type AiInputModalityEnum = {
|
|
87
|
-
[K in AiInputModality]: K;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* The entries of the output-modality enum.
|
|
91
|
-
*
|
|
92
|
-
* @stability experimental
|
|
93
|
-
*/
|
|
94
|
-
export type AiOutputModalityEnum = {
|
|
95
|
-
[K in AiOutputModality]: K;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* The entries of the reasoning-effort enum.
|
|
99
|
-
*
|
|
100
|
-
* @stability experimental
|
|
101
|
-
*/
|
|
102
|
-
export type AiReasoningEffortEnum = {
|
|
103
|
-
[K in AiReasoningEffort]: K;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* What one model can do. Validated with this schema wherever it crosses a
|
|
107
|
-
* trust boundary (an adapter's classifier output, an administrator override,
|
|
108
|
-
* a JSONB column read back from the database).
|
|
109
|
-
*
|
|
110
|
-
* @stability experimental
|
|
111
|
-
*/
|
|
112
|
-
export declare const aiModelCapabilitiesSchema: z.ZodObject<{
|
|
113
|
-
capabilities: z.ZodArray<z.ZodString>;
|
|
114
|
-
inputModalities: z.ZodArray<z.ZodEnum<AiInputModalityEnum>>;
|
|
115
|
-
outputModalities: z.ZodArray<z.ZodEnum<AiOutputModalityEnum>>;
|
|
116
|
-
reasoningEfforts: z.ZodOptional<z.ZodArray<z.ZodEnum<AiReasoningEffortEnum>>>;
|
|
117
|
-
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
118
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
119
|
-
voices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
|
-
/**
|
|
122
|
-
* What one model can do (`aiModelCapabilitiesSchema`'s output).
|
|
123
|
-
*
|
|
124
|
-
* @stability experimental
|
|
125
|
-
*/
|
|
126
|
-
export type AiModelCapabilities = z.infer<typeof aiModelCapabilitiesSchema>;
|
|
1
|
+
import './ai-error';
|
|
2
|
+
export { AI_CAPABILITIES, AI_INPUT_MODALITIES, AI_OUTPUT_MODALITIES, AI_REASONING_EFFORTS, aiModelCapabilitiesSchema, BUILTIN_AI_CAPABILITIES, } from '@marinoscar/platform-ai-providers';
|
|
3
|
+
export type { AiCapability, AiCapabilityEnum, AiInputModality, AiInputModalityEnum, AiModelCapabilities, AiOutputModality, AiOutputModalityEnum, AiReasoningEffort, AiReasoningEffortEnum, BuiltinAiCapability, } from '@marinoscar/platform-ai-providers';
|
|
127
4
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/ai/core/capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/ai/core/capabilities.ts"],"names":[],"mappings":"AAKA,OAAO,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,112 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// The closed vocabulary every other AI story speaks: the catalog (#429) stores
|
|
7
|
-
// an `AiModelCapabilities` per model, the admin UI renders it as chips, and the
|
|
8
|
-
// runtime gate pipeline (#431) refuses a request whose shape needs a
|
|
9
|
-
// capability the chosen model does not declare.
|
|
10
|
-
//
|
|
11
|
-
// TWO LEVELS, deliberately not conflated:
|
|
12
|
-
//
|
|
13
|
-
// - MODEL level (this file): what one model can do. Declared by the
|
|
14
|
-
// adapter's `classifyModel()` and overridable by an administrator.
|
|
15
|
-
// - PROVIDER level (`AiProviderRegistry.supports()`): which capability
|
|
16
|
-
// PORTS the adapter implements at all. Derived from port presence, never
|
|
17
|
-
// declared, so it cannot drift from the code.
|
|
18
|
-
//
|
|
19
|
-
// A request needs both: the provider must carry the port, and the model must
|
|
20
|
-
// declare the capability.
|
|
21
|
-
// =============================================================================
|
|
2
|
+
// Moved to `@marinoscar/platform-ai-providers` (#991) so the AI provider
|
|
3
|
+
// adapters and their core types run without Nest. This path re-exports the
|
|
4
|
+
// names it always exported, unchanged, so platform imports keep working.
|
|
5
|
+
// The side-effect import runs the `AiError` integration (ai-error.ts) first.
|
|
22
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.aiModelCapabilitiesSchema = exports.AI_REASONING_EFFORTS = exports.AI_OUTPUT_MODALITIES = exports.AI_INPUT_MODALITIES = exports.AI_CAPABILITIES =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* (`./capability-registry.ts`).
|
|
33
|
-
*
|
|
34
|
-
* @stability experimental
|
|
35
|
-
*/
|
|
36
|
-
exports.BUILTIN_AI_CAPABILITIES = [
|
|
37
|
-
'responses',
|
|
38
|
-
'reasoning',
|
|
39
|
-
'tools',
|
|
40
|
-
'hosted_tools',
|
|
41
|
-
'structured_output',
|
|
42
|
-
'streaming',
|
|
43
|
-
'vision_input',
|
|
44
|
-
'file_input',
|
|
45
|
-
'image_generation',
|
|
46
|
-
'image_edit',
|
|
47
|
-
'audio_transcription',
|
|
48
|
-
'audio_speech',
|
|
49
|
-
'embeddings',
|
|
50
|
-
'realtime',
|
|
51
|
-
];
|
|
52
|
-
/**
|
|
53
|
-
* The capabilities the platform ships.
|
|
54
|
-
*
|
|
55
|
-
* @deprecated Use {@link BUILTIN_AI_CAPABILITIES}. The list is no longer the
|
|
56
|
-
* set of capabilities a deployment knows (PP-14.17, #935); ask
|
|
57
|
-
* `listAiCapabilities()` or `GET /api/admin/ai/capabilities`. Kept as an
|
|
58
|
-
* alias for one release.
|
|
59
|
-
* @stability experimental
|
|
60
|
-
*/
|
|
61
|
-
exports.AI_CAPABILITIES = exports.BUILTIN_AI_CAPABILITIES;
|
|
62
|
-
/**
|
|
63
|
-
* What a model can read.
|
|
64
|
-
*
|
|
65
|
-
* @stability experimental
|
|
66
|
-
*/
|
|
67
|
-
exports.AI_INPUT_MODALITIES = ['text', 'image', 'audio', 'file'];
|
|
68
|
-
/**
|
|
69
|
-
* What a model can produce.
|
|
70
|
-
*
|
|
71
|
-
* @stability experimental
|
|
72
|
-
*/
|
|
73
|
-
exports.AI_OUTPUT_MODALITIES = ['text', 'image', 'audio', 'embedding'];
|
|
74
|
-
/**
|
|
75
|
-
* How hard a reasoning model may be asked to think.
|
|
76
|
-
*
|
|
77
|
-
* @stability experimental
|
|
78
|
-
*/
|
|
79
|
-
exports.AI_REASONING_EFFORTS = ['minimal', 'low', 'medium', 'high'];
|
|
80
|
-
/**
|
|
81
|
-
* What one model can do. Validated with this schema wherever it crosses a
|
|
82
|
-
* trust boundary (an adapter's classifier output, an administrator override,
|
|
83
|
-
* a JSONB column read back from the database).
|
|
84
|
-
*
|
|
85
|
-
* @stability experimental
|
|
86
|
-
*/
|
|
87
|
-
exports.aiModelCapabilitiesSchema = zod_1.z.object({
|
|
88
|
-
/**
|
|
89
|
-
* The capabilities the model declares: built-in ones and any an app
|
|
90
|
-
* registered. Validated by shape only (`AI_CAPABILITY_ID_PATTERN`), never
|
|
91
|
-
* against the registry: a catalog row or an override written under a
|
|
92
|
-
* capability whose plugin was since removed must still read back.
|
|
93
|
-
*/
|
|
94
|
-
capabilities: zod_1.z.array(zod_1.z.string().regex(ai_1.AI_CAPABILITY_ID_PATTERN)),
|
|
95
|
-
/** What it reads. */
|
|
96
|
-
inputModalities: zod_1.z.array(zod_1.z.enum(exports.AI_INPUT_MODALITIES)),
|
|
97
|
-
/** What it produces. */
|
|
98
|
-
outputModalities: zod_1.z.array(zod_1.z.enum(exports.AI_OUTPUT_MODALITIES)),
|
|
99
|
-
/** The reasoning efforts it accepts, for a `reasoning` model. */
|
|
100
|
-
reasoningEfforts: zod_1.z.array(zod_1.z.enum(exports.AI_REASONING_EFFORTS)).optional(),
|
|
101
|
-
/** The context window in tokens, when known. */
|
|
102
|
-
contextWindow: zod_1.z.number().int().positive().optional(),
|
|
103
|
-
/** The output-token ceiling, when known. */
|
|
104
|
-
maxOutputTokens: zod_1.z.number().int().positive().optional(),
|
|
105
|
-
/**
|
|
106
|
-
* The voices an `audio_speech` model speaks in (#439) — surfaced through
|
|
107
|
-
* `GET /api/ai/models` so a picker can offer them. Optional: absent means
|
|
108
|
-
* "the provider's own list" (`AiAudioPort.voices`).
|
|
109
|
-
*/
|
|
110
|
-
voices: zod_1.z.array(zod_1.z.string().min(1).max(64)).max(100).optional(),
|
|
111
|
-
});
|
|
7
|
+
exports.BUILTIN_AI_CAPABILITIES = exports.aiModelCapabilitiesSchema = exports.AI_REASONING_EFFORTS = exports.AI_OUTPUT_MODALITIES = exports.AI_INPUT_MODALITIES = exports.AI_CAPABILITIES = void 0;
|
|
8
|
+
require("./ai-error");
|
|
9
|
+
var platform_ai_providers_1 = require("@marinoscar/platform-ai-providers");
|
|
10
|
+
Object.defineProperty(exports, "AI_CAPABILITIES", { enumerable: true, get: function () { return platform_ai_providers_1.AI_CAPABILITIES; } });
|
|
11
|
+
Object.defineProperty(exports, "AI_INPUT_MODALITIES", { enumerable: true, get: function () { return platform_ai_providers_1.AI_INPUT_MODALITIES; } });
|
|
12
|
+
Object.defineProperty(exports, "AI_OUTPUT_MODALITIES", { enumerable: true, get: function () { return platform_ai_providers_1.AI_OUTPUT_MODALITIES; } });
|
|
13
|
+
Object.defineProperty(exports, "AI_REASONING_EFFORTS", { enumerable: true, get: function () { return platform_ai_providers_1.AI_REASONING_EFFORTS; } });
|
|
14
|
+
Object.defineProperty(exports, "aiModelCapabilitiesSchema", { enumerable: true, get: function () { return platform_ai_providers_1.aiModelCapabilitiesSchema; } });
|
|
15
|
+
Object.defineProperty(exports, "BUILTIN_AI_CAPABILITIES", { enumerable: true, get: function () { return platform_ai_providers_1.BUILTIN_AI_CAPABILITIES; } });
|
|
112
16
|
//# sourceMappingURL=capabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/ai/core/capabilities.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/ai/core/capabilities.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,6EAA6E;;;AAE7E,sBAAoB;AAEpB,2EAO2C;AANzC,wHAAA,eAAe,OAAA;AACf,4HAAA,mBAAmB,OAAA;AACnB,6HAAA,oBAAoB,OAAA;AACpB,6HAAA,oBAAoB,OAAA;AACpB,kIAAA,yBAAyB,OAAA;AACzB,gIAAA,uBAAuB,OAAA"}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
* A request's `input` as items: a bare string is one user message.
|
|
4
|
-
*
|
|
5
|
-
* @stability experimental
|
|
6
|
-
*/
|
|
7
|
-
export declare function asInputItems(input: AiResponseRequest['input']): AiInputItem[];
|
|
8
|
-
/**
|
|
9
|
-
* One response's output as the input items that replay it (#446). A
|
|
10
|
-
* `reasoning` item keeps its symbol-keyed provider state — the reason it is
|
|
11
|
-
* copied with a spread rather than rebuilt field by field.
|
|
12
|
-
*
|
|
13
|
-
* @stability experimental
|
|
14
|
-
*/
|
|
15
|
-
export declare function replayOutput(output: AiOutputItem[]): AiInputItem[];
|
|
1
|
+
import './ai-error';
|
|
2
|
+
export { asInputItems, replayOutput, } from '@marinoscar/platform-ai-providers';
|
|
16
3
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/ai/core/conversation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/ai/core/conversation.ts"],"names":[],"mappings":"AAKA,OAAO,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,YAAY,GACb,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,57 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// A provider that cannot chain with `previousResponseId`
|
|
7
|
-
// (`AiProviderAdapter.supportsPreviousResponseId: false`) is sent the whole
|
|
8
|
-
// conversation every time. These two helpers are the one definition of what
|
|
9
|
-
// "the conversation so far" is as `AiInputItem`s — shared by the runtime's
|
|
10
|
-
// tool loop and the conformance kit, so both replay a turn identically.
|
|
11
|
-
// =============================================================================
|
|
2
|
+
// Moved to `@marinoscar/platform-ai-providers` (#991) so the AI provider
|
|
3
|
+
// adapters and their core types run without Nest. This path re-exports the
|
|
4
|
+
// names it always exported, unchanged, so platform imports keep working.
|
|
5
|
+
// The side-effect import runs the `AiError` integration (ai-error.ts) first.
|
|
12
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.asInputItems =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* @stability experimental
|
|
20
|
-
*/
|
|
21
|
-
function asInputItems(input) {
|
|
22
|
-
return typeof input === 'string'
|
|
23
|
-
? [{ type: 'message', role: 'user', content: [{ type: 'text', text: input }] }]
|
|
24
|
-
: [...input];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* One response's output as the input items that replay it (#446). A
|
|
28
|
-
* `reasoning` item keeps its symbol-keyed provider state — the reason it is
|
|
29
|
-
* copied with a spread rather than rebuilt field by field.
|
|
30
|
-
*
|
|
31
|
-
* @stability experimental
|
|
32
|
-
*/
|
|
33
|
-
function replayOutput(output) {
|
|
34
|
-
const items = [];
|
|
35
|
-
for (const item of output) {
|
|
36
|
-
switch (item.type) {
|
|
37
|
-
case 'message':
|
|
38
|
-
if (item.text.length > 0) {
|
|
39
|
-
items.push({ type: 'message', role: 'assistant', content: [{ type: 'text', text: item.text }] });
|
|
40
|
-
}
|
|
41
|
-
break;
|
|
42
|
-
case 'function_call':
|
|
43
|
-
items.push({ type: 'function_call', callId: item.callId, name: item.name, arguments: item.arguments });
|
|
44
|
-
break;
|
|
45
|
-
case 'reasoning': {
|
|
46
|
-
const state = item[responses_types_1.AI_PROVIDER_STATE];
|
|
47
|
-
items.push({ type: 'reasoning', summary: [...item.summary], ...(state ? { [responses_types_1.AI_PROVIDER_STATE]: state } : {}) });
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
default:
|
|
51
|
-
// hosted_tool_call: executed by the provider inside that response; not replayable.
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return items;
|
|
56
|
-
}
|
|
7
|
+
exports.replayOutput = exports.asInputItems = void 0;
|
|
8
|
+
require("./ai-error");
|
|
9
|
+
var platform_ai_providers_1 = require("@marinoscar/platform-ai-providers");
|
|
10
|
+
Object.defineProperty(exports, "asInputItems", { enumerable: true, get: function () { return platform_ai_providers_1.asInputItems; } });
|
|
11
|
+
Object.defineProperty(exports, "replayOutput", { enumerable: true, get: function () { return platform_ai_providers_1.replayOutput; } });
|
|
57
12
|
//# sourceMappingURL=conversation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/ai/core/conversation.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/ai/core/conversation.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,6EAA6E;;;AAE7E,sBAAoB;AAEpB,2EAG2C;AAFzC,qHAAA,YAAY,OAAA;AACZ,qHAAA,YAAY,OAAA"}
|
|
@@ -1,173 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* The admin policy the gate reads — structurally `ai.hostedTools` from the settings namespace.
|
|
5
|
-
*
|
|
6
|
-
* @stability experimental
|
|
7
|
-
*/
|
|
8
|
-
export type AiHostedToolsPolicy = Record<AiHostedToolType, boolean> & {
|
|
9
|
-
/** Hosts an MCP `serverUrl` may name; `*.example.com` matches subdomains. Empty = any `https` host. */
|
|
10
|
-
mcpAllowedHosts: string[];
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Most header entries one MCP tool may carry.
|
|
14
|
-
*
|
|
15
|
-
* @stability experimental
|
|
16
|
-
*/
|
|
17
|
-
export declare const AI_MCP_MAX_HEADERS = 16;
|
|
18
|
-
/**
|
|
19
|
-
* A label the provider accepts for an MCP server.
|
|
20
|
-
*
|
|
21
|
-
* @stability experimental
|
|
22
|
-
*/
|
|
23
|
-
export declare const AI_MCP_SERVER_LABEL: RegExp;
|
|
24
|
-
/**
|
|
25
|
-
* One hosted tool, as a request may carry it.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare const aiHostedToolSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"web_search">;
|
|
31
|
-
searchContextSize: z.ZodOptional<z.ZodEnum<{
|
|
32
|
-
low: "low";
|
|
33
|
-
medium: "medium";
|
|
34
|
-
high: "high";
|
|
35
|
-
}>>;
|
|
36
|
-
userLocation: z.ZodOptional<z.ZodObject<{
|
|
37
|
-
country: z.ZodOptional<z.ZodString>;
|
|
38
|
-
city: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strict>>;
|
|
40
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
41
|
-
type: z.ZodLiteral<"file_search">;
|
|
42
|
-
vectorStoreIds: z.ZodArray<z.ZodString>;
|
|
43
|
-
maxResults: z.ZodOptional<z.ZodNumber>;
|
|
44
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
45
|
-
type: z.ZodLiteral<"code_interpreter">;
|
|
46
|
-
container: z.ZodOptional<z.ZodObject<{
|
|
47
|
-
type: z.ZodLiteral<"auto">;
|
|
48
|
-
}, z.core.$strict>>;
|
|
49
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
-
type: z.ZodLiteral<"image_generation">;
|
|
51
|
-
size: z.ZodOptional<z.ZodString>;
|
|
52
|
-
quality: z.ZodOptional<z.ZodString>;
|
|
53
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
54
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
55
|
-
type: z.ZodLiteral<"mcp">;
|
|
56
|
-
serverLabel: z.ZodString;
|
|
57
|
-
serverUrl: z.ZodURL;
|
|
58
|
-
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
-
requireApproval: z.ZodOptional<z.ZodEnum<{
|
|
60
|
-
never: "never";
|
|
61
|
-
always: "always";
|
|
62
|
-
}>>;
|
|
63
|
-
}, z.core.$strict>], "type">;
|
|
64
|
-
/**
|
|
65
|
-
* One hosted tool as STORED with a background run (`ai_runs.request`). The
|
|
66
|
-
* MCP variant has no `headers` member, so the column cannot hold one: a run
|
|
67
|
-
* whose MCP tool needs headers is refused by `startRun` instead.
|
|
68
|
-
*
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
export declare const aiStoredHostedToolSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
72
|
-
type: z.ZodLiteral<"web_search">;
|
|
73
|
-
searchContextSize: z.ZodOptional<z.ZodEnum<{
|
|
74
|
-
low: "low";
|
|
75
|
-
medium: "medium";
|
|
76
|
-
high: "high";
|
|
77
|
-
}>>;
|
|
78
|
-
userLocation: z.ZodOptional<z.ZodObject<{
|
|
79
|
-
country: z.ZodOptional<z.ZodString>;
|
|
80
|
-
city: z.ZodOptional<z.ZodString>;
|
|
81
|
-
}, z.core.$strict>>;
|
|
82
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
-
type: z.ZodLiteral<"file_search">;
|
|
84
|
-
vectorStoreIds: z.ZodArray<z.ZodString>;
|
|
85
|
-
maxResults: z.ZodOptional<z.ZodNumber>;
|
|
86
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
87
|
-
type: z.ZodLiteral<"code_interpreter">;
|
|
88
|
-
container: z.ZodOptional<z.ZodObject<{
|
|
89
|
-
type: z.ZodLiteral<"auto">;
|
|
90
|
-
}, z.core.$strict>>;
|
|
91
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
92
|
-
type: z.ZodLiteral<"image_generation">;
|
|
93
|
-
size: z.ZodOptional<z.ZodString>;
|
|
94
|
-
quality: z.ZodOptional<z.ZodString>;
|
|
95
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
96
|
-
type: z.ZodLiteral<"mcp">;
|
|
97
|
-
serverLabel: z.ZodString;
|
|
98
|
-
serverUrl: z.ZodURL;
|
|
99
|
-
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
-
requireApproval: z.ZodOptional<z.ZodEnum<{
|
|
101
|
-
never: "never";
|
|
102
|
-
always: "always";
|
|
103
|
-
}>>;
|
|
104
|
-
}, z.core.$strict>], "type">;
|
|
105
|
-
/**
|
|
106
|
-
* The hosted tools among a request's tools.
|
|
107
|
-
*
|
|
108
|
-
* @stability experimental
|
|
109
|
-
*/
|
|
110
|
-
export declare function hostedToolsOf(tools: readonly AiTool[] | undefined): AiHostedTool[];
|
|
111
|
-
/**
|
|
112
|
-
* Validates every hosted tool's shape. In-process callers are only
|
|
113
|
-
* type-checked, so the facade runs this too. The error names the tool type
|
|
114
|
-
* and the offending path — never a value (a header value is a secret).
|
|
115
|
-
*
|
|
116
|
-
* @throws AiError('AI_INVALID_REQUEST')
|
|
117
|
-
*
|
|
118
|
-
* @stability experimental
|
|
119
|
-
*/
|
|
120
|
-
export declare function assertHostedToolShapes(tools: readonly AiTool[] | undefined): void;
|
|
121
|
-
/**
|
|
122
|
-
* Lower-cased hostname of an MCP `serverUrl`, or `null` when it does not parse.
|
|
123
|
-
*
|
|
124
|
-
* @stability experimental
|
|
125
|
-
*/
|
|
126
|
-
export declare function mcpHost(serverUrl: string): string | null;
|
|
127
|
-
/**
|
|
128
|
-
* Whether `host` passes `allowed`. An empty list allows any host (the
|
|
129
|
-
* `https://` rule still applies); `example.com` matches exactly that host;
|
|
130
|
-
* `*.example.com` matches any subdomain of it, not the apex.
|
|
131
|
-
*
|
|
132
|
-
* @stability experimental
|
|
133
|
-
*/
|
|
134
|
-
export declare function isMcpHostAllowed(host: string, allowed: readonly string[]): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* The admin policy gate: every hosted tool's type must be switched on, and an
|
|
137
|
-
* MCP server's host must pass the allowlist.
|
|
138
|
-
*
|
|
139
|
-
* @throws AiError('AI_TOOL_DISABLED') (403)
|
|
140
|
-
*
|
|
141
|
-
* @stability experimental
|
|
142
|
-
*/
|
|
143
|
-
export declare function assertHostedToolsAllowed(tools: readonly AiTool[] | undefined, policy: AiHostedToolsPolicy): void;
|
|
144
|
-
/**
|
|
145
|
-
* Whether any MCP tool in `tools` carries headers.
|
|
146
|
-
*
|
|
147
|
-
* @stability experimental
|
|
148
|
-
*/
|
|
149
|
-
export declare function hasMcpHeaders(tools: readonly AiTool[] | undefined): boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Every MCP header VALUE in `tools` worth scrubbing for (at least 4
|
|
152
|
-
* characters — shorter strings would redact ordinary text and are not
|
|
153
|
-
* credentials anyone could use).
|
|
154
|
-
*
|
|
155
|
-
* @stability experimental
|
|
156
|
-
*/
|
|
157
|
-
export declare function mcpHeaderValues(tools: readonly AiTool[] | undefined): string[];
|
|
158
|
-
/**
|
|
159
|
-
* The placeholder a scrubbed secret is replaced with.
|
|
160
|
-
*
|
|
161
|
-
* @stability experimental
|
|
162
|
-
*/
|
|
163
|
-
export declare const AI_REDACTED = "[REDACTED]";
|
|
164
|
-
/**
|
|
165
|
-
* `value` with every occurrence of every string in `secrets` replaced by
|
|
166
|
-
* `[REDACTED]`, in every string reachable through plain objects and arrays.
|
|
167
|
-
* Returns `value` itself when `secrets` is empty; otherwise a copy (binary
|
|
168
|
-
* payloads are passed through untouched).
|
|
169
|
-
*
|
|
170
|
-
* @stability experimental
|
|
171
|
-
*/
|
|
172
|
-
export declare function redactSecretValues<T>(value: T, secrets: readonly string[]): T;
|
|
1
|
+
import './ai-error';
|
|
2
|
+
export { AI_MCP_MAX_HEADERS, AI_MCP_SERVER_LABEL, AI_REDACTED, aiHostedToolSchema, aiStoredHostedToolSchema, assertHostedToolsAllowed, assertHostedToolShapes, hasMcpHeaders, hostedToolsOf, isMcpHostAllowed, mcpHeaderValues, mcpHost, redactSecretValues, } from '@marinoscar/platform-ai-providers';
|
|
3
|
+
export type { AiHostedToolsPolicy, } from '@marinoscar/platform-ai-providers';
|
|
173
4
|
//# sourceMappingURL=hosted-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-tools.d.ts","sourceRoot":"","sources":["../../../src/ai/core/hosted-tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hosted-tools.d.ts","sourceRoot":"","sources":["../../../src/ai/core/hosted-tools.ts"],"names":[],"mappings":"AAKA,OAAO,YAAY,CAAC;AAEpB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,OAAO,EACP,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACV,mBAAmB,GACpB,MAAM,mCAAmC,CAAC"}
|