@remnic/core 9.3.627 → 9.3.629
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 +9 -9
- package/dist/access-http.d.ts +5 -4
- package/dist/access-http.js +5 -4
- package/dist/access-mcp.d.ts +5 -4
- package/dist/access-mcp.js +4 -3
- package/dist/{access-service-C_sfOHsX.d.ts → access-service-BdThkfIE.d.ts} +2 -2
- package/dist/access-service.d.ts +5 -4
- package/dist/access-service.js +3 -2
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +5 -4
- package/dist/briefing.d.ts +33 -2
- package/dist/briefing.js +4 -1
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +2 -2
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +2 -2
- package/dist/{chunk-AZ4RI3QD.js → chunk-3GLCUPXP.js} +24 -6
- package/dist/chunk-3GLCUPXP.js.map +1 -0
- package/dist/{chunk-SHV5Y2WU.js → chunk-54KDA6UK.js} +3 -3
- package/dist/{chunk-KGIGRNR6.js → chunk-723OMPUI.js} +4 -4
- package/dist/{chunk-3VONWEQB.js → chunk-HZVIYZYN.js} +2 -2
- package/dist/{chunk-UELS6WWF.js → chunk-JKCDQBDW.js} +1 -1
- package/dist/{chunk-F3FY3D3S.js → chunk-JXHMAQYT.js} +8 -3
- package/dist/chunk-JXHMAQYT.js.map +1 -0
- package/dist/{chunk-Z3CCEP6F.js → chunk-K47C6M2C.js} +5 -5
- package/dist/{chunk-STDAAGH7.js → chunk-NKCW223V.js} +38 -2
- package/dist/chunk-NKCW223V.js.map +1 -0
- package/dist/{chunk-MON3LMO7.js → chunk-NRST7W5Q.js} +5 -5
- package/dist/{chunk-2RHI3FGV.js → chunk-OLNNOHBC.js} +4 -4
- package/dist/{chunk-Y3TMFC6I.js → chunk-XXO5TI3B.js} +3 -3
- package/dist/{cli-EZv6YE6_.d.ts → cli-DAsHklrf.d.ts} +3 -3
- package/dist/cli.d.ts +6 -5
- package/dist/cli.js +6 -5
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +1 -1
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +5 -4
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction-judge.js +3 -3
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +3 -3
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/fallback-llm.js +2 -2
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +5 -4
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/{orchestrator-CEycaY3M.d.ts → orchestrator-BexeSJ2j.d.ts} +12 -2
- package/dist/orchestrator.d.ts +4 -3
- package/dist/orchestrator.js +8 -7
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +2 -2
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/schemas.d.ts +24 -24
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-FbhPeJjB.d.ts → semantic-consolidation-PwkzNfdK.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +3 -3
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/types.d.ts +12 -12
- package/dist/{types-D5VRAI04.d.ts → types-BCF2wqKa.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/package.json +1 -1
- package/src/access-service.ts +7 -0
- package/src/briefing.ts +67 -1
- package/src/index.ts +2 -0
- package/src/orchestrator.ts +26 -0
- package/dist/chunk-AZ4RI3QD.js.map +0 -1
- package/dist/chunk-F3FY3D3S.js.map +0 -1
- package/dist/chunk-STDAAGH7.js.map +0 -1
- /package/dist/{chunk-SHV5Y2WU.js.map → chunk-54KDA6UK.js.map} +0 -0
- /package/dist/{chunk-KGIGRNR6.js.map → chunk-723OMPUI.js.map} +0 -0
- /package/dist/{chunk-3VONWEQB.js.map → chunk-HZVIYZYN.js.map} +0 -0
- /package/dist/{chunk-UELS6WWF.js.map → chunk-JKCDQBDW.js.map} +0 -0
- /package/dist/{chunk-Z3CCEP6F.js.map → chunk-K47C6M2C.js.map} +0 -0
- /package/dist/{chunk-MON3LMO7.js.map → chunk-NRST7W5Q.js.map} +0 -0
- /package/dist/{chunk-2RHI3FGV.js.map → chunk-OLNNOHBC.js.map} +0 -0
- /package/dist/{chunk-Y3TMFC6I.js.map → chunk-XXO5TI3B.js.map} +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './types-BliCnURB.js';
|
|
2
2
|
import './index-DJ9QWMw-.js';
|
|
3
|
-
export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a6 as AgentAccessAuthToken, b2 as AgentAccessHttpConfig, b3 as AgentDefaultsConfig, b4 as AgentPersona, f as AgentPersonaModelConfig, b5 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, b6 as BehaviorSignalDirection, B as BehaviorSignalEvent, b7 as BehaviorSignalType, aH as BootstrapOptions, aI as BootstrapResult,
|
|
3
|
+
export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a6 as AgentAccessAuthToken, b2 as AgentAccessHttpConfig, b3 as AgentDefaultsConfig, b4 as AgentPersona, f as AgentPersonaModelConfig, b5 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, b6 as BehaviorSignalDirection, B as BehaviorSignalEvent, b7 as BehaviorSignalType, aH as BootstrapOptions, aI as BootstrapResult, V as BriefingActiveThread, b8 as BriefingCalendarSourceError, aO as BriefingConfig, Q as BriefingFocus, O as BriefingFollowup, aP as BriefingOpenCommitment, X as BriefingRecentEntity, W as BriefingResult, N as BriefingSections, aQ as BriefingWindow, b9 as BufferEntryState, k as BufferState, o as BufferSurpriseEvent, Y as BufferTurn, U as CalendarEvent, S as CalendarSource, ba as CaptureMode, $ as Checkpoint, bb as CodexCliReasoningEffort, bc as CodexCompactionFlushMode, aR as CodexCompatConfig, bd as CodexConnectorConfig, aG as CodingContext, aL as CodingModeConfig, be as CompressionGuidelineActivationState, a8 as CompressionGuidelineOptimizerActionSummary, a7 as CompressionGuidelineOptimizerEventCounts, a9 as CompressionGuidelineOptimizerRuleUpdate, bf as CompressionGuidelineOptimizerSourceWindow, C as CompressionGuidelineOptimizerState, bg as ConfidenceTier, bh as ConsolidationAction, bi as ConsolidationItem, aJ as ConsolidationObservation, ag as ConsolidationResult, s as ContinuityImprovementLoop, r as ContinuityIncidentCloseInput, p as ContinuityIncidentOpenInput, q as ContinuityIncidentRecord, bj as ContinuityIncidentState, bk as ContinuityLoopCadence, u as ContinuityLoopReviewInput, bl as ContinuityLoopStatus, t as ContinuityLoopUpsertInput, bm as ContradictionScanConfig, as as ConversationThread, bn as CronConversationRecallMode, bo as CronRecallMode, aS as DEFAULT_RECALL_DISCLOSURE, ah as DaySummaryResult, bp as DreamingConfig, bq as DreamingNarrativePromptStyle, br as DreamsDeepSleepConfig, bs as DreamsLightSleepConfig, au as DreamsPhase, bt as DreamsPhaseStatus, bu as DreamsPhasesConfig, bv as DreamsRemConfig, av as DreamsRunResult, at as DreamsStatusResult, bw as EngramTraceEvent, w as EntityActivityEntry, x as EntityFile, ab as EntityMention, v as EntityRelationship, ac as EntitySchemaDefinition, ad as EntitySchemaSectionDefinition, E as EntityStructuredSection, aK as EntityTimelineEntry, aT as ExtractedFact, bx as ExtractedProcedureStep, by as ExtractedQuestion, bz as ExtractedReasoningTrace, bA as ExtractedReasoningTraceStep, bB as ExtractedRelationship, bC as ExtractionPassSource, af as ExtractionResult, F as FileHygieneConfig, G as GatewayConfig, bD as GitHubLiveConnectorConfig, bE as GmailLiveConnectorConfig, bF as GoogleDriveLiveConnectorConfig, bG as HeartbeatConfig, bH as HeartbeatDetectionMode, a0 as HourlySummary, J as IdentityInjectionMode, ae as ImportanceLevel, I as ImportanceScore, a2 as LifecycleState, L as LiveConnectorsConfig, bI as LlmTraceCallback, bJ as LlmTraceEvent, ak as MemoryActionEligibilityContext, aU as MemoryActionEligibilitySource, m as MemoryActionEvent, bK as MemoryActionOutcome, bL as MemoryActionPolicyDecision, al as MemoryActionPolicyResult, bM as MemoryActionStatus, aa as MemoryActionType, M as MemoryCategory, g as MemoryFile, i as MemoryFrontmatter, ai as MemoryIntent, n as MemoryLifecycleEvent, am as MemoryLifecycleEventType, an as MemoryLifecycleStateSummary, h as MemoryLink, bN as MemoryLinkType, aV as MemoryObservation, bO as MemoryOsPresetName, z as MemoryProjectionCurrentState, aW as MemoryScope, j as MemoryStatus, D as MemorySummary, l as MetaState, bP as ModelApi, bQ as ModelDefinitionConfig, bR as ModelProviderAuthMode, ao as ModelProviderConfig, bS as NamespacePolicy, ap as NativeKnowledgeConfig, bT as NativeKnowledgeFolderRuleConfig, bU as NativeKnowledgeObsidianVaultConfig, bV as NativeKnowledgeOpenClawWorkspaceConfig, bW as NotionLiveConnectorConfig, P as PluginConfig, a4 as PolicyClass, bX as PrincipalFromSessionKeyMode, bY as PrincipalRule, bZ as ProceduralConfig, aj as QmdSearchExplain, Z as QmdSearchResult, b_ as QuestionEntry, aX as RECALL_DISCLOSURE_LEVELS, b$ as ReasoningEffort, K as RecallDisclosure, c0 as RecallPipelineConfig, H as RecallPlanMode, c1 as RecallSectionConfig, R as RecallTierExplain, c2 as RecallTraceEvent, c3 as RelevanceFeedback, aq as RetrievalTier, c4 as SPECULATIVE_TTL_DAYS, c5 as ScoredEntity, a5 as SecretRef, c6 as SemanticChunkingConfigShape, a1 as SessionObserverBandConfig, c7 as SignalLevel, ar as SignalScanResult, c8 as SlotBehaviorConfig, c9 as SlotMismatchMode, T as TopicScore, _ as TranscriptEntry, ca as TriggerMode, a3 as VerificationState, cb as confidenceTier, b1 as isRecallDisclosure } from './types-BCF2wqKa.js';
|
package/package.json
CHANGED
package/src/access-service.ts
CHANGED
|
@@ -1814,6 +1814,13 @@ export class EngramAccessService {
|
|
|
1814
1814
|
openaiApiKey: config.openaiApiKey,
|
|
1815
1815
|
openaiBaseUrl: config.openaiBaseUrl,
|
|
1816
1816
|
model: config.model,
|
|
1817
|
+
// Without a direct OpenAI key, route follow-ups through the configured
|
|
1818
|
+
// LLM chain (gateway model source or local LLM) — same fallback every
|
|
1819
|
+
// other LLM feature uses. A configured key keeps its precedence so
|
|
1820
|
+
// existing deployments are unchanged.
|
|
1821
|
+
followupGenerator: config.openaiApiKey
|
|
1822
|
+
? undefined
|
|
1823
|
+
: this.orchestrator.briefingChainFollowupGenerator,
|
|
1817
1824
|
});
|
|
1818
1825
|
|
|
1819
1826
|
return {
|
package/src/briefing.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { readFile } from "node:fs/promises";
|
|
|
19
19
|
import os from "node:os";
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { log } from "./logger.js";
|
|
22
|
+
import { extractJsonCandidates } from "./json-extract.js";
|
|
22
23
|
import { normalizeEntityName, StorageManager } from "./storage.js";
|
|
23
24
|
import { readEnvVar, resolveHomeDir } from "./runtime/env.js";
|
|
24
25
|
import type {
|
|
@@ -865,7 +866,8 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
865
866
|
if (maxFollowups === 0 || options.allowLlm === false) {
|
|
866
867
|
followupsUnavailableReason = "LLM follow-ups disabled by configuration";
|
|
867
868
|
} else if (!options.openaiApiKey && !options.followupGenerator) {
|
|
868
|
-
followupsUnavailableReason =
|
|
869
|
+
followupsUnavailableReason =
|
|
870
|
+
'no LLM configured for follow-ups (set OPENAI_API_KEY, enable a local LLM, or use modelSource "gateway")';
|
|
869
871
|
} else {
|
|
870
872
|
try {
|
|
871
873
|
const generator = options.followupGenerator ?? buildOpenAiFollowupGenerator({
|
|
@@ -1200,6 +1202,70 @@ function buildOpenAiFollowupGenerator(cfg: {
|
|
|
1200
1202
|
};
|
|
1201
1203
|
}
|
|
1202
1204
|
|
|
1205
|
+
/**
|
|
1206
|
+
* Minimal chat-completion surface shared by `FallbackLlmClient` (gateway
|
|
1207
|
+
* model chain) and `LocalLlmClient` (Ollama / OpenAI-compatible local
|
|
1208
|
+
* endpoints). Matches `Orchestrator.fastLlmForRerank` so briefing
|
|
1209
|
+
* follow-ups can ride the same routing as other fast-tier operations.
|
|
1210
|
+
*/
|
|
1211
|
+
export interface BriefingChainLlmClient {
|
|
1212
|
+
chatCompletion(
|
|
1213
|
+
messages: Array<{ role: "system" | "user" | "assistant"; content: string }>,
|
|
1214
|
+
options?: {
|
|
1215
|
+
temperature?: number;
|
|
1216
|
+
maxTokens?: number;
|
|
1217
|
+
timeoutMs?: number;
|
|
1218
|
+
operation?: string;
|
|
1219
|
+
priority?: "background" | "recall-critical";
|
|
1220
|
+
},
|
|
1221
|
+
): Promise<{ content: string } | null>;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Build a follow-up generator backed by the configured LLM chain
|
|
1226
|
+
* (gateway model source or local LLM) instead of a direct OpenAI key.
|
|
1227
|
+
*
|
|
1228
|
+
* Local models frequently wrap JSON in code fences or prose, so the
|
|
1229
|
+
* response is run through `extractJsonCandidates` and the first candidate
|
|
1230
|
+
* that parses into a valid `{ followups: [...] }` shape wins. Throws when
|
|
1231
|
+
* the chain returns nothing or no candidate parses — `buildBriefing`
|
|
1232
|
+
* catches and surfaces the message via `followupsUnavailableReason`.
|
|
1233
|
+
*/
|
|
1234
|
+
export function buildChainFollowupGenerator(
|
|
1235
|
+
client: BriefingChainLlmClient,
|
|
1236
|
+
): BriefingFollowupGenerator {
|
|
1237
|
+
return async ({ sections, windowLabel, maxFollowups }) => {
|
|
1238
|
+
const prompt = buildFollowupPrompt(sections, windowLabel, maxFollowups);
|
|
1239
|
+
const response = await client.chatCompletion(
|
|
1240
|
+
[
|
|
1241
|
+
{ role: "system", content: FOLLOWUP_INSTRUCTIONS },
|
|
1242
|
+
{ role: "user", content: prompt },
|
|
1243
|
+
],
|
|
1244
|
+
{
|
|
1245
|
+
temperature: 0.2,
|
|
1246
|
+
maxTokens: 512,
|
|
1247
|
+
operation: "briefing-followups",
|
|
1248
|
+
priority: "background",
|
|
1249
|
+
},
|
|
1250
|
+
);
|
|
1251
|
+
if (!response?.content) {
|
|
1252
|
+
throw new Error("LLM chain returned no response");
|
|
1253
|
+
}
|
|
1254
|
+
const candidates = extractJsonCandidates(response.content);
|
|
1255
|
+
let lastError: unknown;
|
|
1256
|
+
for (const candidate of candidates) {
|
|
1257
|
+
try {
|
|
1258
|
+
return parseFollowupResponse(candidate, maxFollowups);
|
|
1259
|
+
} catch (err) {
|
|
1260
|
+
lastError = err;
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
throw new Error(
|
|
1264
|
+
`LLM chain response contained no valid followups JSON: ${stringifyError(lastError ?? "no JSON candidates found")}`,
|
|
1265
|
+
);
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1203
1269
|
const FOLLOWUP_INSTRUCTIONS = `You suggest short follow-up prompts for a daily context briefing.
|
|
1204
1270
|
Return strict JSON of the form { "followups": [{ "text": "...", "rationale": "..." }] }.
|
|
1205
1271
|
Rules:
|
package/src/index.ts
CHANGED
package/src/orchestrator.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { log } from "./logger.js";
|
|
2
|
+
import {
|
|
3
|
+
buildChainFollowupGenerator,
|
|
4
|
+
type BriefingFollowupGenerator,
|
|
5
|
+
} from "./briefing.js";
|
|
2
6
|
import path from "node:path";
|
|
3
7
|
import os from "node:os";
|
|
4
8
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -2516,6 +2520,28 @@ export class Orchestrator {
|
|
|
2516
2520
|
};
|
|
2517
2521
|
}
|
|
2518
2522
|
|
|
2523
|
+
/**
|
|
2524
|
+
* Build a briefing follow-up generator backed by the configured LLM chain
|
|
2525
|
+
* (gateway model source or local LLM). Returns `undefined` when no chain
|
|
2526
|
+
* is available so `buildBriefing` can surface a clear unavailable reason
|
|
2527
|
+
* instead of failing at call time. Used by the access service and CLI as
|
|
2528
|
+
* the fallback when no direct `openaiApiKey` is configured, so briefing
|
|
2529
|
+
* follow-ups ride the same routing as every other fast-tier LLM feature.
|
|
2530
|
+
*/
|
|
2531
|
+
get briefingChainFollowupGenerator(): BriefingFollowupGenerator | undefined {
|
|
2532
|
+
// Plugin mode gates on `localLlmEnabled` alone: `LocalLlmClient.chatCompletion`
|
|
2533
|
+
// returns null when the master switch is off, so `localLlmFastEnabled` by
|
|
2534
|
+
// itself cannot serve requests (Cursor review on PR #1463).
|
|
2535
|
+
const chainAvailable =
|
|
2536
|
+
this.config.modelSource === "gateway"
|
|
2537
|
+
? this._fastGatewayLlm?.isAvailable(
|
|
2538
|
+
this.config.fastGatewayAgentId || this.config.gatewayAgentId || undefined,
|
|
2539
|
+
) === true
|
|
2540
|
+
: this.config.localLlmEnabled;
|
|
2541
|
+
if (!chainAvailable) return undefined;
|
|
2542
|
+
return buildChainFollowupGenerator(this.fastLlmForRerank);
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2519
2545
|
async initialize(): Promise<void> {
|
|
2520
2546
|
// Recreate the deferred-ready gate on every initialize() call.
|
|
2521
2547
|
// The same Orchestrator instance may be reused across stop/start cycles
|