@remnic/core 1.1.6 → 1.1.7
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/dist/access-cli.js +6 -6
- package/dist/access-http.d.ts +1 -1
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-service.d.ts +1 -1
- package/dist/calibration.js +2 -2
- package/dist/causal-consolidation.js +2 -2
- package/dist/{chunk-TMSHGSIG.js → chunk-6B23Z44B.js} +1 -1
- package/dist/{chunk-3P6TPZM4.js → chunk-DWMXVUGO.js} +9 -4
- package/dist/chunk-DWMXVUGO.js.map +1 -0
- package/dist/{chunk-UE2OQNQQ.js → chunk-FCGWNWG4.js} +3 -3
- package/dist/{chunk-XOG2FHYW.js → chunk-KQB4C4OE.js} +2 -2
- package/dist/{chunk-Y27UJK6V.js → chunk-L2EXJQJP.js} +15 -2
- package/dist/chunk-L2EXJQJP.js.map +1 -0
- package/dist/{chunk-BFVBG5XY.js → chunk-S5SQDIF5.js} +2 -2
- package/dist/{chunk-AOABCJVL.js → chunk-VZNQB6NL.js} +5 -5
- package/dist/{cli-WahR0rs-.d.ts → cli-olNPi1uN.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +1 -1
- package/dist/{engine-5OTS6GY3.js → engine-2JKWFKJV.js} +2 -2
- package/dist/extraction.js +3 -3
- package/dist/fallback-llm.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/openai-chat-compat.d.ts +9 -1
- package/dist/openai-chat-compat.js +5 -1
- package/dist/orchestrator.js +6 -6
- package/dist/schemas.d.ts +22 -22
- package/dist/summarizer.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3P6TPZM4.js.map +0 -1
- package/dist/chunk-Y27UJK6V.js.map +0 -1
- package/dist/{access-service-CcKu1Yc0.d.ts → access-service-B9sziJdP.d.ts} +6 -6
- /package/dist/{chunk-TMSHGSIG.js.map → chunk-6B23Z44B.js.map} +0 -0
- /package/dist/{chunk-UE2OQNQQ.js.map → chunk-FCGWNWG4.js.map} +0 -0
- /package/dist/{chunk-XOG2FHYW.js.map → chunk-KQB4C4OE.js.map} +0 -0
- /package/dist/{chunk-BFVBG5XY.js.map → chunk-S5SQDIF5.js.map} +0 -0
- /package/dist/{chunk-AOABCJVL.js.map → chunk-VZNQB6NL.js.map} +0 -0
- /package/dist/{engine-5OTS6GY3.js.map → engine-2JKWFKJV.js.map} +0 -0
package/dist/access-cli.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Orchestrator
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VZNQB6NL.js";
|
|
4
|
+
import "./chunk-6B23Z44B.js";
|
|
5
5
|
import "./chunk-CK5NTM2S.js";
|
|
6
6
|
import "./chunk-FSFEQI74.js";
|
|
7
7
|
import "./chunk-Z5AAYHUC.js";
|
|
8
8
|
import "./chunk-S75M5ZRK.js";
|
|
9
9
|
import "./chunk-TPB3I2AC.js";
|
|
10
10
|
import "./chunk-UHGBNIOS.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-S5SQDIF5.js";
|
|
12
12
|
import "./chunk-ETOW6ACV.js";
|
|
13
13
|
import "./chunk-ZTSE2ZJ6.js";
|
|
14
14
|
import "./chunk-MDYG7VI7.js";
|
|
@@ -35,7 +35,7 @@ import "./chunk-AKV3HOGZ.js";
|
|
|
35
35
|
import "./chunk-74WWN7ZW.js";
|
|
36
36
|
import "./chunk-DF3RVK3X.js";
|
|
37
37
|
import "./chunk-C4SQJZAF.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-FCGWNWG4.js";
|
|
39
39
|
import "./chunk-WW3QQF4H.js";
|
|
40
40
|
import "./chunk-54V4BZWP.js";
|
|
41
41
|
import "./chunk-FEMOX5AD.js";
|
|
@@ -83,10 +83,10 @@ import "./chunk-4WMCPJWX.js";
|
|
|
83
83
|
import "./chunk-JBMSGZEQ.js";
|
|
84
84
|
import "./chunk-ZBZVNWQO.js";
|
|
85
85
|
import "./chunk-EJI5XIBB.js";
|
|
86
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-DWMXVUGO.js";
|
|
87
87
|
import "./chunk-Q7FJ5ZHM.js";
|
|
88
88
|
import "./chunk-ODWDQNRE.js";
|
|
89
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-L2EXJQJP.js";
|
|
90
90
|
import "./chunk-UZB5KHKX.js";
|
|
91
91
|
import "./chunk-6HZ6AO2P.js";
|
|
92
92
|
import "./chunk-JWPLJLDU.js";
|
package/dist/access-http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingMessage } from 'node:http';
|
|
2
|
-
import { E as EngramAccessService } from './access-service-
|
|
2
|
+
import { E as EngramAccessService } from './access-service-B9sziJdP.js';
|
|
3
3
|
import './storage.js';
|
|
4
4
|
import './page-versioning.js';
|
|
5
5
|
import './consolidation-operator.js';
|
package/dist/access-mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Readable, Writable } from 'node:stream';
|
|
2
|
-
import { E as EngramAccessService } from './access-service-
|
|
2
|
+
import { E as EngramAccessService } from './access-service-B9sziJdP.js';
|
|
3
3
|
import './storage.js';
|
|
4
4
|
import './page-versioning.js';
|
|
5
5
|
import './consolidation-operator.js';
|
package/dist/access-service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './storage.js';
|
|
2
|
-
export { o as ENGRAM_ACCESS_WRITE_SCHEMA_VERSION, p as EngramAccessBriefingRequest, q as EngramAccessBriefingResponse, r as EngramAccessCapsuleListResponse, s as EngramAccessDaySummaryRequest, t as EngramAccessEntityListResponse, u as EngramAccessEntityResponse, v as EngramAccessEntitySummary, w as EngramAccessHealthResponse, d as EngramAccessInputError, x as EngramAccessLcmSearchRequest, y as EngramAccessLcmSearchResponse, z as EngramAccessLcmStatusResponse, A as EngramAccessMaintenanceResponse, B as EngramAccessMemoryBrowseRequest, D as EngramAccessMemoryBrowseResponse, F as EngramAccessMemoryRecord, G as EngramAccessMemoryResponse, H as EngramAccessMemoryStoreRequest, J as EngramAccessMemorySummary, K as EngramAccessObserveMessage, L as EngramAccessObserveRequest, M as EngramAccessObserveResponse, N as EngramAccessQualityResponse, O as EngramAccessRecallExplainRequest, Q as EngramAccessRecallExplainResponse, R as EngramAccessRecallRequest, S as EngramAccessRecallResponse, T as EngramAccessReviewDispositionRequest, U as EngramAccessReviewDispositionResponse, V as EngramAccessReviewQueueResponse, E as EngramAccessService, W as EngramAccessSetCodingContextRequest, X as EngramAccessSuggestionSubmitRequest, Y as EngramAccessTimelineResponse, Z as EngramAccessTrustZoneBrowseRequest, _ as EngramAccessTrustZoneBrowseResponse, $ as EngramAccessTrustZoneDemoSeedRequest, a0 as EngramAccessTrustZoneDemoSeedResponse, a1 as EngramAccessTrustZonePromoteRequest, a2 as EngramAccessTrustZonePromoteResponse, a3 as EngramAccessTrustZoneRecordSummary, a4 as EngramAccessTrustZoneStatusResponse, a5 as EngramAccessWriteEnvelope, a6 as EngramAccessWriteResponse, a7 as shapeMemorySummary } from './access-service-
|
|
2
|
+
export { o as ENGRAM_ACCESS_WRITE_SCHEMA_VERSION, p as EngramAccessBriefingRequest, q as EngramAccessBriefingResponse, r as EngramAccessCapsuleListResponse, s as EngramAccessDaySummaryRequest, t as EngramAccessEntityListResponse, u as EngramAccessEntityResponse, v as EngramAccessEntitySummary, w as EngramAccessHealthResponse, d as EngramAccessInputError, x as EngramAccessLcmSearchRequest, y as EngramAccessLcmSearchResponse, z as EngramAccessLcmStatusResponse, A as EngramAccessMaintenanceResponse, B as EngramAccessMemoryBrowseRequest, D as EngramAccessMemoryBrowseResponse, F as EngramAccessMemoryRecord, G as EngramAccessMemoryResponse, H as EngramAccessMemoryStoreRequest, J as EngramAccessMemorySummary, K as EngramAccessObserveMessage, L as EngramAccessObserveRequest, M as EngramAccessObserveResponse, N as EngramAccessQualityResponse, O as EngramAccessRecallExplainRequest, Q as EngramAccessRecallExplainResponse, R as EngramAccessRecallRequest, S as EngramAccessRecallResponse, T as EngramAccessReviewDispositionRequest, U as EngramAccessReviewDispositionResponse, V as EngramAccessReviewQueueResponse, E as EngramAccessService, W as EngramAccessSetCodingContextRequest, X as EngramAccessSuggestionSubmitRequest, Y as EngramAccessTimelineResponse, Z as EngramAccessTrustZoneBrowseRequest, _ as EngramAccessTrustZoneBrowseResponse, $ as EngramAccessTrustZoneDemoSeedRequest, a0 as EngramAccessTrustZoneDemoSeedResponse, a1 as EngramAccessTrustZonePromoteRequest, a2 as EngramAccessTrustZonePromoteResponse, a3 as EngramAccessTrustZoneRecordSummary, a4 as EngramAccessTrustZoneStatusResponse, a5 as EngramAccessWriteEnvelope, a6 as EngramAccessWriteResponse, a7 as shapeMemorySummary } from './access-service-B9sziJdP.js';
|
|
3
3
|
import './recall-xray.js';
|
|
4
4
|
import './recall-explain-renderer.js';
|
|
5
5
|
import './types-C-USTTAx.js';
|
package/dist/calibration.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FallbackLlmClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DWMXVUGO.js";
|
|
4
4
|
import "./chunk-Q7FJ5ZHM.js";
|
|
5
5
|
import "./chunk-ODWDQNRE.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-L2EXJQJP.js";
|
|
7
7
|
import "./chunk-UZB5KHKX.js";
|
|
8
8
|
import "./chunk-MARWOCVP.js";
|
|
9
9
|
import {
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import "./chunk-EJI5XIBB.js";
|
|
10
10
|
import {
|
|
11
11
|
FallbackLlmClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DWMXVUGO.js";
|
|
13
13
|
import "./chunk-Q7FJ5ZHM.js";
|
|
14
14
|
import "./chunk-ODWDQNRE.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-L2EXJQJP.js";
|
|
16
16
|
import "./chunk-UZB5KHKX.js";
|
|
17
17
|
import "./chunk-URB2WSKZ.js";
|
|
18
18
|
import "./chunk-DT5TVLJE.js";
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
loadModelsJsonProviders
|
|
7
7
|
} from "./chunk-ODWDQNRE.js";
|
|
8
8
|
import {
|
|
9
|
+
buildChatCompletionTemperature,
|
|
9
10
|
buildChatCompletionTokenLimit,
|
|
10
11
|
shouldAssumeOpenAiChatCompletions
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L2EXJQJP.js";
|
|
12
13
|
import {
|
|
13
14
|
extractJsonCandidates
|
|
14
15
|
} from "./chunk-UZB5KHKX.js";
|
|
@@ -361,7 +362,9 @@ var FallbackLlmClient = class {
|
|
|
361
362
|
const body = {
|
|
362
363
|
model: modelId,
|
|
363
364
|
messages,
|
|
364
|
-
|
|
365
|
+
...buildChatCompletionTemperature(modelId, options.temperature ?? 0.3, {
|
|
366
|
+
assumeOpenAI
|
|
367
|
+
}),
|
|
365
368
|
...buildChatCompletionTokenLimit(modelId, options.maxTokens ?? 4096, {
|
|
366
369
|
assumeOpenAI
|
|
367
370
|
})
|
|
@@ -414,7 +417,9 @@ var FallbackLlmClient = class {
|
|
|
414
417
|
model: modelId,
|
|
415
418
|
input,
|
|
416
419
|
max_output_tokens: Math.max(0, Math.floor(options.maxTokens ?? 4096)),
|
|
417
|
-
|
|
420
|
+
...buildChatCompletionTemperature(modelId, options.temperature ?? 0.3, {
|
|
421
|
+
assumeOpenAI: shouldAssumeOpenAiChatCompletions(config.baseUrl)
|
|
422
|
+
})
|
|
418
423
|
};
|
|
419
424
|
if (instructions.length > 0) {
|
|
420
425
|
body.instructions = instructions;
|
|
@@ -517,4 +522,4 @@ function extractResponsesOutputText(data) {
|
|
|
517
522
|
export {
|
|
518
523
|
FallbackLlmClient
|
|
519
524
|
};
|
|
520
|
-
//# sourceMappingURL=chunk-
|
|
525
|
+
//# sourceMappingURL=chunk-DWMXVUGO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/fallback-llm.ts"],"sourcesContent":["import { log } from \"./logger.js\";\nimport type { GatewayConfig, ModelProviderConfig, AgentPersona } from \"./types.js\";\nimport { extractJsonCandidates } from \"./json-extract.js\";\nimport {\n buildChatCompletionTemperature,\n buildChatCompletionTokenLimit,\n shouldAssumeOpenAiChatCompletions,\n} from \"./openai-chat-compat.js\";\nimport { resolveProviderApiKey, getGatewayRuntimeAuthForModel } from \"./resolve-provider-secret.js\";\nimport { loadModelsJsonProviders } from \"./models-json.js\";\n\nexport interface FallbackLlmOptions {\n temperature?: number;\n maxTokens?: number;\n timeoutMs?: number;\n /** Override which agent persona's model chain to use (by ID from agents.list[]). */\n agentId?: string;\n}\n\nexport interface FallbackLlmResponse {\n content: string;\n modelUsed: string;\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n };\n}\n\nexport interface FallbackLlmRuntimeContext {\n agentDir?: string;\n workspaceDir?: string;\n}\n\ninterface ModelRef {\n providerId: string;\n modelId: string;\n providerConfig: ModelProviderConfig;\n modelString: string;\n}\n\nconst PROVIDER_ALIASES: Record<string, readonly string[]> = {\n \"openai-codex\": [\"codex\"],\n codex: [\"openai-codex\"],\n \"claude-cli\": [\"anthropic\"],\n};\n\nconst LEGACY_PROVIDER_IDS = new Set([\"openai-codex\", \"claude-cli\"]);\n\nconst BUILT_IN_PROVIDER_FALLBACKS: Record<string, ModelProviderConfig> = {\n anthropic: {\n baseUrl: \"https://api.anthropic.com/v1\",\n api: \"anthropic-messages\",\n apiKey: \"secretref-managed\",\n models: [],\n },\n};\n\n/**\n * Generic fallback LLM client that uses the gateway's default AI configuration\n * and walks through the full fallback chain (primary + fallbacks).\n * Supports OpenAI and Anthropic API formats.\n */\nexport class FallbackLlmClient {\n private gatewayConfig: GatewayConfig | undefined;\n private runtimeContext: FallbackLlmRuntimeContext;\n\n constructor(\n gatewayConfig?: GatewayConfig,\n runtimeContext: FallbackLlmRuntimeContext = {},\n ) {\n this.gatewayConfig = gatewayConfig;\n this.runtimeContext = runtimeContext;\n }\n\n /**\n * Check if fallback is available (gateway config has at least one model).\n */\n isAvailable(agentId?: string): boolean {\n const models = this.getModelChain(agentId);\n return models.length > 0;\n }\n\n /**\n * Make a chat completion request using the gateway's default AI chain.\n * Tries primary first, then each fallback in order.\n * When agentId is provided, uses that agent persona's model chain instead of defaults.\n */\n async chatCompletion(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions = {},\n ): Promise<FallbackLlmResponse | null> {\n const models = this.getModelChain(options.agentId);\n if (models.length === 0) {\n log.warn(\"fallback LLM: no models configured in gateway\");\n return null;\n }\n\n const runChain = async (): Promise<FallbackLlmResponse | null> => {\n // Try each model in the chain\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n const isFallback = i > 0;\n\n try {\n const result = await this.tryModel(model, messages, options);\n if (result) {\n if (isFallback) {\n log.debug(`fallback LLM: succeeded using ${model.modelString} (fallback ${i})`);\n }\n return {\n content: result.content,\n modelUsed: model.modelString,\n usage: result.usage,\n };\n }\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n log.debug(`fallback LLM: ${model.modelString} failed (${errorMsg}), trying next...`);\n // Continue to next model in chain\n }\n }\n\n log.warn(`fallback LLM: all ${models.length} models in chain failed`);\n return null;\n };\n\n if (typeof options.timeoutMs === \"number\") {\n if (options.timeoutMs <= 0) {\n log.warn(\"fallback LLM: timed out before request started\");\n return null;\n }\n let timeoutHandle: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n runChain(),\n new Promise<null>((resolve) => {\n timeoutHandle = setTimeout(() => {\n log.warn(`fallback LLM: timed out after ${options.timeoutMs}ms`);\n resolve(null);\n }, options.timeoutMs);\n }),\n ]);\n } finally {\n if (timeoutHandle) clearTimeout(timeoutHandle);\n }\n }\n\n return await runChain();\n }\n\n /**\n * Make a request with structured output (Zod schema).\n * Returns parsed JSON or null on failure.\n */\n async parseWithSchema<T>(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n schema: { parse: (data: unknown) => T },\n options: FallbackLlmOptions = {},\n ): Promise<T | null> {\n const detailed = await this.parseWithSchemaDetailed(messages, schema, options);\n return detailed?.result ?? null;\n }\n\n /**\n * Like parseWithSchema but also returns the model that was used,\n * so callers can emit accurate trace events.\n */\n async parseWithSchemaDetailed<T>(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n schema: { parse: (data: unknown) => T },\n options: FallbackLlmOptions = {},\n ): Promise<{ result: T; modelUsed: string } | null> {\n const response = await this.chatCompletion(messages, options);\n if (!response?.content) return null;\n\n try {\n const candidates = extractJsonCandidates(response.content);\n for (const c of candidates) {\n try {\n const parsed = JSON.parse(c);\n return { result: schema.parse(parsed), modelUsed: response.modelUsed };\n } catch {\n // keep trying other candidates\n }\n }\n return null;\n } catch (err) {\n log.warn(\"fallback LLM: failed to parse structured output:\", err);\n return null;\n }\n }\n\n /**\n * Get the full model chain from gateway config.\n * Returns array of models in order: [primary, fallback1, fallback2, ...]\n *\n * When agentId is provided, looks up the matching entry in agents.list[]\n * and uses that persona's model chain. Falls back to agents.defaults.model\n * if agentId is not found or not provided.\n */\n private getModelChain(agentId?: string): ModelRef[] {\n const chain: ModelRef[] = [];\n const providers = this.gatewayConfig?.models?.providers ?? {};\n\n // Resolve the model config: agent persona chain or global defaults\n let modelConfig: { primary?: string; fallbacks?: string[] } | undefined;\n\n if (agentId) {\n const persona = this.gatewayConfig?.agents?.list?.find(\n (a) => a.id === agentId,\n );\n if (persona?.model) {\n modelConfig = persona.model;\n log.debug(`fallback LLM: using agent persona \"${agentId}\" model chain`);\n } else {\n log.warn(\n `fallback LLM: agent persona \"${agentId}\" not found or has no model config, falling back to defaults`,\n );\n }\n }\n\n if (!modelConfig) {\n modelConfig = this.gatewayConfig?.agents?.defaults?.model;\n }\n\n // Build list of model strings: primary + fallbacks\n const modelStrings: string[] = [];\n\n if (modelConfig?.primary) {\n modelStrings.push(modelConfig.primary);\n }\n\n if (Array.isArray(modelConfig?.fallbacks)) {\n for (const fb of modelConfig.fallbacks) {\n if (typeof fb === \"string\" && !modelStrings.includes(fb)) {\n modelStrings.push(fb);\n }\n }\n }\n\n // Parse each model string and look up provider config\n for (const modelString of modelStrings) {\n const modelRef = this.parseModelString(modelString, providers);\n if (modelRef) {\n chain.push(modelRef);\n }\n }\n\n return chain;\n }\n\n /**\n * Parse a \"provider/model\" string and look up its config.\n */\n private parseModelString(\n modelString: string,\n providers: Record<string, ModelProviderConfig>,\n ): ModelRef | null {\n // Parse \"provider/model\" format (e.g., \"openai/gpt-5.2\", \"anthropic/claude-opus-4-6\")\n const parts = modelString.split(\"/\");\n if (parts.length < 2) {\n log.warn(`fallback LLM: invalid model format: ${modelString}`);\n return null;\n }\n\n const requestedProviderId = parts[0];\n const modelId = parts.slice(1).join(\"/\"); // Handle cases like \"openai/gpt-5.2-turbo\"\n\n // Respect the active gateway config first so profile-local overrides and\n // credentials win. Fall back to the materialized models.json only when\n // the provider is absent from the loaded config (for built-in providers\n // registered by the gateway at runtime).\n const resolvedProvider = this.resolveProviderConfig(requestedProviderId, providers);\n const providerConfig = resolvedProvider?.config;\n if (!providerConfig) {\n log.warn(\n `fallback LLM: provider not found: ${requestedProviderId} ` +\n `(tried: ${this.providerResolutionCandidates(requestedProviderId).join(\", \")})`,\n );\n return null;\n }\n\n return {\n providerId: resolvedProvider.providerId,\n modelId,\n providerConfig,\n modelString,\n };\n }\n\n private resolveProviderConfig(\n providerId: string,\n providers: Record<string, ModelProviderConfig>,\n ): { providerId: string; config: ModelProviderConfig } | null {\n const candidates = this.providerResolutionCandidates(providerId);\n const aliasCandidates = candidates.filter((candidate) => candidate !== providerId);\n const fallbackCandidates = LEGACY_PROVIDER_IDS.has(providerId)\n ? [...aliasCandidates, providerId]\n : [providerId, ...aliasCandidates];\n for (const candidate of candidates) {\n const config = providers[candidate];\n if (config) {\n if (candidate !== providerId) {\n log.debug(`fallback LLM: provider \"${providerId}\" resolved via alias \"${candidate}\"`);\n }\n return { providerId: candidate, config };\n }\n }\n for (const candidate of fallbackCandidates) {\n const config = this.resolveFromModelsJson(candidate);\n if (config) {\n if (candidate !== providerId) {\n log.debug(`fallback LLM: provider \"${providerId}\" resolved via models.json alias \"${candidate}\"`);\n }\n return { providerId: candidate, config };\n }\n const builtInConfig = BUILT_IN_PROVIDER_FALLBACKS[candidate];\n if (builtInConfig) {\n if (candidate === providerId) {\n log.debug(`fallback LLM: provider \"${providerId}\" resolved from built-in defaults`);\n return { providerId, config: builtInConfig };\n }\n log.debug(`fallback LLM: provider \"${providerId}\" resolved via built-in alias \"${candidate}\"`);\n return { providerId: candidate, config: builtInConfig };\n }\n }\n return null;\n }\n\n private providerResolutionCandidates(providerId: string): string[] {\n const candidates = [providerId, ...(PROVIDER_ALIASES[providerId] ?? [])];\n return [...new Set(candidates)];\n }\n\n /**\n * Look up a provider from the gateway's materialized models.json, which\n * contains all providers including built-in ones (openai-codex, google-vertex,\n * etc.) that aren't in the user's openclaw.json but are registered by\n * gateway plugins. Returns null if the provider isn't found there either.\n */\n private resolveFromModelsJson(providerId: string): ModelProviderConfig | null {\n const allProviders = loadModelsJsonProviders();\n const config = allProviders[providerId];\n if (config) {\n log.debug(`fallback LLM: resolved provider \"${providerId}\" from models.json (api: ${config.api ?? \"default\"})`);\n return config;\n }\n return null;\n }\n\n /**\n * Try to call a single model.\n *\n * Uses the gateway's native getRuntimeAuthForModel when available — this\n * handles all provider-specific auth transforms (OAuth token exchange,\n * base URL overrides for codex/copilot/etc.) through the same codepath\n * the gateway itself uses. Falls back to resolveProviderApiKey for\n * simpler providers or when the runtime module isn't loaded.\n */\n private async tryModel(\n model: ModelRef,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n // Try the gateway's native runtime auth first — it handles all provider-\n // specific transforms (OAuth exchange, base URL rewrite, etc.)\n const runtimeAuth = await this.resolveRuntimeAuth(model);\n const effectiveBaseUrl = runtimeAuth?.baseUrl ?? model.providerConfig.baseUrl;\n const resolvedApiKey = runtimeAuth?.apiKey ?? await this.resolveFallbackApiKey(model);\n\n // If the raw key looks like an unresolved secret ref and resolution fails,\n // skip this provider entirely so the chain falls through to the next.\n const rawKey = model.providerConfig.apiKey;\n const needsResolution = rawKey === \"secretref-managed\"\n || (typeof rawKey === \"object\" && rawKey !== null);\n if (needsResolution && !resolvedApiKey) {\n throw new Error(`API key for provider \"${model.providerId}\" could not be resolved from secret ref`);\n }\n\n const effectiveConfig: ModelProviderConfig = {\n ...model.providerConfig,\n baseUrl: effectiveBaseUrl,\n ...(resolvedApiKey ? { apiKey: resolvedApiKey } : {}),\n };\n\n if (model.providerConfig.api === \"anthropic-messages\") {\n return await this.callAnthropic(effectiveConfig, model.modelId, messages, options);\n }\n\n if (\n model.providerConfig.api === \"openai-responses\" ||\n model.providerConfig.api === \"openai-codex-responses\" ||\n model.providerConfig.api === \"azure-openai-responses\"\n ) {\n return await this.callOpenAIResponses(\n effectiveConfig,\n model.modelId,\n messages,\n options,\n );\n }\n\n // For OpenAI-compatible chat-completions APIs (openai-completions,\n // ollama, etc.) and unknown formats, use chat completions — the gateway's\n // runtime auth resolver returns request-ready base URL and credentials for\n // most providers.\n return await this.callOpenAI(\n effectiveConfig,\n model.modelId,\n messages,\n options,\n shouldAssumeOpenAiChatCompletions(effectiveConfig.baseUrl),\n );\n }\n\n /**\n * Resolve request-ready auth through the gateway's native runtime, which\n * handles provider-specific transforms (OAuth token exchange for codex/copilot,\n * base URL rewrite, etc.). Returns null if the runtime isn't available.\n */\n private async resolveRuntimeAuth(\n model: ModelRef,\n ): Promise<{ apiKey?: string; baseUrl?: string } | null> {\n try {\n const getRuntimeAuth = await getGatewayRuntimeAuthForModel();\n if (!getRuntimeAuth) return null;\n\n const result = await getRuntimeAuth({\n model: {\n provider: model.providerId,\n id: model.modelId,\n api: model.providerConfig.api,\n baseUrl: model.providerConfig.baseUrl,\n },\n cfg: this.gatewayConfig,\n workspaceDir: this.runtimeContext.workspaceDir,\n });\n\n if (result?.apiKey || result?.baseUrl) {\n log.debug(\n `fallback LLM: resolved runtime auth for \"${model.modelString}\" (source: ${result.source ?? \"unknown\"}, mode: ${result.mode ?? \"unknown\"})`,\n );\n return { apiKey: result.apiKey, baseUrl: result.baseUrl };\n }\n } catch (err) {\n log.debug(\n `fallback LLM: gateway runtime auth failed for \"${model.modelString}\": ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n return null;\n }\n\n /**\n * Resolve API key through the existing provider-level resolution (env vars,\n * secret refs, etc.). Used as fallback when gateway runtime auth isn't available.\n */\n private async resolveFallbackApiKey(model: ModelRef): Promise<string | undefined> {\n return resolveProviderApiKey(\n model.providerId,\n model.providerConfig.apiKey,\n this.gatewayConfig,\n this.runtimeContext.agentDir,\n );\n }\n\n /**\n * Call OpenAI-compatible API.\n */\n private async callOpenAI(\n config: ModelProviderConfig,\n modelId: string,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n assumeOpenAI: boolean,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n const base = config.baseUrl.replace(/\\/$/, \"\");\n const url = base.endsWith(\"/v1\")\n ? `${base}/chat/completions`\n : `${base}/v1/chat/completions`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n };\n\n // Handle auth — apiKey is already resolved to a string by tryModel()\n if (config.apiKey && typeof config.apiKey === \"string\") {\n if (config.authHeader !== false) {\n headers[\"Authorization\"] = `Bearer ${config.apiKey}`;\n }\n }\n\n const body = {\n model: modelId,\n messages,\n ...buildChatCompletionTemperature(modelId, options.temperature ?? 0.3, {\n assumeOpenAI,\n }),\n ...buildChatCompletionTokenLimit(modelId, options.maxTokens ?? 4096, {\n assumeOpenAI,\n }),\n };\n\n const response = await fetch(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`OpenAI API error: ${response.status} ${error}`);\n }\n\n const data = (await response.json()) as {\n choices: Array<{\n message: {\n content: string;\n };\n }>;\n usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n total_tokens?: number;\n };\n };\n\n const content = data.choices?.[0]?.message?.content;\n if (!content) {\n throw new Error(\"Empty response from OpenAI API\");\n }\n\n return {\n content,\n usage: data.usage\n ? {\n inputTokens: data.usage.prompt_tokens,\n outputTokens: data.usage.completion_tokens,\n totalTokens: data.usage.total_tokens,\n }\n : undefined,\n };\n }\n\n /**\n * Call an OpenAI-compatible Responses API.\n */\n private async callOpenAIResponses(\n config: ModelProviderConfig,\n modelId: string,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n const base = config.baseUrl.replace(/\\/$/, \"\");\n const url = base.endsWith(\"/v1\")\n ? `${base}/responses`\n : `${base}/v1/responses`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n };\n\n if (config.apiKey && typeof config.apiKey === \"string\" && config.authHeader !== false) {\n headers[\"Authorization\"] = `Bearer ${config.apiKey}`;\n }\n\n const instructions = messages\n .filter((message) => message.role === \"system\")\n .map((message) => message.content)\n .join(\"\\n\\n\")\n .trim();\n const input = messages\n .filter((message) => message.role !== \"system\")\n .map((message) => ({\n role: message.role,\n content: [{\n type: message.role === \"assistant\" ? \"output_text\" : \"input_text\",\n text: message.content,\n }],\n }));\n\n const body: Record<string, unknown> = {\n model: modelId,\n input,\n max_output_tokens: Math.max(0, Math.floor(options.maxTokens ?? 4096)),\n ...buildChatCompletionTemperature(modelId, options.temperature ?? 0.3, {\n assumeOpenAI: shouldAssumeOpenAiChatCompletions(config.baseUrl),\n }),\n };\n if (instructions.length > 0) {\n body.instructions = instructions;\n }\n\n const response = await fetch(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`OpenAI Responses API error: ${response.status} ${error}`);\n }\n\n const data = (await response.json()) as {\n output_text?: string;\n output?: Array<{\n type?: string;\n text?: string;\n content?: Array<{\n type?: string;\n text?: string;\n }>;\n }>;\n usage?: {\n input_tokens?: number;\n output_tokens?: number;\n total_tokens?: number;\n };\n };\n\n const outputText = extractResponsesOutputText(data);\n if (!outputText) {\n throw new Error(\"Empty response from OpenAI Responses API\");\n }\n\n return {\n content: outputText,\n usage: data.usage\n ? {\n inputTokens: data.usage.input_tokens,\n outputTokens: data.usage.output_tokens,\n totalTokens: data.usage.total_tokens,\n }\n : undefined,\n };\n }\n\n /**\n * Call Anthropic Messages API.\n */\n private async callAnthropic(\n config: ModelProviderConfig,\n modelId: string,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n const base = config.baseUrl.replace(/\\/$/, \"\");\n const url = base.endsWith(\"/v1\")\n ? `${base}/messages`\n : `${base}/v1/messages`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"anthropic-version\": \"2023-06-01\",\n ...config.headers,\n };\n\n // Handle auth - Anthropic uses x-api-key header (apiKey resolved by tryModel)\n if (config.apiKey && typeof config.apiKey === \"string\") {\n headers[\"x-api-key\"] = config.apiKey;\n }\n\n // Extract system message (Anthropic handles it separately)\n const systemMessage = messages.find((m) => m.role === \"system\")?.content;\n const nonSystemMessages = messages.filter((m) => m.role !== \"system\");\n\n // Convert messages to Anthropic format\n const anthropicMessages = nonSystemMessages.map((m) => ({\n role: m.role,\n content: m.content,\n }));\n\n const body: Record<string, unknown> = {\n model: modelId,\n messages: anthropicMessages,\n max_tokens: options.maxTokens ?? 4096,\n temperature: options.temperature ?? 0.3,\n };\n\n if (systemMessage) {\n body.system = systemMessage;\n }\n\n const response = await fetch(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Anthropic API error: ${response.status} ${error}`);\n }\n\n const data = (await response.json()) as {\n content: Array<{\n type: string;\n text: string;\n }>;\n usage?: {\n input_tokens?: number;\n output_tokens?: number;\n };\n };\n\n const content = data.content?.[0]?.text;\n if (!content) {\n throw new Error(\"Empty response from Anthropic API\");\n }\n\n return {\n content,\n usage: data.usage\n ? {\n inputTokens: data.usage.input_tokens,\n outputTokens: data.usage.output_tokens,\n totalTokens: (data.usage.input_tokens ?? 0) + (data.usage.output_tokens ?? 0),\n }\n : undefined,\n };\n }\n}\n\nfunction extractResponsesOutputText(data: {\n output_text?: string;\n output?: Array<{\n type?: string;\n text?: string;\n content?: Array<{\n type?: string;\n text?: string;\n }>;\n }>;\n}): string | null {\n if (typeof data.output_text === \"string\" && data.output_text.trim().length > 0) {\n return data.output_text;\n }\n\n const chunks: string[] = [];\n for (const item of data.output ?? []) {\n if (typeof item.text === \"string\" && item.text.trim().length > 0) {\n chunks.push(item.text);\n }\n for (const part of item.content ?? []) {\n if (\n (part.type === \"output_text\" || part.type === \"text\") &&\n typeof part.text === \"string\" &&\n part.text.trim().length > 0\n ) {\n chunks.push(part.text);\n }\n }\n }\n\n const joined = chunks.join(\"\\n\").trim();\n return joined.length > 0 ? joined : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAM,mBAAsD;AAAA,EAC1D,gBAAgB,CAAC,OAAO;AAAA,EACxB,OAAO,CAAC,cAAc;AAAA,EACtB,cAAc,CAAC,WAAW;AAC5B;AAEA,IAAM,sBAAsB,oBAAI,IAAI,CAAC,gBAAgB,YAAY,CAAC;AAElE,IAAM,8BAAmE;AAAA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
|
29
|
+
} from "./chunk-DWMXVUGO.js";
|
|
30
30
|
import {
|
|
31
31
|
buildChatCompletionTokenLimit,
|
|
32
32
|
shouldAssumeOpenAiChatCompletions
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-L2EXJQJP.js";
|
|
34
34
|
import {
|
|
35
35
|
extractJsonCandidates
|
|
36
36
|
} from "./chunk-UZB5KHKX.js";
|
|
@@ -2275,4 +2275,4 @@ ${memoryList}` }
|
|
|
2275
2275
|
export {
|
|
2276
2276
|
ExtractionEngine
|
|
2277
2277
|
};
|
|
2278
|
-
//# sourceMappingURL=chunk-
|
|
2278
|
+
//# sourceMappingURL=chunk-FCGWNWG4.js.map
|
|
@@ -4106,7 +4106,7 @@ async function runSemanticRulePromoteCliCommand(options) {
|
|
|
4106
4106
|
});
|
|
4107
4107
|
}
|
|
4108
4108
|
async function runCompoundingPromoteCliCommand(options) {
|
|
4109
|
-
const { CompoundingEngine } = await import("./engine-
|
|
4109
|
+
const { CompoundingEngine } = await import("./engine-2JKWFKJV.js");
|
|
4110
4110
|
const config = parseConfig({
|
|
4111
4111
|
memoryDir: options.memoryDir,
|
|
4112
4112
|
qmdEnabled: false,
|
|
@@ -9680,4 +9680,4 @@ export {
|
|
|
9680
9680
|
resolveMemoryDirForNamespace,
|
|
9681
9681
|
registerCli
|
|
9682
9682
|
};
|
|
9683
|
-
//# sourceMappingURL=chunk-
|
|
9683
|
+
//# sourceMappingURL=chunk-KQB4C4OE.js.map
|
|
@@ -30,10 +30,23 @@ function buildChatCompletionTokenLimit(model, maxTokens, options) {
|
|
|
30
30
|
}
|
|
31
31
|
return { max_tokens: safeMaxTokens };
|
|
32
32
|
}
|
|
33
|
+
function supportsTemperature(model, options) {
|
|
34
|
+
const normalized = normalizedModel(model);
|
|
35
|
+
if (options?.assumeOpenAI === true && matchesModelFamily(normalized, /^gpt-5(?:$|[-.])/)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function buildChatCompletionTemperature(model, temperature, options) {
|
|
41
|
+
if (!supportsTemperature(model, options)) return {};
|
|
42
|
+
return { temperature };
|
|
43
|
+
}
|
|
33
44
|
|
|
34
45
|
export {
|
|
35
46
|
shouldAssumeOpenAiChatCompletions,
|
|
36
47
|
usesMaxCompletionTokens,
|
|
37
|
-
buildChatCompletionTokenLimit
|
|
48
|
+
buildChatCompletionTokenLimit,
|
|
49
|
+
supportsTemperature,
|
|
50
|
+
buildChatCompletionTemperature
|
|
38
51
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-L2EXJQJP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/openai-chat-compat.ts"],"sourcesContent":["function normalizedModel(model: string): string {\n return model.trim().toLowerCase();\n}\n\nfunction matchesModelFamily(normalized: string, familyPattern: RegExp): boolean {\n return familyPattern.test(normalized);\n}\n\nexport function shouldAssumeOpenAiChatCompletions(baseUrl?: string): boolean {\n if (!baseUrl) return true;\n try {\n return new URL(baseUrl).hostname.toLowerCase() === \"api.openai.com\";\n } catch {\n return false;\n }\n}\n\nexport function usesMaxCompletionTokens(model: string, options?: { assumeOpenAI?: boolean }): boolean {\n const normalized = normalizedModel(model);\n if (options?.assumeOpenAI !== true) return false;\n if (matchesModelFamily(normalized, /^gpt-5(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^gpt-4o(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^gpt-4\\.1(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^o1(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^o3(?:$|[-.])/)) return true;\n return matchesModelFamily(normalized, /^o4-mini(?:$|[-.])/);\n}\n\nexport function buildChatCompletionTokenLimit(\n model: string,\n maxTokens: number,\n options?: { assumeOpenAI?: boolean },\n): { max_tokens: number } | { max_completion_tokens: number } {\n const safeMaxTokens = Math.max(0, Math.floor(maxTokens));\n if (usesMaxCompletionTokens(model, options)) {\n return { max_completion_tokens: safeMaxTokens };\n }\n return { max_tokens: safeMaxTokens };\n}\n\nexport function supportsTemperature(model: string, options?: { assumeOpenAI?: boolean }): boolean {\n const normalized = normalizedModel(model);\n if (options?.assumeOpenAI === true && matchesModelFamily(normalized, /^gpt-5(?:$|[-.])/)) {\n return false;\n }\n return true;\n}\n\nexport function buildChatCompletionTemperature(\n model: string,\n temperature: number,\n options?: { assumeOpenAI?: boolean },\n): { temperature: number } | Record<string, never> {\n if (!supportsTemperature(model, options)) return {};\n return { temperature };\n}\n"],"mappings":";AAAA,SAAS,gBAAgB,OAAuB;AAC9C,SAAO,MAAM,KAAK,EAAE,YAAY;AAClC;AAEA,SAAS,mBAAmB,YAAoB,eAAgC;AAC9E,SAAO,cAAc,KAAK,UAAU;AACtC;AAEO,SAAS,kCAAkC,SAA2B;AAC3E,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI;AACF,WAAO,IAAI,IAAI,OAAO,EAAE,SAAS,YAAY,MAAM;AAAA,EACrD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,wBAAwB,OAAe,SAA+C;AACpG,QAAM,aAAa,gBAAgB,KAAK;AACxC,MAAI,SAAS,iBAAiB,KAAM,QAAO;AAC3C,MAAI,mBAAmB,YAAY,kBAAkB,EAAG,QAAO;AAC/D,MAAI,mBAAmB,YAAY,mBAAmB,EAAG,QAAO;AAChE,MAAI,mBAAmB,YAAY,qBAAqB,EAAG,QAAO;AAClE,MAAI,mBAAmB,YAAY,eAAe,EAAG,QAAO;AAC5D,MAAI,mBAAmB,YAAY,eAAe,EAAG,QAAO;AAC5D,SAAO,mBAAmB,YAAY,oBAAoB;AAC5D;AAEO,SAAS,8BACd,OACA,WACA,SAC4D;AAC5D,QAAM,gBAAgB,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,CAAC;AACvD,MAAI,wBAAwB,OAAO,OAAO,GAAG;AAC3C,WAAO,EAAE,uBAAuB,cAAc;AAAA,EAChD;AACA,SAAO,EAAE,YAAY,cAAc;AACrC;AAEO,SAAS,oBAAoB,OAAe,SAA+C;AAChG,QAAM,aAAa,gBAAgB,KAAK;AACxC,MAAI,SAAS,iBAAiB,QAAQ,mBAAmB,YAAY,kBAAkB,GAAG;AACxF,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,SAAS,+BACd,OACA,aACA,SACiD;AACjD,MAAI,CAAC,oBAAoB,OAAO,OAAO,EAAG,QAAO,CAAC;AAClD,SAAO,EAAE,YAAY;AACvB;","names":[]}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-R2XRID2N.js";
|
|
12
12
|
import {
|
|
13
13
|
FallbackLlmClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DWMXVUGO.js";
|
|
15
15
|
import {
|
|
16
16
|
extractJsonCandidates
|
|
17
17
|
} from "./chunk-UZB5KHKX.js";
|
|
@@ -618,4 +618,4 @@ ${truncatedConversation}`;
|
|
|
618
618
|
export {
|
|
619
619
|
HourlySummarizer
|
|
620
620
|
};
|
|
621
|
-
//# sourceMappingURL=chunk-
|
|
621
|
+
//# sourceMappingURL=chunk-S5SQDIF5.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CompoundingEngine,
|
|
3
3
|
SharedContextManager,
|
|
4
4
|
defaultTierMigrationCycleBudget
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6B23Z44B.js";
|
|
6
6
|
import {
|
|
7
7
|
applyUtilityPromotionRuntimePolicy,
|
|
8
8
|
applyUtilityRankingRuntimeDelta,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-UHGBNIOS.js";
|
|
23
23
|
import {
|
|
24
24
|
HourlySummarizer
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-S5SQDIF5.js";
|
|
26
26
|
import {
|
|
27
27
|
applyTemporalSupersession,
|
|
28
28
|
normalizeSupersessionKey,
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
} from "./chunk-C4SQJZAF.js";
|
|
123
123
|
import {
|
|
124
124
|
ExtractionEngine
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-FCGWNWG4.js";
|
|
126
126
|
import {
|
|
127
127
|
parseMemoryActionEligibilityContext
|
|
128
128
|
} from "./chunk-WW3QQF4H.js";
|
|
@@ -234,7 +234,7 @@ import {
|
|
|
234
234
|
} from "./chunk-ZBZVNWQO.js";
|
|
235
235
|
import {
|
|
236
236
|
FallbackLlmClient
|
|
237
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-DWMXVUGO.js";
|
|
238
238
|
import {
|
|
239
239
|
buildRecallQueryPolicy
|
|
240
240
|
} from "./chunk-6HZ6AO2P.js";
|
|
@@ -14785,4 +14785,4 @@ export {
|
|
|
14785
14785
|
resolvePersistedMemoryRelativePath,
|
|
14786
14786
|
Orchestrator
|
|
14787
14787
|
};
|
|
14788
|
-
//# sourceMappingURL=chunk-
|
|
14788
|
+
//# sourceMappingURL=chunk-VZNQB6NL.js.map
|
|
@@ -3,7 +3,7 @@ import { M as MemoryGovernanceRunResult, c as MemoryGovernanceSummary, d as Memo
|
|
|
3
3
|
import { i as MemoryStatus, f as MemoryFile, B as BehaviorSignalEvent, U as QmdSearchResult, s as MemoryActionEvent, h as MemoryLifecycleEvent } from './types-C-USTTAx.js';
|
|
4
4
|
import { Writable, Readable } from 'node:stream';
|
|
5
5
|
import { DashboardStatus } from './dashboard-runtime.js';
|
|
6
|
-
import { E as EngramAccessService } from './access-service-
|
|
6
|
+
import { E as EngramAccessService } from './access-service-B9sziJdP.js';
|
|
7
7
|
import { ResolveSecretRefFn } from './resolve-auth-token.js';
|
|
8
8
|
import { EvalBaselineDeltaReport, EvalBaselineSnapshot, EvalCiGateReport, EvalBenchmarkPackSummary, EvalHarnessStatus, EvalStoredBaselineCiGateReport } from './evals.js';
|
|
9
9
|
import { GraphHealthReport } from './graph.js';
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './orchestrator-D2lHhFWI.js';
|
|
2
|
-
export { A as AccessHttpServeCliCommandOptions, c as ArchiveObservationsCliCommandOptions, B as BulkImportCliCommandOptions, C as CompatCliCommandOptions, d as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, e as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, g as MemoryActionAuditCliNamespaceSummary, h as MemoryActionAuditCliReport, i as MemoryGovernanceCliCommandOptions, j as MemoryGovernanceReportCliCommandOptions, k as MemoryGovernanceRestoreCliCommandOptions, l as MemoryReviewDispositionCliCommandOptions, m as MemoryTimelineCliCommandOptions, n as MigrateCliOrchestrator, o as MigrateCliReport, q as MigrateObservationsCliCommandOptions, s as PolicyDiffCliReport, t as PolicyDiffEntry, u as PolicyRollbackCliReport, v as PolicyStatusCliReport, w as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, x as RebuildMemoryProjectionCliCommandOptions, y as RebuildObservationsCliCommandOptions, z as RepairMemoryProjectionCliCommandOptions, F as ReplayCliCommandOptions, H as ReplayCliOrchestrator, I as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, J as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, K as TailscaleSyncCliCommandOptions, L as TierMigrationCliOrchestrator, N as TrainingExportCliCommandOptions, V as VerifyMemoryProjectionCliCommandOptions, W as WebDavServeCliCommandOptions, O as WorkProjectCliCommandOptions, Q as WorkTaskCliCommandOptions, U as filterNormalMemorySearchResults, X as hasDestructivePurgeFailures, Y as isNormalRetrievalVisibleMemory, Z as parseDurationToMs, _ as parseStrictCliDate, $ as planAggressiveDuplicateDeletions, a0 as planExactDuplicateDeletions, a1 as registerCli, a2 as resolveAccessPrincipalOverride, a3 as resolveMemoryDirForNamespace, a4 as runAbstractionNodeStatusCliCommand, a5 as runAccessHttpServeCliCommand, a6 as runAccessHttpStatusCliCommand, a7 as runAccessHttpStopCliCommand, a8 as runAccessMcpServeCliCommand, a9 as runArchiveObservationsCliCommand, aa as runBenchmarkBaselineReportCliCommand, ab as runBenchmarkBaselineSnapshotCliCommand, ac as runBenchmarkCiGateCliCommand, ad as runBenchmarkImportCliCommand, ae as runBenchmarkStatusCliCommand, af as runBenchmarkStoredBaselineCiGateCliCommand, ag as runBenchmarkValidateCliCommand, r as runBulkImportCliCommand, ah as runCausalTrajectoryStatusCliCommand, ai as runCommitmentLifecycleCliCommand, aj as runCommitmentRecordCliCommand, ak as runCommitmentSetStateCliCommand, al as runCommitmentStatusCliCommand, am as runCompatCliCommand, an as runCompoundingPromoteCliCommand, ao as runConversationIndexHealthCliCommand, ap as runConversationIndexInspectCliCommand, aq as runConversationIndexRebuildCliCommand, ar as runCueAnchorStatusCliCommand, as as runDashboardStartCliCommand, at as runDashboardStatusCliCommand, au as runDashboardStopCliCommand, av as runGraphHealthCliCommand, aw as runHarmonicSearchCliCommand, ax as runMemoryActionAuditCliCommand, ay as runMemoryGovernanceCliCommand, az as runMemoryGovernanceReportCliCommand, aA as runMemoryGovernanceRestoreCliCommand, aB as runMemoryReviewDispositionCliCommand, aC as runMemoryTimelineCliCommand, aD as runMigrateNormalizeFrontmatterCliCommand, aE as runMigrateObservationsCliCommand, aF as runMigrateRechunkCliCommand, aG as runMigrateReextractCliCommand, aH as runMigrateRescoreImportanceCliCommand, aI as runObjectiveStateStatusCliCommand, aJ as runPolicyDiffCliCommand, aK as runPolicyRollbackCliCommand, aL as runPolicyStatusCliCommand, aM as runRebuildMemoryLifecycleLedgerCliCommand, aN as runRebuildMemoryProjectionCliCommand, aO as runRebuildObservationsCliCommand, aP as runRepairMemoryProjectionCliCommand, aQ as runReplayCliCommand, aR as runResumeBundleBuildCliCommand, aS as runResumeBundleRecordCliCommand, aT as runResumeBundleStatusCliCommand, aU as runRouteCliCommand, aV as runSemanticRulePromoteCliCommand, aW as runSemanticRuleVerifyCliCommand, aX as runSessionCheckCliCommand, aY as runSessionRepairCliCommand, aZ as runTailscaleStatusCliCommand, a_ as runTailscaleSyncCliCommand, a$ as runTierMigrateCliCommand, b0 as runTierStatusCliCommand, b1 as runTrainingExportCliCommand, b2 as runTrustZoneDemoSeedCliCommand, b3 as runTrustZonePromoteCliCommand, b4 as runTrustZoneStatusCliCommand, b5 as runUtilityLearningCliCommand, b6 as runUtilityLearningStatusCliCommand, b7 as runUtilityTelemetryRecordCliCommand, b8 as runUtilityTelemetryStatusCliCommand, b9 as runVerifiedRecallSearchCliCommand, ba as runVerifyMemoryProjectionCliCommand, bb as runWebDavServeCliCommand, bc as runWebDavStopCliCommand, bd as runWorkProductRecallSearchCliCommand, be as runWorkProductRecordCliCommand, bf as runWorkProductStatusCliCommand, bg as runWorkProjectCliCommand, bh as runWorkTaskCliCommand } from './cli-
|
|
2
|
+
export { A as AccessHttpServeCliCommandOptions, c as ArchiveObservationsCliCommandOptions, B as BulkImportCliCommandOptions, C as CompatCliCommandOptions, d as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, e as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, g as MemoryActionAuditCliNamespaceSummary, h as MemoryActionAuditCliReport, i as MemoryGovernanceCliCommandOptions, j as MemoryGovernanceReportCliCommandOptions, k as MemoryGovernanceRestoreCliCommandOptions, l as MemoryReviewDispositionCliCommandOptions, m as MemoryTimelineCliCommandOptions, n as MigrateCliOrchestrator, o as MigrateCliReport, q as MigrateObservationsCliCommandOptions, s as PolicyDiffCliReport, t as PolicyDiffEntry, u as PolicyRollbackCliReport, v as PolicyStatusCliReport, w as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, x as RebuildMemoryProjectionCliCommandOptions, y as RebuildObservationsCliCommandOptions, z as RepairMemoryProjectionCliCommandOptions, F as ReplayCliCommandOptions, H as ReplayCliOrchestrator, I as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, J as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, K as TailscaleSyncCliCommandOptions, L as TierMigrationCliOrchestrator, N as TrainingExportCliCommandOptions, V as VerifyMemoryProjectionCliCommandOptions, W as WebDavServeCliCommandOptions, O as WorkProjectCliCommandOptions, Q as WorkTaskCliCommandOptions, U as filterNormalMemorySearchResults, X as hasDestructivePurgeFailures, Y as isNormalRetrievalVisibleMemory, Z as parseDurationToMs, _ as parseStrictCliDate, $ as planAggressiveDuplicateDeletions, a0 as planExactDuplicateDeletions, a1 as registerCli, a2 as resolveAccessPrincipalOverride, a3 as resolveMemoryDirForNamespace, a4 as runAbstractionNodeStatusCliCommand, a5 as runAccessHttpServeCliCommand, a6 as runAccessHttpStatusCliCommand, a7 as runAccessHttpStopCliCommand, a8 as runAccessMcpServeCliCommand, a9 as runArchiveObservationsCliCommand, aa as runBenchmarkBaselineReportCliCommand, ab as runBenchmarkBaselineSnapshotCliCommand, ac as runBenchmarkCiGateCliCommand, ad as runBenchmarkImportCliCommand, ae as runBenchmarkStatusCliCommand, af as runBenchmarkStoredBaselineCiGateCliCommand, ag as runBenchmarkValidateCliCommand, r as runBulkImportCliCommand, ah as runCausalTrajectoryStatusCliCommand, ai as runCommitmentLifecycleCliCommand, aj as runCommitmentRecordCliCommand, ak as runCommitmentSetStateCliCommand, al as runCommitmentStatusCliCommand, am as runCompatCliCommand, an as runCompoundingPromoteCliCommand, ao as runConversationIndexHealthCliCommand, ap as runConversationIndexInspectCliCommand, aq as runConversationIndexRebuildCliCommand, ar as runCueAnchorStatusCliCommand, as as runDashboardStartCliCommand, at as runDashboardStatusCliCommand, au as runDashboardStopCliCommand, av as runGraphHealthCliCommand, aw as runHarmonicSearchCliCommand, ax as runMemoryActionAuditCliCommand, ay as runMemoryGovernanceCliCommand, az as runMemoryGovernanceReportCliCommand, aA as runMemoryGovernanceRestoreCliCommand, aB as runMemoryReviewDispositionCliCommand, aC as runMemoryTimelineCliCommand, aD as runMigrateNormalizeFrontmatterCliCommand, aE as runMigrateObservationsCliCommand, aF as runMigrateRechunkCliCommand, aG as runMigrateReextractCliCommand, aH as runMigrateRescoreImportanceCliCommand, aI as runObjectiveStateStatusCliCommand, aJ as runPolicyDiffCliCommand, aK as runPolicyRollbackCliCommand, aL as runPolicyStatusCliCommand, aM as runRebuildMemoryLifecycleLedgerCliCommand, aN as runRebuildMemoryProjectionCliCommand, aO as runRebuildObservationsCliCommand, aP as runRepairMemoryProjectionCliCommand, aQ as runReplayCliCommand, aR as runResumeBundleBuildCliCommand, aS as runResumeBundleRecordCliCommand, aT as runResumeBundleStatusCliCommand, aU as runRouteCliCommand, aV as runSemanticRulePromoteCliCommand, aW as runSemanticRuleVerifyCliCommand, aX as runSessionCheckCliCommand, aY as runSessionRepairCliCommand, aZ as runTailscaleStatusCliCommand, a_ as runTailscaleSyncCliCommand, a$ as runTierMigrateCliCommand, b0 as runTierStatusCliCommand, b1 as runTrainingExportCliCommand, b2 as runTrustZoneDemoSeedCliCommand, b3 as runTrustZonePromoteCliCommand, b4 as runTrustZoneStatusCliCommand, b5 as runUtilityLearningCliCommand, b6 as runUtilityLearningStatusCliCommand, b7 as runUtilityTelemetryRecordCliCommand, b8 as runUtilityTelemetryStatusCliCommand, b9 as runVerifiedRecallSearchCliCommand, ba as runVerifyMemoryProjectionCliCommand, bb as runWebDavServeCliCommand, bc as runWebDavStopCliCommand, bd as runWorkProductRecallSearchCliCommand, be as runWorkProductRecordCliCommand, bf as runWorkProductStatusCliCommand, bg as runWorkProjectCliCommand, bh as runWorkTaskCliCommand } from './cli-olNPi1uN.js';
|
|
3
3
|
import './memory-projection-store-BQt5VUQ8.js';
|
|
4
4
|
import './types-C-USTTAx.js';
|
|
5
5
|
import 'node:stream';
|
|
6
6
|
import './dashboard-runtime.js';
|
|
7
|
-
import './access-service-
|
|
7
|
+
import './access-service-B9sziJdP.js';
|
|
8
8
|
import './resolve-auth-token.js';
|
|
9
9
|
import './evals.js';
|
|
10
10
|
import './graph.js';
|
package/dist/cli.js
CHANGED
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
runWorkProductStatusCliCommand,
|
|
89
89
|
runWorkProjectCliCommand,
|
|
90
90
|
runWorkTaskCliCommand
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-KQB4C4OE.js";
|
|
92
92
|
import "./chunk-YELFQNQH.js";
|
|
93
93
|
import "./chunk-MXC3AP5I.js";
|
|
94
94
|
import "./chunk-RXGR3YLU.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompoundingEngine,
|
|
3
3
|
defaultTierMigrationCycleBudget
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6B23Z44B.js";
|
|
5
5
|
import "./chunk-IXEJRKCZ.js";
|
|
6
6
|
import "./chunk-DLYTYJ43.js";
|
|
7
7
|
import "./chunk-YNJHCGDT.js";
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
CompoundingEngine,
|
|
26
26
|
defaultTierMigrationCycleBudget
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=engine-
|
|
28
|
+
//# sourceMappingURL=engine-2JKWFKJV.js.map
|
package/dist/extraction.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractionEngine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FCGWNWG4.js";
|
|
4
4
|
import "./chunk-WW3QQF4H.js";
|
|
5
5
|
import "./chunk-54V4BZWP.js";
|
|
6
6
|
import "./chunk-FEMOX5AD.js";
|
|
@@ -8,10 +8,10 @@ import "./chunk-R2XRID2N.js";
|
|
|
8
8
|
import "./chunk-GZCUW5IC.js";
|
|
9
9
|
import "./chunk-VEWZZM3H.js";
|
|
10
10
|
import "./chunk-EJI5XIBB.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-DWMXVUGO.js";
|
|
12
12
|
import "./chunk-Q7FJ5ZHM.js";
|
|
13
13
|
import "./chunk-ODWDQNRE.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-L2EXJQJP.js";
|
|
15
15
|
import "./chunk-UZB5KHKX.js";
|
|
16
16
|
import "./chunk-EEQLFRUM.js";
|
|
17
17
|
import "./chunk-NBNN5GOB.js";
|
package/dist/fallback-llm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FallbackLlmClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DWMXVUGO.js";
|
|
4
4
|
import "./chunk-Q7FJ5ZHM.js";
|
|
5
5
|
import "./chunk-ODWDQNRE.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-L2EXJQJP.js";
|
|
7
7
|
import "./chunk-UZB5KHKX.js";
|
|
8
8
|
import "./chunk-MARWOCVP.js";
|
|
9
9
|
import "./chunk-2ODBA7MQ.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import { P as PluginConfig, S as CodingContext, ap as CodingModeConfig, f as Mem
|
|
|
13
13
|
export { af as AgentAccessAuthToken, ab as BriefingActiveThread, aq as BriefingConfig, a8 as BriefingFocus, a7 as BriefingFollowup, ar as BriefingOpenCommitment, ad as BriefingRecentEntity, ac as BriefingResult, a6 as BriefingSections, as as BriefingWindow, t as BufferSurpriseEvent, aa as CalendarEvent, a9 as CalendarSource, at as CodexCompatConfig, x as ContinuityImprovementLoop, au as DEFAULT_RECALL_DISCLOSURE, av as ExtractedFact, G as GatewayConfig, L as LcmMessagePartInput, aw as LcmMessagePartKind, ax as LcmMessagePartRow, ay as MemoryActionEligibilityContext, az as MemoryActionEligibilitySource, aj as MemoryActionType, aA as MemoryObservation, aB as MemoryScope, j as MessagePartSourceFormat, aC as ParseMessagePartsOptions, aD as RECALL_DISCLOSURE_LEVELS, g as RecallDisclosure, ae as SecretRef, aE as isLcmMessagePartKind, aF as isRecallDisclosure, aG as normalizeExplicitParts, aH as parseAnthropicMessageParts, aI as parseMessageParts, aJ as parseOpenAiMessageParts, aK as parseOpenClawMessageParts, aL as partsFromRenderedText } from './types-C-USTTAx.js';
|
|
14
14
|
export { JudgeBatchResult, JudgeCandidate, JudgeVerdict, JudgeVerdictKind, clearVerdictCache, createVerdictCache, getVerdictKind, isDurableVerdict, isValidCachedVerdict, judgeFactDurability, normalizeCachedVerdict, verdictCacheSize } from './extraction-judge.js';
|
|
15
15
|
export { hasBroadGraphIntent, inferIntentFromText, intentCompatibilityScore, isTaskInitiationIntent, planRecallMode } from './intent.js';
|
|
16
|
-
import { P as PeerInteractionLogEntry, a as Peer, b as PeerProfile, c as ExportManifestV2, I as ImportCapsuleResult, C as CapsuleParent } from './access-service-
|
|
17
|
-
export { d as EngramAccessInputError, E as EngramAccessService, e as PEER_ID_MAX_LENGTH, f as PEER_ID_PATTERN, g as PeerKind, h as PeerProfileFieldProvenance, i as ProcedureStatsConfigSnapshot, j as ProcedureStatsRecent, k as ProcedureStatsReport, l as ProcedureStatusCounts, m as computeProcedureStats, n as formatProcedureStatsText } from './access-service-
|
|
16
|
+
import { P as PeerInteractionLogEntry, a as Peer, b as PeerProfile, c as ExportManifestV2, I as ImportCapsuleResult, C as CapsuleParent } from './access-service-B9sziJdP.js';
|
|
17
|
+
export { d as EngramAccessInputError, E as EngramAccessService, e as PEER_ID_MAX_LENGTH, f as PEER_ID_PATTERN, g as PeerKind, h as PeerProfileFieldProvenance, i as ProcedureStatsConfigSnapshot, j as ProcedureStatsRecent, k as ProcedureStatsReport, l as ProcedureStatusCounts, m as computeProcedureStats, n as formatProcedureStatsText } from './access-service-B9sziJdP.js';
|
|
18
18
|
export { FILTER_LABELS as DIRECT_ANSWER_FILTER_LABELS, DirectAnswerCandidate, DirectAnswerConfig, DirectAnswerInput, DirectAnswerReason, DirectAnswerResult, isDirectAnswerEligible } from './direct-answer.js';
|
|
19
19
|
export { MemoryTier, TierRoutingPolicy, TierTransitionDecision, computeTierValueScore, decideTierTransition } from './tier-routing.js';
|
|
20
20
|
export { ApplyReasoningTraceBoostOptions, BoostableResult, DEFAULT_REASONING_TRACE_BOOST, applyReasoningTraceBoost, isReasoningTracePath, looksLikeProblemSolvingQuery } from './reasoning-trace-recall.js';
|
|
@@ -51,7 +51,7 @@ import { R as RolloutSummaryInput, M as MaterializeResult } from './codex-materi
|
|
|
51
51
|
export { a as MATERIALIZE_VERSION, b as MaterializeOptions, S as SENTINEL_FILE, d as describeMemoriesDir, e as ensureSentinel, m as materializeForNamespace } from './codex-materialize-D5d5vvyS.js';
|
|
52
52
|
import { T as Taxonomy, R as ResolverDecision } from './types-DJhqDJUV.js';
|
|
53
53
|
export { a as TaxonomyCategory } from './types-DJhqDJUV.js';
|
|
54
|
-
export { B as BulkImportCliCommandOptions, P as ProcessBatchFn, a as ProcessBatchResult, f as formatBatchTranscript, p as parseStrictCliDate, r as runBulkImportCliCommand, b as runBulkImportPipeline } from './cli-
|
|
54
|
+
export { B as BulkImportCliCommandOptions, P as ProcessBatchFn, a as ProcessBatchResult, f as formatBatchTranscript, p as parseStrictCliDate, r as runBulkImportCliCommand, b as runBulkImportPipeline } from './cli-olNPi1uN.js';
|
|
55
55
|
export { FallbackLlmClient, FallbackLlmOptions, FallbackLlmResponse, FallbackLlmRuntimeContext } from './fallback-llm.js';
|
|
56
56
|
export { ComputeMemoryWorthInput, MemoryWorthResult, computeMemoryWorth } from './memory-worth.js';
|
|
57
57
|
export { MemoryOutcomeKind, RecordMemoryOutcomeInput, RecordMemoryOutcomeResult, memoryWorthOutcomeEligibleCategories, recordMemoryOutcome } from './memory-worth-outcomes.js';
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
runBulkImportCliCommand,
|
|
54
54
|
runBulkImportPipeline,
|
|
55
55
|
validateImportTurn
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-KQB4C4OE.js";
|
|
57
57
|
import "./chunk-YELFQNQH.js";
|
|
58
58
|
import {
|
|
59
59
|
clearAuthTokenSecretCache,
|
|
@@ -117,8 +117,8 @@ import {
|
|
|
117
117
|
saveTaxonomy,
|
|
118
118
|
validateSlug,
|
|
119
119
|
validateTaxonomy
|
|
120
|
-
} from "./chunk-
|
|
121
|
-
import "./chunk-
|
|
120
|
+
} from "./chunk-VZNQB6NL.js";
|
|
121
|
+
import "./chunk-6B23Z44B.js";
|
|
122
122
|
import "./chunk-CK5NTM2S.js";
|
|
123
123
|
import "./chunk-FSFEQI74.js";
|
|
124
124
|
import "./chunk-Z5AAYHUC.js";
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
} from "./chunk-S75M5ZRK.js";
|
|
129
129
|
import "./chunk-TPB3I2AC.js";
|
|
130
130
|
import "./chunk-UHGBNIOS.js";
|
|
131
|
-
import "./chunk-
|
|
131
|
+
import "./chunk-S5SQDIF5.js";
|
|
132
132
|
import "./chunk-ETOW6ACV.js";
|
|
133
133
|
import "./chunk-ZTSE2ZJ6.js";
|
|
134
134
|
import "./chunk-MDYG7VI7.js";
|
|
@@ -196,7 +196,7 @@ import {
|
|
|
196
196
|
} from "./chunk-C4SQJZAF.js";
|
|
197
197
|
import {
|
|
198
198
|
ExtractionEngine
|
|
199
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-FCGWNWG4.js";
|
|
200
200
|
import "./chunk-WW3QQF4H.js";
|
|
201
201
|
import "./chunk-54V4BZWP.js";
|
|
202
202
|
import "./chunk-FEMOX5AD.js";
|
|
@@ -313,10 +313,10 @@ import {
|
|
|
313
313
|
} from "./chunk-EJI5XIBB.js";
|
|
314
314
|
import {
|
|
315
315
|
FallbackLlmClient
|
|
316
|
-
} from "./chunk-
|
|
316
|
+
} from "./chunk-DWMXVUGO.js";
|
|
317
317
|
import "./chunk-Q7FJ5ZHM.js";
|
|
318
318
|
import "./chunk-ODWDQNRE.js";
|
|
319
|
-
import "./chunk-
|
|
319
|
+
import "./chunk-L2EXJQJP.js";
|
|
320
320
|
import "./chunk-UZB5KHKX.js";
|
|
321
321
|
import "./chunk-6HZ6AO2P.js";
|
|
322
322
|
import "./chunk-JWPLJLDU.js";
|
|
@@ -9,5 +9,13 @@ declare function buildChatCompletionTokenLimit(model: string, maxTokens: number,
|
|
|
9
9
|
} | {
|
|
10
10
|
max_completion_tokens: number;
|
|
11
11
|
};
|
|
12
|
+
declare function supportsTemperature(model: string, options?: {
|
|
13
|
+
assumeOpenAI?: boolean;
|
|
14
|
+
}): boolean;
|
|
15
|
+
declare function buildChatCompletionTemperature(model: string, temperature: number, options?: {
|
|
16
|
+
assumeOpenAI?: boolean;
|
|
17
|
+
}): {
|
|
18
|
+
temperature: number;
|
|
19
|
+
} | Record<string, never>;
|
|
12
20
|
|
|
13
|
-
export { buildChatCompletionTokenLimit, shouldAssumeOpenAiChatCompletions, usesMaxCompletionTokens };
|
|
21
|
+
export { buildChatCompletionTemperature, buildChatCompletionTokenLimit, shouldAssumeOpenAiChatCompletions, supportsTemperature, usesMaxCompletionTokens };
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildChatCompletionTemperature,
|
|
2
3
|
buildChatCompletionTokenLimit,
|
|
3
4
|
shouldAssumeOpenAiChatCompletions,
|
|
5
|
+
supportsTemperature,
|
|
4
6
|
usesMaxCompletionTokens
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-L2EXJQJP.js";
|
|
6
8
|
import "./chunk-PZ5AY32C.js";
|
|
7
9
|
export {
|
|
10
|
+
buildChatCompletionTemperature,
|
|
8
11
|
buildChatCompletionTokenLimit,
|
|
9
12
|
shouldAssumeOpenAiChatCompletions,
|
|
13
|
+
supportsTemperature,
|
|
10
14
|
usesMaxCompletionTokens
|
|
11
15
|
};
|
|
12
16
|
//# sourceMappingURL=openai-chat-compat.js.map
|
package/dist/orchestrator.js
CHANGED
|
@@ -26,15 +26,15 @@ import {
|
|
|
26
26
|
sanitizeSessionKeyForFilename,
|
|
27
27
|
shouldFilterLifecycleRecallCandidate,
|
|
28
28
|
summarizeGraphShadowComparison
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-VZNQB6NL.js";
|
|
30
|
+
import "./chunk-6B23Z44B.js";
|
|
31
31
|
import "./chunk-CK5NTM2S.js";
|
|
32
32
|
import "./chunk-FSFEQI74.js";
|
|
33
33
|
import "./chunk-Z5AAYHUC.js";
|
|
34
34
|
import "./chunk-S75M5ZRK.js";
|
|
35
35
|
import "./chunk-TPB3I2AC.js";
|
|
36
36
|
import "./chunk-UHGBNIOS.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-S5SQDIF5.js";
|
|
38
38
|
import "./chunk-ETOW6ACV.js";
|
|
39
39
|
import "./chunk-ZTSE2ZJ6.js";
|
|
40
40
|
import "./chunk-MDYG7VI7.js";
|
|
@@ -61,7 +61,7 @@ import "./chunk-AKV3HOGZ.js";
|
|
|
61
61
|
import "./chunk-74WWN7ZW.js";
|
|
62
62
|
import "./chunk-DF3RVK3X.js";
|
|
63
63
|
import "./chunk-C4SQJZAF.js";
|
|
64
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-FCGWNWG4.js";
|
|
65
65
|
import "./chunk-WW3QQF4H.js";
|
|
66
66
|
import "./chunk-54V4BZWP.js";
|
|
67
67
|
import "./chunk-FEMOX5AD.js";
|
|
@@ -103,10 +103,10 @@ import "./chunk-4WMCPJWX.js";
|
|
|
103
103
|
import "./chunk-JBMSGZEQ.js";
|
|
104
104
|
import "./chunk-ZBZVNWQO.js";
|
|
105
105
|
import "./chunk-EJI5XIBB.js";
|
|
106
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-DWMXVUGO.js";
|
|
107
107
|
import "./chunk-Q7FJ5ZHM.js";
|
|
108
108
|
import "./chunk-ODWDQNRE.js";
|
|
109
|
-
import "./chunk-
|
|
109
|
+
import "./chunk-L2EXJQJP.js";
|
|
110
110
|
import "./chunk-UZB5KHKX.js";
|
|
111
111
|
import "./chunk-6HZ6AO2P.js";
|
|
112
112
|
import "./chunk-JWPLJLDU.js";
|
package/dist/schemas.d.ts
CHANGED
|
@@ -217,12 +217,12 @@ declare const EntityMentionSchema: z.ZodObject<{
|
|
|
217
217
|
title: z.ZodString;
|
|
218
218
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
219
219
|
}, "strip", z.ZodTypeAny, {
|
|
220
|
-
key: string;
|
|
221
220
|
title: string;
|
|
221
|
+
key: string;
|
|
222
222
|
facts: string[];
|
|
223
223
|
}, {
|
|
224
|
-
key: string;
|
|
225
224
|
title: string;
|
|
225
|
+
key: string;
|
|
226
226
|
facts: string[];
|
|
227
227
|
}>, "many">>>;
|
|
228
228
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -230,8 +230,8 @@ declare const EntityMentionSchema: z.ZodObject<{
|
|
|
230
230
|
name: string;
|
|
231
231
|
facts: string[];
|
|
232
232
|
structuredSections?: {
|
|
233
|
-
key: string;
|
|
234
233
|
title: string;
|
|
234
|
+
key: string;
|
|
235
235
|
facts: string[];
|
|
236
236
|
}[] | null | undefined;
|
|
237
237
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -240,8 +240,8 @@ declare const EntityMentionSchema: z.ZodObject<{
|
|
|
240
240
|
name: string;
|
|
241
241
|
facts: string[];
|
|
242
242
|
structuredSections?: {
|
|
243
|
-
key: string;
|
|
244
243
|
title: string;
|
|
244
|
+
key: string;
|
|
245
245
|
facts: string[];
|
|
246
246
|
}[] | null | undefined;
|
|
247
247
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -468,12 +468,12 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
468
468
|
title: z.ZodString;
|
|
469
469
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
470
470
|
}, "strip", z.ZodTypeAny, {
|
|
471
|
-
key: string;
|
|
472
471
|
title: string;
|
|
472
|
+
key: string;
|
|
473
473
|
facts: string[];
|
|
474
474
|
}, {
|
|
475
|
-
key: string;
|
|
476
475
|
title: string;
|
|
476
|
+
key: string;
|
|
477
477
|
facts: string[];
|
|
478
478
|
}>, "many">>>;
|
|
479
479
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -481,8 +481,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
481
481
|
name: string;
|
|
482
482
|
facts: string[];
|
|
483
483
|
structuredSections?: {
|
|
484
|
-
key: string;
|
|
485
484
|
title: string;
|
|
485
|
+
key: string;
|
|
486
486
|
facts: string[];
|
|
487
487
|
}[] | null | undefined;
|
|
488
488
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -491,8 +491,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
491
491
|
name: string;
|
|
492
492
|
facts: string[];
|
|
493
493
|
structuredSections?: {
|
|
494
|
-
key: string;
|
|
495
494
|
title: string;
|
|
495
|
+
key: string;
|
|
496
496
|
facts: string[];
|
|
497
497
|
}[] | null | undefined;
|
|
498
498
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -549,8 +549,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
549
549
|
name: string;
|
|
550
550
|
facts: string[];
|
|
551
551
|
structuredSections?: {
|
|
552
|
-
key: string;
|
|
553
552
|
title: string;
|
|
553
|
+
key: string;
|
|
554
554
|
facts: string[];
|
|
555
555
|
}[] | null | undefined;
|
|
556
556
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -598,8 +598,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
598
598
|
name: string;
|
|
599
599
|
facts: string[];
|
|
600
600
|
structuredSections?: {
|
|
601
|
-
key: string;
|
|
602
601
|
title: string;
|
|
602
|
+
key: string;
|
|
603
603
|
facts: string[];
|
|
604
604
|
}[] | null | undefined;
|
|
605
605
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -778,12 +778,12 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
778
778
|
title: z.ZodString;
|
|
779
779
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
780
780
|
}, "strip", z.ZodTypeAny, {
|
|
781
|
-
key: string;
|
|
782
781
|
title: string;
|
|
782
|
+
key: string;
|
|
783
783
|
facts: string[];
|
|
784
784
|
}, {
|
|
785
|
-
key: string;
|
|
786
785
|
title: string;
|
|
786
|
+
key: string;
|
|
787
787
|
facts: string[];
|
|
788
788
|
}>, "many">>>;
|
|
789
789
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -791,8 +791,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
791
791
|
name: string;
|
|
792
792
|
facts: string[];
|
|
793
793
|
structuredSections?: {
|
|
794
|
-
key: string;
|
|
795
794
|
title: string;
|
|
795
|
+
key: string;
|
|
796
796
|
facts: string[];
|
|
797
797
|
}[] | null | undefined;
|
|
798
798
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -801,8 +801,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
801
801
|
name: string;
|
|
802
802
|
facts: string[];
|
|
803
803
|
structuredSections?: {
|
|
804
|
-
key: string;
|
|
805
804
|
title: string;
|
|
805
|
+
key: string;
|
|
806
806
|
facts: string[];
|
|
807
807
|
}[] | null | undefined;
|
|
808
808
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -873,8 +873,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
873
873
|
name: string;
|
|
874
874
|
facts: string[];
|
|
875
875
|
structuredSections?: {
|
|
876
|
-
key: string;
|
|
877
876
|
title: string;
|
|
877
|
+
key: string;
|
|
878
878
|
facts: string[];
|
|
879
879
|
}[] | null | undefined;
|
|
880
880
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -928,8 +928,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
928
928
|
name: string;
|
|
929
929
|
facts: string[];
|
|
930
930
|
structuredSections?: {
|
|
931
|
-
key: string;
|
|
932
931
|
title: string;
|
|
932
|
+
key: string;
|
|
933
933
|
facts: string[];
|
|
934
934
|
}[] | null | undefined;
|
|
935
935
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -998,12 +998,12 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
998
998
|
title: z.ZodString;
|
|
999
999
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
1000
1000
|
}, "strip", z.ZodTypeAny, {
|
|
1001
|
-
key: string;
|
|
1002
1001
|
title: string;
|
|
1002
|
+
key: string;
|
|
1003
1003
|
facts: string[];
|
|
1004
1004
|
}, {
|
|
1005
|
-
key: string;
|
|
1006
1005
|
title: string;
|
|
1006
|
+
key: string;
|
|
1007
1007
|
facts: string[];
|
|
1008
1008
|
}>, "many">>>;
|
|
1009
1009
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1011,8 +1011,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1011
1011
|
name: string;
|
|
1012
1012
|
facts: string[];
|
|
1013
1013
|
structuredSections?: {
|
|
1014
|
-
key: string;
|
|
1015
1014
|
title: string;
|
|
1015
|
+
key: string;
|
|
1016
1016
|
facts: string[];
|
|
1017
1017
|
}[] | null | undefined;
|
|
1018
1018
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -1021,8 +1021,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1021
1021
|
name: string;
|
|
1022
1022
|
facts: string[];
|
|
1023
1023
|
structuredSections?: {
|
|
1024
|
-
key: string;
|
|
1025
1024
|
title: string;
|
|
1025
|
+
key: string;
|
|
1026
1026
|
facts: string[];
|
|
1027
1027
|
}[] | null | undefined;
|
|
1028
1028
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -1041,8 +1041,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1041
1041
|
name: string;
|
|
1042
1042
|
facts: string[];
|
|
1043
1043
|
structuredSections?: {
|
|
1044
|
-
key: string;
|
|
1045
1044
|
title: string;
|
|
1045
|
+
key: string;
|
|
1046
1046
|
facts: string[];
|
|
1047
1047
|
}[] | null | undefined;
|
|
1048
1048
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -1061,8 +1061,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1061
1061
|
name: string;
|
|
1062
1062
|
facts: string[];
|
|
1063
1063
|
structuredSections?: {
|
|
1064
|
-
key: string;
|
|
1065
1064
|
title: string;
|
|
1065
|
+
key: string;
|
|
1066
1066
|
facts: string[];
|
|
1067
1067
|
}[] | null | undefined;
|
|
1068
1068
|
promptedByQuestion?: string | null | undefined;
|
package/dist/summarizer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HourlySummarizer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S5SQDIF5.js";
|
|
4
4
|
import "./chunk-ETOW6ACV.js";
|
|
5
5
|
import "./chunk-FEMOX5AD.js";
|
|
6
6
|
import "./chunk-R2XRID2N.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-DWMXVUGO.js";
|
|
8
8
|
import "./chunk-Q7FJ5ZHM.js";
|
|
9
9
|
import "./chunk-ODWDQNRE.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-L2EXJQJP.js";
|
|
11
11
|
import "./chunk-UZB5KHKX.js";
|
|
12
12
|
import "./chunk-OR64ZGRZ.js";
|
|
13
13
|
import "./chunk-MARWOCVP.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/fallback-llm.ts"],"sourcesContent":["import { log } from \"./logger.js\";\nimport type { GatewayConfig, ModelProviderConfig, AgentPersona } from \"./types.js\";\nimport { extractJsonCandidates } from \"./json-extract.js\";\nimport {\n buildChatCompletionTokenLimit,\n shouldAssumeOpenAiChatCompletions,\n} from \"./openai-chat-compat.js\";\nimport { resolveProviderApiKey, getGatewayRuntimeAuthForModel } from \"./resolve-provider-secret.js\";\nimport { loadModelsJsonProviders } from \"./models-json.js\";\n\nexport interface FallbackLlmOptions {\n temperature?: number;\n maxTokens?: number;\n timeoutMs?: number;\n /** Override which agent persona's model chain to use (by ID from agents.list[]). */\n agentId?: string;\n}\n\nexport interface FallbackLlmResponse {\n content: string;\n modelUsed: string;\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n };\n}\n\nexport interface FallbackLlmRuntimeContext {\n agentDir?: string;\n workspaceDir?: string;\n}\n\ninterface ModelRef {\n providerId: string;\n modelId: string;\n providerConfig: ModelProviderConfig;\n modelString: string;\n}\n\nconst PROVIDER_ALIASES: Record<string, readonly string[]> = {\n \"openai-codex\": [\"codex\"],\n codex: [\"openai-codex\"],\n \"claude-cli\": [\"anthropic\"],\n};\n\nconst LEGACY_PROVIDER_IDS = new Set([\"openai-codex\", \"claude-cli\"]);\n\nconst BUILT_IN_PROVIDER_FALLBACKS: Record<string, ModelProviderConfig> = {\n anthropic: {\n baseUrl: \"https://api.anthropic.com/v1\",\n api: \"anthropic-messages\",\n apiKey: \"secretref-managed\",\n models: [],\n },\n};\n\n/**\n * Generic fallback LLM client that uses the gateway's default AI configuration\n * and walks through the full fallback chain (primary + fallbacks).\n * Supports OpenAI and Anthropic API formats.\n */\nexport class FallbackLlmClient {\n private gatewayConfig: GatewayConfig | undefined;\n private runtimeContext: FallbackLlmRuntimeContext;\n\n constructor(\n gatewayConfig?: GatewayConfig,\n runtimeContext: FallbackLlmRuntimeContext = {},\n ) {\n this.gatewayConfig = gatewayConfig;\n this.runtimeContext = runtimeContext;\n }\n\n /**\n * Check if fallback is available (gateway config has at least one model).\n */\n isAvailable(agentId?: string): boolean {\n const models = this.getModelChain(agentId);\n return models.length > 0;\n }\n\n /**\n * Make a chat completion request using the gateway's default AI chain.\n * Tries primary first, then each fallback in order.\n * When agentId is provided, uses that agent persona's model chain instead of defaults.\n */\n async chatCompletion(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions = {},\n ): Promise<FallbackLlmResponse | null> {\n const models = this.getModelChain(options.agentId);\n if (models.length === 0) {\n log.warn(\"fallback LLM: no models configured in gateway\");\n return null;\n }\n\n const runChain = async (): Promise<FallbackLlmResponse | null> => {\n // Try each model in the chain\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n const isFallback = i > 0;\n\n try {\n const result = await this.tryModel(model, messages, options);\n if (result) {\n if (isFallback) {\n log.debug(`fallback LLM: succeeded using ${model.modelString} (fallback ${i})`);\n }\n return {\n content: result.content,\n modelUsed: model.modelString,\n usage: result.usage,\n };\n }\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : String(err);\n log.debug(`fallback LLM: ${model.modelString} failed (${errorMsg}), trying next...`);\n // Continue to next model in chain\n }\n }\n\n log.warn(`fallback LLM: all ${models.length} models in chain failed`);\n return null;\n };\n\n if (typeof options.timeoutMs === \"number\") {\n if (options.timeoutMs <= 0) {\n log.warn(\"fallback LLM: timed out before request started\");\n return null;\n }\n let timeoutHandle: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n runChain(),\n new Promise<null>((resolve) => {\n timeoutHandle = setTimeout(() => {\n log.warn(`fallback LLM: timed out after ${options.timeoutMs}ms`);\n resolve(null);\n }, options.timeoutMs);\n }),\n ]);\n } finally {\n if (timeoutHandle) clearTimeout(timeoutHandle);\n }\n }\n\n return await runChain();\n }\n\n /**\n * Make a request with structured output (Zod schema).\n * Returns parsed JSON or null on failure.\n */\n async parseWithSchema<T>(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n schema: { parse: (data: unknown) => T },\n options: FallbackLlmOptions = {},\n ): Promise<T | null> {\n const detailed = await this.parseWithSchemaDetailed(messages, schema, options);\n return detailed?.result ?? null;\n }\n\n /**\n * Like parseWithSchema but also returns the model that was used,\n * so callers can emit accurate trace events.\n */\n async parseWithSchemaDetailed<T>(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n schema: { parse: (data: unknown) => T },\n options: FallbackLlmOptions = {},\n ): Promise<{ result: T; modelUsed: string } | null> {\n const response = await this.chatCompletion(messages, options);\n if (!response?.content) return null;\n\n try {\n const candidates = extractJsonCandidates(response.content);\n for (const c of candidates) {\n try {\n const parsed = JSON.parse(c);\n return { result: schema.parse(parsed), modelUsed: response.modelUsed };\n } catch {\n // keep trying other candidates\n }\n }\n return null;\n } catch (err) {\n log.warn(\"fallback LLM: failed to parse structured output:\", err);\n return null;\n }\n }\n\n /**\n * Get the full model chain from gateway config.\n * Returns array of models in order: [primary, fallback1, fallback2, ...]\n *\n * When agentId is provided, looks up the matching entry in agents.list[]\n * and uses that persona's model chain. Falls back to agents.defaults.model\n * if agentId is not found or not provided.\n */\n private getModelChain(agentId?: string): ModelRef[] {\n const chain: ModelRef[] = [];\n const providers = this.gatewayConfig?.models?.providers ?? {};\n\n // Resolve the model config: agent persona chain or global defaults\n let modelConfig: { primary?: string; fallbacks?: string[] } | undefined;\n\n if (agentId) {\n const persona = this.gatewayConfig?.agents?.list?.find(\n (a) => a.id === agentId,\n );\n if (persona?.model) {\n modelConfig = persona.model;\n log.debug(`fallback LLM: using agent persona \"${agentId}\" model chain`);\n } else {\n log.warn(\n `fallback LLM: agent persona \"${agentId}\" not found or has no model config, falling back to defaults`,\n );\n }\n }\n\n if (!modelConfig) {\n modelConfig = this.gatewayConfig?.agents?.defaults?.model;\n }\n\n // Build list of model strings: primary + fallbacks\n const modelStrings: string[] = [];\n\n if (modelConfig?.primary) {\n modelStrings.push(modelConfig.primary);\n }\n\n if (Array.isArray(modelConfig?.fallbacks)) {\n for (const fb of modelConfig.fallbacks) {\n if (typeof fb === \"string\" && !modelStrings.includes(fb)) {\n modelStrings.push(fb);\n }\n }\n }\n\n // Parse each model string and look up provider config\n for (const modelString of modelStrings) {\n const modelRef = this.parseModelString(modelString, providers);\n if (modelRef) {\n chain.push(modelRef);\n }\n }\n\n return chain;\n }\n\n /**\n * Parse a \"provider/model\" string and look up its config.\n */\n private parseModelString(\n modelString: string,\n providers: Record<string, ModelProviderConfig>,\n ): ModelRef | null {\n // Parse \"provider/model\" format (e.g., \"openai/gpt-5.2\", \"anthropic/claude-opus-4-6\")\n const parts = modelString.split(\"/\");\n if (parts.length < 2) {\n log.warn(`fallback LLM: invalid model format: ${modelString}`);\n return null;\n }\n\n const requestedProviderId = parts[0];\n const modelId = parts.slice(1).join(\"/\"); // Handle cases like \"openai/gpt-5.2-turbo\"\n\n // Respect the active gateway config first so profile-local overrides and\n // credentials win. Fall back to the materialized models.json only when\n // the provider is absent from the loaded config (for built-in providers\n // registered by the gateway at runtime).\n const resolvedProvider = this.resolveProviderConfig(requestedProviderId, providers);\n const providerConfig = resolvedProvider?.config;\n if (!providerConfig) {\n log.warn(\n `fallback LLM: provider not found: ${requestedProviderId} ` +\n `(tried: ${this.providerResolutionCandidates(requestedProviderId).join(\", \")})`,\n );\n return null;\n }\n\n return {\n providerId: resolvedProvider.providerId,\n modelId,\n providerConfig,\n modelString,\n };\n }\n\n private resolveProviderConfig(\n providerId: string,\n providers: Record<string, ModelProviderConfig>,\n ): { providerId: string; config: ModelProviderConfig } | null {\n const candidates = this.providerResolutionCandidates(providerId);\n const aliasCandidates = candidates.filter((candidate) => candidate !== providerId);\n const fallbackCandidates = LEGACY_PROVIDER_IDS.has(providerId)\n ? [...aliasCandidates, providerId]\n : [providerId, ...aliasCandidates];\n for (const candidate of candidates) {\n const config = providers[candidate];\n if (config) {\n if (candidate !== providerId) {\n log.debug(`fallback LLM: provider \"${providerId}\" resolved via alias \"${candidate}\"`);\n }\n return { providerId: candidate, config };\n }\n }\n for (const candidate of fallbackCandidates) {\n const config = this.resolveFromModelsJson(candidate);\n if (config) {\n if (candidate !== providerId) {\n log.debug(`fallback LLM: provider \"${providerId}\" resolved via models.json alias \"${candidate}\"`);\n }\n return { providerId: candidate, config };\n }\n const builtInConfig = BUILT_IN_PROVIDER_FALLBACKS[candidate];\n if (builtInConfig) {\n if (candidate === providerId) {\n log.debug(`fallback LLM: provider \"${providerId}\" resolved from built-in defaults`);\n return { providerId, config: builtInConfig };\n }\n log.debug(`fallback LLM: provider \"${providerId}\" resolved via built-in alias \"${candidate}\"`);\n return { providerId: candidate, config: builtInConfig };\n }\n }\n return null;\n }\n\n private providerResolutionCandidates(providerId: string): string[] {\n const candidates = [providerId, ...(PROVIDER_ALIASES[providerId] ?? [])];\n return [...new Set(candidates)];\n }\n\n /**\n * Look up a provider from the gateway's materialized models.json, which\n * contains all providers including built-in ones (openai-codex, google-vertex,\n * etc.) that aren't in the user's openclaw.json but are registered by\n * gateway plugins. Returns null if the provider isn't found there either.\n */\n private resolveFromModelsJson(providerId: string): ModelProviderConfig | null {\n const allProviders = loadModelsJsonProviders();\n const config = allProviders[providerId];\n if (config) {\n log.debug(`fallback LLM: resolved provider \"${providerId}\" from models.json (api: ${config.api ?? \"default\"})`);\n return config;\n }\n return null;\n }\n\n /**\n * Try to call a single model.\n *\n * Uses the gateway's native getRuntimeAuthForModel when available — this\n * handles all provider-specific auth transforms (OAuth token exchange,\n * base URL overrides for codex/copilot/etc.) through the same codepath\n * the gateway itself uses. Falls back to resolveProviderApiKey for\n * simpler providers or when the runtime module isn't loaded.\n */\n private async tryModel(\n model: ModelRef,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n // Try the gateway's native runtime auth first — it handles all provider-\n // specific transforms (OAuth exchange, base URL rewrite, etc.)\n const runtimeAuth = await this.resolveRuntimeAuth(model);\n const effectiveBaseUrl = runtimeAuth?.baseUrl ?? model.providerConfig.baseUrl;\n const resolvedApiKey = runtimeAuth?.apiKey ?? await this.resolveFallbackApiKey(model);\n\n // If the raw key looks like an unresolved secret ref and resolution fails,\n // skip this provider entirely so the chain falls through to the next.\n const rawKey = model.providerConfig.apiKey;\n const needsResolution = rawKey === \"secretref-managed\"\n || (typeof rawKey === \"object\" && rawKey !== null);\n if (needsResolution && !resolvedApiKey) {\n throw new Error(`API key for provider \"${model.providerId}\" could not be resolved from secret ref`);\n }\n\n const effectiveConfig: ModelProviderConfig = {\n ...model.providerConfig,\n baseUrl: effectiveBaseUrl,\n ...(resolvedApiKey ? { apiKey: resolvedApiKey } : {}),\n };\n\n if (model.providerConfig.api === \"anthropic-messages\") {\n return await this.callAnthropic(effectiveConfig, model.modelId, messages, options);\n }\n\n if (\n model.providerConfig.api === \"openai-responses\" ||\n model.providerConfig.api === \"openai-codex-responses\" ||\n model.providerConfig.api === \"azure-openai-responses\"\n ) {\n return await this.callOpenAIResponses(\n effectiveConfig,\n model.modelId,\n messages,\n options,\n );\n }\n\n // For OpenAI-compatible chat-completions APIs (openai-completions,\n // ollama, etc.) and unknown formats, use chat completions — the gateway's\n // runtime auth resolver returns request-ready base URL and credentials for\n // most providers.\n return await this.callOpenAI(\n effectiveConfig,\n model.modelId,\n messages,\n options,\n shouldAssumeOpenAiChatCompletions(effectiveConfig.baseUrl),\n );\n }\n\n /**\n * Resolve request-ready auth through the gateway's native runtime, which\n * handles provider-specific transforms (OAuth token exchange for codex/copilot,\n * base URL rewrite, etc.). Returns null if the runtime isn't available.\n */\n private async resolveRuntimeAuth(\n model: ModelRef,\n ): Promise<{ apiKey?: string; baseUrl?: string } | null> {\n try {\n const getRuntimeAuth = await getGatewayRuntimeAuthForModel();\n if (!getRuntimeAuth) return null;\n\n const result = await getRuntimeAuth({\n model: {\n provider: model.providerId,\n id: model.modelId,\n api: model.providerConfig.api,\n baseUrl: model.providerConfig.baseUrl,\n },\n cfg: this.gatewayConfig,\n workspaceDir: this.runtimeContext.workspaceDir,\n });\n\n if (result?.apiKey || result?.baseUrl) {\n log.debug(\n `fallback LLM: resolved runtime auth for \"${model.modelString}\" (source: ${result.source ?? \"unknown\"}, mode: ${result.mode ?? \"unknown\"})`,\n );\n return { apiKey: result.apiKey, baseUrl: result.baseUrl };\n }\n } catch (err) {\n log.debug(\n `fallback LLM: gateway runtime auth failed for \"${model.modelString}\": ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n return null;\n }\n\n /**\n * Resolve API key through the existing provider-level resolution (env vars,\n * secret refs, etc.). Used as fallback when gateway runtime auth isn't available.\n */\n private async resolveFallbackApiKey(model: ModelRef): Promise<string | undefined> {\n return resolveProviderApiKey(\n model.providerId,\n model.providerConfig.apiKey,\n this.gatewayConfig,\n this.runtimeContext.agentDir,\n );\n }\n\n /**\n * Call OpenAI-compatible API.\n */\n private async callOpenAI(\n config: ModelProviderConfig,\n modelId: string,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n assumeOpenAI: boolean,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n const base = config.baseUrl.replace(/\\/$/, \"\");\n const url = base.endsWith(\"/v1\")\n ? `${base}/chat/completions`\n : `${base}/v1/chat/completions`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n };\n\n // Handle auth — apiKey is already resolved to a string by tryModel()\n if (config.apiKey && typeof config.apiKey === \"string\") {\n if (config.authHeader !== false) {\n headers[\"Authorization\"] = `Bearer ${config.apiKey}`;\n }\n }\n\n const body = {\n model: modelId,\n messages,\n temperature: options.temperature ?? 0.3,\n ...buildChatCompletionTokenLimit(modelId, options.maxTokens ?? 4096, {\n assumeOpenAI,\n }),\n };\n\n const response = await fetch(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`OpenAI API error: ${response.status} ${error}`);\n }\n\n const data = (await response.json()) as {\n choices: Array<{\n message: {\n content: string;\n };\n }>;\n usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n total_tokens?: number;\n };\n };\n\n const content = data.choices?.[0]?.message?.content;\n if (!content) {\n throw new Error(\"Empty response from OpenAI API\");\n }\n\n return {\n content,\n usage: data.usage\n ? {\n inputTokens: data.usage.prompt_tokens,\n outputTokens: data.usage.completion_tokens,\n totalTokens: data.usage.total_tokens,\n }\n : undefined,\n };\n }\n\n /**\n * Call an OpenAI-compatible Responses API.\n */\n private async callOpenAIResponses(\n config: ModelProviderConfig,\n modelId: string,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n const base = config.baseUrl.replace(/\\/$/, \"\");\n const url = base.endsWith(\"/v1\")\n ? `${base}/responses`\n : `${base}/v1/responses`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n };\n\n if (config.apiKey && typeof config.apiKey === \"string\" && config.authHeader !== false) {\n headers[\"Authorization\"] = `Bearer ${config.apiKey}`;\n }\n\n const instructions = messages\n .filter((message) => message.role === \"system\")\n .map((message) => message.content)\n .join(\"\\n\\n\")\n .trim();\n const input = messages\n .filter((message) => message.role !== \"system\")\n .map((message) => ({\n role: message.role,\n content: [{\n type: message.role === \"assistant\" ? \"output_text\" : \"input_text\",\n text: message.content,\n }],\n }));\n\n const body: Record<string, unknown> = {\n model: modelId,\n input,\n max_output_tokens: Math.max(0, Math.floor(options.maxTokens ?? 4096)),\n temperature: options.temperature ?? 0.3,\n };\n if (instructions.length > 0) {\n body.instructions = instructions;\n }\n\n const response = await fetch(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`OpenAI Responses API error: ${response.status} ${error}`);\n }\n\n const data = (await response.json()) as {\n output_text?: string;\n output?: Array<{\n type?: string;\n text?: string;\n content?: Array<{\n type?: string;\n text?: string;\n }>;\n }>;\n usage?: {\n input_tokens?: number;\n output_tokens?: number;\n total_tokens?: number;\n };\n };\n\n const outputText = extractResponsesOutputText(data);\n if (!outputText) {\n throw new Error(\"Empty response from OpenAI Responses API\");\n }\n\n return {\n content: outputText,\n usage: data.usage\n ? {\n inputTokens: data.usage.input_tokens,\n outputTokens: data.usage.output_tokens,\n totalTokens: data.usage.total_tokens,\n }\n : undefined,\n };\n }\n\n /**\n * Call Anthropic Messages API.\n */\n private async callAnthropic(\n config: ModelProviderConfig,\n modelId: string,\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options: FallbackLlmOptions,\n ): Promise<{ content: string; usage?: FallbackLlmResponse[\"usage\"] } | null> {\n const base = config.baseUrl.replace(/\\/$/, \"\");\n const url = base.endsWith(\"/v1\")\n ? `${base}/messages`\n : `${base}/v1/messages`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"anthropic-version\": \"2023-06-01\",\n ...config.headers,\n };\n\n // Handle auth - Anthropic uses x-api-key header (apiKey resolved by tryModel)\n if (config.apiKey && typeof config.apiKey === \"string\") {\n headers[\"x-api-key\"] = config.apiKey;\n }\n\n // Extract system message (Anthropic handles it separately)\n const systemMessage = messages.find((m) => m.role === \"system\")?.content;\n const nonSystemMessages = messages.filter((m) => m.role !== \"system\");\n\n // Convert messages to Anthropic format\n const anthropicMessages = nonSystemMessages.map((m) => ({\n role: m.role,\n content: m.content,\n }));\n\n const body: Record<string, unknown> = {\n model: modelId,\n messages: anthropicMessages,\n max_tokens: options.maxTokens ?? 4096,\n temperature: options.temperature ?? 0.3,\n };\n\n if (systemMessage) {\n body.system = systemMessage;\n }\n\n const response = await fetch(url, {\n method: \"POST\",\n headers,\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Anthropic API error: ${response.status} ${error}`);\n }\n\n const data = (await response.json()) as {\n content: Array<{\n type: string;\n text: string;\n }>;\n usage?: {\n input_tokens?: number;\n output_tokens?: number;\n };\n };\n\n const content = data.content?.[0]?.text;\n if (!content) {\n throw new Error(\"Empty response from Anthropic API\");\n }\n\n return {\n content,\n usage: data.usage\n ? {\n inputTokens: data.usage.input_tokens,\n outputTokens: data.usage.output_tokens,\n totalTokens: (data.usage.input_tokens ?? 0) + (data.usage.output_tokens ?? 0),\n }\n : undefined,\n };\n }\n}\n\nfunction extractResponsesOutputText(data: {\n output_text?: string;\n output?: Array<{\n type?: string;\n text?: string;\n content?: Array<{\n type?: string;\n text?: string;\n }>;\n }>;\n}): string | null {\n if (typeof data.output_text === \"string\" && data.output_text.trim().length > 0) {\n return data.output_text;\n }\n\n const chunks: string[] = [];\n for (const item of data.output ?? []) {\n if (typeof item.text === \"string\" && item.text.trim().length > 0) {\n chunks.push(item.text);\n }\n for (const part of item.content ?? []) {\n if (\n (part.type === \"output_text\" || part.type === \"text\") &&\n typeof part.text === \"string\" &&\n part.text.trim().length > 0\n ) {\n chunks.push(part.text);\n }\n }\n }\n\n const joined = chunks.join(\"\\n\").trim();\n return joined.length > 0 ? joined : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,IAAM,mBAAsD;AAAA,EAC1D,gBAAgB,CAAC,OAAO;AAAA,EACxB,OAAO,CAAC,cAAc;AAAA,EACtB,cAAc,CAAC,WAAW;AAC5B;AAEA,IAAM,sBAAsB,oBAAI,IAAI,CAAC,gBAAgB,YAAY,CAAC;AAElE,IAAM,8BAAmE;AAAA,EACvE,WAAW;AAAA,IACT,SAAS;AAAA,IACT,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ,CAAC;AAAA,EACX;AACF;AAOO,IAAM,oBAAN,MAAwB;AAAA,EACrB;AAAA,EACA;AAAA,EAER,YACE,eACA,iBAA4C,CAAC,GAC7C;AACA,SAAK,gBAAgB;AACrB,SAAK,iBAAiB;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY,SAA2B;AACrC,UAAM,SAAS,KAAK,cAAc,OAAO;AACzC,WAAO,OAAO,SAAS;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,eACJ,UACA,UAA8B,CAAC,GACM;AACrC,UAAM,SAAS,KAAK,cAAc,QAAQ,OAAO;AACjD,QAAI,OAAO,WAAW,GAAG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AAW,QAAQ,KAAK,UAAU,CAAC,GAAG;AACpC,QAAI,OAAO,KAAK,SAAS,YAAY,KAAK,KAAK,KAAK,EAAE,SAAS,GAAG;AAChE,aAAO,KAAK,KAAK,IAAI;AAAA,IACvB;AACA,eAAW,QAAQ,KAAK,WAAW,CAAC,GAAG;AACrC,WACG,KAAK,SAAS,iBAAiB,KAAK,SAAS,WAC9C,OAAO,KAAK,SAAS,YACrB,KAAK,KAAK,KAAK,EAAE,SAAS,GAC1B;AACA,eAAO,KAAK,KAAK,IAAI;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAS,OAAO,KAAK,IAAI,EAAE,KAAK;AACtC,SAAO,OAAO,SAAS,IAAI,SAAS;AACtC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/openai-chat-compat.ts"],"sourcesContent":["function normalizedModel(model: string): string {\n return model.trim().toLowerCase();\n}\n\nfunction matchesModelFamily(normalized: string, familyPattern: RegExp): boolean {\n return familyPattern.test(normalized);\n}\n\nexport function shouldAssumeOpenAiChatCompletions(baseUrl?: string): boolean {\n if (!baseUrl) return true;\n try {\n return new URL(baseUrl).hostname.toLowerCase() === \"api.openai.com\";\n } catch {\n return false;\n }\n}\n\nexport function usesMaxCompletionTokens(model: string, options?: { assumeOpenAI?: boolean }): boolean {\n const normalized = normalizedModel(model);\n if (options?.assumeOpenAI !== true) return false;\n if (matchesModelFamily(normalized, /^gpt-5(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^gpt-4o(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^gpt-4\\.1(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^o1(?:$|[-.])/)) return true;\n if (matchesModelFamily(normalized, /^o3(?:$|[-.])/)) return true;\n return matchesModelFamily(normalized, /^o4-mini(?:$|[-.])/);\n}\n\nexport function buildChatCompletionTokenLimit(\n model: string,\n maxTokens: number,\n options?: { assumeOpenAI?: boolean },\n): { max_tokens: number } | { max_completion_tokens: number } {\n const safeMaxTokens = Math.max(0, Math.floor(maxTokens));\n if (usesMaxCompletionTokens(model, options)) {\n return { max_completion_tokens: safeMaxTokens };\n }\n return { max_tokens: safeMaxTokens };\n}\n"],"mappings":";AAAA,SAAS,gBAAgB,OAAuB;AAC9C,SAAO,MAAM,KAAK,EAAE,YAAY;AAClC;AAEA,SAAS,mBAAmB,YAAoB,eAAgC;AAC9E,SAAO,cAAc,KAAK,UAAU;AACtC;AAEO,SAAS,kCAAkC,SAA2B;AAC3E,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI;AACF,WAAO,IAAI,IAAI,OAAO,EAAE,SAAS,YAAY,MAAM;AAAA,EACrD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,wBAAwB,OAAe,SAA+C;AACpG,QAAM,aAAa,gBAAgB,KAAK;AACxC,MAAI,SAAS,iBAAiB,KAAM,QAAO;AAC3C,MAAI,mBAAmB,YAAY,kBAAkB,EAAG,QAAO;AAC/D,MAAI,mBAAmB,YAAY,mBAAmB,EAAG,QAAO;AAChE,MAAI,mBAAmB,YAAY,qBAAqB,EAAG,QAAO;AAClE,MAAI,mBAAmB,YAAY,eAAe,EAAG,QAAO;AAC5D,MAAI,mBAAmB,YAAY,eAAe,EAAG,QAAO;AAC5D,SAAO,mBAAmB,YAAY,oBAAoB;AAC5D;AAEO,SAAS,8BACd,OACA,WACA,SAC4D;AAC5D,QAAM,gBAAgB,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,CAAC;AACvD,MAAI,wBAAwB,OAAO,OAAO,GAAG;AAC3C,WAAO,EAAE,uBAAuB,cAAc;AAAA,EAChD;AACA,SAAO,EAAE,YAAY,cAAc;AACrC;","names":[]}
|
|
@@ -394,13 +394,13 @@ declare const CapsuleBlockSchema: z.ZodObject<{
|
|
|
394
394
|
peerProfiles: boolean;
|
|
395
395
|
}>;
|
|
396
396
|
}, "strip", z.ZodTypeAny, {
|
|
397
|
+
schemaVersion: string;
|
|
397
398
|
includes: {
|
|
398
399
|
procedural: boolean;
|
|
399
400
|
taxonomy: boolean;
|
|
400
401
|
identityAnchors: boolean;
|
|
401
402
|
peerProfiles: boolean;
|
|
402
403
|
};
|
|
403
|
-
schemaVersion: string;
|
|
404
404
|
id: string;
|
|
405
405
|
description: string;
|
|
406
406
|
version: string;
|
|
@@ -415,13 +415,13 @@ declare const CapsuleBlockSchema: z.ZodObject<{
|
|
|
415
415
|
directAnswerEnabled: boolean;
|
|
416
416
|
};
|
|
417
417
|
}, {
|
|
418
|
+
schemaVersion: string;
|
|
418
419
|
includes: {
|
|
419
420
|
procedural: boolean;
|
|
420
421
|
taxonomy: boolean;
|
|
421
422
|
identityAnchors: boolean;
|
|
422
423
|
peerProfiles: boolean;
|
|
423
424
|
};
|
|
424
|
-
schemaVersion: string;
|
|
425
425
|
id: string;
|
|
426
426
|
description: string;
|
|
427
427
|
version: string;
|
|
@@ -545,13 +545,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
545
545
|
peerProfiles: boolean;
|
|
546
546
|
}>;
|
|
547
547
|
}, "strip", z.ZodTypeAny, {
|
|
548
|
+
schemaVersion: string;
|
|
548
549
|
includes: {
|
|
549
550
|
procedural: boolean;
|
|
550
551
|
taxonomy: boolean;
|
|
551
552
|
identityAnchors: boolean;
|
|
552
553
|
peerProfiles: boolean;
|
|
553
554
|
};
|
|
554
|
-
schemaVersion: string;
|
|
555
555
|
id: string;
|
|
556
556
|
description: string;
|
|
557
557
|
version: string;
|
|
@@ -566,13 +566,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
566
566
|
directAnswerEnabled: boolean;
|
|
567
567
|
};
|
|
568
568
|
}, {
|
|
569
|
+
schemaVersion: string;
|
|
569
570
|
includes: {
|
|
570
571
|
procedural: boolean;
|
|
571
572
|
taxonomy: boolean;
|
|
572
573
|
identityAnchors: boolean;
|
|
573
574
|
peerProfiles: boolean;
|
|
574
575
|
};
|
|
575
|
-
schemaVersion: string;
|
|
576
576
|
id: string;
|
|
577
577
|
description: string;
|
|
578
578
|
version: string;
|
|
@@ -599,13 +599,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
599
599
|
pluginVersion: string;
|
|
600
600
|
includesTranscripts: boolean;
|
|
601
601
|
capsule: {
|
|
602
|
+
schemaVersion: string;
|
|
602
603
|
includes: {
|
|
603
604
|
procedural: boolean;
|
|
604
605
|
taxonomy: boolean;
|
|
605
606
|
identityAnchors: boolean;
|
|
606
607
|
peerProfiles: boolean;
|
|
607
608
|
};
|
|
608
|
-
schemaVersion: string;
|
|
609
609
|
id: string;
|
|
610
610
|
description: string;
|
|
611
611
|
version: string;
|
|
@@ -632,13 +632,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
632
632
|
pluginVersion: string;
|
|
633
633
|
includesTranscripts: boolean;
|
|
634
634
|
capsule: {
|
|
635
|
+
schemaVersion: string;
|
|
635
636
|
includes: {
|
|
636
637
|
procedural: boolean;
|
|
637
638
|
taxonomy: boolean;
|
|
638
639
|
identityAnchors: boolean;
|
|
639
640
|
peerProfiles: boolean;
|
|
640
641
|
};
|
|
641
|
-
schemaVersion: string;
|
|
642
642
|
id: string;
|
|
643
643
|
description: string;
|
|
644
644
|
version: string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|