@vedmalex/ai-connect 0.2.0

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.
Files changed (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1266 -0
  3. package/dist/browser/index.js +6690 -0
  4. package/dist/browser/index.js.map +7 -0
  5. package/dist/bun/index.js +10073 -0
  6. package/dist/bun/index.js.map +7 -0
  7. package/dist/bun/local.js +9753 -0
  8. package/dist/bun/local.js.map +7 -0
  9. package/dist/node/index.js +10073 -0
  10. package/dist/node/index.js.map +7 -0
  11. package/dist/node/local.js +9753 -0
  12. package/dist/node/local.js.map +7 -0
  13. package/dist/types/acp-presets.d.ts +2 -0
  14. package/dist/types/acp-presets.d.ts.map +1 -0
  15. package/dist/types/acp.d.ts +39 -0
  16. package/dist/types/acp.d.ts.map +1 -0
  17. package/dist/types/browser.d.ts +5 -0
  18. package/dist/types/browser.d.ts.map +1 -0
  19. package/dist/types/bun.d.ts +2 -0
  20. package/dist/types/bun.d.ts.map +1 -0
  21. package/dist/types/catalog.d.ts +33 -0
  22. package/dist/types/catalog.d.ts.map +1 -0
  23. package/dist/types/cli-presets.d.ts +12 -0
  24. package/dist/types/cli-presets.d.ts.map +1 -0
  25. package/dist/types/cli.d.ts +20 -0
  26. package/dist/types/cli.d.ts.map +1 -0
  27. package/dist/types/client.d.ts +3 -0
  28. package/dist/types/client.d.ts.map +1 -0
  29. package/dist/types/config.d.ts +30 -0
  30. package/dist/types/config.d.ts.map +1 -0
  31. package/dist/types/default-handlers.d.ts +5 -0
  32. package/dist/types/default-handlers.d.ts.map +1 -0
  33. package/dist/types/errors.d.ts +15 -0
  34. package/dist/types/errors.d.ts.map +1 -0
  35. package/dist/types/fanout.d.ts +20 -0
  36. package/dist/types/fanout.d.ts.map +1 -0
  37. package/dist/types/files.d.ts +42 -0
  38. package/dist/types/files.d.ts.map +1 -0
  39. package/dist/types/image.d.ts +40 -0
  40. package/dist/types/image.d.ts.map +1 -0
  41. package/dist/types/index.browser.d.ts +18 -0
  42. package/dist/types/index.browser.d.ts.map +1 -0
  43. package/dist/types/index.d.ts +19 -0
  44. package/dist/types/index.d.ts.map +1 -0
  45. package/dist/types/local-handlers.d.ts +12 -0
  46. package/dist/types/local-handlers.d.ts.map +1 -0
  47. package/dist/types/local.d.ts +6 -0
  48. package/dist/types/local.d.ts.map +1 -0
  49. package/dist/types/logging.d.ts +8 -0
  50. package/dist/types/logging.d.ts.map +1 -0
  51. package/dist/types/mock-gateway.d.ts +97 -0
  52. package/dist/types/mock-gateway.d.ts.map +1 -0
  53. package/dist/types/model-reference.d.ts +85 -0
  54. package/dist/types/model-reference.d.ts.map +1 -0
  55. package/dist/types/node.d.ts +2 -0
  56. package/dist/types/node.d.ts.map +1 -0
  57. package/dist/types/probe.d.ts +71 -0
  58. package/dist/types/probe.d.ts.map +1 -0
  59. package/dist/types/router.d.ts +41 -0
  60. package/dist/types/router.d.ts.map +1 -0
  61. package/dist/types/runtime.d.ts +6 -0
  62. package/dist/types/runtime.d.ts.map +1 -0
  63. package/dist/types/server-presets.d.ts +9 -0
  64. package/dist/types/server-presets.d.ts.map +1 -0
  65. package/dist/types/server.d.ts +12 -0
  66. package/dist/types/server.d.ts.map +1 -0
  67. package/dist/types/types.d.ts +1346 -0
  68. package/dist/types/types.d.ts.map +1 -0
  69. package/package.json +94 -0
@@ -0,0 +1,85 @@
1
+ import type { ModelContextResolution, ModelPricing, ModelReferenceEntry, ResolveModelContextInput } from "./types.js";
2
+ /**
3
+ * Browser-safe model-reference primitive (C4 / UR-007, UR-009, UR-015).
4
+ *
5
+ * This module is a PURE data + functions reuse primitive: it has ZERO `node:*` imports,
6
+ * needs no client instance, and references no provider/transport/bs-search symbol except
7
+ * inside the curated `MODEL_REFERENCE` id-string literals (INV-REUSE-1). Everything here is
8
+ * synchronous and side-effect-free — safe to run in a browser bundle.
9
+ *
10
+ * The fallback default context window when nothing else is known.
11
+ */
12
+ export declare const DEFAULT_CONTEXT_WINDOW = 8192;
13
+ /**
14
+ * Curated reference table of model context windows / pricing / free-tier flags.
15
+ *
16
+ * Keys are NORMALIZED model keys (see {@link normalizeModelKey}): lowercase, provider prefix
17
+ * dropped, `:free`/`:beta` suffixes dropped. Covers every model id that appears in
18
+ * `src/catalog.ts` plus the common public model families so the flat-8192 default rarely
19
+ * fires (R-OQ3). The provider/model NAMES that appear here are inert string DATA, not symbol
20
+ * references — the reusability gate (INV-REUSE-1) explicitly allows them inside these literals.
21
+ */
22
+ export declare const MODEL_REFERENCE: Record<string, ModelReferenceEntry>;
23
+ /**
24
+ * Normalize a model id into a {@link MODEL_REFERENCE} lookup key:
25
+ * 1. lowercase
26
+ * 2. drop a leading `provider/` segment (e.g. `openai/gpt-4.1` → `gpt-4.1`)
27
+ * 3. drop a trailing `:free` / `:beta` modifier (e.g. `gpt-4.1:free` → `gpt-4.1`)
28
+ *
29
+ * Pure string transform — provider/transport-blind.
30
+ */
31
+ export declare function normalizeModelKey(model: string): string;
32
+ /**
33
+ * Look up a curated {@link ModelReferenceEntry} for a model id. Normalizes the id first
34
+ * (see {@link normalizeModelKey}) then matches by, in order: EXACT key, longest PREFIX key,
35
+ * longest SUBSTRING key. When several keys tie, the LONGEST key wins (R18 — avoids a short
36
+ * key shadowing a more specific one). Returns `undefined` when nothing matches.
37
+ */
38
+ export declare function lookupModelRef(model: string): ModelReferenceEntry | undefined;
39
+ /**
40
+ * Extract a context-window length from a raw provider model record. Probes a FIXED key order
41
+ * (first usable value wins): `context_length` → `max_model_len` → `context_window` →
42
+ * `top_provider.context_length`. Zero, negative, NaN, and non-number values are ignored.
43
+ * Returns `undefined` when no usable value is present.
44
+ */
45
+ export declare function extractModelContextLength(raw: unknown): number | undefined;
46
+ /**
47
+ * Parse a {@link ModelPricing} block from a raw provider model record's `pricing` object.
48
+ * Numbers and numeric strings are accepted; other shapes are dropped. Returns `undefined`
49
+ * when no pricing components are present.
50
+ */
51
+ export declare function parseModelPricing(raw: unknown): ModelPricing | undefined;
52
+ /**
53
+ * Determine whether a model is free. Two independent signals (INV — dual-free-detection):
54
+ * 1. the model id carries a `:free` suffix, OR
55
+ * 2. every DEFINED pricing component (prompt/completion/request/image) is exactly 0.
56
+ *
57
+ * A PARTIAL zero (some components 0, others positive) is NOT free. When no pricing is supplied
58
+ * and there is no `:free` suffix, returns `false`.
59
+ */
60
+ export declare function detectModelFree(modelId: string, pricing?: ModelPricing, raw?: unknown): boolean;
61
+ /**
62
+ * Standalone context-window resolver (no client instance required — INV-REUSE-1). Precedence
63
+ * is FIXED: discovered > reference > configured > default. Each candidate must be a usable
64
+ * positive finite number to participate; otherwise the next source is consulted. When nothing
65
+ * is usable, falls back to `defaultContextWindow` (default {@link DEFAULT_CONTEXT_WINDOW}).
66
+ */
67
+ export declare function resolveModelContextWindow(input: {
68
+ discovered?: number;
69
+ reference?: number;
70
+ configured?: number;
71
+ defaultContextWindow?: number;
72
+ }): {
73
+ contextWindow: number;
74
+ source: ModelContextResolution["source"];
75
+ };
76
+ /**
77
+ * Compute the cache key + model id for a {@link ResolveModelContextInput}. Cache scope is
78
+ * per-(baseUrl|transportId)::model so two routes pointing at different gateways do not share a
79
+ * cached window.
80
+ */
81
+ export declare function modelContextCacheKey(input: ResolveModelContextInput): {
82
+ key: string;
83
+ model: string;
84
+ };
85
+ //# sourceMappingURL=model-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-reference.d.ts","sourceRoot":"","sources":["../../src/model-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CA6C/D,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAmC7E;AAMD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAuB1E;AAgBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CA0BxE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,EACtB,GAAG,CAAC,EAAE,OAAO,GACZ,OAAO,CAsBT;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAA;CAAE,CActE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,wBAAwB,GAAG;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAMA"}
@@ -0,0 +1,2 @@
1
+ export * from "./index.js";
2
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { AiConnectError } from "./errors.js";
2
+ import type { AiConnectErrorCode, ProbeModelResult } from "./types.js";
3
+ /** Default per-probe timeout (ms). The probe ping aborts independently after this elapses. */
4
+ export declare const PROBE_DEFAULT_TIMEOUT_MS = 8000;
5
+ /** Default TTL (ms) for the per-(route::sorted-models) probe cache. */
6
+ export declare const PROBE_DEFAULT_TTL_MS = 300000;
7
+ /** Default bounded fan-out concurrency for `probeModels`. */
8
+ export declare const PROBE_DEFAULT_CONCURRENCY = 4;
9
+ /**
10
+ * Outcome of classifying a single probe ping. `ok` is true ONLY when the ping produced usable
11
+ * output (non-empty `text` OR at least one `toolCall`). `broken` flags a route-side fault that a
12
+ * retry will NOT fix: `400 ≤ httpStatus < 500 ∧ httpStatus ≠ 429` (INV-PROBE-1). Everything else
13
+ * (429 / 5xx / status-less transport errors) is transient (`broken:false`).
14
+ */
15
+ export interface ProbeOutcomeClassification {
16
+ ok: boolean;
17
+ broken: boolean;
18
+ detail: string;
19
+ code?: AiConnectErrorCode | "not_supported";
20
+ httpStatus?: number;
21
+ }
22
+ /** Internal cache entry — exported as a type only so the client can own a typed `Map`. */
23
+ export interface ProbeCacheEntry {
24
+ expiresAt: number;
25
+ results: ProbeModelResult[];
26
+ }
27
+ /** The probe cache shape. The client owns one of these per-client; this module never mutates a global. */
28
+ export type ProbeCache = Map<string, ProbeCacheEntry>;
29
+ /**
30
+ * Classify a probe ping into {ok, broken, detail, code?, httpStatus?} (INV-PROBE-1).
31
+ *
32
+ * - On error: `ok=false`; `broken` is true exactly when `400 ≤ httpStatus < 500 ∧ httpStatus ≠ 429`
33
+ * (the route-side, retry-won't-fix band). 429 / 5xx / status-less are transient (`broken=false`).
34
+ * - On success: `ok=true` ONLY when `text` is non-empty OR `toolCalls` is present; an empty/blank
35
+ * response is treated as a model-side failure (`ok=false`, `broken=false`).
36
+ *
37
+ * Pure and provider-blind — keys off `httpStatus` + output presence only, never a provider symbol.
38
+ */
39
+ export declare function classifyProbeOutcome(input: {
40
+ error?: AiConnectError;
41
+ text?: string;
42
+ toolCalls?: unknown[];
43
+ }): ProbeOutcomeClassification;
44
+ /**
45
+ * Stable, order-independent cache key for a route::model-set probe. Models are sorted+deduped so
46
+ * `['a','b']` and `['b','a']` collide (scenario #47). The `routeId` is the namespace; the joined
47
+ * sorted model list is the discriminant.
48
+ */
49
+ export declare function probeCacheKey(routeId: string, models: readonly string[]): string;
50
+ /**
51
+ * Read a non-expired cache entry. A hit requires `now < entry.expiresAt` (so `now = expiresAt - 1`
52
+ * hits and `now = expiresAt` / `+1` misses — scenario #47). Returns `undefined` on miss/absence.
53
+ * Pure read; never mutates the cache or reads wall-clock (`now` is injected).
54
+ */
55
+ export declare function readProbeCache(cache: ProbeCache, key: string, now: number): ProbeModelResult[] | undefined;
56
+ /**
57
+ * Write a cache entry expiring at `now + ttlMs`. Stored results are normalized to `cached:false`
58
+ * (the stored copy represents a freshly-probed result; `readProbeCache` re-flags hits). Mutates
59
+ * only the caller-owned `cache` — no module-level state.
60
+ */
61
+ export declare function writeProbeCache(cache: ProbeCache, key: string, results: ProbeModelResult[], now: number, ttlMs: number): void;
62
+ /**
63
+ * Bounded-concurrency runner (INV: max in-flight ≤ `limit` at all times). Runs `fn` over every
64
+ * item with at most `limit` concurrent in-flight, preserving input order in the resolved array.
65
+ * `fn` receives the item index so callers can correlate results. Rejections propagate (the first
66
+ * rejection rejects the whole run) — probe callers therefore make `fn` total (it never rejects).
67
+ *
68
+ * Pure scheduling primitive: no timers, no clock, no provider/transport symbol (UR-015).
69
+ */
70
+ export declare function runBounded<T, R>(items: readonly T[], limit: number, fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
71
+ //# sourceMappingURL=probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../src/probe.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAC3C,6DAA6D;AAC7D,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,kBAAkB,GAAG,eAAe,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,0GAA0G;AAC1G,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAYtD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB,GAAG,0BAA0B,CA4B7B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAGhF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,gBAAgB,EAAE,GAAG,SAAS,CAOhC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,EAAE,EAC3B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,IAAI,CAKN;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAE,CAAC,EACnC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACzC,OAAO,CAAC,CAAC,EAAE,CAAC,CA0Bd"}
@@ -0,0 +1,41 @@
1
+ import type { AiConnectConfig, AiConnectErrorCode, CandidateModel, GenerateRequest, NormalizedRoute, OperationKind, ProviderId, RouteHealthSnapshot, RuntimeEnvironment } from "./types.js";
2
+ export declare class RouteRegistry {
3
+ #private;
4
+ readonly config: AiConnectConfig;
5
+ readonly runtime: RuntimeEnvironment;
6
+ constructor(config: AiConnectConfig, runtime: RuntimeEnvironment);
7
+ getHealth(route: NormalizedRoute): RouteHealthSnapshot;
8
+ listRoutes(filter?: {
9
+ operation?: GenerateRequest["operation"];
10
+ }): NormalizedRoute[];
11
+ /**
12
+ * Project the currently-eligible routes into secret-free {@link CandidateModel}s (C9 / UR-014).
13
+ * Deferred from C7 (needs the C9-owned `CandidateModel` type). Reuses the runtime-eligibility +
14
+ * health filters (a `cooling_down`/`unavailable` route is excluded), then narrows by optional
15
+ * `operation` (router pool) and `provider`. Carries ONLY the secret-free fields — never a
16
+ * credential/baseUrl/handler key (mirrors INV-PROJ-1 for the candidate list).
17
+ */
18
+ candidateModels(filter?: {
19
+ operation?: OperationKind;
20
+ provider?: ProviderId;
21
+ }): CandidateModel[];
22
+ resolveCandidates(request: GenerateRequest & {
23
+ operation: NonNullable<GenerateRequest["operation"]>;
24
+ }): NormalizedRoute[];
25
+ recordSuccess(route: NormalizedRoute): void;
26
+ recordFailure(route: NormalizedRoute, code: AiConnectErrorCode): void;
27
+ }
28
+ export declare function canFallbackBetween(failed: NormalizedRoute, next: NormalizedRoute, actions: string[]): boolean;
29
+ /**
30
+ * Apply a request-level model override to a candidate route (C7 / CD-8 / INV-ROUTE-1).
31
+ *
32
+ * - No `requestedModel` → the route is returned unchanged.
33
+ * - `requestedModel` already equals `route.model` → returned unchanged (no synthetic copy).
34
+ * - `strict` route + undeclared model → returns `undefined` (DROP — never silently billed; OQ-6).
35
+ * - `shortlist` route + undeclared model → returns a synthetic copy with `model: requestedModel`
36
+ * while PRESERVING the original `route.id` (R12 — health/cursors keyed on `id` never fragment).
37
+ *
38
+ * Pure and route-local: the input route object is never mutated.
39
+ */
40
+ export declare function applyRequestedModel(route: NormalizedRoute, requestedModel: string | undefined): NormalizedRoute | undefined;
41
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACV,mBAAmB,EAGnB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAkGpB,qBAAa,aAAa;;IACxB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;gBAOzB,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB;IAShE,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,mBAAmB;IA0BtD,UAAU,CAAC,MAAM,CAAC,EAAE;QAClB,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;KAC1C,GAAG,eAAe,EAAE;IAWrB;;;;;;OAMG;IACH,eAAe,CAAC,MAAM,CAAC,EAAE;QACvB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,QAAQ,CAAC,EAAE,UAAU,CAAC;KACvB,GAAG,cAAc,EAAE;IAyBpB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG;QAAE,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAA;KAAE,GAAG,eAAe,EAAE;IAiCzH,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAO3C,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI;CA8FtE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CA8CT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,EACtB,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,eAAe,GAAG,SAAS,CAiB7B"}
@@ -0,0 +1,6 @@
1
+ import type { RuntimeEnvironment, RuntimeKind } from "./types.js";
2
+ export declare function inferRuntimeKind(): RuntimeKind;
3
+ export declare function createRuntimeEnvironment(kind: RuntimeKind, overrides?: Partial<RuntimeEnvironment>): RuntimeEnvironment;
4
+ export declare function createBrowserRuntimeEnvironment(overrides?: Partial<RuntimeEnvironment>): RuntimeEnvironment;
5
+ export declare function createLocalRuntimeEnvironment(overrides?: Partial<RuntimeEnvironment>): RuntimeEnvironment;
6
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,gBAAgB,IAAI,WAAW,CAS9C;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,kBAAkB,CAWpB;AAED,wBAAgB,+BAA+B,CAC7C,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,kBAAkB,CAEpB;AAED,wBAAgB,6BAA6B,CAC3C,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,kBAAkB,CAEpB"}
@@ -0,0 +1,9 @@
1
+ export type ServerTransportPreset = {
2
+ id: string;
3
+ label: string;
4
+ command: string;
5
+ transportId: string;
6
+ };
7
+ export declare const AI_CONNECT_DEFAULT_SERVER_PRESETS: Record<"opencode", ServerTransportPreset>;
8
+ export declare const AI_CONNECT_DEFAULT_SERVER_COMMANDS: Record<string, string>;
9
+ //# sourceMappingURL=server-presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-presets.d.ts","sourceRoot":"","sources":["../../src/server-presets.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,UAAU,EACV,qBAAqB,CASpB,CAAC;AAEJ,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAErE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { AcpModelCatalog, DiscoverAcpModelsContext, GenerateContext, NormalizedRoute, RouteHandlerGenerateResult, ServerClientOptions } from "./types.js";
2
+ export declare function resolveServerExecutable(route: NormalizedRoute, options?: ServerClientOptions): string;
3
+ export declare function createServerTransportManager(options?: ServerClientOptions): {
4
+ runPrompt: (context: GenerateContext) => Promise<RouteHandlerGenerateResult>;
5
+ discoverModels: (context: DiscoverAcpModelsContext) => Promise<AcpModelCatalog>;
6
+ verifyRoute: (route: NormalizedRoute) => Promise<{
7
+ ok: boolean;
8
+ message?: string;
9
+ }>;
10
+ dispose: () => Promise<void>;
11
+ };
12
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EAEf,wBAAwB,EAExB,eAAe,EACf,eAAe,EACf,0BAA0B,EAC1B,mBAAmB,EAGpB,MAAM,YAAY,CAAC;AAmEpB,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAER;AA8SD,wBAAgB,4BAA4B,CAC1C,OAAO,CAAC,EAAE,mBAAmB,GAC5B;IACD,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC7E,cAAc,EAAE,CACd,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9B,WAAW,EAAE,CACX,KAAK,EAAE,eAAe,KACnB,OAAO,CAAC;QACX,EAAE,EAAE,OAAO,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAuLA"}