@nyte-ai/ai 0.0.0-stage → 0.0.18
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/LICENSE +21 -0
- package/README.md +170 -2
- package/THIRD-PARTY-NOTICES.md +800 -0
- package/dist/chunks/account-limits-cache-031vfpt3.js +37 -0
- package/dist/chunks/account-limits-cache-09vs98g6.js +41 -0
- package/dist/chunks/account-limits-cache-0af5gqeg.js +15 -0
- package/dist/chunks/account-limits-cache-0yd6bde8.js +103 -0
- package/dist/chunks/account-limits-cache-1jv43fhh.js +22 -0
- package/dist/chunks/account-limits-cache-3ykqmnj5.js +88 -0
- package/dist/chunks/account-limits-cache-4b8ckwqw.js +293 -0
- package/dist/chunks/account-limits-cache-4fn5w63p.js +295 -0
- package/dist/chunks/account-limits-cache-4hptgd2h.js +49 -0
- package/dist/chunks/account-limits-cache-53e64mhx.js +417 -0
- package/dist/chunks/account-limits-cache-5jdhn0e1.js +562 -0
- package/dist/chunks/account-limits-cache-5rx2pfm5.js +8 -0
- package/dist/chunks/account-limits-cache-5ygxyyss.js +19 -0
- package/dist/chunks/account-limits-cache-6250ykn6.js +21 -0
- package/dist/chunks/account-limits-cache-6x05n06z.js +49 -0
- package/dist/chunks/account-limits-cache-736tdyme.js +6 -0
- package/dist/chunks/account-limits-cache-75smws02.js +213 -0
- package/dist/chunks/account-limits-cache-7z9s8j16.js +139 -0
- package/dist/chunks/account-limits-cache-8137j3zp.js +37 -0
- package/dist/chunks/account-limits-cache-8qzk56vj.js +160 -0
- package/dist/chunks/account-limits-cache-8s8bz4dr.js +36 -0
- package/dist/chunks/account-limits-cache-8vzx8k6r.js +166 -0
- package/dist/chunks/account-limits-cache-8wfqg73s.js +135 -0
- package/dist/chunks/account-limits-cache-90c9c2eb.js +50 -0
- package/dist/chunks/account-limits-cache-9wqk28n5.js +25 -0
- package/dist/chunks/account-limits-cache-a1jyaq00.js +56 -0
- package/dist/chunks/account-limits-cache-a558rjbg.js +138 -0
- package/dist/chunks/account-limits-cache-a55e14fr.js +70 -0
- package/dist/chunks/account-limits-cache-a6cgeagz.js +77 -0
- package/dist/chunks/account-limits-cache-ag5b8dja.js +38 -0
- package/dist/chunks/account-limits-cache-b0x2sfya.js +45 -0
- package/dist/chunks/account-limits-cache-b23sbrke.js +26 -0
- package/dist/chunks/account-limits-cache-b4edaybk.js +8 -0
- package/dist/chunks/account-limits-cache-bsknrh6t.js +74 -0
- package/dist/chunks/account-limits-cache-c7v93krb.js +235 -0
- package/dist/chunks/account-limits-cache-csbxvam7.js +12 -0
- package/dist/chunks/account-limits-cache-cw7q7vfy.js +293 -0
- package/dist/chunks/account-limits-cache-d1ypzqzp.js +27 -0
- package/dist/chunks/account-limits-cache-d2a51dka.js +17 -0
- package/dist/chunks/account-limits-cache-dejeygdt.js +114 -0
- package/dist/chunks/account-limits-cache-eejm0vth.js +11 -0
- package/dist/chunks/account-limits-cache-ehy0ze2b.js +33 -0
- package/dist/chunks/account-limits-cache-emg5b4hj.js +53 -0
- package/dist/chunks/account-limits-cache-eqwweapz.js +6 -0
- package/dist/chunks/account-limits-cache-eyx1jcxc.js +8 -0
- package/dist/chunks/account-limits-cache-f9z00x8c.js +36 -0
- package/dist/chunks/account-limits-cache-fbkaq46e.js +113 -0
- package/dist/chunks/account-limits-cache-fdwad56n.js +399 -0
- package/dist/chunks/account-limits-cache-fht68jp2.js +22 -0
- package/dist/chunks/account-limits-cache-fp03ztsw.js +17 -0
- package/dist/chunks/account-limits-cache-fsktnetm.js +69 -0
- package/dist/chunks/account-limits-cache-fvadc36m.js +110 -0
- package/dist/chunks/account-limits-cache-ghe9ne4j.js +69 -0
- package/dist/chunks/account-limits-cache-gknnm1kv.js +13 -0
- package/dist/chunks/account-limits-cache-gqsrbky9.js +40 -0
- package/dist/chunks/account-limits-cache-gr671dr2.js +0 -0
- package/dist/chunks/account-limits-cache-gs8a3fhw.js +32 -0
- package/dist/chunks/account-limits-cache-gsa5tzck.js +37 -0
- package/dist/chunks/account-limits-cache-h92bzz1j.js +235 -0
- package/dist/chunks/account-limits-cache-hemxtapd.js +142 -0
- package/dist/chunks/account-limits-cache-hj1h48sc.js +92 -0
- package/dist/chunks/account-limits-cache-hj3ek3ty.js +128 -0
- package/dist/chunks/account-limits-cache-hwehc67r.js +509 -0
- package/dist/chunks/account-limits-cache-hyzn1jmk.js +46 -0
- package/dist/chunks/account-limits-cache-j2bt392s.js +63 -0
- package/dist/chunks/account-limits-cache-k0pkzhbx.js +74 -0
- package/dist/chunks/account-limits-cache-kjx405q0.js +277 -0
- package/dist/chunks/account-limits-cache-ks1sjym9.js +37 -0
- package/dist/chunks/account-limits-cache-me1x57bs.js +89 -0
- package/dist/chunks/account-limits-cache-n3yk6g5c.js +314 -0
- package/dist/chunks/account-limits-cache-nbhht7xz.js +72 -0
- package/dist/chunks/account-limits-cache-nbkyhs6v.js +42 -0
- package/dist/chunks/account-limits-cache-nn9jebsj.js +26 -0
- package/dist/chunks/account-limits-cache-nxkprk3g.js +13 -0
- package/dist/chunks/account-limits-cache-nyy770yd.js +38 -0
- package/dist/chunks/account-limits-cache-pfa86y8e.js +45 -0
- package/dist/chunks/account-limits-cache-pfr14mcn.js +59 -0
- package/dist/chunks/account-limits-cache-q1ebtvet.js +8 -0
- package/dist/chunks/account-limits-cache-q63mc41j.js +51 -0
- package/dist/chunks/account-limits-cache-re8hpzwn.js +104 -0
- package/dist/chunks/account-limits-cache-rz8p1g5y.js +9 -0
- package/dist/chunks/account-limits-cache-skbfmzqe.js +7 -0
- package/dist/chunks/account-limits-cache-tc38g0ca.js +20 -0
- package/dist/chunks/account-limits-cache-v4n30az2.js +24 -0
- package/dist/chunks/account-limits-cache-vwgfz727.js +281 -0
- package/dist/chunks/account-limits-cache-x9fvb3s5.js +8 -0
- package/dist/chunks/account-limits-cache-xds88kxd.js +209 -0
- package/dist/chunks/account-limits-cache-xz65wyd1.js +428 -0
- package/dist/chunks/account-limits-cache-ydq8p8qp.js +39 -0
- package/dist/chunks/account-limits-cache-ykbqsvv6.js +134 -0
- package/dist/chunks/account-limits-cache-za42x8a3.js +25 -0
- package/dist/chunks/account-limits-cache-zcbkmrvy.js +79 -0
- package/dist/chunks/account-limits-cache-zgzptd0z.js +62 -0
- package/dist/chunks/account-limits-cache-zn01kscn.js +252 -0
- package/dist/chunks/account-limits-cache-zpjmeyt0.js +113 -0
- package/dist/chunks/account-limits-cache-zqdb4yh4.js +8 -0
- package/dist/src/account-limits-cache.d.ts +16 -0
- package/dist/src/account-limits-cache.js +7 -0
- package/dist/src/api/anthropic-client.d.ts +25 -0
- package/dist/src/api/anthropic-client.js +30 -0
- package/dist/src/api/anthropic-convert.d.ts +17 -0
- package/dist/src/api/anthropic-convert.js +14 -0
- package/dist/src/api/anthropic-events.d.ts +101 -0
- package/dist/src/api/anthropic-events.js +11 -0
- package/dist/src/api/anthropic-messages.d.ts +88 -0
- package/dist/src/api/anthropic-messages.js +578 -0
- package/dist/src/api/anthropic-messages.lazy.d.ts +2 -0
- package/dist/src/api/anthropic-messages.lazy.js +11 -0
- package/dist/src/api/assistant-stream.d.ts +23 -0
- package/dist/src/api/assistant-stream.js +15 -0
- package/dist/src/api/claude-code.d.ts +12 -0
- package/dist/src/api/claude-code.js +12 -0
- package/dist/src/api/cloudflare.d.ts +8 -0
- package/dist/src/api/cloudflare.js +11 -0
- package/dist/src/api/constrained-sampling.d.ts +24 -0
- package/dist/src/api/constrained-sampling.js +16 -0
- package/dist/src/api/deferred.d.ts +7 -0
- package/dist/src/api/deferred.js +10 -0
- package/dist/src/api/github-copilot-headers.d.ts +15 -0
- package/dist/src/api/github-copilot-headers.js +12 -0
- package/dist/src/api/google-generative-ai.d.ts +22 -0
- package/dist/src/api/google-generative-ai.js +583 -0
- package/dist/src/api/google-generative-ai.lazy.d.ts +2 -0
- package/dist/src/api/google-generative-ai.lazy.js +11 -0
- package/dist/src/api/lazy.d.ts +18 -0
- package/dist/src/api/lazy.js +12 -0
- package/dist/src/api/openai-codex-compact.d.ts +14 -0
- package/dist/src/api/openai-codex-compact.js +389 -0
- package/dist/src/api/openai-codex-compaction-error.d.ts +7 -0
- package/dist/src/api/openai-codex-compaction-error.js +6 -0
- package/dist/src/api/openai-codex-protocol.d.ts +125 -0
- package/dist/src/api/openai-codex-protocol.js +48 -0
- package/dist/src/api/openai-codex-responses.d.ts +4 -0
- package/dist/src/api/openai-codex-responses.js +175 -0
- package/dist/src/api/openai-codex-responses.lazy.d.ts +2 -0
- package/dist/src/api/openai-codex-responses.lazy.js +11 -0
- package/dist/src/api/openai-codex-websocket.d.ts +13 -0
- package/dist/src/api/openai-codex-websocket.js +37 -0
- package/dist/src/api/openai-codex-wire.d.ts +44 -0
- package/dist/src/api/openai-codex-wire.js +34 -0
- package/dist/src/api/openai-compact.d.ts +9 -0
- package/dist/src/api/openai-compact.js +12 -0
- package/dist/src/api/openai-completions-convert.d.ts +58 -0
- package/dist/src/api/openai-completions-convert.js +21 -0
- package/dist/src/api/openai-completions-params.d.ts +29 -0
- package/dist/src/api/openai-completions-params.js +20 -0
- package/dist/src/api/openai-completions-reasoning.d.ts +54 -0
- package/dist/src/api/openai-completions-reasoning.js +22 -0
- package/dist/src/api/openai-completions.d.ts +22 -0
- package/dist/src/api/openai-completions.js +484 -0
- package/dist/src/api/openai-completions.lazy.d.ts +5 -0
- package/dist/src/api/openai-completions.lazy.js +11 -0
- package/dist/src/api/openai-prompt-cache.d.ts +1 -0
- package/dist/src/api/openai-prompt-cache.js +6 -0
- package/dist/src/api/openai-responses-convert.d.ts +58 -0
- package/dist/src/api/openai-responses-convert.js +16 -0
- package/dist/src/api/openai-responses-events.d.ts +379 -0
- package/dist/src/api/openai-responses-events.js +12 -0
- package/dist/src/api/openai-responses-stream.d.ts +36 -0
- package/dist/src/api/openai-responses-stream.js +25 -0
- package/dist/src/api/openai-responses.d.ts +18 -0
- package/dist/src/api/openai-responses.js +276 -0
- package/dist/src/api/openai-responses.lazy.d.ts +2 -0
- package/dist/src/api/openai-responses.lazy.js +11 -0
- package/dist/src/api/simple-options.d.ts +17 -0
- package/dist/src/api/simple-options.js +18 -0
- package/dist/src/api/token-count.d.ts +5 -0
- package/dist/src/api/token-count.js +8 -0
- package/dist/src/api/transform-messages.d.ts +9 -0
- package/dist/src/api/transform-messages.js +6 -0
- package/dist/src/api-options.d.ts +27 -0
- package/dist/src/api-options.js +0 -0
- package/dist/src/auth/context.d.ts +11 -0
- package/dist/src/auth/context.js +6 -0
- package/dist/src/auth/credential-store.d.ts +17 -0
- package/dist/src/auth/credential-store.js +7 -0
- package/dist/src/auth/helpers.d.ts +24 -0
- package/dist/src/auth/helpers.js +8 -0
- package/dist/src/auth/oauth/anthropic.d.ts +7 -0
- package/dist/src/auth/oauth/anthropic.js +12 -0
- package/dist/src/auth/oauth/authorization-input.d.ts +14 -0
- package/dist/src/auth/oauth/authorization-input.js +6 -0
- package/dist/src/auth/oauth/device-code.d.ts +29 -0
- package/dist/src/auth/oauth/device-code.js +9 -0
- package/dist/src/auth/oauth/github-copilot.d.ts +23 -0
- package/dist/src/auth/oauth/github-copilot.js +12 -0
- package/dist/src/auth/oauth/load.d.ts +14 -0
- package/dist/src/auth/oauth/load.js +10 -0
- package/dist/src/auth/oauth/oauth-page.d.ts +13 -0
- package/dist/src/auth/oauth/oauth-page.js +8 -0
- package/dist/src/auth/oauth/openai-codex.d.ts +10 -0
- package/dist/src/auth/oauth/openai-codex.js +18 -0
- package/dist/src/auth/oauth/pkce.d.ts +12 -0
- package/dist/src/auth/oauth/pkce.js +6 -0
- package/dist/src/auth/resolve.d.ts +38 -0
- package/dist/src/auth/resolve.js +12 -0
- package/dist/src/auth/store.d.ts +29 -0
- package/dist/src/auth/store.js +10 -0
- package/dist/src/auth/types.d.ts +291 -0
- package/dist/src/auth/types.js +8 -0
- package/dist/src/auth/verify.d.ts +13 -0
- package/dist/src/auth/verify.js +7 -0
- package/dist/src/bun-oauth.d.ts +2 -0
- package/dist/src/bun-oauth.js +25 -0
- package/dist/src/env-api-keys.d.ts +32 -0
- package/dist/src/env-api-keys.js +27 -0
- package/dist/src/file-models-store.d.ts +18 -0
- package/dist/src/file-models-store.js +9 -0
- package/dist/src/index.d.ts +62 -0
- package/dist/src/index.js +372 -0
- package/dist/src/model-capabilities.d.ts +21 -0
- package/dist/src/model-capabilities.js +14 -0
- package/dist/src/model-pricing.d.ts +6 -0
- package/dist/src/model-pricing.js +10 -0
- package/dist/src/model-variants.d.ts +21 -0
- package/dist/src/model-variants.js +19 -0
- package/dist/src/models-refresh.d.ts +27 -0
- package/dist/src/models-refresh.js +9 -0
- package/dist/src/models-store.d.ts +31 -0
- package/dist/src/models-store.js +6 -0
- package/dist/src/models-types.d.ts +206 -0
- package/dist/src/models-types.js +0 -0
- package/dist/src/models.d.ts +7 -0
- package/dist/src/models.js +44 -0
- package/dist/src/prompt-cache.d.ts +5 -0
- package/dist/src/prompt-cache.js +9 -0
- package/dist/src/provider.d.ts +23 -0
- package/dist/src/provider.js +14 -0
- package/dist/src/providers/account-limits.d.ts +13 -0
- package/dist/src/providers/account-limits.js +8 -0
- package/dist/src/providers/anthropic-limits.d.ts +9 -0
- package/dist/src/providers/anthropic-limits.js +10 -0
- package/dist/src/providers/anthropic.d.ts +2 -0
- package/dist/src/providers/anthropic.js +25 -0
- package/dist/src/providers/github-copilot-catalog.d.ts +5 -0
- package/dist/src/providers/github-copilot-catalog.js +7 -0
- package/dist/src/providers/github-copilot.d.ts +2 -0
- package/dist/src/providers/github-copilot.js +23 -0
- package/dist/src/providers/nyte-catalog.d.ts +15 -0
- package/dist/src/providers/nyte-catalog.js +63 -0
- package/dist/src/providers/openai-codex-limits.d.ts +8 -0
- package/dist/src/providers/openai-codex-limits.js +14 -0
- package/dist/src/providers/openai-codex.d.ts +2 -0
- package/dist/src/providers/openai-codex.js +23 -0
- package/dist/src/providers/openai.d.ts +2 -0
- package/dist/src/providers/openai.js +19 -0
- package/dist/src/providers/opencode-go.d.ts +5 -0
- package/dist/src/providers/opencode-go.js +22 -0
- package/dist/src/providers/opencode-headers.d.ts +5 -0
- package/dist/src/providers/opencode-headers.js +6 -0
- package/dist/src/providers/opencode.d.ts +14 -0
- package/dist/src/providers/opencode.js +23 -0
- package/dist/src/providers/openrouter.d.ts +2 -0
- package/dist/src/providers/openrouter.js +19 -0
- package/dist/src/providers/vercel-ai-gateway.d.ts +3 -0
- package/dist/src/providers/vercel-ai-gateway.js +19 -0
- package/dist/src/session-resources.d.ts +9 -0
- package/dist/src/session-resources.js +10 -0
- package/dist/src/types.d.ts +210 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils/abort.d.ts +12 -0
- package/dist/src/utils/abort.js +10 -0
- package/dist/src/utils/deferred-tools.d.ts +11 -0
- package/dist/src/utils/deferred-tools.js +6 -0
- package/dist/src/utils/diagnostics.d.ts +11 -0
- package/dist/src/utils/diagnostics.js +12 -0
- package/dist/src/utils/error-body.d.ts +26 -0
- package/dist/src/utils/error-body.js +10 -0
- package/dist/src/utils/estimate.d.ts +20 -0
- package/dist/src/utils/estimate.js +14 -0
- package/dist/src/utils/event-stream.d.ts +22 -0
- package/dist/src/utils/event-stream.js +11 -0
- package/dist/src/utils/failure.d.ts +49 -0
- package/dist/src/utils/failure.js +10 -0
- package/dist/src/utils/fifo-queue.d.ts +11 -0
- package/dist/src/utils/fifo-queue.js +6 -0
- package/dist/src/utils/hash.d.ts +5 -0
- package/dist/src/utils/hash.js +6 -0
- package/dist/src/utils/headers.d.ts +12 -0
- package/dist/src/utils/headers.js +14 -0
- package/dist/src/utils/json-parse.d.ts +33 -0
- package/dist/src/utils/json-parse.js +12 -0
- package/dist/src/utils/node-http-proxy.d.ts +6 -0
- package/dist/src/utils/node-http-proxy.js +9 -0
- package/dist/src/utils/nyte-home.d.ts +2 -0
- package/dist/src/utils/nyte-home.js +6 -0
- package/dist/src/utils/nyte-user-agent.d.ts +1 -0
- package/dist/src/utils/nyte-user-agent.js +6 -0
- package/dist/src/utils/overflow.d.ts +18 -0
- package/dist/src/utils/overflow.js +9 -0
- package/dist/src/utils/provider-env.d.ts +9 -0
- package/dist/src/utils/provider-env.js +6 -0
- package/dist/src/utils/provider-retry.d.ts +22 -0
- package/dist/src/utils/provider-retry.js +9 -0
- package/dist/src/utils/retry.d.ts +66 -0
- package/dist/src/utils/retry.js +18 -0
- package/dist/src/utils/sanitize-unicode.d.ts +24 -0
- package/dist/src/utils/sanitize-unicode.js +6 -0
- package/dist/src/utils/sse.d.ts +21 -0
- package/dist/src/utils/sse.js +6 -0
- package/dist/src/utils/text.d.ts +5 -0
- package/dist/src/utils/text.js +10 -0
- package/dist/src/utils/transcript.d.ts +5 -0
- package/dist/src/utils/transcript.js +36 -0
- package/dist/src/utils/typebox-helpers.d.ts +19 -0
- package/dist/src/utils/typebox-helpers.js +6 -0
- package/dist/src/utils/uuid.d.ts +2 -0
- package/dist/src/utils/uuid.js +6 -0
- package/dist/src/utils/validation.d.ts +13 -0
- package/dist/src/utils/validation.js +8 -0
- package/package.json +152 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
headersToRecord2,
|
|
3
|
+
mergeProviderHeaders2,
|
|
4
|
+
providerHeadersToRecord2,
|
|
5
|
+
hasHeader2,
|
|
6
|
+
getClientApiKey2
|
|
7
|
+
} from "../../chunks/account-limits-cache-ag5b8dja.js";
|
|
8
|
+
export {
|
|
9
|
+
getClientApiKey2 as getClientApiKey,
|
|
10
|
+
hasHeader2 as hasHeader,
|
|
11
|
+
headersToRecord2 as headersToRecord,
|
|
12
|
+
mergeProviderHeaders2 as mergeProviderHeaders,
|
|
13
|
+
providerHeadersToRecord2 as providerHeadersToRecord
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON parsing for tool-call arguments: repairs malformed string literals, parses partial JSON during streaming so clients can render arguments before the call is complete, and parses a finished call strictly so a truncated call is reported instead of run.
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolCall } from "@nyte-ai/schema/model";
|
|
5
|
+
import { Type, type Static } from "typebox";
|
|
6
|
+
declare const ToolArgumentsSchema: Type.TRecord<"^.*$", Type.TUnknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Repairs malformed JSON string literals by:
|
|
9
|
+
* - escaping raw control characters inside strings
|
|
10
|
+
* - doubling backslashes before invalid escape characters
|
|
11
|
+
*/
|
|
12
|
+
export declare function repairJson(json: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Attempts to parse potentially incomplete JSON during streaming.
|
|
15
|
+
* Always returns a valid object, even if the JSON is incomplete. Partial parsing runs on the
|
|
16
|
+
* repaired text, because it can silently drop fields containing raw control characters.
|
|
17
|
+
*
|
|
18
|
+
* @param partialJson The partial JSON string from streaming
|
|
19
|
+
* @returns Parsed object or empty object if parsing fails
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseStreamingJson(partialJson: string | undefined): Static<typeof ToolArgumentsSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* Parses the complete arguments text of a finished tool call.
|
|
24
|
+
*
|
|
25
|
+
* Unlike {@link parseStreamingJson}, this never keeps a partially parsed prefix: once the call is
|
|
26
|
+
* finished, text that is not a JSON object means the model sent malformed or truncated arguments.
|
|
27
|
+
* `arguments` is then `{}` and `argumentsError` describes the problem with the text the model sent,
|
|
28
|
+
* so the call fails validation instead of running with half its arguments.
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseToolCallArguments(json: string | undefined): Pick<ToolCall, "arguments" | "argumentsError">;
|
|
31
|
+
/** The arguments of a tool call whose response ended before the call finished. */
|
|
32
|
+
export declare function unfinishedToolCallArguments(json: string): Pick<ToolCall, "arguments" | "argumentsError">;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
repairJson2,
|
|
3
|
+
parseStreamingJson2,
|
|
4
|
+
parseToolCallArguments2,
|
|
5
|
+
unfinishedToolCallArguments2
|
|
6
|
+
} from "../../chunks/account-limits-cache-fbkaq46e.js";
|
|
7
|
+
export {
|
|
8
|
+
parseStreamingJson2 as parseStreamingJson,
|
|
9
|
+
parseToolCallArguments2 as parseToolCallArguments,
|
|
10
|
+
repairJson2 as repairJson,
|
|
11
|
+
unfinishedToolCallArguments2 as unfinishedToolCallArguments
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the HTTP(S) proxy URL for a target from the usual proxy environment variables, honoring NO_PROXY.
|
|
3
|
+
*/
|
|
4
|
+
import type { ProviderEnv } from "../types.ts";
|
|
5
|
+
export declare const UNSUPPORTED_PROXY_PROTOCOL_MESSAGE = "Unsupported proxy protocol. SOCKS and PAC proxy URLs are not supported; use an HTTP or HTTPS proxy URL.";
|
|
6
|
+
export declare function resolveHttpProxyUrlForTarget(targetUrl: string | URL, env?: ProviderEnv): URL | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UNSUPPORTED_PROXY_PROTOCOL_MESSAGE2,
|
|
3
|
+
resolveHttpProxyUrlForTarget2
|
|
4
|
+
} from "../../chunks/account-limits-cache-0yd6bde8.js";
|
|
5
|
+
import"../../chunks/account-limits-cache-b23sbrke.js";
|
|
6
|
+
export {
|
|
7
|
+
UNSUPPORTED_PROXY_PROTOCOL_MESSAGE2 as UNSUPPORTED_PROXY_PROTOCOL_MESSAGE,
|
|
8
|
+
resolveHttpProxyUrlForTarget2 as resolveHttpProxyUrlForTarget
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNyteUserAgent(): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context-window overflow as a function of the failure class, plus the length
|
|
3
|
+
* stop a caller may recover from.
|
|
4
|
+
*/
|
|
5
|
+
import type { AssistantMessage } from "@nyte-ai/schema/model";
|
|
6
|
+
/**
|
|
7
|
+
* Whether an assistant message overflowed the context window: a provider error
|
|
8
|
+
* that says so, or, with `contextWindow`, a silent overflow the provider accepted
|
|
9
|
+
* or truncated. The error text patterns live in `failure.ts`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function overflowsContext(message: AssistantMessage, contextWindow?: number): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Check whether a length stop ended below the caller or model's intended output limit.
|
|
14
|
+
* Such responses may be caused by context pressure or provider-side truncation, so callers
|
|
15
|
+
* can make one bounded compact-and-retry attempt. `desiredMaxOutput` must be the original
|
|
16
|
+
* limit before any context-based clamping.
|
|
17
|
+
*/
|
|
18
|
+
export declare function stoppedShort(message: AssistantMessage, desiredMaxOutput: number): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-scoped environment lookup: request-scoped overrides first, then process.env, then the Bun sandbox fallback.
|
|
3
|
+
*/
|
|
4
|
+
import type { ProviderEnv } from "../types.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a provider env value from scoped overrides, normal process.env, then
|
|
7
|
+
* the duplicated Bun sandbox fallback for direct @nyte-ai/ai consumers.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getProviderEnvValue(name: string, env?: ProviderEnv): string | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ProviderRetryOptions {
|
|
2
|
+
maxRetries?: number;
|
|
3
|
+
maxRetryDelayMs?: number;
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
/** Vetoes a retry the SDK policy would allow, for provider-specific terminal failures. */
|
|
6
|
+
retryable?: (error: unknown) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/** A server asked to wait longer than `maxRetryDelayMs` before retrying. */
|
|
9
|
+
export declare class RetryDelayExceededError extends Error {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reproduce the retry behavior used by the OpenAI and Anthropic SDKs while making
|
|
13
|
+
* their backoff sleep interruptible. Their built-in retry timers ignore the
|
|
14
|
+
* request AbortSignal, so callers must invoke the SDK with `maxRetries: 0` and
|
|
15
|
+
* wrap the request with this helper. Provider-requested delays above
|
|
16
|
+
* `maxRetryDelayMs` fail immediately with a {@link RetryDelayExceededError} (60
|
|
17
|
+
* seconds by default); set it to zero to disable the limit. Adapters without an SDK
|
|
18
|
+
* throw errors carrying `status` and `headers` to take part in the same policy. Each retry is a
|
|
19
|
+
* fresh SDK request, so X-Stainless-Retry-Count stays zero.
|
|
20
|
+
*/
|
|
21
|
+
export declare function retryProviderRequest<T>(request: () => Promise<T>, options?: ProviderRetryOptions): Promise<T>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RetryDelayExceededError2,
|
|
3
|
+
retryProviderRequest2
|
|
4
|
+
} from "../../chunks/account-limits-cache-nbhht7xz.js";
|
|
5
|
+
import"../../chunks/account-limits-cache-j2bt392s.js";
|
|
6
|
+
export {
|
|
7
|
+
RetryDelayExceededError2 as RetryDelayExceededError,
|
|
8
|
+
retryProviderRequest2 as retryProviderRequest
|
|
9
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded exponential-backoff retry loop for assistant calls. What counts as
|
|
3
|
+
* transient is decided by the failure class in `failure.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import type { AssistantMessage } from "@nyte-ai/schema/model";
|
|
6
|
+
/**
|
|
7
|
+
* Bounded retries with exponential backoff. `maxAgentDelayMs` defaults to 60 seconds.
|
|
8
|
+
*/
|
|
9
|
+
export interface RetryPolicy {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
/** Max retry attempts (0 = no retries). The initial call never counts as a retry. */
|
|
12
|
+
maxRetries: number;
|
|
13
|
+
/** Base delay in ms. Per-attempt delay is `baseDelayMs * 2^(attempt-1)` before jitter. */
|
|
14
|
+
baseDelayMs: number;
|
|
15
|
+
/** Optional cap for agent-level retry delays in ms. Defaults to 60 seconds. */
|
|
16
|
+
maxAgentDelayMs?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEFAULT_MAX_AGENT_RETRY_DELAY_MS = 60000;
|
|
19
|
+
/** Optional callbacks emitted by {@link retryAssistantCall} around each retry. */
|
|
20
|
+
export interface RetryCallbacks {
|
|
21
|
+
/** Emitted before the backoff sleep of each retry attempt (1-indexed). */
|
|
22
|
+
onRetryScheduled?: (attempt: number, maxAttempts: number, delayMs: number, errorMessage: string) => void | Promise<void>;
|
|
23
|
+
/** Emitted after the backoff sleep, immediately before the retried call starts. */
|
|
24
|
+
onRetryAttemptStart?: () => void | Promise<void>;
|
|
25
|
+
/** Emitted once when the loop ends: success if a later call completed normally. */
|
|
26
|
+
onRetryFinished?: (success: boolean, attempt: number, finalError?: string) => void | Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Backoff before `attempt`, 1-based, capped at `maxAgentDelayMs`. The one definition: a caller
|
|
30
|
+
* that schedules its own retries must compute the delay here rather than restating the formula.
|
|
31
|
+
*/
|
|
32
|
+
export declare function retryDelayMs(policy: Pick<RetryPolicy, "baseDelayMs" | "maxAgentDelayMs">, attempt: number): number;
|
|
33
|
+
/**
|
|
34
|
+
* The wait before retrying a failed assistant call at `attempt`: the backoff stretched to the
|
|
35
|
+
* provider's `retryAfterMs`, or null when the provider asks for longer than `maxAgentDelayMs`,
|
|
36
|
+
* since every later attempt meets the same limit.
|
|
37
|
+
*/
|
|
38
|
+
export declare function assistantRetryDelayMs(policy: Pick<RetryPolicy, "baseDelayMs" | "maxAgentDelayMs">, attempt: number, retryAfterMs: number | undefined): number | null;
|
|
39
|
+
/** Resolves after `ms`. Rejects the moment `signal` aborts, and only then. */
|
|
40
|
+
export declare function abortableSleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Run a single assistant-producing call with bounded retry on transient errors.
|
|
43
|
+
*
|
|
44
|
+
* Behavior:
|
|
45
|
+
* - A successful response is returned immediately. Aborts are terminal and never
|
|
46
|
+
* retried, but reported as unsuccessful if they happen after a retry was scheduled.
|
|
47
|
+
* Aborts during the backoff sleep are normalized to an aborted `AssistantMessage`
|
|
48
|
+
* too, so callers do not need to care when cancellation happened.
|
|
49
|
+
* - A non-retryable error (per {@link failedTransiently}, including quota/
|
|
50
|
+
* billing exhaustion) is returned immediately so deterministic errors fail fast.
|
|
51
|
+
* - Otherwise retries up to `maxRetries` times with exponential backoff, waiting at least
|
|
52
|
+
* the provider's retry-after and giving up when it asks for longer than `maxAgentDelayMs`,
|
|
53
|
+
* emitting `onRetryScheduled` before each sleep, `onRetryAttemptStart` after each sleep
|
|
54
|
+
* before the retried call starts, and `onRetryFinished` once at the end (whether the loop
|
|
55
|
+
* ends in success, exhausted retries, or an aborted backoff).
|
|
56
|
+
*
|
|
57
|
+
* When `policy` is undefined or disabled, the first response is returned unchanged
|
|
58
|
+
* (equivalent to calling `produce()` directly).
|
|
59
|
+
*/
|
|
60
|
+
export declare function retryAssistantCall(produce: () => Promise<AssistantMessage>, policy: RetryPolicy | undefined, signal: AbortSignal | undefined, callbacks?: RetryCallbacks): Promise<AssistantMessage>;
|
|
61
|
+
/**
|
|
62
|
+
* Whether a failed assistant message looks like a transient provider or
|
|
63
|
+
* transport error, as a function of its failure class. Callers handle context
|
|
64
|
+
* overflow first and own their retry budget, backoff, and reporting.
|
|
65
|
+
*/
|
|
66
|
+
export declare function failedTransiently(message: AssistantMessage): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_MAX_AGENT_RETRY_DELAY_MS2,
|
|
3
|
+
retryDelayMs2,
|
|
4
|
+
assistantRetryDelayMs2,
|
|
5
|
+
abortableSleep2,
|
|
6
|
+
retryAssistantCall2,
|
|
7
|
+
failedTransiently2
|
|
8
|
+
} from "../../chunks/account-limits-cache-bsknrh6t.js";
|
|
9
|
+
import"../../chunks/account-limits-cache-xds88kxd.js";
|
|
10
|
+
import"../../chunks/account-limits-cache-j2bt392s.js";
|
|
11
|
+
export {
|
|
12
|
+
DEFAULT_MAX_AGENT_RETRY_DELAY_MS2 as DEFAULT_MAX_AGENT_RETRY_DELAY_MS,
|
|
13
|
+
abortableSleep2 as abortableSleep,
|
|
14
|
+
assistantRetryDelayMs2 as assistantRetryDelayMs,
|
|
15
|
+
failedTransiently2 as failedTransiently,
|
|
16
|
+
retryAssistantCall2 as retryAssistantCall,
|
|
17
|
+
retryDelayMs2 as retryDelayMs
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes unpaired Unicode surrogates, which break JSON serialization at several providers.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Removes unpaired Unicode surrogate characters from a string.
|
|
6
|
+
*
|
|
7
|
+
* Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,
|
|
8
|
+
* or vice versa) cause JSON serialization errors in many API providers.
|
|
9
|
+
*
|
|
10
|
+
* Valid emoji and other characters outside the Basic Multilingual Plane use properly paired
|
|
11
|
+
* surrogates and will NOT be affected by this function.
|
|
12
|
+
*
|
|
13
|
+
* @param text - The text to sanitize
|
|
14
|
+
* @returns The sanitized text with unpaired surrogates removed
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Valid emoji (properly paired surrogates) are preserved
|
|
18
|
+
* sanitizeSurrogates("Hello 🙈 World") // => "Hello 🙈 World"
|
|
19
|
+
*
|
|
20
|
+
* // Unpaired high surrogate is removed
|
|
21
|
+
* const unpaired = String.fromCharCode(0xD83D); // high surrogate without low
|
|
22
|
+
* sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
|
|
23
|
+
*/
|
|
24
|
+
export declare function sanitizeSurrogates(text: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one `text/event-stream` decoder the adapters share.
|
|
3
|
+
*/
|
|
4
|
+
/** One dispatched server-sent event. */
|
|
5
|
+
interface ServerSentEvent {
|
|
6
|
+
/** The `event` field, or null when the event had none. */
|
|
7
|
+
event: string | null;
|
|
8
|
+
/** The event's `data` lines joined with newlines. */
|
|
9
|
+
data: string;
|
|
10
|
+
/** Every non-blank line of the event as received, for error reports. */
|
|
11
|
+
raw: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Decodes a `text/event-stream` body per the WHATWG grammar: CR, LF and CRLF line ends split
|
|
15
|
+
* anywhere across chunks, comments, one optional space after the field colon, and a final event
|
|
16
|
+
* flushed at EOF. The body is cancelled when `signal` aborts (rejecting with "Request was
|
|
17
|
+
* aborted"), when no chunk arrives within `idleTimeoutMs` (rejecting with a `TimeoutError`
|
|
18
|
+
* DOMException), and when the consumer stops iterating.
|
|
19
|
+
*/
|
|
20
|
+
export declare function iterateServerSentEvents(body: ReadableStream<Uint8Array>, signal?: AbortSignal, idleTimeoutMs?: number): AsyncGenerator<ServerSentEvent>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
contentText2,
|
|
3
|
+
getSystemMessageText2,
|
|
4
|
+
renderSystemMessageUpdate2
|
|
5
|
+
} from "../../chunks/account-limits-cache-b4edaybk.js";
|
|
6
|
+
export {
|
|
7
|
+
contentText2 as contentText,
|
|
8
|
+
getSystemMessageText2 as getSystemMessageText,
|
|
9
|
+
renderSystemMessageUpdate2 as renderSystemMessageUpdate
|
|
10
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transcript replay helpers live in @nyte-ai/schema so clients share one
|
|
3
|
+
* reading of system messages; re-exported here for the ai layout.
|
|
4
|
+
*/
|
|
5
|
+
export { collapseSystemMessages, createInitialSystemMessage, declarationsEqual, getCurrentSystemMessage, getCurrentSystemPrompt, getCurrentTools, getDeclaredTools, getInitialSystemMessage, getToolStateChanges, hasNonAdditiveToolChanges, hasToolRedefinitions, normalizeContext, resolveTranscript, resolveTranscriptTools, toToolDeclaration, withoutInitialSystemMessage, type ToolStateChanges, type TranscriptContext, type TranscriptMessages, type TranscriptTools, } from "@nyte-ai/schema/model";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collapseSystemMessages2,
|
|
3
|
+
createInitialSystemMessage2,
|
|
4
|
+
declarationsEqual2,
|
|
5
|
+
getCurrentSystemMessage2,
|
|
6
|
+
getCurrentSystemPrompt2,
|
|
7
|
+
getCurrentTools2,
|
|
8
|
+
getDeclaredTools2,
|
|
9
|
+
getInitialSystemMessage2,
|
|
10
|
+
getToolStateChanges2,
|
|
11
|
+
hasNonAdditiveToolChanges2,
|
|
12
|
+
hasToolRedefinitions2,
|
|
13
|
+
normalizeContext2,
|
|
14
|
+
resolveTranscript2,
|
|
15
|
+
resolveTranscriptTools2,
|
|
16
|
+
toToolDeclaration2,
|
|
17
|
+
withoutInitialSystemMessage2
|
|
18
|
+
} from "../../chunks/account-limits-cache-6250ykn6.js";
|
|
19
|
+
export {
|
|
20
|
+
collapseSystemMessages2 as collapseSystemMessages,
|
|
21
|
+
createInitialSystemMessage2 as createInitialSystemMessage,
|
|
22
|
+
declarationsEqual2 as declarationsEqual,
|
|
23
|
+
getCurrentSystemMessage2 as getCurrentSystemMessage,
|
|
24
|
+
getCurrentSystemPrompt2 as getCurrentSystemPrompt,
|
|
25
|
+
getCurrentTools2 as getCurrentTools,
|
|
26
|
+
getDeclaredTools2 as getDeclaredTools,
|
|
27
|
+
getInitialSystemMessage2 as getInitialSystemMessage,
|
|
28
|
+
getToolStateChanges2 as getToolStateChanges,
|
|
29
|
+
hasNonAdditiveToolChanges2 as hasNonAdditiveToolChanges,
|
|
30
|
+
hasToolRedefinitions2 as hasToolRedefinitions,
|
|
31
|
+
normalizeContext2 as normalizeContext,
|
|
32
|
+
resolveTranscript2 as resolveTranscript,
|
|
33
|
+
resolveTranscriptTools2 as resolveTranscriptTools,
|
|
34
|
+
toToolDeclaration2 as toToolDeclaration,
|
|
35
|
+
withoutInitialSystemMessage2 as withoutInitialSystemMessage
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeBox helpers for tool parameter schemas.
|
|
3
|
+
*/
|
|
4
|
+
import { Type } from "typebox";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a string enum schema compatible with Google's API and other providers
|
|
7
|
+
* that don't support anyOf/const patterns.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const OperationSchema = StringEnum(["add", "subtract", "multiply", "divide"], {
|
|
11
|
+
* description: "The operation to perform"
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* type Operation = Static<typeof OperationSchema>; // "add" | "subtract" | "multiply" | "divide"
|
|
15
|
+
*/
|
|
16
|
+
export declare function StringEnum<T extends string[]>(values: readonly [...T], options?: {
|
|
17
|
+
description?: string;
|
|
18
|
+
default?: T[number];
|
|
19
|
+
}): Type.TEnum<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Static, type TSchema } from "typebox";
|
|
2
|
+
import type { Tool, ToolCall } from "@nyte-ai/schema/model";
|
|
3
|
+
/**
|
|
4
|
+
* Validates tool call arguments against the tool's TypeBox schema
|
|
5
|
+
* @param tool The tool definition with TypeBox schema
|
|
6
|
+
* @param toolCall The tool call from the LLM
|
|
7
|
+
* @returns The validated (and potentially coerced) arguments
|
|
8
|
+
* @throws Error with formatted message if validation fails, or with the call's `argumentsError`
|
|
9
|
+
* when its arguments text was not a JSON object
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateToolArguments(tool: Tool, toolCall: ToolCall): unknown;
|
|
12
|
+
/** Captures the schema's validator while its input type is still known. */
|
|
13
|
+
export declare function createToolArgumentParser<T extends TSchema>(tool: Tool<T>): (args: unknown) => Static<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,155 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyte-ai/ai",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.18",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/interfaces-lab/nyte.git",
|
|
9
|
+
"directory": "packages/ai"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"THIRD-PARTY-NOTICES.md"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/src/index.d.ts",
|
|
20
|
+
"import": "./dist/src/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./auth/context": {
|
|
23
|
+
"types": "./dist/src/auth/context.d.ts",
|
|
24
|
+
"import": "./dist/src/auth/context.js"
|
|
25
|
+
},
|
|
26
|
+
"./auth/helpers": {
|
|
27
|
+
"types": "./dist/src/auth/helpers.d.ts",
|
|
28
|
+
"import": "./dist/src/auth/helpers.js"
|
|
29
|
+
},
|
|
30
|
+
"./auth/types": {
|
|
31
|
+
"types": "./dist/src/auth/types.d.ts",
|
|
32
|
+
"import": "./dist/src/auth/types.js"
|
|
33
|
+
},
|
|
34
|
+
"./auth/credential-store": {
|
|
35
|
+
"types": "./dist/src/auth/credential-store.d.ts",
|
|
36
|
+
"import": "./dist/src/auth/credential-store.js"
|
|
37
|
+
},
|
|
38
|
+
"./auth/oauth/github-copilot": {
|
|
39
|
+
"types": "./dist/src/auth/oauth/github-copilot.d.ts",
|
|
40
|
+
"import": "./dist/src/auth/oauth/github-copilot.js"
|
|
41
|
+
},
|
|
42
|
+
"./auth/oauth/openai-codex": {
|
|
43
|
+
"types": "./dist/src/auth/oauth/openai-codex.d.ts",
|
|
44
|
+
"import": "./dist/src/auth/oauth/openai-codex.js"
|
|
45
|
+
},
|
|
46
|
+
"./auth/store": {
|
|
47
|
+
"types": "./dist/src/auth/store.d.ts",
|
|
48
|
+
"import": "./dist/src/auth/store.js"
|
|
49
|
+
},
|
|
50
|
+
"./bun-oauth": {
|
|
51
|
+
"types": "./dist/src/bun-oauth.d.ts",
|
|
52
|
+
"import": "./dist/src/bun-oauth.js"
|
|
53
|
+
},
|
|
54
|
+
"./models": {
|
|
55
|
+
"types": "./dist/src/models.d.ts",
|
|
56
|
+
"import": "./dist/src/models.js"
|
|
57
|
+
},
|
|
58
|
+
"./providers/github-copilot": {
|
|
59
|
+
"types": "./dist/src/providers/github-copilot.d.ts",
|
|
60
|
+
"import": "./dist/src/providers/github-copilot.js"
|
|
61
|
+
},
|
|
62
|
+
"./providers/openai-codex": {
|
|
63
|
+
"types": "./dist/src/providers/openai-codex.d.ts",
|
|
64
|
+
"import": "./dist/src/providers/openai-codex.js"
|
|
65
|
+
},
|
|
66
|
+
"./providers/openrouter": {
|
|
67
|
+
"types": "./dist/src/providers/openrouter.d.ts",
|
|
68
|
+
"import": "./dist/src/providers/openrouter.js"
|
|
69
|
+
},
|
|
70
|
+
"./providers/vercel-ai-gateway": {
|
|
71
|
+
"types": "./dist/src/providers/vercel-ai-gateway.d.ts",
|
|
72
|
+
"import": "./dist/src/providers/vercel-ai-gateway.js"
|
|
73
|
+
},
|
|
74
|
+
"./session-resources": {
|
|
75
|
+
"types": "./dist/src/session-resources.d.ts",
|
|
76
|
+
"import": "./dist/src/session-resources.js"
|
|
77
|
+
},
|
|
78
|
+
"./types": {
|
|
79
|
+
"types": "./dist/src/types.d.ts",
|
|
80
|
+
"import": "./dist/src/types.js"
|
|
81
|
+
},
|
|
82
|
+
"./utils/estimate": {
|
|
83
|
+
"types": "./dist/src/utils/estimate.d.ts",
|
|
84
|
+
"import": "./dist/src/utils/estimate.js"
|
|
85
|
+
},
|
|
86
|
+
"./utils/event-stream": {
|
|
87
|
+
"types": "./dist/src/utils/event-stream.d.ts",
|
|
88
|
+
"import": "./dist/src/utils/event-stream.js"
|
|
89
|
+
},
|
|
90
|
+
"./utils/failure": {
|
|
91
|
+
"types": "./dist/src/utils/failure.d.ts",
|
|
92
|
+
"import": "./dist/src/utils/failure.js"
|
|
93
|
+
},
|
|
94
|
+
"./utils/fifo-queue": {
|
|
95
|
+
"types": "./dist/src/utils/fifo-queue.d.ts",
|
|
96
|
+
"import": "./dist/src/utils/fifo-queue.js"
|
|
97
|
+
},
|
|
98
|
+
"./utils/overflow": {
|
|
99
|
+
"types": "./dist/src/utils/overflow.d.ts",
|
|
100
|
+
"import": "./dist/src/utils/overflow.js"
|
|
101
|
+
},
|
|
102
|
+
"./utils/retry": {
|
|
103
|
+
"types": "./dist/src/utils/retry.d.ts",
|
|
104
|
+
"import": "./dist/src/utils/retry.js"
|
|
105
|
+
},
|
|
106
|
+
"./utils/text": {
|
|
107
|
+
"types": "./dist/src/utils/text.d.ts",
|
|
108
|
+
"import": "./dist/src/utils/text.js"
|
|
109
|
+
},
|
|
110
|
+
"./utils/transcript": {
|
|
111
|
+
"types": "./dist/src/utils/transcript.d.ts",
|
|
112
|
+
"import": "./dist/src/utils/transcript.js"
|
|
113
|
+
},
|
|
114
|
+
"./utils/uuid": {
|
|
115
|
+
"types": "./dist/src/utils/uuid.d.ts",
|
|
116
|
+
"import": "./dist/src/utils/uuid.js"
|
|
117
|
+
},
|
|
118
|
+
"./utils/validation": {
|
|
119
|
+
"types": "./dist/src/utils/validation.d.ts",
|
|
120
|
+
"import": "./dist/src/utils/validation.js"
|
|
121
|
+
},
|
|
122
|
+
"./auth/oauth/anthropic": {
|
|
123
|
+
"types": "./dist/src/auth/oauth/anthropic.d.ts",
|
|
124
|
+
"import": "./dist/src/auth/oauth/anthropic.js"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"publishConfig": {
|
|
128
|
+
"access": "public",
|
|
129
|
+
"provenance": true
|
|
130
|
+
},
|
|
131
|
+
"dependencies": {
|
|
132
|
+
"@anthropic-ai/sdk": "0.129.0",
|
|
133
|
+
"@google/genai": "1.52.0",
|
|
134
|
+
"@nyte-ai/schema": "0.0.18",
|
|
135
|
+
"openai": "6.40.0",
|
|
136
|
+
"partial-json": "0.1.7",
|
|
137
|
+
"typebox": "1.3.36"
|
|
138
|
+
},
|
|
139
|
+
"devDependencies": {
|
|
140
|
+
"@types/node": "^26.6.5",
|
|
141
|
+
"typescript": "6.0.3",
|
|
142
|
+
"vitest": "^5.0.5"
|
|
143
|
+
},
|
|
144
|
+
"engines": {
|
|
145
|
+
"node": ">=26.4.0"
|
|
146
|
+
},
|
|
147
|
+
"scripts": {
|
|
148
|
+
"clean": "rm -rf node_modules .turbo",
|
|
149
|
+
"models:generate": "node scripts/generate-models.ts",
|
|
150
|
+
"models:publish": "node scripts/publish-models.ts",
|
|
151
|
+
"typecheck": "tsgo --noEmit",
|
|
152
|
+
"test": "vitest --run",
|
|
153
|
+
"build:package": "bun ../../scripts/sdk-packages.mjs build ai"
|
|
154
|
+
}
|
|
6
155
|
}
|