@robota-sdk/agent-framework 3.0.0-beta.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2924 -0
- package/LICENSE +661 -0
- package/README.md +482 -0
- package/dist/node/createInteractiveRuntime-20Gv8UI1.d.cts +10425 -0
- package/dist/node/createInteractiveRuntime-20Gv8UI1.d.cts.map +1 -0
- package/dist/node/createInteractiveRuntime-vsCT07qt.d.ts +10425 -0
- package/dist/node/createInteractiveRuntime-vsCT07qt.d.ts.map +1 -0
- package/dist/node/index.cjs +31 -0
- package/dist/node/index.d.cts +2192 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.d.ts +2192 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +32 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/interactive-CyPYYFZe.cjs +130 -0
- package/dist/node/interactive-JZVRVsIt.js +131 -0
- package/dist/node/interactive-JZVRVsIt.js.map +1 -0
- package/dist/node/testing/index.cjs +2 -0
- package/dist/node/testing/index.d.cts +240 -0
- package/dist/node/testing/index.d.cts.map +1 -0
- package/dist/node/testing/index.d.ts +240 -0
- package/dist/node/testing/index.d.ts.map +1 -0
- package/dist/node/testing/index.js +3 -0
- package/dist/node/testing/index.js.map +1 -0
- package/package.json +144 -0
|
@@ -0,0 +1,2192 @@
|
|
|
1
|
+
import { $ as PluginCommandSource, $a as TCommandModuleSessionRequirement, $c as TWorkspaceProjectSettingsWriteDecision, $i as TSettingsData, $l as IEditCheckpointFileRecord, $n as inspectCommandEditCheckpoint, $o as GoalController, $r as formatCommandPermissionsMessage, $s as IHandoffProgress, $t as evaluateReversibleToolSafety, A as resolvePromptFileReferencePaths, Aa as removeCommandContextReference, Ac as WorkspaceProjectSessionStore, Ai as IModelListSelection, Al as IExecutionWorkspaceTaskSpawner, An as createSkillCommand, Ao as ISemanticMemoryAdapter, Ar as TAppearanceSettingsPatch, As as ICommandExternalEventsAdapter, At as ICreateSessionOptions, B as TPermissionResultValue$1, Ba as IProviderProfileSettings, Bc as IWorkspaceProjectMutation, Bi as mergeSettings, Bl as EXECUTION_ORIGIN_METADATA_KEYS, Bn as MEMORY_COMMAND_ARGUMENT_HINT, Bo as IAppendMemoryResult, Br as readStatusLineSettings, Bs as ICommandMCPSourceProblem, Bt as ISubagentPromptOptions, C as TExternalEventSettlement, Ca as addCommandContextReference, Cc as isSafeSessionId, Ci as formatCommandBackgroundTaskList, Cl as IAgentJobMonitors, Cn as listFrameworkProjectContributionPaths, Co as IMemoryBudget, Cr as RELOAD_PLUGINS_COMMAND_DESCRIPTION, Cs as TPromptFileReferenceDiagnosticCode, Ct as storeAgentToolDeps, Cu as TFrontmatterDecodeResult, D as sandboxApprovalFor, Da as readAutoCompactThreshold, Dc as resolveLatestSessionId, Di as HELP_COMMAND_DESCRIPTION, Dl as IBackgroundTaskRunner, Dn as ISkillSourceSkip, Do as IMemoryTopicMutationResult, Dr as APPEARANCE_SETTINGS_KEYS, Ds as ICommandCostBudgetAdapter, Dt as preprocessShellCommands, E as resolveSubagentLogDir, Ea as listCommandContextReferences, Ec as listUnreadableSessionsForWorkspace, Ei as readCommandBackgroundTaskLog, El as MonitorCommandRefusedError, En as ISkillSourceInspection, Eo as IMemoryStore, Er as resolvePluginCommandAdapter, Es as ICommandCostBudget, Et as TShellExecFn, F as formatPromptFileReferenceDiagnostics, Fa as IProviderCommandSettingsAdapter, Fc as IWorkspaceAncestorTextEntry, Fi as createProviderFromSettings, Fl as createMainThreadDetailPage, Fn as IResolvedConfig, Fo as IMemoryPendingRecord, Fr as STATUSLINE_COMMAND_ARGUMENT_HINT, Fs as ICommandMCPOAuthLoginRequest, Ft as TSubagentRunnerFactory, G as createSkillExecutionPort, Ga as buildProviderProfile, Gc as IWorkspaceTrustGrant, Gi as IProviderSwitchOptions, Gl as parseExecutionWorkspaceEntryId, Gn as hasSensitiveCommandMemoryContent, Go as ProjectMemoryStore, Gr as PERMISSIONS_COMMAND_DESCRIPTION, Gs as ICommandPickerAdapter, Gt as IReversibleExecutionOptions, H as IRemoteCommandPolicy, Ha as IProviderSetupInput, Hc as IWorkspaceProjectSettingsWriter, Hi as resolveActiveProvider, Hl as createBackgroundTaskExecutionEntryId, Hn as MEMORY_COMMAND_USAGE, Ho as IStartupMemory, Hr as applyPresetToSession, Hs as ICommandOutputStyleSummary, Ht as assembleSubagentPrompt, I as hasBlockingPromptFileReferenceDiagnostics, Ia as IProviderConnectionHost, Ic as IWorkspaceDirectoryEntry, Ii as readMergedProviderSettings, Il as IResolveExecutionAttachInput, In as TEnvResolvedSettings, Io as IMemoryRetrievalResult, Ir as STATUSLINE_COMMAND_DESCRIPTION, Is as ICommandMCPOAuthLoginResult, It as createInProcessSubagentRunner, J as ISkillExecutionResult, Ja as mergeProviderPatch, Jc as TWorkspaceContributionKind, Ji as applyProviderSwitch, Jl as summarizeBackgroundJobGroup, Jn as recordCommandMemoryEvent, Jo as buildGoalStartPrompt, Jr as PERMISSION_MODE_LABELS, Js as ICommandSandboxAdapter, Jt as IReversibleToolSafetyReport, K as IForkExecutionOptions, Ka as buildProviderSetupPatch, Kc as IWorkspaceTrustStore, Ki as applyActiveModelChange, Kl as BackgroundJobOrchestrator, Kn as isCommandMemoryType, Ko as isMemoryType, Kr as PERMISSION_MODE_ARGUMENT_HINT, Ks as ICommandProcessAdapter, Kt as IReversibleToolSafetyContext, L as toPromptFileReferenceRecords, La as IProviderConnectionRequest, Lc as IWorkspaceIdentity, Li as readProviderSettings, Ll as TExecutionAttachOutcome, Ln as TSandboxSettings, Lo as TMemoryCandidateStatus, Lr as applyStatusLineSettings, Ls as ICommandMCPOAuthLogoutResult, Lt as ISubagentOptions, M as parsePromptFileReferences, Ma as setCommandAutoCompactThreshold, Mc as WorkspaceSessionLogSource, Mi as resolveModelListSelection, Ml as ISpawnProcessTaskRequest, Mn as IContributionSource, Mo as IAutomaticMemoryConfig, Mr as isAppearanceSettingsPatch, Ms as ICommandHostAdapters, Mt as IToolCallHandoffPolicy, N as buildPromptWithFileReferences, Na as writeAutoCompactThresholdSetting, Nc as IRestrictedWorkspaceProjectAccess, Ni as IReadProviderSettingsOptions, Nl as createExecutionWorkspaceTaskSpawner, Nn as createWorkspaceProjectContributionSource, No as IMemoryCandidate, Nr as readAppearanceSettings, Ns as ICommandMCPActivationAdapter, Nt as IToolCallHandoffProvenance, O as IHookDefinitionSource, Oa as readAutoCompactThresholdSource, Oc as resolveReusableEmptySessionId, Oi as formatCommandHelpMessage, Ol as IBackgroundTaskSpawnerGroupRequest, On as SkillCommandSource, Oo as IMemoryWriter, Or as DEFAULT_APPEARANCE_SETTINGS, Os as ICommandEffortAdapter, Ot as substituteVariables, P as createPromptFileReferenceHistoryEntry, Pa as IProviderCommandModuleOptions, Pc as ITrustedWorkspaceProjectAccess, Pi as ProviderConfigError, Pl as createLineDetailPage, Pn as ILoadContextOptions, Po as IMemoryExtractionInput, Pr as DEFAULT_STATUS_LINE_COMMAND_SETTINGS, Ps as ICommandMCPActivationSummary, Pt as IInProcessSubagentRunnerDeps, Q as SystemCommandExecutor, Qa as ICommandModule, Qc as TWorkspaceProjectSettingsTarget, Qi as ISettingsDocumentStore, Ql as IEditCheckpointFileInspection, Qn as forkCommandEditCheckpoint, Qo as DEFAULT_GOAL_NO_PROGRESS_LIMIT, Qr as buildPermissionModeSubcommands, Qs as ICommandWorkspaceAdapter, Qt as TReversibleSideEffect, R as IExecutionResult$1, Ra as TProviderConnectionStage, Rc as IWorkspaceIdentityResolver, Ri as resolveEnvDefaultProvider, Rl as resolveExecutionAttach, Rn as TSettings, Ro as TMemoryPolicyMode, Rr as buildStatusLineCommandSubcommands, Rs as ICommandMCPOAuthRedirectPrompt, Rt as ISubagentParentContext, S as TExternalEventReceipt, Sa as TAutoCompactThreshold, Sc as createUserSessionStore, Si as formatCommandBackgroundTask, Sl as IAgentJobLogs, Sn as IProjectContributionPath, So as IDurableMemoryReader, Sr as PLUGIN_COMMAND_DESCRIPTION, Ss as IResolvedPromptFileReferences, St as retrieveAgentToolDeps, Su as IFrontmatterDecodeInput, T as createSubagentLogger, Ta as compactCommandContext, Tc as listUnreadableSessions, Ti as parseCommandBackgroundLogCursor, Tl as MONITOR_SHELL_TOOL, Tn as ISkillRootInspection, To as IMemoryRecaller, Tr as createShowPluginManagerIntent, Ts as EditCheckpointStore, Tt as ISkillPromptContext, U as createDefaultRemoteCommandPolicy, Ua as IProviderSetupPatch, Uc as IWorkspaceProjectStateStorage, Ui as IActiveModelChangeOptions, Ul as createExecutionOriginMetadata, Un as buildMemoryCommandSubcommands, Uo as MEMORY_INDEX_MAX_BYTES, Ur as IPermissionRuleGroup, Us as ICommandPermissionModeAdapter, Ut as getForkWorkerSuffix, V as IPromptHistoryOptions, Va as IProviderSettingsBuildOptions, Vc as IWorkspaceProjectReader, Vi as readMergedProviderSettingsFromSources, Vl as createBackgroundGroupExecutionEntryId, Vn as MEMORY_COMMAND_DESCRIPTION, Vo as IProjectMemorySummary, Vr as IPresetApplicationResult, Vs as ICommandOutputStyleRegistryAdapter, Vt as TSubagentSuffix, W as ISkillActivationHistoryData, Wa as TProviderSettingsDocument, Wc as IWorkspaceTrustCause, Wi as IActiveModelChangeResult, Wl as createMainThreadExecutionEntryId, Wn as createCommandMemoryStores, Wo as MEMORY_INDEX_MAX_LINES, Wr as IPermissionsCommandState, Ws as ICommandPermissionRulesAdapter, Wt as getSubagentSuffix, X as findUnknownModuleNames, Xa as upsertProviderProfile, Xc as TWorkspaceProjectAuthorityCandidate, Xi as createWorkspaceProjectSettingsStore, Xl as ICommandResult$1, Xn as REWIND_COMMAND_DESCRIPTION, Xo as createGoalStatusTool, Xr as TPermissionRuleKind, Xs as ICommandSettingsAdapter, Xt as TReversibleRollbackLayer, Y as executeSkill, Ya as setCurrentProvider, Yc as TWorkspaceProjectAccess, Yi as resolveProviderSettingsWriteTarget, Yl as ISessionUsageRecord, Yn as REWIND_COMMAND_ARGUMENT_HINT, Yo as GOAL_SIGNAL_TOOL_NAME, Yr as RUNTIME_RULE_SOURCE, Ys as ICommandSandboxStatus, Yt as TReversibleExecutionIsolation, Z as selectCommandModules, Za as validateProviderProfile, Zc as TWorkspaceProjectMutationDecision, Zi as createNodeHostSettingsStore, Zl as IOrgPolicy, Zn as buildRewindCommandSubcommands, Zo as DEFAULT_GOAL_MAX_ITERATIONS, Zr as VALID_PERMISSION_MODES, Zs as ICommandSettingsDocument, Zt as TReversibleSafetyStatus, _ as TInteractiveSessionOptions, _a as probeProviderProfile, _c as IInteractiveSessionStore$1, _i as BACKGROUND_COMMAND_DESCRIPTION, _l as TAutoCompactThresholdSource, _n as IBundleSkill, _o as ICommandHostSessionAccess, _r as formatCommandSessionReplayValidationReport, _s as IPromptFileReferenceHistoryData, _t as TMarketplaceSource, _u as TEffortSelection, a as SessionRenameUnavailableError, aa as IProjectSettingsPath, ac as TRemoteControlStatus, ai as readCommandPermissionMode, al as ICommandSessionHistory, an as AgentExecutor, ao as ICommandHostAdapterAccess, ar as CLEAR_COMMAND_DESCRIPTION, as as IContextReferenceAddResult, at as IHostBundlePluginLoaderOptions, au as IEditCheckpointSummary, b as IExternalEventSource, ba as DEFAULT_AUTO_COMPACT_THRESHOLD, bc as createProjectSessionStore, bi as cancelCommandBackgroundTask, bl as IAgentJobGroups, bn as TEnabledPlugins, bo as ICommandHostUserInteraction, br as validateCommandSessionReplayLog, bs as IPromptFileReferenceToken, bt as CommandRegistry, bu as resolveModelEffort, c as TRestoredScheduleDisposition, ca as TSettingsSource, cc as IAdvisorSetResult, ci as retryCommandPermissionDenial, cl as ICommandSessionPermissions, cn as TSessionFactory, co as ICommandHostCatalog, cr as ICommandSessionInfo, cs as IContextReferenceRemoveResult, ct as loadHostBundlePluginsFromScopes, cu as ICapabilityDescriptor, d as generateSessionName, da as INodeHostSettingsSource, dc as ICommandAdvisorAdapter, di as LANGUAGE_COMMAND_DESCRIPTION, dl as ICommandHostNoCapability, dn as IBundlePluginHookIssue, do as ICommandHostContextReferences, dr as RESUME_COMMAND_DESCRIPTION, ds as createContextReferenceItem, dt as NodeHostPluginSettingsStore, du as IAgentDefinition, ea as TSettingsScope, ec as IHandoffStaysBehind, ei as formatInvalidPermissionModeMessage, el as TWorkspaceProjectStateDirectories, en as wrapReversibleExecutionTools, eo as DuplicateSystemCommandSemanticRoleError, er as listCommandEditCheckpointBranches, es as IGoalSignal, et as BundlePluginInstaller, eu as IEditCheckpointInspection, f as IInteractiveSessionShutdownOptions, fa as createNodeHostSettingsSource, fc as formatAdvisorSpec, fi as RECOMMENDED_RESPONSE_LANGUAGES, fl as ICommandProductVocabulary, fn as IBundlePluginInspection, fo as ICommandHostContextWindow, fr as VALIDATE_SESSION_COMMAND_DESCRIPTION, fs as listActiveContextReferences, ft as IKnownMarketplaceEntry, fu as IProviderErrorGuidance, g as restoreSessionRecordIntoSession, ga as checkSettingsDocument, gc as IInteractiveSessionRecord$1, gi as parseLanguageArgument, gl as IUnknownCommandModuleName, gn as IBundlePluginSkip, go as ICommandHostPresetApplication, gr as createShowSessionPickerIntent, gs as IPromptFileReferenceDiagnostic, gt as TKnownMarketplacesRegistry, gu as TEffortDisposition, h as ISessionRecordRestoreResult, ha as checkNodeHostSettingsFile, hc as IHostToolResultSpillStore, hi as formatLanguageUsageMessage, hl as IModelReapplyOptions, hn as IBundlePluginMcpServer, ho as ICommandHostPlan, hr as createSessionRenameHostAction, hs as upsertContextReference, ht as IMarketplacePluginEntry, hu as IModelEffortResolution, i as IInteractiveRuntime, ia as writeSettings, ic as IWorkspaceMoveRequest, ii as parsePermissionModeArgument, il as ICommandSessionContextWindow, in as TProviderFactory, io as TSystemCommandSemanticRole, ir as switchCommandEditCheckpointBranch, is as isGoalCancelVerb, it as MarketplaceClient, iu as IEditCheckpointRestoreResult, j as resolvePromptFileReferences, ja as resetAutoCompactThresholdSetting, jc as WorkspaceSessionLogSink, ji as buildModelListSnapshot, jl as ISpawnAgentTaskRequest, jn as inspectSkillSources, jo as ISemanticMemoryQueryResult, jr as applyAppearanceSettings, js as ICommandHandoffAdapter, jt as TSessionResponseFormat, k as TSettingsMergeRule, ka as readCommandContextState, kc as resolveSessionIdByIdOrName, ki as buildProviderProfilesSnapshot, kl as ICreateExecutionWorkspaceTaskSpawnerOptions, kn as TSkillSkipReason, ko as IPerTurnRecallConfig, kr as IAppearanceSettings, ks as ICommandExternalEventGrant, kt as ILivePromptTracePort, l as restoredScheduleDisposition, la as createWorkspaceProjectSettingsSources, lc as IAdvisorSpec, li as writeCommandPermissionMode, ll as ICommandSessionPreset, ln as describeBundleContribution, lo as ICommandHostCheckpoints, lr as RENAME_COMMAND_DESCRIPTION, ls as IContextReferenceUpsertResult, lt as BundlePluginLoader, lu as DEFAULT_AGENT_DEFINED_IN, ma as TSettingsCheck, mc as resolveStartupAdvisorSpec, mi as buildLanguageCommandSubcommands, ml as ICommandSkillListEntry, mn as IBundlePluginMcpFault, mo as ICommandHostMemory, mr as createSessionExitHostAction, ms as toContextReferenceRecords, mt as IMarketplaceManifest, mu as IModelEffortInputs, na as readSettings, nc as IPermissionRuleLayer, ni as isPermissionMode, nl as TWorkspaceTrustState, nn as IPromptProvider, no as ISystemCommandSemanticRoles, nr as restoreCommandEditCheckpoint, ns as TGoalDecision, nt as IInstalledPluginRecord, nu as IEditCheckpointManifest, o as persistSessionRename, oa as IWorkspaceProjectSettingsSource, oc as TSandboxCommandMode, oi as readCommandPermissionsState, ol as ICommandSessionIdentity, on as IAgentExecutorOptions, oo as ICommandHostAgentJobs, or as COST_COMMAND_DESCRIPTION, os as IContextReferenceClearResult, ot as createHostBundlePluginLoader, ou as IEditCheckpointTurnInput, p as InteractiveSession, pa as THostSettingsScope, pc as parseAdvisorSpec, pi as TRecommendedResponseLanguage, pl as ICommandSessionReplayValidationReport, pn as IBundlePluginManifest, po as ICommandHostGoal, pr as clearConversationHistory, ps as removeContextReference, pt as IMarketplaceClientOptions, pu as EFFORT_LEVEL_LABELS, q as ISkillExecutionCallbacks, qa as deleteProviderProfile, qc as IWorkspaceTrustStoreSnapshot, qi as applyProviderConfiguration, ql as IBackgroundJobOrchestratorOptions, qn as listCommandUsedMemoryReferences, qo as buildGoalContinuationPrompt, qr as PERMISSION_MODE_COMMAND_DESCRIPTION, qs as ICommandRemoteControlAdapter, qt as IReversibleToolSafetyInput, r as createInteractiveRuntime, ra as updateModelInSettings, rc as IPermissionRuleRemoval, ri as listCommandSessionAllowedTools, rl as IOutputStylePrompt, rn as PromptExecutor, ro as TSystemCommandLifecycle, rr as rollbackCommandEditCheckpoint, rs as extractGoalSignal, rt as TInstalledPluginsRegistry, ru as IEditCheckpointRecorder, s as PeerMessageIngress, sa as TProjectSettingsScope, sc as ADVISOR_OFF, si as resolvePermissionModeAdapter, sl as ICommandSessionModel, sn as IAgentSession, so as ICommandHostBackgroundTasks, sr as EXIT_COMMAND_DESCRIPTION, ss as IContextReferenceInventoryLimits, st as loadHostBundlePluginInspectionFromScopes, su as TEditCheckpointFileRestoreAction, t as IInteractiveRuntimeOptions, ta as deleteSettings, tc as ILinkedDeviceSummary, ti as groupPermissionRulesBySource, tl as TWorkspaceProjectStateNamespace, tn as IPromptExecutorOptions, to as ISystemCommand, tr as listCommandEditCheckpoints, ts as IGoalStartOptions, tt as IBundlePluginInstallerOptions, tu as IEditCheckpointInspectionPlan, u as IGenerateSessionNameOptions, ua as readSettingsSourceText, uc as IAdvisorStatus, ui as LANGUAGE_COMMAND_ARGUMENT_HINT, ul as ICommandSessionRuntime, un as IBundlePluginFeatures, uo as ICommandHostContext, ur as RENAME_COMMAND_USAGE, us as clearContextReferences, ut as IPluginSettings, uu as DEFAULT_AGENT_TYPE, v as ExternalEventGrantHistory, va as testProviderProfileCommand, vc as createNodeHostSessionStore, vi as BACKGROUND_COMMAND_USAGE, vl as IPresetApplicationOptions, vn as ILoadedBundlePlugin, vo as ICommandHostSetupState, vr as parseSessionNameArgument, vs as IPromptFileReferenceLimits, vt as BuiltinCommandSource, vu as TEffortSource, w as createExternalEventGrantHistory, wa as clearCommandContextReferences, wc as listResumableSessionSummaries, wi as listCommandBackgroundTasks, wl as IAgentJobSchedules, wn as ISkillRootDescriptor, wo as IMemoryCurationQueue, wr as buildPluginCommandSubcommands, ws as wrapEditCheckpointTools, wt as IAgentToolDeps, wu as TFrontmatterProfile, x as IExternalEventSourceOptions, xa as ICompactContextResult, xc as createUserPromptHistoryFile, xi as closeCommandBackgroundTask, xl as IAgentJobHostContext, xn as IContributionDescriptor, xo as ICommandHostWorkspace, xr as PLUGIN_COMMAND_ARGUMENT_HINT, xs as IResolvedPromptFileReference, xt as createAgentTool, xu as IFrontmatterDecodeFailure, y as ExternalEventIngress, ya as AUTO_COMPACT_THRESHOLD_SETTINGS_KEY, yc as createNodeToolResultSpillStore, yi as buildBackgroundCommandSubcommands, yl as IAgentJobDispatch, yn as TBundlePluginSkipReason, yo as ICommandHostTerminalHandoff, yr as readCommandSessionInfo, ys as IPromptFileReferenceResolveOptions, yt as createBuiltinCommandModule, yu as parseModelEffort, z as TInteractivePermissionHandler, za as ILegacyProviderSettings, zc as IWorkspaceProjectAuthority, zi as mergeProviders, zl as createExecutionWorkspaceSnapshot, zn as createSystemCommands, zo as IAppendMemoryInput, zr as isStatusLineCommandSettingsPatch, zs as ICommandMCPOAuthStatus, zt as createSubagentSession } from "./createInteractiveRuntime-20Gv8UI1.cjs";
|
|
2
|
+
import { IAIProvider, IActionRequest, IChatOptions, IDestroyResult, IEventService, IFileSystem, IFileSystemAsync, IGroupChatOrchestrationSpec, IHandoffOrchestrationSpec, IHierarchicalOrchestrationSpec, IHistoryEntry, IModelFallbackNotice, IModelRef, IOrchestrationDelegation, IOrchestrationRunResult, IOrchestrationStepResult, IParallelOrchestrationSpec, IProviderDefinition, IProviderDefinitionConfig, IProviderRequest, IRawProviderResponse, ISequentialOrchestrationSpec, ITerminalOutput as ITerminalOutput$2, IToolSchema, IToolWithEventService, IUniversalObjectValue, IUserInteraction, TActionResponse, TPermissionMode, TProviderCredentialResolver, TRoleModelMap, TToolArgs, TUniversalMessage, TUniversalValue } from "@robota-sdk/agent-core";
|
|
3
|
+
import { IAgentDriver, ICommandInfo, IDiffLine, IExecutionResult, IInteractionChannel, IInteractiveSession, IInteractiveSessionEvents, IInteractiveSessionStore, IPlanArtifact, ISessionChangeRefusal, ISessionCommands, ISessionDeleteRefusal, ISessionEvents, ISessionGoal, ISessionIdentity, ISessionLoopState, ISessionTurnSubmission, ITerminalHandoff, InteractionEvent, TInteractiveEventName, TPlanStepStatus, TSessionBindingRole, TSessionChangeRefusalCode, TSessionDeleteRefusalCode } from "@robota-sdk/agent-interface-session";
|
|
4
|
+
import { ICommandResult } from "@robota-sdk/agent-interface-command";
|
|
5
|
+
import { IBackgroundTaskManager, IBackgroundTaskRunner as IBackgroundTaskRunner$1, ISubagentManager } from "@robota-sdk/agent-executor";
|
|
6
|
+
import { TBackgroundPrimitive } from "@robota-sdk/agent-interface-execution";
|
|
7
|
+
import { Session } from "@robota-sdk/agent-session";
|
|
8
|
+
import { ISandboxClient, createZodFunctionTool } from "@robota-sdk/agent-tools";
|
|
9
|
+
import { ITransportCompletionRecord, ITransportEntry, ITransportFailureRecord, ITransportLifecycleRegistryView, ITransportRegistryView, ITransportRunnerAdapter, ITransportSavedConfig, ITransportSettingsCapability, ITransportSettingsRepository, TBoundConfigurableTransport, TBoundTransportAdapter, TTransportAdapter } from "@robota-sdk/agent-interface-transport";
|
|
10
|
+
import "@robota-sdk/agent-roundtable";
|
|
11
|
+
//#region src/frontmatter/frontmatter-json.d.ts
|
|
12
|
+
type TFrontmatterJsonResult = {
|
|
13
|
+
readonly ok: true;
|
|
14
|
+
readonly frontmatter: IUniversalObjectValue;
|
|
15
|
+
readonly body: string;
|
|
16
|
+
} | IFrontmatterDecodeFailure;
|
|
17
|
+
/** Decode every YAML field for content equality; no profile normalization or instruction activation. */
|
|
18
|
+
declare function decodeFrontmatterJson(source: string, content: string): TFrontmatterJsonResult | undefined;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/frontmatter/frontmatter-decoder.d.ts
|
|
21
|
+
declare function decodeFrontmatter<P extends TFrontmatterProfile>(input: IFrontmatterDecodeInput<P>): TFrontmatterDecodeResult<P>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/transport-host/headless/headless-output-format.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* Leaf module for the output-format vocabulary (issue #2052: the ONE owner of the type and the
|
|
26
|
+
* runtime constant together).
|
|
27
|
+
*
|
|
28
|
+
* Split out of `headless-runner.ts` so `headless-output.ts` can depend on {@link TOutputFormat}
|
|
29
|
+
* without importing back from `headless-runner.ts`, which previously created an import cycle
|
|
30
|
+
* between the two.
|
|
31
|
+
*/
|
|
32
|
+
declare const OUTPUT_FORMATS: readonly ["text", "json", "stream-json"];
|
|
33
|
+
type TOutputFormat = (typeof OUTPUT_FORMATS)[number];
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/transport-host/headless/headless-session.d.ts
|
|
36
|
+
/** Session roles required by the headless runner and transport. */
|
|
37
|
+
interface IHeadlessSession extends ISessionTurnSubmission, ISessionEvents, ISessionCommands, ISessionGoal, ISessionIdentity {}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/transport-host/headless/headless-runner.d.ts
|
|
40
|
+
/** GOAL-001: options for an autonomous headless goal run. */
|
|
41
|
+
interface IHeadlessGoalOptions {
|
|
42
|
+
maxIterations?: number;
|
|
43
|
+
}
|
|
44
|
+
interface IHeadlessRunnerOptions {
|
|
45
|
+
session: IHeadlessSession;
|
|
46
|
+
outputFormat: TOutputFormat;
|
|
47
|
+
/** Optional startup resolution projected into ordinary print results. */
|
|
48
|
+
effortResolution?: IModelEffortResolution;
|
|
49
|
+
providerErrorGuidance?: IProviderErrorGuidance;
|
|
50
|
+
}
|
|
51
|
+
declare function createHeadlessRunner(options: IHeadlessRunnerOptions): {
|
|
52
|
+
run: (prompt: string) => Promise<number>;
|
|
53
|
+
runGoal: (objective: string, goalOptions?: IHeadlessGoalOptions) => Promise<number>;
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/command-api/org-policy/org-policy-parse-error.d.ts
|
|
57
|
+
/**
|
|
58
|
+
* Issue #2023: an org policy file that EXISTS and cannot be understood is an error condition, never
|
|
59
|
+
* silently equated with a missing one.
|
|
60
|
+
*
|
|
61
|
+
* The loader returned `null` for both, and every enforcement site reads `null` as "no policy
|
|
62
|
+
* configured" — `orgPolicy?.allowedProviders && …` does not fire when the policy is absent. So a
|
|
63
|
+
* corrupted file removed provider allowlisting, blocked commands and the plaintext-key requirement
|
|
64
|
+
* at once, with no signal, and produced behaviour identical to having deployed no policy at all.
|
|
65
|
+
* An administrator could not tell those apart.
|
|
66
|
+
*
|
|
67
|
+
* This mirrors `SettingsParseError` (CLI-069) and the trusted-device store, which answer the same
|
|
68
|
+
* question the same way one and two files over. The sanctioned-degradation comment it replaces was
|
|
69
|
+
* not wrong to care about startup — a MISSING policy still returns `null` and still does not throw,
|
|
70
|
+
* which is the common case. What changes is the case where an administrator deployed a file and it
|
|
71
|
+
* cannot be read.
|
|
72
|
+
*/
|
|
73
|
+
declare class OrgPolicyParseError extends Error {
|
|
74
|
+
readonly filePath: string;
|
|
75
|
+
constructor(filePath: string, reason: string);
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/command-api/org-policy/org-policy-loader.d.ts
|
|
79
|
+
/**
|
|
80
|
+
* Read the organization policy, or `null` when none is deployed.
|
|
81
|
+
*
|
|
82
|
+
* **`null` means "no policy file", and nothing else** (issue #2023). Every enforcement site spells
|
|
83
|
+
* its guard `orgPolicy?.<field> && <violation>`, so `null` is read as "no restrictions" — which is
|
|
84
|
+
* correct for an administrator who deployed no policy and catastrophic for one whose policy file was
|
|
85
|
+
* truncated by a partial write or mangled by a sync tool. Returning `null` for both made those two
|
|
86
|
+
* indistinguishable, and the second silently removed provider allowlisting, blocked commands and the
|
|
87
|
+
* plaintext-key requirement together.
|
|
88
|
+
*
|
|
89
|
+
* A file that EXISTS and cannot be understood therefore throws. That answers the concern the
|
|
90
|
+
* sanctioned-degradation comment here used to state — "malformed org-policy.json must not crash CLI
|
|
91
|
+
* startup" — rather than deleting it: a **missing** file is the common case and still returns `null`
|
|
92
|
+
* without throwing. What throws is a file an administrator put there that cannot be read, which is
|
|
93
|
+
* their error to see.
|
|
94
|
+
*
|
|
95
|
+
* `settings-io.ts` (CLI-069) and the trusted-device store answer the same question the same way, one
|
|
96
|
+
* and two files over. This loader was the one that did not.
|
|
97
|
+
*/
|
|
98
|
+
declare function loadOrgPolicy(policyPath: string): IOrgPolicy | null;
|
|
99
|
+
declare function formatOrgPolicyViolationMessage(reason: string, adminContact: string | undefined): string;
|
|
100
|
+
declare function isApiKeyPlaintext(apiKey: string | undefined): boolean;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/workspace-trust/workspace-authority.d.ts
|
|
103
|
+
declare function assertWorkspaceProjectAuthority(candidate: TWorkspaceProjectAuthorityCandidate): IWorkspaceProjectAuthority;
|
|
104
|
+
declare function getWorkspaceProjectReader(authority: IWorkspaceProjectAuthority): IWorkspaceProjectReader;
|
|
105
|
+
declare function getWorkspaceProjectIdentity(authority: IWorkspaceProjectAuthority): IWorkspaceIdentity;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/workspace-trust/project-state-storage.d.ts
|
|
108
|
+
declare function getWorkspaceProjectStateStorage(authority: IWorkspaceProjectAuthority, namespace: TWorkspaceProjectStateNamespace): IWorkspaceProjectStateStorage;
|
|
109
|
+
declare function assertWorkspaceProjectStateStorage(candidate: TWorkspaceProjectAuthorityCandidate): IWorkspaceProjectStateStorage;
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/workspace-trust/project-settings-writer.d.ts
|
|
112
|
+
declare function createWorkspaceProjectSettingsWriter(authority: IWorkspaceProjectAuthority, decision: TWorkspaceProjectSettingsWriteDecision): IWorkspaceProjectSettingsWriter;
|
|
113
|
+
declare function assertWorkspaceProjectSettingsWriter(candidate: TWorkspaceProjectAuthorityCandidate): IWorkspaceProjectSettingsWriter;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/workspace-trust/project-mutation.d.ts
|
|
116
|
+
declare function createWorkspaceProjectMutation(authority: IWorkspaceProjectAuthority, decision: TWorkspaceProjectMutationDecision): IWorkspaceProjectMutation;
|
|
117
|
+
declare function assertWorkspaceProjectMutation(candidate: TWorkspaceProjectAuthorityCandidate): IWorkspaceProjectMutation;
|
|
118
|
+
/** Internal same-grant check for adapters that combine reads/state with project mutation. */
|
|
119
|
+
declare function assertWorkspaceProjectMutationForAuthority(mutation: IWorkspaceProjectMutation, authority: IWorkspaceProjectAuthority): IWorkspaceProjectMutation;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/workspace-trust/project-relative-writer.d.ts
|
|
122
|
+
/**
|
|
123
|
+
* Whether a project write on `platform` can be proven to stay under the trusted root. The proof
|
|
124
|
+
* walks descriptor-relative paths through `/proc/self/fd`, which only Linux provides; elsewhere every
|
|
125
|
+
* project mutation is refused, so a host keeps state it must write somewhere other than the project.
|
|
126
|
+
*/
|
|
127
|
+
declare function supportsWorkspaceProjectMutation(platform?: NodeJS.Platform): boolean;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/workspace-trust/project-reader.d.ts
|
|
130
|
+
declare function assertWorkspaceProjectReader(candidate: TWorkspaceProjectAuthorityCandidate): IWorkspaceProjectReader;
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/workspace-trust/pretrust-contribution-inspector.d.ts
|
|
133
|
+
type TPreTrustProjectPathKind = TWorkspaceContributionKind | 'absent' | 'unavailable';
|
|
134
|
+
interface IPreTrustProjectPathInspection {
|
|
135
|
+
readonly relativePath: string;
|
|
136
|
+
readonly kind: TPreTrustProjectPathKind;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Inspect only metadata for owner-declared project paths before trust is granted. The same
|
|
140
|
+
* identity-revalidating, no-follow path walk used by trusted readers is called without exposing
|
|
141
|
+
* their content-reading authority. A replaced root or unsafe ancestor yields no metadata claim.
|
|
142
|
+
*/
|
|
143
|
+
declare function inspectPreTrustProjectPaths(identity: IWorkspaceIdentity, relativePaths: readonly string[]): readonly IPreTrustProjectPathInspection[];
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/workspace-trust/workspace-authority-required-error.d.ts
|
|
146
|
+
/** Fail-closed response for project APIs without an accepted runtime authority. */
|
|
147
|
+
declare class WorkspaceAuthorityRequiredError extends Error {
|
|
148
|
+
readonly name: string;
|
|
149
|
+
readonly code = "WORKSPACE_AUTHORITY_REQUIRED";
|
|
150
|
+
constructor(message?: string, cause?: Error);
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/workspace-trust/workspace-trust-service.d.ts
|
|
154
|
+
interface IWorkspaceTrustServiceOptions {
|
|
155
|
+
readonly identityResolver: IWorkspaceIdentityResolver;
|
|
156
|
+
readonly store: IWorkspaceTrustStore;
|
|
157
|
+
readonly projectStateDirectories?: TWorkspaceProjectStateDirectories;
|
|
158
|
+
}
|
|
159
|
+
declare function createRestrictedWorkspaceProjectAccess(trustState: IRestrictedWorkspaceProjectAccess['trustState'], displayPath?: string, cause?: Error, identity?: IWorkspaceIdentity): IRestrictedWorkspaceProjectAccess;
|
|
160
|
+
declare class WorkspaceTrustService {
|
|
161
|
+
private readonly options;
|
|
162
|
+
private readonly issuerGenerations;
|
|
163
|
+
private readonly projectStateDirectories;
|
|
164
|
+
constructor(options: IWorkspaceTrustServiceOptions);
|
|
165
|
+
private identityKey;
|
|
166
|
+
private recordGeneration;
|
|
167
|
+
inspect(cwd: string): Promise<TWorkspaceProjectAccess>;
|
|
168
|
+
/** The trusted branch: re-resolve the identity so a moved or replaced worktree cannot keep authority. */
|
|
169
|
+
private mintTrustedAccess;
|
|
170
|
+
grant(cwd: string): Promise<TWorkspaceProjectAccess>;
|
|
171
|
+
revoke(cwd: string): Promise<TWorkspaceProjectAccess>;
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/workspace-trust/node-host-workspace-trust.d.ts
|
|
175
|
+
/** Resolve a Git worktree to a replacement-safe host identity. */
|
|
176
|
+
declare function createNodeWorkspaceIdentityResolver(): IWorkspaceIdentityResolver;
|
|
177
|
+
/** Create the owner-only, replacement-safe persistent grant store used by the Node host. */
|
|
178
|
+
declare function createNodeWorkspaceTrustStore(filePath: string): IWorkspaceTrustStore;
|
|
179
|
+
/** Compose the default Node resolver, caller-selected persistent store, and authority service. */
|
|
180
|
+
declare function createNodeWorkspaceTrustService(filePath: string, projectStateDirectories?: TWorkspaceProjectStateDirectories): WorkspaceTrustService;
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/checkpoints/edit-checkpoints-unavailable-error.d.ts
|
|
183
|
+
/**
|
|
184
|
+
* Why a session has no edit checkpoints. A host that names its own commands (a trust command, say)
|
|
185
|
+
* maps the reason to that guidance; the messages below name none.
|
|
186
|
+
*/
|
|
187
|
+
type TEditCheckpointsUnavailableReason = 'host-cannot-write-project' | 'restricted-workspace' | 'no-checkpoint-store';
|
|
188
|
+
/** Thrown by a checkpoint operation on a session that has no checkpoint store. */
|
|
189
|
+
declare class EditCheckpointsUnavailableError extends WorkspaceAuthorityRequiredError {
|
|
190
|
+
readonly reason: TEditCheckpointsUnavailableReason;
|
|
191
|
+
readonly name: string;
|
|
192
|
+
constructor(reason: TEditCheckpointsUnavailableReason);
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/command-api/provider/provider-profile-names.d.ts
|
|
196
|
+
interface IProviderProfileNameSuggestionInput {
|
|
197
|
+
type: string;
|
|
198
|
+
}
|
|
199
|
+
interface IProviderProfileNameSuggestionOptions {
|
|
200
|
+
existingProfileNames?: readonly string[];
|
|
201
|
+
}
|
|
202
|
+
declare function suggestProviderProfileName(input: IProviderProfileNameSuggestionInput, options?: IProviderProfileNameSuggestionOptions): string;
|
|
203
|
+
declare function sanitizeProviderProfileName(value: string | undefined): string | undefined;
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/contributions/node-host-contribution-source.d.ts
|
|
206
|
+
/** Explicit root-bounded adapter for host-owned contribution content. */
|
|
207
|
+
declare function createNodeHostContributionSource(root: string): IContributionSource;
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/contributions/initial-contribution-sources.d.ts
|
|
210
|
+
/** Default host-owned contribution roots. Project content is intentionally absent. */
|
|
211
|
+
declare function createDefaultUserContributionSources(userHome: string): readonly IContributionSource[];
|
|
212
|
+
/** Compose the initial contribution sources from one explicit trusted-or-restricted decision. */
|
|
213
|
+
declare function createContributionSourcesForProjectAccess(projectAccess: TWorkspaceProjectAccess, userHome: string): readonly IContributionSource[];
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/transport-host/headless/HeadlessInteractionChannel.d.ts
|
|
216
|
+
interface IHeadlessInteractionChannelOptions {
|
|
217
|
+
cwd: string;
|
|
218
|
+
livePromptTrace?: ILivePromptTracePort;
|
|
219
|
+
provider: IAIProvider;
|
|
220
|
+
providerErrorGuidance?: IProviderErrorGuidance;
|
|
221
|
+
promptFileReferenceTag?: string;
|
|
222
|
+
modelCommandToolPrefix?: string;
|
|
223
|
+
subagentHookEnvironmentNames?: ICreateSessionOptions['subagentHookEnvironmentNames'];
|
|
224
|
+
observerFailureWarningCode?: ICreateSessionOptions['observerFailureWarningCode'];
|
|
225
|
+
commandHookShell?: string;
|
|
226
|
+
/** Resolved organization policy enforced by the interactive session. */
|
|
227
|
+
orgPolicy?: IOrgPolicy;
|
|
228
|
+
projectAccess?: TWorkspaceProjectAccess;
|
|
229
|
+
projectSettingsPaths?: readonly IProjectSettingsPath[];
|
|
230
|
+
userSettingsSources?: readonly INodeHostSettingsSource[];
|
|
231
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
232
|
+
baselinePermissionAllow?: readonly string[];
|
|
233
|
+
/** Host-selected task-context root; absent means the framework scans no task directory. */
|
|
234
|
+
taskContext?: IResolvedConfig['taskContext'];
|
|
235
|
+
contributionSources?: readonly IContributionSource[];
|
|
236
|
+
skillRoots?: readonly ISkillRootDescriptor[];
|
|
237
|
+
outputFormat: TOutputFormat;
|
|
238
|
+
/**
|
|
239
|
+
* CLI-076: the resolved model id (the same value the CLI header displays). Forwarded verbatim to the
|
|
240
|
+
* session so an explicit `--model` override actually reaches the provider chat call. Absent ⇒ the
|
|
241
|
+
* session resolves the model from config (no silent substitution of the requested model).
|
|
242
|
+
*/
|
|
243
|
+
model?: string;
|
|
244
|
+
/** CLI-1988: resolved provider-neutral response style. */
|
|
245
|
+
outputStyle?: IOutputStylePrompt;
|
|
246
|
+
/** ARCH-013: resolved preset effort, threaded to the session's `effort` seam. */
|
|
247
|
+
effort?: ICreateSessionOptions['effort'];
|
|
248
|
+
/** Provider generation options resolved by the print/goal preset. */
|
|
249
|
+
temperature?: number;
|
|
250
|
+
maxOutputTokens?: number;
|
|
251
|
+
/** Response language and preset prompt seed, distinct from a replacing system prompt. */
|
|
252
|
+
language?: string;
|
|
253
|
+
presetSystemPrompt?: string;
|
|
254
|
+
/** Structured response policy, including JSON schema requests. */
|
|
255
|
+
responseFormat?: ICreateSessionOptions['responseFormat'];
|
|
256
|
+
/** FLOW-008: startup source/effective metadata projected into headless results. */
|
|
257
|
+
effortResolution?: IModelEffortResolution;
|
|
258
|
+
permissionMode?: TPermissionMode;
|
|
259
|
+
maxTurns?: number;
|
|
260
|
+
sessionStore?: IInteractiveSessionStore;
|
|
261
|
+
disableSessionLoops?: boolean;
|
|
262
|
+
resolveDefaultLoopPrompt?: () => string;
|
|
263
|
+
/** Continue/resume an existing session by id (print-mode parity with TUI). */
|
|
264
|
+
resumeSessionId?: string;
|
|
265
|
+
/** Fork the resumed session into a new independent session instead of appending. */
|
|
266
|
+
forkSession?: boolean;
|
|
267
|
+
sessionName?: string;
|
|
268
|
+
bare?: boolean;
|
|
269
|
+
/** See `IInteractiveSessionOptions.skipConfiguredHooks`. */
|
|
270
|
+
skipConfiguredHooks?: boolean;
|
|
271
|
+
allowedTools?: readonly string[];
|
|
272
|
+
deniedTools?: readonly string[];
|
|
273
|
+
appendSystemPrompt?: string;
|
|
274
|
+
systemPrompt?: string;
|
|
275
|
+
/** Name reported to the underlying agent config (resolved by the CLI, e.g. preset agentName). */
|
|
276
|
+
agentName?: string;
|
|
277
|
+
/** Active preset id selected at startup (PRESET-011 runtime state). Defaults to 'default'. */
|
|
278
|
+
activePresetId?: string;
|
|
279
|
+
/** Preset persona block composed as a `source: 'persona'` system-prompt section (priority 5). */
|
|
280
|
+
persona?: string;
|
|
281
|
+
/** Preset execution capability: activate agent runtime + subagent/background dispatch. */
|
|
282
|
+
enableParallelSubagents?: boolean;
|
|
283
|
+
/** Preset execution capability: run a post-task self-verification step. */
|
|
284
|
+
selfVerification?: boolean;
|
|
285
|
+
backgroundTaskRunners?: IBackgroundTaskRunner$1[];
|
|
286
|
+
subagentRunnerFactory?: TSubagentRunnerFactory;
|
|
287
|
+
/**
|
|
288
|
+
* ARCH-005: subagent definitions contributed by the composition root (the capability packs
|
|
289
|
+
* `assembleProduct` merged). Forwarded to the session's `agentDefinitions` seam; absent ⇒ unchanged.
|
|
290
|
+
*/
|
|
291
|
+
agentDefinitions?: readonly IAgentDefinition[];
|
|
292
|
+
/** Ordered host-owned relative directories for discovered agent definitions. */
|
|
293
|
+
agentDefinitionRoots?: readonly string[];
|
|
294
|
+
pluginDirectories?: {
|
|
295
|
+
readonly user?: string;
|
|
296
|
+
readonly project?: string;
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* ARCH-006: tools contributed by the composition root (the capability packs `assembleProduct` merged)
|
|
300
|
+
* and, when the profile hands the packs the whole tool surface, the suppressed framework default tier
|
|
301
|
+
* (`defaultTools: []`). Forwarded to the session's tool-composition seam; absent ⇒ unchanged.
|
|
302
|
+
*/
|
|
303
|
+
additionalTools?: IToolWithEventService[];
|
|
304
|
+
defaultTools?: readonly IToolWithEventService[];
|
|
305
|
+
/** The sandbox the shell tools run under, so the session can let a confined command skip the prompt. */
|
|
306
|
+
sandboxClient?: ISandboxClient;
|
|
307
|
+
commandModules?: readonly ICommandModule[];
|
|
308
|
+
commandHostAdapters?: ICommandHostAdapters;
|
|
309
|
+
/** Host-owned shell adapter used only when a skill explicitly requests shell interpolation. */
|
|
310
|
+
shellExec: TShellExecFn;
|
|
311
|
+
/**
|
|
312
|
+
* SELFHOST-008 P6: optional durable-memory store injected by the surface (agent-cli). Forwarded into
|
|
313
|
+
* `buildRuntimeSession`; absent ⇒ memory OFF (today's behavior). Enablement/policy is surface-owned.
|
|
314
|
+
*/
|
|
315
|
+
memoryStore?: IMemoryStore;
|
|
316
|
+
/** SELFHOST-008 P6: optional automatic post-turn capture policy (absent ⇒ capture OFF). */
|
|
317
|
+
automaticMemory?: IAutomaticMemoryConfig;
|
|
318
|
+
/** SELFHOST-008 P6: optional per-turn recall policy (absent ⇒ recall OFF, startup-only injection). */
|
|
319
|
+
recallMemory?: IPerTurnRecallConfig;
|
|
320
|
+
/** The run's edit checkpoint store, so a print run's edits can be rewound when it is resumed. */
|
|
321
|
+
editCheckpointStore?: EditCheckpointStore;
|
|
322
|
+
}
|
|
323
|
+
declare class HeadlessInteractionChannel {
|
|
324
|
+
private readonly opts;
|
|
325
|
+
private exitCode;
|
|
326
|
+
constructor(options: IHeadlessInteractionChannelOptions);
|
|
327
|
+
run(prompt: string): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* GOAL-001: run an autonomous goal to completion (or a stop condition) in headless mode.
|
|
330
|
+
* Mirrors {@link run} but drives the framework goal loop instead of a single prompt.
|
|
331
|
+
*/
|
|
332
|
+
runGoal(objective: string, options?: {
|
|
333
|
+
maxIterations?: number;
|
|
334
|
+
}): Promise<void>;
|
|
335
|
+
private createSession;
|
|
336
|
+
getExitCode(): number;
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/transport-host/headless/headless-transport.d.ts
|
|
340
|
+
interface IHeadlessTransportOptions {
|
|
341
|
+
/** Output format: 'text', 'json', or 'stream-json'. */
|
|
342
|
+
outputFormat: TOutputFormat;
|
|
343
|
+
/** The prompt to execute. */
|
|
344
|
+
prompt: string;
|
|
345
|
+
}
|
|
346
|
+
interface IHeadlessTransport extends ITransportRunnerAdapter<IInteractiveSession> {
|
|
347
|
+
attach(session: IHeadlessSession): void;
|
|
348
|
+
getExitCode(): number;
|
|
349
|
+
}
|
|
350
|
+
declare function createHeadlessTransport(options: IHeadlessTransportOptions): IHeadlessTransport;
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/transport-host/programmatic/ProgrammaticInteractionChannel.d.ts
|
|
353
|
+
declare class ProgrammaticInteractionChannel implements IInteractionChannel {
|
|
354
|
+
/** Full structured event stream pushed by the framework, in order. */
|
|
355
|
+
readonly events: InteractionEvent[];
|
|
356
|
+
availableCommands: ICommandInfo[];
|
|
357
|
+
busy: boolean;
|
|
358
|
+
started: boolean;
|
|
359
|
+
stopped: boolean;
|
|
360
|
+
private submitHandler;
|
|
361
|
+
private readonly userActionResponses;
|
|
362
|
+
onSubmit(handler: (text: string) => Promise<void>): void;
|
|
363
|
+
write(event: InteractionEvent): void;
|
|
364
|
+
/**
|
|
365
|
+
* CMD-004 unified ask. Resolves from the pre-supplied queue (FIFO); an empty queue resolves
|
|
366
|
+
* `{ type: 'cancelled' }` so a programmatic run never blocks on an un-answered question.
|
|
367
|
+
*/
|
|
368
|
+
askUser(_request: IActionRequest): Promise<TActionResponse>;
|
|
369
|
+
setAvailableCommands(commands: ICommandInfo[]): void;
|
|
370
|
+
setBusy(busy: boolean): void;
|
|
371
|
+
start(): Promise<void>;
|
|
372
|
+
stop(): Promise<void>;
|
|
373
|
+
/** Push a user submission into the framework (the programmatic "user types and presses enter"). */
|
|
374
|
+
submit(text: string): Promise<void>;
|
|
375
|
+
/** Pre-answer the next `askUser` (CMD-004 unified ask). */
|
|
376
|
+
queueUserAction(response: TActionResponse): void;
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/transport-host/programmatic/createProgrammaticAgent.d.ts
|
|
380
|
+
interface ICreateProgrammaticAgentOptions {
|
|
381
|
+
/** Provider that answers the agent loop (e.g. a real provider, or the scripted provider in tests). */
|
|
382
|
+
provider: IAIProvider;
|
|
383
|
+
/** Working directory for session creation. */
|
|
384
|
+
cwd: string;
|
|
385
|
+
/** Trusted-or-restricted project decision made by the host. Absence is Restricted. */
|
|
386
|
+
projectAccess?: TWorkspaceProjectAccess;
|
|
387
|
+
/** Explicit user settings layers for the underlying interactive session. */
|
|
388
|
+
userSettingsSources?: readonly INodeHostSettingsSource[];
|
|
389
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
390
|
+
/** Slash-command modules to register (defaults to none). */
|
|
391
|
+
commandModules?: readonly ICommandModule[];
|
|
392
|
+
/** Optional session store for persistence. */
|
|
393
|
+
sessionStore?: IInteractiveSessionStore;
|
|
394
|
+
/** Permission mode for tool execution (e.g. `'bypassPermissions'` for unattended driving). */
|
|
395
|
+
permissionMode?: TPermissionMode;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Construct an in-process {@link IAgentDriver} bound to a real `InteractiveSession`. The returned
|
|
399
|
+
* driver's accessors are the shared `read*` helpers applied to the captured event stream.
|
|
400
|
+
*/
|
|
401
|
+
declare function createProgrammaticAgent(options: ICreateProgrammaticAgentOptions): IAgentDriver;
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region src/transport-host/transport-registry.d.ts
|
|
404
|
+
declare class TransportRegistry {
|
|
405
|
+
private readonly entries;
|
|
406
|
+
private readonly settings;
|
|
407
|
+
private generation;
|
|
408
|
+
private state;
|
|
409
|
+
private startOperation;
|
|
410
|
+
private stopOperation;
|
|
411
|
+
private preemptionStopOperation;
|
|
412
|
+
private startingTransport;
|
|
413
|
+
private preemptionStopFailure;
|
|
414
|
+
/**
|
|
415
|
+
* TRANS-010 (issue #2480): settings storage is an injected repository. A string is accepted as the
|
|
416
|
+
* path of a settings file and wrapped in the file repository, so the existing shell and tests keep
|
|
417
|
+
* their call shape.
|
|
418
|
+
*/
|
|
419
|
+
constructor(settings: string | ITransportSettingsRepository);
|
|
420
|
+
/** The lifecycle/shape agreement every entry must satisfy, on the way in and on a replace. */
|
|
421
|
+
private assertRegisterableShape;
|
|
422
|
+
register(transport: TBoundTransportAdapter): void;
|
|
423
|
+
/**
|
|
424
|
+
* Swap the adapter registered under `transport.name` for a new instance of the same name.
|
|
425
|
+
*
|
|
426
|
+
* Narrower than an unregister: the name must ALREADY be registered and the count cannot change, so
|
|
427
|
+
* `stopAll` keeps its promise to reach everything. An entry is a claim about WHICH instance is
|
|
428
|
+
* live, and reconnect makes it false (issue #2043).
|
|
429
|
+
*
|
|
430
|
+
* Returns nothing and stops nothing: every caller that abandons an adapter already stops it on the
|
|
431
|
+
* path that abandoned it, and a registry that stopped it here would do so at a moment the caller
|
|
432
|
+
* did not choose.
|
|
433
|
+
*/
|
|
434
|
+
replace(transport: TBoundTransportAdapter): void;
|
|
435
|
+
getAll(): ITransportEntry[];
|
|
436
|
+
getEnabled(): TBoundTransportAdapter[];
|
|
437
|
+
setEnabled(name: string, enabled: boolean): Promise<void>;
|
|
438
|
+
setOptions(name: string, options: Record<string, TUniversalValue>): Promise<void>;
|
|
439
|
+
/**
|
|
440
|
+
* TRANS-002 (issue #2480): hand the persisted options to a transport BEFORE it starts. Non-empty
|
|
441
|
+
* options a transport cannot receive (`configure` absent) or refuses (`validateOptions` false) are
|
|
442
|
+
* a typed configuration error rather than a silent ignore — the former "read, displayed, never
|
|
443
|
+
* applied" state.
|
|
444
|
+
*/
|
|
445
|
+
private deliverOptions;
|
|
446
|
+
startAll(): Promise<void>;
|
|
447
|
+
waitForCompletion(): Promise<ITransportCompletionRecord[]>;
|
|
448
|
+
waitForFailure(): Promise<ITransportFailureRecord | undefined>;
|
|
449
|
+
stopAll(): Promise<IDestroyResult>;
|
|
450
|
+
private performStop;
|
|
451
|
+
private performStart;
|
|
452
|
+
private requireConfigurable;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/transport-host/bind-transport-adapter.d.ts
|
|
456
|
+
/** Bind the exact session port outside the registry while preserving configure-before-attach. */
|
|
457
|
+
declare function bindTransportAdapter<TSession, TAdapter extends TTransportAdapter<TSession>>(adapter: TAdapter, session: TSession): TAdapter extends ITransportSettingsCapability ? TBoundConfigurableTransport : TBoundTransportAdapter;
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/transport-host/transport-settings-repository.d.ts
|
|
460
|
+
/** Reads/writes the `transports` section of one settings file. */
|
|
461
|
+
declare function createFileTransportSettingsRepository(settingsPath: string): ITransportSettingsRepository;
|
|
462
|
+
/** Holds transport settings in memory — tests, and hosts with no settings file. */
|
|
463
|
+
declare function createMemoryTransportSettingsRepository(initial?: Record<string, ITransportSavedConfig>): ITransportSettingsRepository;
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/assembly/context-capacity-hint.d.ts
|
|
466
|
+
/**
|
|
467
|
+
* NEUT-005 wave 2 — surface-derived context-capacity hint.
|
|
468
|
+
*
|
|
469
|
+
* The zero-dependency `agent-core` layer emits a product-neutral hard-capacity notice and exposes
|
|
470
|
+
* the `IAgentConfig.contextCapacityHint` seam (a surface tier injects its own concrete remediation
|
|
471
|
+
* wording). This framework tier owns command composition, so it can derive that wording from the
|
|
472
|
+
* surface's OWN registered command set rather than hardcoding product vocabulary in a neutral core:
|
|
473
|
+
* when a `compact` command is composed into the session, the notice can point users at it; when no
|
|
474
|
+
* such command exists, no product wording is emitted and the neutral core default stands.
|
|
475
|
+
*/
|
|
476
|
+
/**
|
|
477
|
+
* Derive the concrete remediation hint for the hard-capacity notice from the composed command set.
|
|
478
|
+
* Returns `undefined` when no context-reduction command is registered, leaving the neutral core
|
|
479
|
+
* default (`DEFAULT_CONTEXT_CAPACITY_HINT`) in force.
|
|
480
|
+
*/
|
|
481
|
+
declare function deriveContextCapacityHint(contextReductionCommandName: string | undefined): string | undefined;
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/interactive/session-loop-stop-verb.d.ts
|
|
484
|
+
/**
|
|
485
|
+
* #3288: whether a `/loop` invocation's arguments are the `stop <id>` verb.
|
|
486
|
+
*
|
|
487
|
+
* `InteractiveSession.executeCommand`'s mid-turn control-action bypass (so `/loop stop <id>` can
|
|
488
|
+
* reach a loop while its own turn is still running, mirroring `isGoalCancelVerb`) and the `/loop`
|
|
489
|
+
* command module's own routing both need the identical answer — one parses it, the other imports
|
|
490
|
+
* it, so the two can never drift apart.
|
|
491
|
+
*/
|
|
492
|
+
declare function isLoopStopVerb(args: string): boolean;
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region src/interactive/interactive-session-fork-record.d.ts
|
|
495
|
+
/**
|
|
496
|
+
* A moved conversation's copy under a name no other record in `sessionStore` holds (issue #3081).
|
|
497
|
+
* The copy often lands in the same store as its source — every Restricted move, and a move within
|
|
498
|
+
* one worktree — and a name lookup matches the first record, so a shared name would make
|
|
499
|
+
* `--resume <name>` pick either one.
|
|
500
|
+
*/
|
|
501
|
+
declare function withUniqueSessionName(record: IInteractiveSessionRecord$1, sessionStore: IInteractiveSessionStore$1): IInteractiveSessionRecord$1;
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/interactive/interactive-session-terminal-handoff.d.ts
|
|
504
|
+
declare class SessionTerminalHandoffGate {
|
|
505
|
+
private readonly handoff;
|
|
506
|
+
/** Guards handoff exclusivity (one handoff at a time). */
|
|
507
|
+
private active;
|
|
508
|
+
constructor(handoff: ITerminalHandoff | undefined);
|
|
509
|
+
/**
|
|
510
|
+
* Whether the active transport can hand the real terminal to a child process. False when no
|
|
511
|
+
* handoff capability was injected or its `canHandoffTerminal` is false (e.g. headless).
|
|
512
|
+
*/
|
|
513
|
+
canHandoffTerminal(): boolean;
|
|
514
|
+
/**
|
|
515
|
+
* Suspend the display, run `fn` (which spawns a child with inherited stdio), then restore. The
|
|
516
|
+
* framework enforces exclusivity and fast-fails when no interactive terminal is available instead
|
|
517
|
+
* of hanging; the transport implements the underlying suspend/resume; the caller's `fn` spawns
|
|
518
|
+
* whatever child it wants — the framework stays platform-neutral and never spawns a shell.
|
|
519
|
+
*/
|
|
520
|
+
runWithTerminal<T>(fn: () => Promise<T>): Promise<T>;
|
|
521
|
+
}
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/plan/plan-controller.d.ts
|
|
524
|
+
/** An approval decision: flip to `acceptEdits`. */
|
|
525
|
+
type TPlanApproveDecision = {
|
|
526
|
+
action: 'approve';
|
|
527
|
+
nextMode: TPermissionMode;
|
|
528
|
+
plan: IPlanArtifact;
|
|
529
|
+
};
|
|
530
|
+
/** A revert decision: return the mode to `plan`. */
|
|
531
|
+
type TPlanRevertDecision = {
|
|
532
|
+
action: 'revert';
|
|
533
|
+
nextMode: TPermissionMode;
|
|
534
|
+
plan: IPlanArtifact;
|
|
535
|
+
};
|
|
536
|
+
/** A no-mode-change decision (e.g. presenting the plan for review). */
|
|
537
|
+
type TPlanContinueDecision = {
|
|
538
|
+
action: 'continue';
|
|
539
|
+
plan: IPlanArtifact;
|
|
540
|
+
};
|
|
541
|
+
/** The controller's decision after a plan-phase transition. */
|
|
542
|
+
type TPlanDecision = TPlanApproveDecision | TPlanRevertDecision | TPlanContinueDecision;
|
|
543
|
+
/** Injected seams so the controller stays deterministic and testable. */
|
|
544
|
+
interface IPlanControllerDeps {
|
|
545
|
+
now: () => string;
|
|
546
|
+
createId: () => string;
|
|
547
|
+
}
|
|
548
|
+
declare class PlanController {
|
|
549
|
+
private readonly deps;
|
|
550
|
+
private plan;
|
|
551
|
+
constructor(deps?: IPlanControllerDeps);
|
|
552
|
+
getState(): IPlanArtifact | null;
|
|
553
|
+
/**
|
|
554
|
+
* Begin drafting a plan (phase `planning`). Throws on an empty objective. Step descriptions are
|
|
555
|
+
* seeded as `pending` steps with generated ids. Returns the seeded artifact.
|
|
556
|
+
*/
|
|
557
|
+
start(objective: string, stepDescriptions?: readonly string[]): IPlanArtifact;
|
|
558
|
+
/** Restore a persisted plan on resume. */
|
|
559
|
+
restore(plan: IPlanArtifact): void;
|
|
560
|
+
/** Present the drafted plan for review (`planning` → `awaiting-approval`). */
|
|
561
|
+
requestApproval(): TPlanContinueDecision;
|
|
562
|
+
/**
|
|
563
|
+
* Approve the plan (`awaiting-approval` → `executing`). Returns the decision to flip the mode to
|
|
564
|
+
* `acceptEdits`; the controller does NOT apply it. Throws unless awaiting approval.
|
|
565
|
+
*/
|
|
566
|
+
approve(): TPlanApproveDecision;
|
|
567
|
+
/**
|
|
568
|
+
* Revert to planning, returning the mode back to `plan`. Intentionally has NO phase guard — it is
|
|
569
|
+
* the escape hatch usable from ANY phase (reject while awaiting approval, bail mid-execution, or
|
|
570
|
+
* re-open a completed plan for another cycle). The mode flip is always the safe direction (`→ plan`,
|
|
571
|
+
* which re-blocks mutation), so an any-phase revert can never widen permissions.
|
|
572
|
+
*/
|
|
573
|
+
revert(): TPlanRevertDecision;
|
|
574
|
+
/** Finish the plan (`executing` → `completed`), reverting the mode to `plan` for the next cycle. */
|
|
575
|
+
complete(): TPlanRevertDecision;
|
|
576
|
+
/** Update one step's status (todo tracking). Throws on an unknown step id (surfaces caller bugs). */
|
|
577
|
+
markStep(stepId: string, status: TPlanStepStatus): IPlanArtifact;
|
|
578
|
+
private requirePlan;
|
|
579
|
+
}
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region src/query.d.ts
|
|
582
|
+
interface ICreateQueryOptions {
|
|
583
|
+
/** AI provider instance (required). */
|
|
584
|
+
provider: IAIProvider;
|
|
585
|
+
/** Working directory. Defaults to process.cwd(). */
|
|
586
|
+
cwd?: string;
|
|
587
|
+
/** Host-owned initial project decision. Absence produces an observable Restricted query. */
|
|
588
|
+
projectAccess?: TWorkspaceProjectAccess;
|
|
589
|
+
/** Explicit user settings layers for this query's session. */
|
|
590
|
+
userSettingsSources?: readonly INodeHostSettingsSource[];
|
|
591
|
+
/**
|
|
592
|
+
* Permission mode. Defaults to `'default'`: with no `permissionHandler`, anything that would ask is
|
|
593
|
+
* denied (issue #3081). Pass `'bypassPermissions'` explicitly for unattended driving.
|
|
594
|
+
*/
|
|
595
|
+
permissionMode?: TPermissionMode;
|
|
596
|
+
/**
|
|
597
|
+
* Model to request. Without it the query uses the model from `userSettingsSources`, or Anthropic's
|
|
598
|
+
* default when none is set — so pass it with any other provider.
|
|
599
|
+
*/
|
|
600
|
+
model?: string;
|
|
601
|
+
/** Maximum agentic turns per query. */
|
|
602
|
+
maxTurns?: number;
|
|
603
|
+
/**
|
|
604
|
+
* Tools that run without asking (e.g. your own `additionalTools`). A call that every mode asks
|
|
605
|
+
* about still asks.
|
|
606
|
+
*/
|
|
607
|
+
allowedTools?: readonly string[];
|
|
608
|
+
/** Tools the model is never offered. Denied wins over allowed. */
|
|
609
|
+
deniedTools?: readonly string[];
|
|
610
|
+
/** Permission handler callback. */
|
|
611
|
+
permissionHandler?: TInteractivePermissionHandler;
|
|
612
|
+
/** Streaming text callback. */
|
|
613
|
+
onTextDelta?: (delta: string) => void;
|
|
614
|
+
/** Additional tools registered alongside the default CLI tools. */
|
|
615
|
+
additionalTools?: IToolWithEventService[];
|
|
616
|
+
/** Request structured output from the provider. */
|
|
617
|
+
responseFormat?: {
|
|
618
|
+
type: 'text' | 'json_object';
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Callable query surface plus its immutable initial project-access decision. Calls share one session
|
|
623
|
+
* and run one at a time, each answered by its own turn.
|
|
624
|
+
*/
|
|
625
|
+
type TQueryFunction = ((prompt: string) => Promise<string>) & {
|
|
626
|
+
readonly projectAccess: TWorkspaceProjectAccess;
|
|
627
|
+
/** Shut the query's session down; the running call and every later one reject. */
|
|
628
|
+
shutdown(): Promise<void>;
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* Create a prompt-only query function bound to a provider.
|
|
632
|
+
*
|
|
633
|
+
* ```typescript
|
|
634
|
+
* import { createQuery } from '@robota-sdk/agent-framework';
|
|
635
|
+
* import { AnthropicProvider } from '@robota-sdk/agent-provider-anthropic';
|
|
636
|
+
*
|
|
637
|
+
* const query = createQuery({ provider: new AnthropicProvider({ apiKey: '...' }) });
|
|
638
|
+
* const answer = await query('List all TypeScript files');
|
|
639
|
+
* ```
|
|
640
|
+
*/
|
|
641
|
+
declare function createQuery(options: ICreateQueryOptions): TQueryFunction;
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/advisor/advisor-controller.d.ts
|
|
644
|
+
/** A resolved advisor: the provider instance to ask and where it sends what it is given. */
|
|
645
|
+
interface IAdvisorTarget {
|
|
646
|
+
readonly provider: IAIProvider;
|
|
647
|
+
readonly model: string;
|
|
648
|
+
/**
|
|
649
|
+
* Where the conversation goes: the provider type together with the endpoint it talks to. Consent
|
|
650
|
+
* is keyed on it, and it decides whether history leaves for somewhere the main model does not
|
|
651
|
+
* already send it — two endpoints of one provider type are two destinations.
|
|
652
|
+
*/
|
|
653
|
+
readonly destination: string;
|
|
654
|
+
/** Defaults to the model's known window. */
|
|
655
|
+
readonly contextWindow?: number;
|
|
656
|
+
}
|
|
657
|
+
/** Host-supplied: build the provider a spec names. Throws when the profile does not exist. */
|
|
658
|
+
type TAdvisorTargetResolver = (spec: IAdvisorSpec) => IAdvisorTarget;
|
|
659
|
+
/** Per-destination consent to send conversation history there, persisted by the host. */
|
|
660
|
+
interface IAdvisorConsentStore {
|
|
661
|
+
has(destination: string): boolean;
|
|
662
|
+
grant(destination: string): void;
|
|
663
|
+
}
|
|
664
|
+
interface IAdvisorControllerOptions {
|
|
665
|
+
/** The advisor configured when the session starts; absent means no Advisor tool this session. */
|
|
666
|
+
readonly spec?: IAdvisorSpec;
|
|
667
|
+
readonly resolveTarget: TAdvisorTargetResolver;
|
|
668
|
+
/** Optional host credential resolution; ordinary synchronous SDK callers remain unchanged. */
|
|
669
|
+
readonly resolveTargetAsync?: (spec: IAdvisorSpec) => Promise<IAdvisorTarget>;
|
|
670
|
+
/** Validate an asynchronously resolved target's settings without constructing its provider. */
|
|
671
|
+
readonly validateTarget?: (spec: IAdvisorSpec) => void;
|
|
672
|
+
readonly consent: IAdvisorConsentStore;
|
|
673
|
+
/** The organization's provider allowlist (profile names). */
|
|
674
|
+
readonly allowedProfiles?: readonly string[];
|
|
675
|
+
/** The kill switch: no tool, and nothing can turn the advisor on. */
|
|
676
|
+
readonly killSwitch?: boolean;
|
|
677
|
+
readonly maxCallsPerTurn?: number;
|
|
678
|
+
readonly maxCallsPerSession?: number;
|
|
679
|
+
}
|
|
680
|
+
type TAdvisorOutcome = 'answered' | 'repeated' | 'declined' | 'disabled' | 'limit';
|
|
681
|
+
interface IAdvisorConsultation {
|
|
682
|
+
readonly outcome: TAdvisorOutcome;
|
|
683
|
+
/** What the main model receives as the tool result. */
|
|
684
|
+
readonly text: string;
|
|
685
|
+
}
|
|
686
|
+
/** One consultation, as the calling session sees it. */
|
|
687
|
+
interface IAdvisorConsultRequest {
|
|
688
|
+
readonly question?: string;
|
|
689
|
+
/** The calling session's conversation, ending in the Advisor call itself. */
|
|
690
|
+
readonly history: readonly TUniversalMessage[];
|
|
691
|
+
readonly systemPrompt: string;
|
|
692
|
+
/**
|
|
693
|
+
* Where the main model sends the conversation now (`<type>@<host>`). Unknown means every advisor
|
|
694
|
+
* destination counts as a different one.
|
|
695
|
+
*/
|
|
696
|
+
readonly mainDestination?: string;
|
|
697
|
+
readonly sessionId: string;
|
|
698
|
+
/** Identifies the turn the call belongs to; the per-turn limit and answer reuse are per turn. */
|
|
699
|
+
readonly turnId: string;
|
|
700
|
+
readonly ask?: IUserInteraction['ask'];
|
|
701
|
+
readonly signal?: AbortSignal;
|
|
702
|
+
/** Where the advisor's token usage is recorded: the same place the session records turn usage. */
|
|
703
|
+
readonly recordUsage?: (entries: readonly IHistoryEntry[]) => void;
|
|
704
|
+
}
|
|
705
|
+
declare class AdvisorController {
|
|
706
|
+
private readonly options;
|
|
707
|
+
private spec;
|
|
708
|
+
private enabled;
|
|
709
|
+
private readonly registered;
|
|
710
|
+
private readonly killSwitch;
|
|
711
|
+
private readonly maxCallsPerTurn;
|
|
712
|
+
private readonly maxCallsPerSession;
|
|
713
|
+
private sessionCalls;
|
|
714
|
+
private cachedTarget;
|
|
715
|
+
private readonly turns;
|
|
716
|
+
private readonly pendingConsent;
|
|
717
|
+
/** Destinations the user refused this session: not asked again until the next session. */
|
|
718
|
+
private readonly deniedConsent;
|
|
719
|
+
constructor(options: IAdvisorControllerOptions);
|
|
720
|
+
/** Whether the Advisor tool belongs in this session's tool list. Fixed for the session's life. */
|
|
721
|
+
isRegistered(): boolean;
|
|
722
|
+
status(): IAdvisorStatus;
|
|
723
|
+
/** The name the transcript shows on the Advisor tool line. */
|
|
724
|
+
displayLabel(): string;
|
|
725
|
+
/** `/advisor <spec>` or `/advisor off`. Changes the target only, never the tool. */
|
|
726
|
+
set(value: string): IAdvisorSetResult;
|
|
727
|
+
consult(request: IAdvisorConsultRequest): Promise<IAdvisorConsultation>;
|
|
728
|
+
private attempt;
|
|
729
|
+
private isAllowed;
|
|
730
|
+
private targetFor;
|
|
731
|
+
private targetForAsync;
|
|
732
|
+
private resolveQuietly;
|
|
733
|
+
private hasConsent;
|
|
734
|
+
private turnState;
|
|
735
|
+
private recordUsage;
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/advisor/advisor-tool.d.ts
|
|
739
|
+
declare const ADVISOR_TOOL_NAME = "Advisor";
|
|
740
|
+
/** The unbound tool a host adds to a session's tools when the advisor is configured at start. */
|
|
741
|
+
declare function createAdvisorTool(controller: AdvisorController): IToolWithEventService;
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region src/advisor/provider-destination.d.ts
|
|
744
|
+
/**
|
|
745
|
+
* `<type>@<host>`: the configured base URL's host, else the type's default base URL or endpoint. A
|
|
746
|
+
* default port (80, 443) is left out, so one endpoint always has one name.
|
|
747
|
+
*/
|
|
748
|
+
declare function describeProviderDestination(config: {
|
|
749
|
+
readonly name: string;
|
|
750
|
+
readonly baseURL?: string;
|
|
751
|
+
}, providerDefinitions: readonly IProviderDefinition[]): string;
|
|
752
|
+
/** Record where `provider` sends requests; called where the provider is built from its settings. */
|
|
753
|
+
declare function rememberProviderDestination(provider: IAIProvider, destination: string): void;
|
|
754
|
+
/** Where `provider` sends requests, when that was recorded; otherwise unknown. */
|
|
755
|
+
declare function providerDestinationOf(provider: IAIProvider): string | undefined;
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region src/user-local/storage.d.ts
|
|
758
|
+
declare const USER_LOCAL_STORAGE_CATEGORIES: readonly ["preferences", "view-state", "memory-projections", "task-associations", "workflow-metadata", "inspection-index"];
|
|
759
|
+
type TUserLocalStorageCategory = (typeof USER_LOCAL_STORAGE_CATEGORIES)[number];
|
|
760
|
+
interface IUserLocalStorageCategoryDefinition {
|
|
761
|
+
readonly category: TUserLocalStorageCategory;
|
|
762
|
+
readonly purpose: string;
|
|
763
|
+
readonly mayExecuteCommands: false;
|
|
764
|
+
}
|
|
765
|
+
interface IUserLocalStorageItemSummary {
|
|
766
|
+
readonly root: string;
|
|
767
|
+
readonly category: TUserLocalStorageCategory;
|
|
768
|
+
readonly key: string;
|
|
769
|
+
readonly summary: string;
|
|
770
|
+
readonly source: string;
|
|
771
|
+
readonly scope: string;
|
|
772
|
+
readonly storageLocation: string;
|
|
773
|
+
readonly createdAt?: string;
|
|
774
|
+
readonly lastUsedAt?: string;
|
|
775
|
+
readonly enabled: boolean;
|
|
776
|
+
readonly deleteAvailable: boolean;
|
|
777
|
+
readonly disableAvailable: boolean;
|
|
778
|
+
}
|
|
779
|
+
interface IUserLocalStorageCategoryProjection {
|
|
780
|
+
readonly category: TUserLocalStorageCategory;
|
|
781
|
+
readonly purpose: string;
|
|
782
|
+
readonly mayExecuteCommands: false;
|
|
783
|
+
readonly storageLocation: string;
|
|
784
|
+
readonly itemCount: number;
|
|
785
|
+
readonly items: readonly IUserLocalStorageItemSummary[];
|
|
786
|
+
}
|
|
787
|
+
interface IUserLocalStorageInspection {
|
|
788
|
+
readonly root: string;
|
|
789
|
+
readonly activeRepositoryRoot: string;
|
|
790
|
+
readonly categories: readonly IUserLocalStorageCategoryProjection[];
|
|
791
|
+
readonly generatedAt: string;
|
|
792
|
+
}
|
|
793
|
+
interface IResolveUserLocalStorageRootOptions {
|
|
794
|
+
readonly activeRepositoryRoot: string;
|
|
795
|
+
readonly storageRoot: string;
|
|
796
|
+
readonly fsAsync?: IFileSystemAsync;
|
|
797
|
+
}
|
|
798
|
+
interface IInspectUserLocalStorageOptions extends IResolveUserLocalStorageRootOptions {
|
|
799
|
+
readonly now?: () => Date;
|
|
800
|
+
readonly createDirectories?: boolean;
|
|
801
|
+
}
|
|
802
|
+
declare const USER_LOCAL_STORAGE_CATEGORY_DEFINITIONS: readonly IUserLocalStorageCategoryDefinition[];
|
|
803
|
+
declare function resolveUserLocalStorageRoot(options: IResolveUserLocalStorageRootOptions): Promise<string>;
|
|
804
|
+
declare function inspectUserLocalStorage(options: IInspectUserLocalStorageOptions): Promise<IUserLocalStorageInspection>;
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region src/user-local/memory-types.d.ts
|
|
807
|
+
declare const USER_LOCAL_MEMORY_CATEGORIES: readonly ["view-preference", "last-visible-cwd", "background-selection", "task-association", "display-preference", "inspection-choice"];
|
|
808
|
+
type TUserLocalMemoryCategory = (typeof USER_LOCAL_MEMORY_CATEGORIES)[number];
|
|
809
|
+
type TUserLocalMemoryCommandExecutionEffect = 'none';
|
|
810
|
+
interface IUserLocalMemoryItemProjection {
|
|
811
|
+
readonly root: string;
|
|
812
|
+
readonly category: TUserLocalMemoryCategory;
|
|
813
|
+
readonly key: string;
|
|
814
|
+
readonly summary: string;
|
|
815
|
+
readonly valueSummary: string;
|
|
816
|
+
readonly source: string;
|
|
817
|
+
readonly scope: string;
|
|
818
|
+
readonly storageLocation: string;
|
|
819
|
+
readonly createdAt: string;
|
|
820
|
+
readonly lastUsedAt: string;
|
|
821
|
+
readonly enabled: boolean;
|
|
822
|
+
readonly displayNavigationRule: string;
|
|
823
|
+
readonly commandExecutionEffect: TUserLocalMemoryCommandExecutionEffect;
|
|
824
|
+
readonly deleteAvailable: true;
|
|
825
|
+
readonly disableAvailable: true;
|
|
826
|
+
}
|
|
827
|
+
interface IUserLocalMemoryListProjection {
|
|
828
|
+
readonly root: string;
|
|
829
|
+
readonly activeRepositoryRoot: string;
|
|
830
|
+
readonly items: readonly IUserLocalMemoryItemProjection[];
|
|
831
|
+
}
|
|
832
|
+
interface IUserLocalMemorySetOptions extends IResolveUserLocalStorageRootOptions {
|
|
833
|
+
readonly category: TUserLocalMemoryCategory;
|
|
834
|
+
readonly key: string;
|
|
835
|
+
readonly value: string;
|
|
836
|
+
readonly summary: string;
|
|
837
|
+
readonly source: string;
|
|
838
|
+
readonly scope?: string;
|
|
839
|
+
readonly now?: () => Date;
|
|
840
|
+
}
|
|
841
|
+
interface IUserLocalMemoryItemOptions extends IResolveUserLocalStorageRootOptions {
|
|
842
|
+
readonly category: TUserLocalMemoryCategory;
|
|
843
|
+
readonly key: string;
|
|
844
|
+
readonly now?: () => Date;
|
|
845
|
+
}
|
|
846
|
+
interface IUserLocalMemoryListOptions extends IResolveUserLocalStorageRootOptions {
|
|
847
|
+
readonly now?: () => Date;
|
|
848
|
+
}
|
|
849
|
+
interface IUserLocalMemoryDeleteResult {
|
|
850
|
+
readonly category: TUserLocalMemoryCategory;
|
|
851
|
+
readonly key: string;
|
|
852
|
+
readonly deleted: boolean;
|
|
853
|
+
}
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region src/user-local/memory.d.ts
|
|
856
|
+
declare function setUserLocalMemoryItem(options: IUserLocalMemorySetOptions): Promise<IUserLocalMemoryItemProjection>;
|
|
857
|
+
declare function listUserLocalMemoryItems(options: IUserLocalMemoryListOptions): Promise<IUserLocalMemoryListProjection>;
|
|
858
|
+
declare function inspectUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryItemProjection>;
|
|
859
|
+
declare function disableUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryItemProjection>;
|
|
860
|
+
declare function deleteUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryDeleteResult>;
|
|
861
|
+
declare function readEnabledUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryItemProjection | null>;
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region src/memory/file-system-memory-store.d.ts
|
|
864
|
+
declare class WorkspaceMemoryStore implements IMemoryStore {
|
|
865
|
+
private readonly project;
|
|
866
|
+
private readonly pending;
|
|
867
|
+
private readonly retrieval;
|
|
868
|
+
constructor(storage: IWorkspaceProjectStateStorage, now?: () => Date);
|
|
869
|
+
loadStartupMemory(): Promise<IStartupMemory>;
|
|
870
|
+
list(): Promise<IProjectMemorySummary>;
|
|
871
|
+
readTopic(topic: string): Promise<string>;
|
|
872
|
+
append(input: IAppendMemoryInput): Promise<IAppendMemoryResult>;
|
|
873
|
+
replaceTopic(input: IAppendMemoryInput): Promise<{
|
|
874
|
+
topic: string;
|
|
875
|
+
topicPath: string;
|
|
876
|
+
indexPath: string;
|
|
877
|
+
}>;
|
|
878
|
+
forgetTopic(topic: string): Promise<{
|
|
879
|
+
topic: string;
|
|
880
|
+
topicPath: string;
|
|
881
|
+
indexPath: string;
|
|
882
|
+
}>;
|
|
883
|
+
private purgePendingTopic;
|
|
884
|
+
recall(query: string, budget: IMemoryBudget): Promise<IMemoryRetrievalResult>;
|
|
885
|
+
getPending(id: string): Promise<IMemoryPendingRecord | undefined>;
|
|
886
|
+
listPending(status?: TMemoryCandidateStatus): Promise<IMemoryPendingRecord[]>;
|
|
887
|
+
markPending(id: string, status: TMemoryCandidateStatus, reason: string): Promise<IMemoryPendingRecord>;
|
|
888
|
+
upsertPending(candidate: IMemoryCandidate, status: TMemoryCandidateStatus, reason: string): Promise<void>;
|
|
889
|
+
}
|
|
890
|
+
/** Create the memory port adapter for an accepted workspace `memory` state facet. */
|
|
891
|
+
declare function createWorkspaceMemoryStore(storage: IWorkspaceProjectStateStorage, now?: () => Date): IMemoryStore;
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region src/memory/memory-approval.d.ts
|
|
894
|
+
interface IApprovedMemoryCandidate {
|
|
895
|
+
record: IMemoryPendingRecord;
|
|
896
|
+
saved: IAppendMemoryResult;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* The one approval path for a queued memory candidate. Only a `pending` candidate can be approved, and
|
|
900
|
+
* its text is checked for sensitive content again, so a skipped, rejected or already-saved record — or
|
|
901
|
+
* one that a stricter filter now flags — never reaches durable memory.
|
|
902
|
+
*/
|
|
903
|
+
declare function approvePendingMemoryCandidate(store: IMemoryStore, id: string): Promise<IApprovedMemoryCandidate>;
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/memory/semantic-memory-store.d.ts
|
|
906
|
+
declare class SemanticMemoryStore implements IMemoryStore {
|
|
907
|
+
private readonly base;
|
|
908
|
+
private readonly adapter;
|
|
909
|
+
private mutations;
|
|
910
|
+
constructor(base: IMemoryStore, adapter: ISemanticMemoryAdapter);
|
|
911
|
+
loadStartupMemory(): Promise<IStartupMemory>;
|
|
912
|
+
list(): Promise<IProjectMemorySummary>;
|
|
913
|
+
readTopic(topic: string): Promise<string>;
|
|
914
|
+
/**
|
|
915
|
+
* Durable base write first (authoritative), then a guarded semantic index — but only when the base actually wrote a
|
|
916
|
+
* new entry (not a dedup). An index failure is a declared degradation: the durable write is kept, the vector write is
|
|
917
|
+
* skipped (re-indexable later).
|
|
918
|
+
*/
|
|
919
|
+
append(input: IAppendMemoryInput): Promise<IAppendMemoryResult>;
|
|
920
|
+
private mutate;
|
|
921
|
+
replaceTopic(input: IAppendMemoryInput): Promise<IMemoryTopicMutationResult>;
|
|
922
|
+
forgetTopic(topic: string): Promise<IMemoryTopicMutationResult>;
|
|
923
|
+
recall(query: string, budget: IMemoryBudget): Promise<IMemoryRetrievalResult>;
|
|
924
|
+
getPending(id: string): Promise<IMemoryPendingRecord | undefined>;
|
|
925
|
+
listPending(status?: TMemoryCandidateStatus): Promise<IMemoryPendingRecord[]>;
|
|
926
|
+
markPending(id: string, status: TMemoryCandidateStatus, reason: string): Promise<IMemoryPendingRecord>;
|
|
927
|
+
upsertPending(candidate: IMemoryCandidate, status: TMemoryCandidateStatus, reason: string): Promise<void>;
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Compose a base `IMemoryStore` with a semantic adapter into a semantic-upgraded store (mirrors
|
|
931
|
+
* `createFileSystemMemoryStore`). The surface supplies the concrete `ISemanticMemoryAdapter`.
|
|
932
|
+
*/
|
|
933
|
+
declare function createSemanticMemoryStore(base: IMemoryStore, adapter: ISemanticMemoryAdapter): IMemoryStore;
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/memory/memory-candidate-extractor.d.ts
|
|
936
|
+
interface IMemoryCandidateExtractor {
|
|
937
|
+
extract(input: IMemoryExtractionInput): IMemoryCandidate[];
|
|
938
|
+
}
|
|
939
|
+
/** A memory-cue trigger: the first capture group of `pattern` becomes the candidate text. */
|
|
940
|
+
interface IMemoryExtractorTrigger {
|
|
941
|
+
pattern: RegExp;
|
|
942
|
+
confidence: number;
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* NEUT-007: extractor POLICY — trigger phrases and classification vocabulary are
|
|
946
|
+
* locale/domain policy, injectable by the composition root. The library holds no
|
|
947
|
+
* baked-in locale/domain heuristics beyond the documented default below.
|
|
948
|
+
*/
|
|
949
|
+
interface IMemoryExtractorPolicy {
|
|
950
|
+
/** Memory-cue triggers, evaluated in order against the user message. */
|
|
951
|
+
triggers: readonly IMemoryExtractorTrigger[];
|
|
952
|
+
/** Vocabulary classifying a candidate as project-scoped memory. */
|
|
953
|
+
projectTerms: RegExp;
|
|
954
|
+
/** Vocabulary classifying a candidate as user-preference memory. */
|
|
955
|
+
preferenceTerms: RegExp;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* The DOCUMENTED default policy: bilingual (English/Korean) memory cues plus a
|
|
959
|
+
* software-project vocabulary. Composition roots supply their own
|
|
960
|
+
* `IMemoryExtractorPolicy` to replace it (other locales, other domains).
|
|
961
|
+
*/
|
|
962
|
+
declare const DEFAULT_MEMORY_EXTRACTOR_POLICY: IMemoryExtractorPolicy;
|
|
963
|
+
declare class RegexMemoryCandidateExtractor implements IMemoryCandidateExtractor {
|
|
964
|
+
private readonly policy;
|
|
965
|
+
constructor(policy?: IMemoryExtractorPolicy);
|
|
966
|
+
extract(input: IMemoryExtractionInput): IMemoryCandidate[];
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/self-hosting/self-hosting-verification.d.ts
|
|
970
|
+
type TSelfHostingVerificationPhase = 'checkpoint' | 'edit' | 'handoff' | 'verify' | 'recover';
|
|
971
|
+
type TSelfHostingLoopState = 'idle' | 'checkpointed' | 'editing' | 'verifying' | 'passed' | 'failed' | 'rolled_back' | 'cancelled';
|
|
972
|
+
type TSelfHostingLoopEvent = 'checkpoint_created' | 'edits_started' | 'edits_applied' | 'verify_passed' | 'verify_failed' | 'rollback_completed' | 'cancelled';
|
|
973
|
+
/**
|
|
974
|
+
* Repo-process command templates injected by the composition root (NEUT-001).
|
|
975
|
+
*
|
|
976
|
+
* The library ships NO default commands: which package manager, verification
|
|
977
|
+
* commands, or CI-like gate a repository uses is the host project's policy.
|
|
978
|
+
* Placeholders: `{scope}` in `packageVerify` templates is replaced with each
|
|
979
|
+
* package scope; `{baseRef}` in the `repoVerify` template is replaced with the
|
|
980
|
+
* plan's base ref.
|
|
981
|
+
*/
|
|
982
|
+
interface ISelfHostingCommandTemplates {
|
|
983
|
+
/** Per-scope verification commands, applied to every package scope in order. */
|
|
984
|
+
packageVerify: readonly {
|
|
985
|
+
name: string;
|
|
986
|
+
template: string;
|
|
987
|
+
}[];
|
|
988
|
+
/** Optional repo-wide verification gate appended after the per-scope steps. */
|
|
989
|
+
repoVerify?: {
|
|
990
|
+
description: string;
|
|
991
|
+
template: string;
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
interface ISelfHostingVerificationPlanInput {
|
|
995
|
+
changedFiles: readonly string[];
|
|
996
|
+
packageScopes?: readonly string[];
|
|
997
|
+
/** Base git ref to verify against. Required — the library has no repo-specific default. */
|
|
998
|
+
baseRef: string;
|
|
999
|
+
/** Verification command templates. Required — the library has no repo-specific default. */
|
|
1000
|
+
commandTemplates: ISelfHostingCommandTemplates;
|
|
1001
|
+
}
|
|
1002
|
+
interface ISelfHostingVerificationStep {
|
|
1003
|
+
id: string;
|
|
1004
|
+
phase: TSelfHostingVerificationPhase;
|
|
1005
|
+
description: string;
|
|
1006
|
+
required: boolean;
|
|
1007
|
+
command?: string;
|
|
1008
|
+
}
|
|
1009
|
+
interface ISelfHostingVerificationPlan {
|
|
1010
|
+
changedFiles: readonly string[];
|
|
1011
|
+
packageScopes: readonly string[];
|
|
1012
|
+
baseRef: string;
|
|
1013
|
+
steps: readonly ISelfHostingVerificationStep[];
|
|
1014
|
+
}
|
|
1015
|
+
declare function planSelfHostingVerification(input: ISelfHostingVerificationPlanInput): ISelfHostingVerificationPlan;
|
|
1016
|
+
declare function transitionSelfHostingLoop(state: TSelfHostingLoopState, event: TSelfHostingLoopEvent): TSelfHostingLoopState;
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region src/evals/eval-types.d.ts
|
|
1019
|
+
/**
|
|
1020
|
+
* A metric scores one run's SSOT result. A `boolean` is a direct pass/fail; a `number` is a score in `[0, 1]`
|
|
1021
|
+
* where higher is better (compared against the definition threshold). Required assertions must score 1. A numeric score outside `[0, 1]` is
|
|
1022
|
+
* clamped by the runner. Pure — no IO, no provider.
|
|
1023
|
+
*/
|
|
1024
|
+
interface IMetric {
|
|
1025
|
+
readonly name: string;
|
|
1026
|
+
/** A required assertion must score 1 in every case, independently of the aggregate threshold. */
|
|
1027
|
+
readonly required?: boolean;
|
|
1028
|
+
score(result: IExecutionResult$1, evalCase?: IEvalCase): number | boolean;
|
|
1029
|
+
}
|
|
1030
|
+
/** One eval case: the prompt driven through the agent, plus an optional expected reference for a metric to use. */
|
|
1031
|
+
interface IEvalCase {
|
|
1032
|
+
readonly input: string;
|
|
1033
|
+
readonly expected?: string;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* An eval definition: a dataset of cases scored by metrics against a pass threshold.
|
|
1037
|
+
* `threshold` is the aggregate mean-score bar in `[0, 1]` (default `1`). Because a `boolean` score normalizes to
|
|
1038
|
+
* `1`/`0`, for boolean metrics the aggregate IS the pass rate (e.g. One-Shot CI Pass Rate ≥ 0.8).
|
|
1039
|
+
*/
|
|
1040
|
+
interface IEvalDefinition {
|
|
1041
|
+
readonly name?: string;
|
|
1042
|
+
readonly cases: readonly IEvalCase[];
|
|
1043
|
+
readonly metrics: readonly IMetric[];
|
|
1044
|
+
readonly threshold?: number;
|
|
1045
|
+
}
|
|
1046
|
+
/** One metric's outcome for one case: the raw score and its `[0, 1]`-normalized value. */
|
|
1047
|
+
interface IEvalMetricScore {
|
|
1048
|
+
readonly metric: string;
|
|
1049
|
+
readonly score: number | boolean;
|
|
1050
|
+
readonly normalized: number;
|
|
1051
|
+
}
|
|
1052
|
+
/** One case's outcome: each metric's score plus the case's mean normalized score. */
|
|
1053
|
+
interface IEvalCaseResult {
|
|
1054
|
+
readonly input: string;
|
|
1055
|
+
readonly scores: readonly IEvalMetricScore[];
|
|
1056
|
+
readonly caseScore: number;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* The eval report: per-case results, the aggregate `overallScore` (mean of every case×metric normalized score),
|
|
1060
|
+
* the resolved `threshold`, and the overall `passed` verdict (all runs completed, aggregate threshold met and every required assertion passes). This verdict is what
|
|
1061
|
+
* the `agent eval` CI gate (P2) maps to a process exit code.
|
|
1062
|
+
*/
|
|
1063
|
+
interface IEvalReport {
|
|
1064
|
+
readonly name?: string;
|
|
1065
|
+
readonly results: readonly IEvalCaseResult[];
|
|
1066
|
+
readonly overallScore: number;
|
|
1067
|
+
readonly threshold: number;
|
|
1068
|
+
readonly passed: boolean;
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* The injected run function: produce a run result for one case input. The library defines NO provider and NO
|
|
1072
|
+
* agent config — the caller supplies this (the default is built from `createAgentRuntime().createSession()`,
|
|
1073
|
+
* capturing the terminal `complete`-event `IExecutionResult`; see `createSessionRunFn`).
|
|
1074
|
+
*/
|
|
1075
|
+
type TEvalRunFn = (input: string) => Promise<IExecutionResult$1>;
|
|
1076
|
+
//#endregion
|
|
1077
|
+
//#region src/evals/runner.d.ts
|
|
1078
|
+
/**
|
|
1079
|
+
* Validate + normalize an eval definition. Throws on an empty case/metric set or an out-of-range threshold;
|
|
1080
|
+
* returns the definition with `threshold` defaulted to `1`. Exposed so a caller can fail fast before a run.
|
|
1081
|
+
*/
|
|
1082
|
+
declare function defineEval(def: IEvalDefinition): IEvalDefinition;
|
|
1083
|
+
/**
|
|
1084
|
+
* Run every case through `runFn`, score each run-result with each metric, and aggregate to a report.
|
|
1085
|
+
*
|
|
1086
|
+
* Cases run sequentially (deterministic; a shared provider is not hammered in parallel). `overallScore` is the
|
|
1087
|
+
* mean of every case×metric normalized score. Every run must complete and required assertions must pass; the CI
|
|
1088
|
+
* gate maps to an exit code.
|
|
1089
|
+
*/
|
|
1090
|
+
declare function runEval(def: IEvalDefinition, runFn: TEvalRunFn): Promise<IEvalReport>;
|
|
1091
|
+
//#endregion
|
|
1092
|
+
//#region src/runtime/session-runtime.d.ts
|
|
1093
|
+
interface IAgentRuntimeConfig {
|
|
1094
|
+
cwd: string;
|
|
1095
|
+
provider: IAIProvider;
|
|
1096
|
+
/** Host-owned initial project decision. Absence produces an observable Restricted runtime. */
|
|
1097
|
+
projectAccess?: TWorkspaceProjectAccess;
|
|
1098
|
+
/** Explicit user settings layers for sessions created by this runtime. */
|
|
1099
|
+
userSettingsSources?: readonly INodeHostSettingsSource[];
|
|
1100
|
+
commandModules?: readonly ICommandModule[];
|
|
1101
|
+
commandHostAdapters?: ICommandHostAdapters;
|
|
1102
|
+
backgroundTaskRunners?: IBackgroundTaskRunner$1[];
|
|
1103
|
+
subagentRunnerFactory?: TSubagentRunnerFactory;
|
|
1104
|
+
/** Runtime default; explicit undefined disables persistence for sessions that omit an override. */
|
|
1105
|
+
sessionStore?: IInteractiveSessionStore$1 | undefined;
|
|
1106
|
+
transportRegistry?: ITransportRegistryView;
|
|
1107
|
+
reloadPluginCommandSource?: (registry: CommandRegistry) => void;
|
|
1108
|
+
orgPolicy?: IOrgPolicy;
|
|
1109
|
+
/** REMOTE-006: optional remote-command policy. Absent → allow (local == remote); provide one only to restrict. */
|
|
1110
|
+
remoteCommandPolicy?: IRemoteCommandPolicy;
|
|
1111
|
+
}
|
|
1112
|
+
/** Session-specific options for IAgentRuntime.createSession(). Runtime fields (cwd, provider, etc.) are inherited automatically. */
|
|
1113
|
+
interface IHeadlessSessionOptions {
|
|
1114
|
+
permissionMode?: TPermissionMode;
|
|
1115
|
+
maxTurns?: number;
|
|
1116
|
+
/** Omitted inherits the runtime store; explicit undefined disables persistence for this session. */
|
|
1117
|
+
sessionStore?: IInteractiveSessionStore$1 | undefined;
|
|
1118
|
+
sessionName?: string;
|
|
1119
|
+
bare?: boolean;
|
|
1120
|
+
allowedTools?: string[];
|
|
1121
|
+
/** Denied tool names — added to permissions.deny. denied > allowed. */
|
|
1122
|
+
deniedTools?: string[];
|
|
1123
|
+
/** Override the model from config. When set, takes precedence over config.provider.model. */
|
|
1124
|
+
model?: string;
|
|
1125
|
+
appendSystemPrompt?: string;
|
|
1126
|
+
/** Replace the entire system prompt. Takes precedence over the default builder. */
|
|
1127
|
+
systemPrompt?: string;
|
|
1128
|
+
shellExec?: TShellExecFn;
|
|
1129
|
+
agentName?: string;
|
|
1130
|
+
/** Additional tools registered alongside the default CLI tools. */
|
|
1131
|
+
additionalTools?: IToolWithEventService[];
|
|
1132
|
+
/** Resume an existing persisted session by ID. Requires sessionStore to be configured. */
|
|
1133
|
+
resumeSessionId?: string;
|
|
1134
|
+
/** Request structured output from the provider for this session (issue #2056: incl. `json_schema`). */
|
|
1135
|
+
responseFormat?: TSessionResponseFormat;
|
|
1136
|
+
}
|
|
1137
|
+
interface IAgentRuntime {
|
|
1138
|
+
readonly cwd: string;
|
|
1139
|
+
readonly provider: IAIProvider;
|
|
1140
|
+
readonly projectAccess: TWorkspaceProjectAccess;
|
|
1141
|
+
readonly commandModules: readonly ICommandModule[];
|
|
1142
|
+
readonly commandHostAdapters: ICommandHostAdapters;
|
|
1143
|
+
readonly backgroundTaskRunners: IBackgroundTaskRunner$1[];
|
|
1144
|
+
readonly subagentRunnerFactory: TSubagentRunnerFactory | undefined;
|
|
1145
|
+
readonly sessionStore: IInteractiveSessionStore$1 | undefined;
|
|
1146
|
+
readonly transportRegistry: ITransportRegistryView | undefined;
|
|
1147
|
+
readonly reloadPluginCommandSource: (registry: CommandRegistry) => void;
|
|
1148
|
+
createSession(opts: IHeadlessSessionOptions): InteractiveSession;
|
|
1149
|
+
}
|
|
1150
|
+
declare function createAgentRuntime(config: IAgentRuntimeConfig): IAgentRuntime;
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/evals/session-run-fn.d.ts
|
|
1153
|
+
/**
|
|
1154
|
+
* Build a default `runFn` bound to an agent runtime. Each invocation runs one case in its own session, captures
|
|
1155
|
+
* that session's terminal `complete`/`interrupted` `IExecutionResult` (an `error` event rejects), and shuts the
|
|
1156
|
+
* session down before returning.
|
|
1157
|
+
*/
|
|
1158
|
+
declare function createSessionRunFn(runtime: IAgentRuntime, options?: IHeadlessSessionOptions): TEvalRunFn;
|
|
1159
|
+
//#endregion
|
|
1160
|
+
//#region src/evals/metric-helpers.d.ts
|
|
1161
|
+
/**
|
|
1162
|
+
* The run response equals the expected string. Two forms:
|
|
1163
|
+
* - `exactMatch('foo')` — a fixed expected applied to every case (homogeneous).
|
|
1164
|
+
* - `exactMatch()` — reads each case's `evalCase.expected` (per-case; makes `parseEvalCases`' field live).
|
|
1165
|
+
* `trim` (default true) trims both sides before comparing.
|
|
1166
|
+
*/
|
|
1167
|
+
declare function exactMatch(expected?: string, options?: {
|
|
1168
|
+
trim?: boolean;
|
|
1169
|
+
}): IMetric;
|
|
1170
|
+
/** The run response contains `substring`. */
|
|
1171
|
+
declare function includesText(substring: string): IMetric;
|
|
1172
|
+
/** The run response matches `pattern`. */
|
|
1173
|
+
declare function regexMatch(pattern: RegExp): IMetric;
|
|
1174
|
+
/** The run response parses as JSON (a format probe — no domain schema opinion). */
|
|
1175
|
+
declare function responseIsJson(): IMetric;
|
|
1176
|
+
/** The run's tool trajectory includes a call to the named tool. */
|
|
1177
|
+
declare function usedTool(name: string): IMetric;
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region src/evals/dataset.d.ts
|
|
1180
|
+
/**
|
|
1181
|
+
* Parse a consumer-supplied dataset into `IEvalCase[]`.
|
|
1182
|
+
* - `'json'` — a JSON array of `{ input, expected? }` rows.
|
|
1183
|
+
* - `'jsonl'` — one JSON `{ input, expected? }` object per non-blank line.
|
|
1184
|
+
* Throws on malformed input (a broken corpus is a loud failure, not a silent skip).
|
|
1185
|
+
*/
|
|
1186
|
+
declare function parseEvalCases(text: string, format: 'json' | 'jsonl'): IEvalCase[];
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/evals/format.d.ts
|
|
1189
|
+
/** A compact human/CI-readable report: a per-case line each + an overall `PASS`/`FAIL` line against the threshold. */
|
|
1190
|
+
declare function formatEvalReport(report: IEvalReport): string;
|
|
1191
|
+
//#endregion
|
|
1192
|
+
//#region src/agents/built-in-agents.d.ts
|
|
1193
|
+
/**
|
|
1194
|
+
* All built-in agent definitions shipped with the SDK.
|
|
1195
|
+
* Order matters: general-purpose is the default fallback.
|
|
1196
|
+
*/
|
|
1197
|
+
declare const BUILT_IN_AGENTS: IAgentDefinition[];
|
|
1198
|
+
//#endregion
|
|
1199
|
+
//#region src/tools/command-execution-tool.d.ts
|
|
1200
|
+
type TModelCommandDescriptor$1 = Pick<ICapabilityDescriptor, 'name' | 'description' | 'argumentHint'>;
|
|
1201
|
+
interface ICommandExecutionToolDeps {
|
|
1202
|
+
isModelInvocable: (command: string) => boolean;
|
|
1203
|
+
execute: (command: string, args: string) => Promise<ICommandResult$1 | null>;
|
|
1204
|
+
commandNames?: readonly string[];
|
|
1205
|
+
commandDescriptors?: readonly TModelCommandDescriptor$1[];
|
|
1206
|
+
}
|
|
1207
|
+
declare function createCommandExecutionTool(deps: ICommandExecutionToolDeps): ReturnType<typeof createZodFunctionTool>;
|
|
1208
|
+
//#endregion
|
|
1209
|
+
//#region src/tools/model-command-tool-projection.d.ts
|
|
1210
|
+
declare const MODEL_COMMAND_TOOL_PREFIX: "command_";
|
|
1211
|
+
declare const PROVIDER_SAFE_TOOL_NAME_PATTERN: RegExp;
|
|
1212
|
+
type TModelCommandDescriptor = Pick<ICapabilityDescriptor, 'name' | 'description' | 'argumentHint' | 'requiresPermission'>;
|
|
1213
|
+
interface IProjectedModelCommandTool {
|
|
1214
|
+
readonly commandName: string;
|
|
1215
|
+
readonly toolName: string;
|
|
1216
|
+
readonly description: string;
|
|
1217
|
+
readonly descriptor: TModelCommandDescriptor;
|
|
1218
|
+
/** Mirrors the source command's requiresPermission flag. false = auto-approved. */
|
|
1219
|
+
readonly requiresPermission: boolean;
|
|
1220
|
+
}
|
|
1221
|
+
interface IModelCommandToolProjection {
|
|
1222
|
+
readonly commandTools: readonly IProjectedModelCommandTool[];
|
|
1223
|
+
readonly toolNameToCommandName: ReadonlyMap<string, string>;
|
|
1224
|
+
readonly commandNameToToolName: ReadonlyMap<string, string>;
|
|
1225
|
+
}
|
|
1226
|
+
interface IProjectedCommandExecutionToolsDeps {
|
|
1227
|
+
isModelInvocable: (command: string) => boolean;
|
|
1228
|
+
execute: (command: string, args: string) => Promise<ICommandResult$1 | null>;
|
|
1229
|
+
commandDescriptors: readonly TModelCommandDescriptor[];
|
|
1230
|
+
toolNamePrefix?: string;
|
|
1231
|
+
}
|
|
1232
|
+
declare function normalizeModelCommandName(command: string): string;
|
|
1233
|
+
declare function createProviderSafeModelCommandToolName(commandName: string, prefix?: string): string;
|
|
1234
|
+
declare function createModelCommandToolProjection(commandDescriptors: readonly TModelCommandDescriptor[], toolNamePrefix?: string): IModelCommandToolProjection;
|
|
1235
|
+
declare function formatProjectedModelCommandToolPromptDescription(projection: IProjectedModelCommandTool): string;
|
|
1236
|
+
declare function createProjectedCommandExecutionTools(deps: IProjectedCommandExecutionToolsDeps): Array<ReturnType<typeof createZodFunctionTool>>;
|
|
1237
|
+
//#endregion
|
|
1238
|
+
//#region src/tools/background-process-tool.d.ts
|
|
1239
|
+
interface IBackgroundProcessToolDeps {
|
|
1240
|
+
backgroundTaskManager: IBackgroundTaskManager;
|
|
1241
|
+
cwd?: string;
|
|
1242
|
+
parentSessionId?: string;
|
|
1243
|
+
metadata?: Record<string, TBackgroundPrimitive>;
|
|
1244
|
+
}
|
|
1245
|
+
declare function createBackgroundProcessTool(deps: IBackgroundProcessToolDeps): ReturnType<typeof createZodFunctionTool>;
|
|
1246
|
+
//#endregion
|
|
1247
|
+
//#region src/orchestration/shared.d.ts
|
|
1248
|
+
/**
|
|
1249
|
+
* Neutral run context threaded into each spawned subagent request. Shared by
|
|
1250
|
+
* every orchestration primitive (`sequential`/`parallel`/`handoff`/…).
|
|
1251
|
+
*/
|
|
1252
|
+
interface IOrchestrationRunContext {
|
|
1253
|
+
/** The parent session id the run belongs to. */
|
|
1254
|
+
parentSessionId: string;
|
|
1255
|
+
/** The working directory for spawned subagents. */
|
|
1256
|
+
cwd: string;
|
|
1257
|
+
/** Depth of this orchestration in the hierarchy (0 = root). */
|
|
1258
|
+
depth?: number;
|
|
1259
|
+
}
|
|
1260
|
+
//#endregion
|
|
1261
|
+
//#region src/orchestration/sequential.d.ts
|
|
1262
|
+
/**
|
|
1263
|
+
* Neutral run context threaded into each spawned subagent request.
|
|
1264
|
+
* Alias of the shared {@link IOrchestrationRunContext}, kept as the
|
|
1265
|
+
* sequential-specific public name for back-compat.
|
|
1266
|
+
*/
|
|
1267
|
+
type ISequentialRunContext = IOrchestrationRunContext;
|
|
1268
|
+
/**
|
|
1269
|
+
* Dependencies for the `sequential` orchestration mechanism.
|
|
1270
|
+
*
|
|
1271
|
+
* The `manager` is the `agent-executor` `ISubagentManager` — the port surface
|
|
1272
|
+
* over `ISubagentRunner`. At the composition root it is built over the real
|
|
1273
|
+
* runner (`createInProcessSubagentRunner` in-process, or the child-process
|
|
1274
|
+
* runner from `agent-subagent-runner` injected at the `agent-cli` root). The
|
|
1275
|
+
* framework NEVER depends on `agent-subagent-runner` (that would be a cycle);
|
|
1276
|
+
* it composes only over the injected `ISubagentManager`.
|
|
1277
|
+
*/
|
|
1278
|
+
interface ISequentialOrchestratorDeps {
|
|
1279
|
+
/** The subagent manager (over `ISubagentRunner`) that runs each step. */
|
|
1280
|
+
manager: ISubagentManager;
|
|
1281
|
+
/** Run context threaded into each spawned subagent request. */
|
|
1282
|
+
context: IOrchestrationRunContext;
|
|
1283
|
+
/** Optional event service; when present, lifecycle events are emitted. */
|
|
1284
|
+
events?: IEventService;
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Run a `sequential` orchestration: execute each step in order over the injected
|
|
1288
|
+
* `ISubagentManager`, threading each step's output into the next (when
|
|
1289
|
+
* `threadOutput` is not disabled), and emitting neutral lifecycle events over the
|
|
1290
|
+
* event-service. Returns the per-step results plus the final aggregate output
|
|
1291
|
+
* (the last step's output).
|
|
1292
|
+
*/
|
|
1293
|
+
declare function runSequential(spec: ISequentialOrchestrationSpec, deps: ISequentialOrchestratorDeps): Promise<IOrchestrationRunResult>;
|
|
1294
|
+
//#endregion
|
|
1295
|
+
//#region src/orchestration/parallel.d.ts
|
|
1296
|
+
/**
|
|
1297
|
+
* Dependencies for the `parallel` orchestration mechanism. Same shape as the
|
|
1298
|
+
* sequential deps — the injected `ISubagentManager` (over `ISubagentRunner`)
|
|
1299
|
+
* runs each step; the framework never depends on `agent-subagent-runner`.
|
|
1300
|
+
*/
|
|
1301
|
+
interface IParallelOrchestratorDeps {
|
|
1302
|
+
/** The subagent manager (over `ISubagentRunner`) that runs each step. */
|
|
1303
|
+
manager: ISubagentManager;
|
|
1304
|
+
/** Run context threaded into each spawned subagent request. */
|
|
1305
|
+
context: IOrchestrationRunContext;
|
|
1306
|
+
/** Optional event service; when present, lifecycle events are emitted. */
|
|
1307
|
+
events?: IEventService;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Run a `parallel` orchestration: execute the steps concurrently over the
|
|
1311
|
+
* injected `ISubagentManager` under a bounded concurrency pool
|
|
1312
|
+
* (`maxConcurrency`; unbounded when omitted or `<= 0`), then aggregate. Each
|
|
1313
|
+
* step runs with only its own prompt (no threading). Results are returned in
|
|
1314
|
+
* original step order regardless of completion order; the aggregate output is
|
|
1315
|
+
* every step's output joined in order (blank-line separated). Emits neutral
|
|
1316
|
+
* lifecycle events over the event-service; step events interleave by nature.
|
|
1317
|
+
*/
|
|
1318
|
+
declare function runParallel(spec: IParallelOrchestrationSpec, deps: IParallelOrchestratorDeps): Promise<IOrchestrationRunResult>;
|
|
1319
|
+
//#endregion
|
|
1320
|
+
//#region src/orchestration/handoff.d.ts
|
|
1321
|
+
/**
|
|
1322
|
+
* A neutral handoff policy: given the current step's output and id, return the
|
|
1323
|
+
* id of the step to transfer control to, or `null` to stop. This is the ONLY
|
|
1324
|
+
* injected policy — keeping WHICH step receives control a caller decision means
|
|
1325
|
+
* the primitive itself carries no app-domain routing logic (library-neutral).
|
|
1326
|
+
*/
|
|
1327
|
+
type ResolveHandoff = (output: string, currentStepId: string) => string | null;
|
|
1328
|
+
/**
|
|
1329
|
+
* Dependencies for the `handoff` orchestration mechanism. Adds the neutral
|
|
1330
|
+
* `resolveHandoff` policy to the shared manager/context/events surface.
|
|
1331
|
+
*/
|
|
1332
|
+
interface IHandoffOrchestratorDeps {
|
|
1333
|
+
/** The subagent manager (over `ISubagentRunner`) that runs each step. */
|
|
1334
|
+
manager: ISubagentManager;
|
|
1335
|
+
/** Run context threaded into each spawned subagent request. */
|
|
1336
|
+
context: IOrchestrationRunContext;
|
|
1337
|
+
/** Optional event service; when present, lifecycle events are emitted. */
|
|
1338
|
+
events?: IEventService;
|
|
1339
|
+
/** Caller-supplied policy resolving the next step to transfer control to (or `null` to stop). */
|
|
1340
|
+
resolveHandoff: ResolveHandoff;
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Run a `handoff` orchestration: control starts at `entryStepId`; after each
|
|
1344
|
+
* step the injected `resolveHandoff` policy decides which step (if any) receives
|
|
1345
|
+
* control next, transferring loop ownership. The receiving step is threaded the
|
|
1346
|
+
* previous step's output. A `maxHandoffs` bound (default: step count) guards a
|
|
1347
|
+
* policy that never terminates. Returns the per-step results in execution order
|
|
1348
|
+
* plus the final control-holder's output. Emits neutral lifecycle events.
|
|
1349
|
+
*/
|
|
1350
|
+
declare function runHandoff(spec: IHandoffOrchestrationSpec, deps: IHandoffOrchestratorDeps): Promise<IOrchestrationRunResult>;
|
|
1351
|
+
//#endregion
|
|
1352
|
+
//#region src/orchestration/hierarchical.d.ts
|
|
1353
|
+
/**
|
|
1354
|
+
* A neutral delegation policy: given the manager step's latest output and the
|
|
1355
|
+
* current round, return the worker delegations to run next, or an empty
|
|
1356
|
+
* array / `null` to finish. Keeping WHICH workers run a caller decision means
|
|
1357
|
+
* the primitive itself carries no app-domain routing (library-neutral).
|
|
1358
|
+
*/
|
|
1359
|
+
type PlanDelegation = (managerOutput: string, round: number) => IOrchestrationDelegation[] | null;
|
|
1360
|
+
/**
|
|
1361
|
+
* Dependencies for the `hierarchical` orchestration mechanism. Adds the neutral
|
|
1362
|
+
* `planDelegation` policy to the shared manager/context/events surface.
|
|
1363
|
+
*/
|
|
1364
|
+
interface IHierarchicalOrchestratorDeps {
|
|
1365
|
+
/** The subagent manager (over `ISubagentRunner`) that runs each step. */
|
|
1366
|
+
manager: ISubagentManager;
|
|
1367
|
+
/** Run context threaded into each spawned subagent request. */
|
|
1368
|
+
context: IOrchestrationRunContext;
|
|
1369
|
+
/** Optional event service; when present, lifecycle events are emitted. */
|
|
1370
|
+
events?: IEventService;
|
|
1371
|
+
/** Caller-supplied policy turning the manager's output into worker delegations (or `null` to stop). */
|
|
1372
|
+
planDelegation: PlanDelegation;
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Run a `hierarchical` (manager-delegation) orchestration: the manager step runs
|
|
1376
|
+
* (threaded the previous round's aggregated worker output), the injected
|
|
1377
|
+
* `planDelegation` policy turns its output into worker delegations, those workers
|
|
1378
|
+
* run, and their aggregated output feeds the manager's next round — until the
|
|
1379
|
+
* policy returns an empty/`null` plan (the manager is done) or `maxRounds` is
|
|
1380
|
+
* exceeded. Returns the per-step results in execution order plus the manager's
|
|
1381
|
+
* final output. Emits neutral lifecycle events over the event-service.
|
|
1382
|
+
*/
|
|
1383
|
+
declare function runHierarchical(spec: IHierarchicalOrchestrationSpec, deps: IHierarchicalOrchestratorDeps): Promise<IOrchestrationRunResult>;
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region src/orchestration/group-chat-roundtable.d.ts
|
|
1386
|
+
/**
|
|
1387
|
+
* The neutral turn-selection policy the facade wraps into a `TurnSelector` (SELFHOST-001 P3 —
|
|
1388
|
+
* moved here, unchanged, from `group-chat.ts`; re-exported there for the existing public path).
|
|
1389
|
+
*/
|
|
1390
|
+
type SelectNextStep = (history: IOrchestrationStepResult[], lastStepId: string) => string | null;
|
|
1391
|
+
//#endregion
|
|
1392
|
+
//#region src/orchestration/group-chat.d.ts
|
|
1393
|
+
/**
|
|
1394
|
+
* Dependencies for the `group-chat` orchestration mechanism. Adds the neutral
|
|
1395
|
+
* `selectNextStep` policy to the shared manager/context/events surface.
|
|
1396
|
+
*/
|
|
1397
|
+
interface IGroupChatOrchestratorDeps {
|
|
1398
|
+
/** The subagent manager (over `ISubagentRunner`) that runs each step. */
|
|
1399
|
+
manager: ISubagentManager;
|
|
1400
|
+
/** Run context threaded into each spawned subagent request. */
|
|
1401
|
+
context: IOrchestrationRunContext;
|
|
1402
|
+
/** Optional event service; when present, lifecycle events are emitted. */
|
|
1403
|
+
events?: IEventService;
|
|
1404
|
+
/** Caller-supplied policy selecting the next step to take a turn (or `null` to end). */
|
|
1405
|
+
selectNextStep: SelectNextStep;
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Run a `group-chat` (turn-taking) orchestration: starting at `firstStepId` (or
|
|
1409
|
+
* the first step), each selected step takes a turn — threaded the prior turns'
|
|
1410
|
+
* outputs — then the injected `selectNextStep` policy picks who goes next, `null`
|
|
1411
|
+
* ending the run. A `maxTurns` bound (default: step count) guards a policy that
|
|
1412
|
+
* never ends; exceeding it fails the run. Returns the per-step results in turn
|
|
1413
|
+
* order plus the last turn's output. Emits neutral lifecycle events.
|
|
1414
|
+
*
|
|
1415
|
+
* A facade over `@robota-sdk/agent-roundtable`'s `Roundtable`: the core owns the only turn loop
|
|
1416
|
+
* here (see `group-chat-roundtable.ts`) — this function itself holds no transcript, turn counter or
|
|
1417
|
+
* `while` loop, only the STARTED/COMPLETED/FAILED lifecycle around one `Roundtable` run.
|
|
1418
|
+
*/
|
|
1419
|
+
declare function runGroupChat(spec: IGroupChatOrchestrationSpec, deps: IGroupChatOrchestratorDeps): Promise<IOrchestrationRunResult>;
|
|
1420
|
+
//#endregion
|
|
1421
|
+
//#region src/context/task-context.d.ts
|
|
1422
|
+
type TTaskFileStatus = 'todo' | 'in-progress' | 'blocked' | 'completed' | 'unknown';
|
|
1423
|
+
interface ITaskContextFile {
|
|
1424
|
+
path: string;
|
|
1425
|
+
relativePath: string;
|
|
1426
|
+
title: string;
|
|
1427
|
+
status: TTaskFileStatus;
|
|
1428
|
+
branch?: string;
|
|
1429
|
+
scope?: string;
|
|
1430
|
+
objective?: string;
|
|
1431
|
+
openItems: readonly string[];
|
|
1432
|
+
}
|
|
1433
|
+
interface ITaskSelectionOptions {
|
|
1434
|
+
currentBranch?: string;
|
|
1435
|
+
maxTasks?: number;
|
|
1436
|
+
/**
|
|
1437
|
+
* NEUT-004: host-selected task-file scan directory relative to cwd; absence disables the scan.
|
|
1438
|
+
*/
|
|
1439
|
+
dir?: string;
|
|
1440
|
+
}
|
|
1441
|
+
declare function readCurrentGitBranchFromNodeHost(cwd: string, fs?: IFileSystem): string | undefined;
|
|
1442
|
+
declare function discoverTaskFiles(reader: IWorkspaceProjectReader, dir: string): string[];
|
|
1443
|
+
declare function parseTaskFile(taskPath: string, reader: IWorkspaceProjectReader): ITaskContextFile;
|
|
1444
|
+
declare function selectRelevantTasks(tasks: readonly ITaskContextFile[], options?: ITaskSelectionOptions): ITaskContextFile[];
|
|
1445
|
+
declare function formatTaskContext(tasks: readonly ITaskContextFile[]): string;
|
|
1446
|
+
declare function loadTaskContext(reader: IWorkspaceProjectReader, options?: ITaskSelectionOptions): string;
|
|
1447
|
+
//#endregion
|
|
1448
|
+
//#region src/interaction/input-parser.d.ts
|
|
1449
|
+
type TParsedInput = {
|
|
1450
|
+
type: 'slash-command';
|
|
1451
|
+
name: string;
|
|
1452
|
+
args: string[];
|
|
1453
|
+
} | {
|
|
1454
|
+
type: 'user-message';
|
|
1455
|
+
text: string;
|
|
1456
|
+
};
|
|
1457
|
+
/** Return true if text starts with '/' followed by a non-whitespace character. */
|
|
1458
|
+
declare function isSlashCommand(text: string): boolean;
|
|
1459
|
+
/** Tokenise '/name arg1 arg2' → { name, args }. */
|
|
1460
|
+
declare function tokeniseSlashCommand(text: string): {
|
|
1461
|
+
name: string;
|
|
1462
|
+
args: string[];
|
|
1463
|
+
};
|
|
1464
|
+
/** Parse raw user input into a structured command or message. */
|
|
1465
|
+
declare function parseInput(text: string): TParsedInput;
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/permissions/permission-prompt.d.ts
|
|
1468
|
+
/**
|
|
1469
|
+
* Issue #2351: the permission pattern a "don't ask again" answer for this invocation grants — the
|
|
1470
|
+
* scope the enforcer remembers, so every prompt surface prints the same words.
|
|
1471
|
+
*
|
|
1472
|
+
* The rule is owned by agent-session; this is the framework's OWN facade over it rather than a
|
|
1473
|
+
* pass-through re-export of the owner's binding. `agent-ui-terminal`'s permission prompt reads it
|
|
1474
|
+
* and depends on this package alone, never on agent-session, and `sdk-public-surface` refuses the
|
|
1475
|
+
* public graph passing through the owner directly.
|
|
1476
|
+
*/
|
|
1477
|
+
declare function consentScopeFor(toolName: string, toolArgs: TToolArgs): string;
|
|
1478
|
+
declare function promptForApproval(terminal: ITerminalOutput$2, toolName: string, toolArgs: TToolArgs): Promise<TPermissionResultValue$1>;
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region src/config/settings-inspection.d.ts
|
|
1481
|
+
type TSettingsLayerState = 'absent' | 'ok' | 'empty' | 'unreadable' | 'invalid-json' | 'schema-invalid';
|
|
1482
|
+
interface ISettingsSchemaIssue {
|
|
1483
|
+
readonly path: string;
|
|
1484
|
+
readonly code: string;
|
|
1485
|
+
}
|
|
1486
|
+
/** Structured cause of a non-`ok`, non-`absent` layer state. Never carries file content. */
|
|
1487
|
+
interface ISettingsLayerCause {
|
|
1488
|
+
readonly state: Exclude<TSettingsLayerState, 'absent' | 'ok'>;
|
|
1489
|
+
/** `unreadable`: the errno code of the failed read (`EACCES`, `EISDIR`, …) when the error had one. */
|
|
1490
|
+
readonly errno?: string;
|
|
1491
|
+
/** `invalid-json`: the byte offset the parser reported, when it reported one. */
|
|
1492
|
+
readonly offset?: number;
|
|
1493
|
+
/** `schema-invalid`: the failing paths and issue codes. */
|
|
1494
|
+
readonly issues?: readonly ISettingsSchemaIssue[];
|
|
1495
|
+
}
|
|
1496
|
+
interface ISettingsLayerInspection {
|
|
1497
|
+
readonly source: TSettingsSource;
|
|
1498
|
+
readonly displayName: string;
|
|
1499
|
+
readonly kind: TSettingsSource['kind'];
|
|
1500
|
+
readonly scope: TSettingsSource['scope'];
|
|
1501
|
+
readonly state: TSettingsLayerState;
|
|
1502
|
+
readonly cause?: ISettingsLayerCause;
|
|
1503
|
+
/** The schema-validated document of an `ok` layer, before `$ENV:` resolution. */
|
|
1504
|
+
readonly settings?: TSettings;
|
|
1505
|
+
}
|
|
1506
|
+
interface ISettingsKeyProvenance {
|
|
1507
|
+
readonly key: string;
|
|
1508
|
+
readonly rule: TSettingsMergeRule;
|
|
1509
|
+
/** Display names of the layers that declared the key, in precedence order (lowest first). */
|
|
1510
|
+
readonly contributors: readonly string[];
|
|
1511
|
+
}
|
|
1512
|
+
interface ISettingsInspection {
|
|
1513
|
+
readonly layers: readonly ISettingsLayerInspection[];
|
|
1514
|
+
/**
|
|
1515
|
+
* The merge of every `ok` layer with the loader's own `mergeSettings`. When `partial` is true a
|
|
1516
|
+
* present layer is broken and session start will refuse the configuration; this view then shows
|
|
1517
|
+
* what the healthy layers alone would produce, and says so.
|
|
1518
|
+
*/
|
|
1519
|
+
readonly merged: TEnvResolvedSettings;
|
|
1520
|
+
readonly partial: boolean;
|
|
1521
|
+
readonly provenance: readonly ISettingsKeyProvenance[];
|
|
1522
|
+
/** Effective settings-layer definitions only, in merge order. No hook commands or prompts. */
|
|
1523
|
+
readonly hookSources: readonly IHookDefinitionSource[];
|
|
1524
|
+
}
|
|
1525
|
+
/** Read-only inspection of every settings layer plus the merged view and its provenance. */
|
|
1526
|
+
declare function inspectSettingsLayers(sources: readonly TSettingsSource[]): ISettingsInspection;
|
|
1527
|
+
//#endregion
|
|
1528
|
+
//#region src/config/permission-rule-layers.d.ts
|
|
1529
|
+
declare function readPermissionRuleLayers(sources: readonly TSettingsSource[]): IPermissionRuleLayer[];
|
|
1530
|
+
/**
|
|
1531
|
+
* #3282 §4a: remove one declared pattern from whichever writable `stores` entry matches the
|
|
1532
|
+
* removal's `scope` — the same settings document `/permissions` would read the rule from. Returns
|
|
1533
|
+
* `false` (writes nothing) when no store matches the scope, or the pattern is not actually present.
|
|
1534
|
+
*/
|
|
1535
|
+
declare function removePermissionRule(stores: readonly ISettingsDocumentStore[], removal: IPermissionRuleRemoval): boolean;
|
|
1536
|
+
declare function createSettingsPermissionRulesAdapter(sources: readonly TSettingsSource[], stores?: readonly ISettingsDocumentStore[]): ICommandPermissionRulesAdapter;
|
|
1537
|
+
//#endregion
|
|
1538
|
+
//#region src/config/settings-parse-error.d.ts
|
|
1539
|
+
/**
|
|
1540
|
+
* CLI-069: an EXISTING settings file that fails to parse is an error condition,
|
|
1541
|
+
* never silently equated with a missing file (forbidden-fallback class). Thrown
|
|
1542
|
+
* by the settings readers; session start propagates it (fail fast, exit 1),
|
|
1543
|
+
* reporting consumers (e.g. diagnose) catch it and present it as a finding.
|
|
1544
|
+
*/
|
|
1545
|
+
declare class SettingsParseError extends Error {
|
|
1546
|
+
readonly filePath: string;
|
|
1547
|
+
constructor(filePath: string, parseMessage: string);
|
|
1548
|
+
}
|
|
1549
|
+
//#endregion
|
|
1550
|
+
//#region src/config/no-current-provider-profile-error.d.ts
|
|
1551
|
+
/**
|
|
1552
|
+
* CONFIG-002: `updateModelInSettings` writes the active model into
|
|
1553
|
+
* `providers[currentProvider]`. When the settings file names no active profile there is nothing
|
|
1554
|
+
* the canonical loader would accept, so the writer refuses instead of emitting the legacy flat
|
|
1555
|
+
* `provider` shape that `loadConfig()` rejects.
|
|
1556
|
+
*/
|
|
1557
|
+
declare class NoCurrentProviderProfileError extends Error {
|
|
1558
|
+
readonly filePath: string;
|
|
1559
|
+
constructor(filePath: string);
|
|
1560
|
+
}
|
|
1561
|
+
//#endregion
|
|
1562
|
+
//#region src/config/reset-user-config.d.ts
|
|
1563
|
+
interface IResetUserConfigResult {
|
|
1564
|
+
deleted: boolean;
|
|
1565
|
+
path: string;
|
|
1566
|
+
}
|
|
1567
|
+
declare function resetUserConfig(path: string): IResetUserConfigResult;
|
|
1568
|
+
//#endregion
|
|
1569
|
+
//#region src/git/git-branch.d.ts
|
|
1570
|
+
/** Explicit host-filesystem Git metadata adapter. This does not establish project trust. */
|
|
1571
|
+
declare function resolveGitBranchFromNodeHost(cwd: string): string | undefined;
|
|
1572
|
+
//#endregion
|
|
1573
|
+
//#region src/git/git-process.d.ts
|
|
1574
|
+
declare const GIT_DEFAULT_TIMEOUT_MS = 120000;
|
|
1575
|
+
declare const GIT_MAX_OUTPUT_BYTES: number;
|
|
1576
|
+
/**
|
|
1577
|
+
* Variables that redirect a git child to ANOTHER repository. Git exports them into hooks, so a
|
|
1578
|
+
* `/git` run started from inside a hook (or from any process that inherited one) would otherwise
|
|
1579
|
+
* operate on the wrong tree. Identity and configuration variables are deliberately NOT here — the
|
|
1580
|
+
* user's `GIT_CONFIG_GLOBAL`, `GIT_AUTHOR_*`, `GPG_TTY`, `SSH_AUTH_SOCK` … are what make the commit
|
|
1581
|
+
* theirs.
|
|
1582
|
+
*/
|
|
1583
|
+
declare const GIT_ENV_DENYLIST: readonly string[];
|
|
1584
|
+
interface IGitProcessRunOptions {
|
|
1585
|
+
cwd: string;
|
|
1586
|
+
timeoutMs?: number;
|
|
1587
|
+
signal?: AbortSignal;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* `not-found` covers every spawn failure — ENOENT, EACCES, ENOTDIR, … — with the code in `detail`;
|
|
1591
|
+
* the other three are the run's own bounds.
|
|
1592
|
+
*/
|
|
1593
|
+
type TGitProcessFailureReason = 'not-found' | 'timeout' | 'aborted' | 'output-too-large';
|
|
1594
|
+
type TGitProcessOutcome = {
|
|
1595
|
+
kind: 'exited';
|
|
1596
|
+
stdout: string;
|
|
1597
|
+
stderr: string;
|
|
1598
|
+
exitCode: number;
|
|
1599
|
+
} | {
|
|
1600
|
+
kind: 'failed';
|
|
1601
|
+
reason: TGitProcessFailureReason;
|
|
1602
|
+
detail: string;
|
|
1603
|
+
};
|
|
1604
|
+
interface IGitProcessPort {
|
|
1605
|
+
run(args: readonly string[], options: IGitProcessRunOptions): Promise<TGitProcessOutcome>;
|
|
1606
|
+
}
|
|
1607
|
+
interface ICreateGitProcessOptions {
|
|
1608
|
+
/** The executable to run; `git` on PATH by default. */
|
|
1609
|
+
executable?: string;
|
|
1610
|
+
/** The environment to derive the child's from; the live process environment by default. */
|
|
1611
|
+
env?: NodeJS.ProcessEnv;
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* The child's environment: `source` minus the repository-redirecting variables, with the locale
|
|
1615
|
+
* forced to `C`. `isNotAGitRepositoryFailure` (and every other place this module's callers pattern-
|
|
1616
|
+
* match git's stderr text) depends on that text being English; git translates it under the host's
|
|
1617
|
+
* own `LANG`/`LC_ALL` otherwise, which would silently break that match on a non-English host (#3282
|
|
1618
|
+
* §4c review).
|
|
1619
|
+
*/
|
|
1620
|
+
declare function gitEnvironment(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
1621
|
+
/** The production port: argv-only `execFile`, stdin closed, output capped, timeout bounded. */
|
|
1622
|
+
declare function createGitProcess(options?: ICreateGitProcessOptions): IGitProcessPort;
|
|
1623
|
+
/**
|
|
1624
|
+
* The reason a run did not produce a usable answer, for the verbs where a non-zero exit IS a failure.
|
|
1625
|
+
* `undefined` when the child exited 0.
|
|
1626
|
+
*/
|
|
1627
|
+
declare function gitFailureMessage(verb: string, outcome: TGitProcessOutcome): string | undefined;
|
|
1628
|
+
//#endregion
|
|
1629
|
+
//#region src/git/git-status.d.ts
|
|
1630
|
+
declare const GIT_STATUS_ARGS: readonly string[];
|
|
1631
|
+
interface IGitStatusSummary {
|
|
1632
|
+
/** `branch.head`; `(detached)` when detached; `undefined` when git printed no branch header. */
|
|
1633
|
+
branch: string | undefined;
|
|
1634
|
+
/** `branch.oid` is `(initial)` on an unborn branch. */
|
|
1635
|
+
unborn: boolean;
|
|
1636
|
+
staged: readonly string[];
|
|
1637
|
+
unstaged: readonly string[];
|
|
1638
|
+
untracked: readonly string[];
|
|
1639
|
+
conflicted: readonly string[];
|
|
1640
|
+
}
|
|
1641
|
+
/** One porcelain-v2 record, kept close to the wire so a consumer can classify it its own way (the
|
|
1642
|
+
* `/git status` text summary below, and the Project panel's plain-word-per-file view). */
|
|
1643
|
+
type TRawGitStatusRecordKind = 'ordinary' | 'renamed' | 'unmerged' | 'untracked';
|
|
1644
|
+
interface IRawGitStatusRecord {
|
|
1645
|
+
kind: TRawGitStatusRecordKind;
|
|
1646
|
+
/** The X (index) and Y (worktree) status letters; `'??'` for an untracked record (git gives none). */
|
|
1647
|
+
xy: string;
|
|
1648
|
+
/** The current path — the post-rename name for a `renamed` record. */
|
|
1649
|
+
path: string;
|
|
1650
|
+
/** Only on a `renamed` record — the record's own SECOND NUL-terminated field. */
|
|
1651
|
+
origPath?: string;
|
|
1652
|
+
}
|
|
1653
|
+
interface IParsedGitStatus {
|
|
1654
|
+
branch: string | undefined;
|
|
1655
|
+
unborn: boolean;
|
|
1656
|
+
records: readonly IRawGitStatusRecord[];
|
|
1657
|
+
}
|
|
1658
|
+
/** The porcelain-v2 stdout, parsed into the branch header and every path record — the shared step
|
|
1659
|
+
* both `parseStatusPorcelainV2` (the `/git status` text summary) and the Project panel's per-file
|
|
1660
|
+
* status reader build on, so the two never classify a record differently. */
|
|
1661
|
+
declare function parseStatusRecords(stdout: string): IParsedGitStatus;
|
|
1662
|
+
declare function parseStatusPorcelainV2(stdout: string): IGitStatusSummary;
|
|
1663
|
+
declare function formatGitStatus(summary: IGitStatusSummary): string;
|
|
1664
|
+
declare function executeGitStatus(port: IGitProcessPort, cwd: string): Promise<ICommandResult>;
|
|
1665
|
+
//#endregion
|
|
1666
|
+
//#region src/git/git-diff.d.ts
|
|
1667
|
+
declare const GIT_DIFF_USAGE = "Usage: /git diff [--staged | <rev> | <a>..<b>] [-- <path> ...] — other git flags are not accepted here.";
|
|
1668
|
+
type TGitDiffTarget = {
|
|
1669
|
+
kind: 'worktree';
|
|
1670
|
+
} | {
|
|
1671
|
+
kind: 'staged';
|
|
1672
|
+
} | {
|
|
1673
|
+
kind: 'revision';
|
|
1674
|
+
revision: string;
|
|
1675
|
+
} | {
|
|
1676
|
+
kind: 'range';
|
|
1677
|
+
from: string;
|
|
1678
|
+
to: string;
|
|
1679
|
+
};
|
|
1680
|
+
interface IGitDiffArgs {
|
|
1681
|
+
target: TGitDiffTarget;
|
|
1682
|
+
paths: readonly string[];
|
|
1683
|
+
}
|
|
1684
|
+
type TParseGitDiffArgs = {
|
|
1685
|
+
ok: true;
|
|
1686
|
+
args: IGitDiffArgs;
|
|
1687
|
+
} | {
|
|
1688
|
+
ok: false;
|
|
1689
|
+
message: string;
|
|
1690
|
+
};
|
|
1691
|
+
declare function parseGitDiffArgs(tokens: readonly string[]): TParseGitDiffArgs;
|
|
1692
|
+
/** The `diff` argv for a parsed target, `--end-of-options` before revisions and `--` before paths. */
|
|
1693
|
+
declare function gitDiffArgv(args: IGitDiffArgs): readonly string[];
|
|
1694
|
+
declare function executeGitDiff(port: IGitProcessPort, cwd: string, args: string): Promise<ICommandResult>;
|
|
1695
|
+
//#endregion
|
|
1696
|
+
//#region src/git/project-status-read.d.ts
|
|
1697
|
+
/** Never a raw XY code — the #3277 "usable by anyone" principle applies to this panel too. */
|
|
1698
|
+
type TProjectFileStatus = 'Added' | 'Modified' | 'Deleted' | 'Renamed' | 'Copied' | 'Untracked' | 'Conflicted';
|
|
1699
|
+
interface IProjectGitStatusFile {
|
|
1700
|
+
path: string;
|
|
1701
|
+
status: TProjectFileStatus;
|
|
1702
|
+
/** For a rename/copy, the record's own prior path. */
|
|
1703
|
+
renamedFrom?: string;
|
|
1704
|
+
/** Lines added/removed since HEAD (or the empty tree on an unborn branch). Absent for Untracked and
|
|
1705
|
+
* Conflicted — no single baseline to diff against — and for a binary file (git counts it as `-`). */
|
|
1706
|
+
added?: number;
|
|
1707
|
+
removed?: number;
|
|
1708
|
+
}
|
|
1709
|
+
type TProjectGitStatusResult = {
|
|
1710
|
+
ok: true;
|
|
1711
|
+
repository: true;
|
|
1712
|
+
branch: string | undefined;
|
|
1713
|
+
unborn: boolean;
|
|
1714
|
+
files: readonly IProjectGitStatusFile[];
|
|
1715
|
+
/** True when `files` stopped at {@link MAX_STATUS_FILES} — there were more. */
|
|
1716
|
+
truncated: boolean;
|
|
1717
|
+
} | {
|
|
1718
|
+
ok: true;
|
|
1719
|
+
repository: false;
|
|
1720
|
+
} | {
|
|
1721
|
+
ok: false;
|
|
1722
|
+
message: string;
|
|
1723
|
+
};
|
|
1724
|
+
/** Bounds the panel's file list — #3282 §4c "bound every output: file count, diff lines and bytes". */
|
|
1725
|
+
declare const MAX_STATUS_FILES = 200;
|
|
1726
|
+
/** Whether a failed git run means "this folder is not a git repository" (vs. a real git failure). */
|
|
1727
|
+
declare function isNotAGitRepositoryFailure(stderr: string): boolean;
|
|
1728
|
+
/** The Project panel's git status: `/git status`'s own record parser, turned into the panel's shape. */
|
|
1729
|
+
declare function readProjectGitStatus(port: IGitProcessPort, cwd: string): Promise<TProjectGitStatusResult>;
|
|
1730
|
+
//#endregion
|
|
1731
|
+
//#region src/git/project-diff-read.d.ts
|
|
1732
|
+
type TProjectGitDiffResult = {
|
|
1733
|
+
ok: true;
|
|
1734
|
+
diffLines: readonly IDiffLine[];
|
|
1735
|
+
truncated: boolean;
|
|
1736
|
+
} | {
|
|
1737
|
+
ok: false;
|
|
1738
|
+
code: 'not_a_repository';
|
|
1739
|
+
message: string;
|
|
1740
|
+
} | {
|
|
1741
|
+
ok: false;
|
|
1742
|
+
code: 'outside_workspace';
|
|
1743
|
+
message: string;
|
|
1744
|
+
} | {
|
|
1745
|
+
ok: false;
|
|
1746
|
+
code: 'git_failed';
|
|
1747
|
+
message: string;
|
|
1748
|
+
};
|
|
1749
|
+
/** Matches `MAX_WRITE_DIFF_LINES` in `interactive-session-streaming.ts` — the ONE diff-line cap a
|
|
1750
|
+
* surface already renders correctly (DiffLines has no fold of its own; a builder caps its output). */
|
|
1751
|
+
declare const MAX_PROJECT_DIFF_LINES = 500;
|
|
1752
|
+
/** Parses `git diff`'s unified-diff body into `IDiffLine[]`. A binary file's one-line notice becomes
|
|
1753
|
+
* a single `hunk` line; anything before the first `@@` hunk header (the `diff --git`/`index`/`---`/
|
|
1754
|
+
* `+++` preamble) is not itself a line of the change and is skipped. */
|
|
1755
|
+
declare function parseUnifiedDiffLines(diffText: string): IDiffLine[];
|
|
1756
|
+
/**
|
|
1757
|
+
* The Project panel's one-file diff. `requestedPath` is workspace-relative, exactly as
|
|
1758
|
+
* {@link readProjectGitStatus} reported it — resolved against `cwd` and checked with `isPathInside`
|
|
1759
|
+
* before anything else runs.
|
|
1760
|
+
*/
|
|
1761
|
+
declare function readProjectGitDiff(port: IGitProcessPort, cwd: string, requestedPath: string, fs?: IFileSystemAsync): Promise<TProjectGitDiffResult>;
|
|
1762
|
+
//#endregion
|
|
1763
|
+
//#region src/utils/semver-compare.d.ts
|
|
1764
|
+
declare function compareSemverVersions(left: string, right: string): number;
|
|
1765
|
+
declare function isNewerSemverVersion(candidate: string, current: string): boolean;
|
|
1766
|
+
//#endregion
|
|
1767
|
+
//#region src/utils/trim-char.d.ts
|
|
1768
|
+
/** Remove every trailing character in `chars`. Equivalent to `value.replace(/[chars]+$/, '')`. */
|
|
1769
|
+
declare function trimTrailingChars(value: string, chars: string): string;
|
|
1770
|
+
//#endregion
|
|
1771
|
+
//#region src/utils/read-package-version.d.ts
|
|
1772
|
+
declare function readPackageVersion(importMetaUrl: string): string;
|
|
1773
|
+
//#endregion
|
|
1774
|
+
//#region src/runtime/stateless-runtime.d.ts
|
|
1775
|
+
interface IStatelessRuntimeConfig {
|
|
1776
|
+
provider: IAIProvider;
|
|
1777
|
+
/** Working directory. Defaults to process.cwd(). Not used for file I/O in stateless mode. */
|
|
1778
|
+
cwd?: string;
|
|
1779
|
+
}
|
|
1780
|
+
declare function createStatelessRuntime(config: IStatelessRuntimeConfig): IAgentRuntime;
|
|
1781
|
+
//#endregion
|
|
1782
|
+
//#region src/runtime/session-slot.d.ts
|
|
1783
|
+
interface ISessionSlotOptions {
|
|
1784
|
+
/** Bound on shutting the replaced session down; defaults to {@link RUNTIME_SHUTDOWN_TIMEOUT_MS}. */
|
|
1785
|
+
shutdownTimeoutMs?: number;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* A stable {@link IInteractiveSession} that forwards every member to the current session. `moveTo`
|
|
1789
|
+
* makes another session current and leaves the previous one running, for a host that keeps several
|
|
1790
|
+
* sessions live; `replace` does the same and shuts the previous one down. Either way listeners move
|
|
1791
|
+
* to the next session and only this slot's listeners receive `session_switched`.
|
|
1792
|
+
*/
|
|
1793
|
+
declare class SessionSlot<TSession extends IInteractiveSession = InteractiveSession> implements IInteractiveSession {
|
|
1794
|
+
private currentSession;
|
|
1795
|
+
private readonly listeners;
|
|
1796
|
+
private readonly shutdownTimeoutMs;
|
|
1797
|
+
constructor(initial: TSession, options?: ISessionSlotOptions);
|
|
1798
|
+
/** The session every call reaches now. Read it at call time; it changes on `moveTo` and `replace`. */
|
|
1799
|
+
get current(): TSession;
|
|
1800
|
+
/**
|
|
1801
|
+
* Make `next` the current session and leave the previous one running: another slot, or nobody,
|
|
1802
|
+
* may still be on it. Listeners registered on this slot move to `next`, then this slot's listeners
|
|
1803
|
+
* — and no one else's — receive `session_switched`.
|
|
1804
|
+
*/
|
|
1805
|
+
moveTo(next: TSession): void;
|
|
1806
|
+
/**
|
|
1807
|
+
* Make `next` the current session and shut the previous one down. Listeners registered on the slot
|
|
1808
|
+
* move to it before the old session shuts down (bounded), so no event of the new session is
|
|
1809
|
+
* missed; `session_switched` follows once the old one is gone.
|
|
1810
|
+
*/
|
|
1811
|
+
replace(next: TSession, message?: string): Promise<void>;
|
|
1812
|
+
/** Move the listeners onto `next` and make it current; `undefined` when it already is. */
|
|
1813
|
+
private swap;
|
|
1814
|
+
private emitSwitched;
|
|
1815
|
+
on<E extends TInteractiveEventName>(event: E, handler: IInteractiveSessionEvents[E]): void;
|
|
1816
|
+
off<E extends TInteractiveEventName>(event: E, handler: IInteractiveSessionEvents[E]): void;
|
|
1817
|
+
get isInitialized(): boolean;
|
|
1818
|
+
shutdown: IInteractiveSession['shutdown'];
|
|
1819
|
+
submit: IInteractiveSession['submit'];
|
|
1820
|
+
abort: IInteractiveSession['abort'];
|
|
1821
|
+
cancelQueue: IInteractiveSession['cancelQueue'];
|
|
1822
|
+
setGoal: IInteractiveSession['setGoal'];
|
|
1823
|
+
getGoalState: IInteractiveSession['getGoalState'];
|
|
1824
|
+
cancelGoal: IInteractiveSession['cancelGoal'];
|
|
1825
|
+
isExecuting: IInteractiveSession['isExecuting'];
|
|
1826
|
+
getPendingPrompt: IInteractiveSession['getPendingPrompt'];
|
|
1827
|
+
getPendingCount: IInteractiveSession['getPendingCount'];
|
|
1828
|
+
getActiveDriverId: IInteractiveSession['getActiveDriverId'];
|
|
1829
|
+
getMessages: IInteractiveSession['getMessages'];
|
|
1830
|
+
getFullHistory: IInteractiveSession['getFullHistory'];
|
|
1831
|
+
getMessagesDisplay: IInteractiveSession['getMessagesDisplay'];
|
|
1832
|
+
getContextState: IInteractiveSession['getContextState'];
|
|
1833
|
+
getSession: IInteractiveSession['getSession'];
|
|
1834
|
+
getCwd: IInteractiveSession['getCwd'];
|
|
1835
|
+
executeCommand: IInteractiveSession['executeCommand'];
|
|
1836
|
+
listCommands: IInteractiveSession['listCommands'];
|
|
1837
|
+
listSkills: IInteractiveSession['listSkills'];
|
|
1838
|
+
getStatusSnapshot: IInteractiveSession['getStatusSnapshot'];
|
|
1839
|
+
listModels: IInteractiveSession['listModels'];
|
|
1840
|
+
listRuntimeTools: IInteractiveSession['listRuntimeTools'];
|
|
1841
|
+
invokeRuntimeTool: IInteractiveSession['invokeRuntimeTool'];
|
|
1842
|
+
readToolAppView: IInteractiveSession['readToolAppView'];
|
|
1843
|
+
resolvePermission: IInteractiveSession['resolvePermission'];
|
|
1844
|
+
resolveAsk: IInteractiveSession['resolveAsk'];
|
|
1845
|
+
listBackgroundTasks: IInteractiveSession['listBackgroundTasks'];
|
|
1846
|
+
getBackgroundTask: IInteractiveSession['getBackgroundTask'];
|
|
1847
|
+
cancelBackgroundTask: IInteractiveSession['cancelBackgroundTask'];
|
|
1848
|
+
closeBackgroundTask: IInteractiveSession['closeBackgroundTask'];
|
|
1849
|
+
sendBackgroundTask: IInteractiveSession['sendBackgroundTask'];
|
|
1850
|
+
readBackgroundTaskLog: IInteractiveSession['readBackgroundTaskLog'];
|
|
1851
|
+
listBackgroundJobGroups: IInteractiveSession['listBackgroundJobGroups'];
|
|
1852
|
+
getBackgroundJobGroup: IInteractiveSession['getBackgroundJobGroup'];
|
|
1853
|
+
createBackgroundJobGroup: IInteractiveSession['createBackgroundJobGroup'];
|
|
1854
|
+
waitBackgroundJobGroup: IInteractiveSession['waitBackgroundJobGroup'];
|
|
1855
|
+
getExecutionWorkspaceSnapshot: IInteractiveSession['getExecutionWorkspaceSnapshot'];
|
|
1856
|
+
readExecutionWorkspaceDetail: IInteractiveSession['readExecutionWorkspaceDetail'];
|
|
1857
|
+
stopWaitingSelfPacedLoop: IInteractiveSession['stopWaitingSelfPacedLoop'];
|
|
1858
|
+
listAgentDefinitions: IInteractiveSession['listAgentDefinitions'];
|
|
1859
|
+
getDefaultAgentType: IInteractiveSession['getDefaultAgentType'];
|
|
1860
|
+
setDefaultAgentType: IInteractiveSession['setDefaultAgentType'];
|
|
1861
|
+
listAgentJobs: IInteractiveSession['listAgentJobs'];
|
|
1862
|
+
spawnAgentJob: IInteractiveSession['spawnAgentJob'];
|
|
1863
|
+
sendAgentJob: IInteractiveSession['sendAgentJob'];
|
|
1864
|
+
cancelAgentJob: IInteractiveSession['cancelAgentJob'];
|
|
1865
|
+
closeAgentJob: IInteractiveSession['closeAgentJob'];
|
|
1866
|
+
}
|
|
1867
|
+
//#endregion
|
|
1868
|
+
//#region src/runtime/session-pool.d.ts
|
|
1869
|
+
/** The primary included. */
|
|
1870
|
+
declare const SESSION_POOL_MAX_LIVE = 4;
|
|
1871
|
+
/** How long a session nobody is bound to stays live once idle. */
|
|
1872
|
+
declare const SESSION_POOL_IDLE_GRACE_MS = 300000;
|
|
1873
|
+
/** A binding's role, as the session contracts define it. */
|
|
1874
|
+
type TSessionPoolRole = TSessionBindingRole;
|
|
1875
|
+
/** The members of a session the default busy rule reads; the last two are InteractiveSession's own. */
|
|
1876
|
+
type TPoolBusySession = Pick<IInteractiveSession, 'isExecuting' | 'getPendingPrompt' | 'getPendingCount' | 'listBackgroundTasks'> & {
|
|
1877
|
+
/** `needs-input` while a permission or ask prompt waits for an answer. */
|
|
1878
|
+
getLocalActivityStatus?(): 'working' | 'needs-input' | 'idle' | undefined;
|
|
1879
|
+
listSelfPacedLoops?(): readonly ISessionLoopState[];
|
|
1880
|
+
};
|
|
1881
|
+
/**
|
|
1882
|
+
* Whether closing this session now would lose work: a running turn, a prompt waiting for an answer,
|
|
1883
|
+
* queued messages, a live background task, or a self-paced loop that has not ended.
|
|
1884
|
+
*/
|
|
1885
|
+
declare function isSessionBusy(session: TPoolBusySession, nowMs?: number): boolean;
|
|
1886
|
+
interface ISessionPoolOptions<TSession> {
|
|
1887
|
+
/** The session the host started with. Every binding starts on it; only `shutdownAll` closes it. */
|
|
1888
|
+
primary: TSession;
|
|
1889
|
+
/** Build a session, resuming `resumeSessionId` when given, or a fresh one. */
|
|
1890
|
+
build(resumeSessionId?: string): TSession;
|
|
1891
|
+
/** Live sessions at most, the primary and sessions still starting included. */
|
|
1892
|
+
maxLive?: number;
|
|
1893
|
+
/** How long a session nobody is bound to stays live once idle. */
|
|
1894
|
+
idleGraceMs?: number;
|
|
1895
|
+
/** Whether closing `session` now would lose work; defaults to {@link isSessionBusy}. */
|
|
1896
|
+
isBusy?(session: TSession): boolean;
|
|
1897
|
+
/** Shut `session` down, bounded; defaults to {@link shutdownSessionBounded}. */
|
|
1898
|
+
shutdown?(session: TSession, message: string): Promise<void>;
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* A session held for one client between `acquire` and the binding's `moveTo`: while held it is not
|
|
1902
|
+
* closed. Hand it to `moveTo`, or `cancel` it when the client does not move after all.
|
|
1903
|
+
*/
|
|
1904
|
+
interface ISessionLease<TSession> {
|
|
1905
|
+
readonly session: TSession;
|
|
1906
|
+
cancel(): void;
|
|
1907
|
+
}
|
|
1908
|
+
/** One client's place in the pool. */
|
|
1909
|
+
interface ISessionPoolBinding<TSession extends IInteractiveSession> {
|
|
1910
|
+
readonly role: TSessionPoolRole;
|
|
1911
|
+
/** The client's session; it follows this binding's moves and no one else's. */
|
|
1912
|
+
readonly slot: SessionSlot<TSession>;
|
|
1913
|
+
/** Move this binding onto the leased session. Its slot's listeners hear `session_switched`. */
|
|
1914
|
+
moveTo(lease: ISessionLease<TSession>): void;
|
|
1915
|
+
/** This binding drives, and no other driver is on its session. */
|
|
1916
|
+
isLastDriver(): boolean;
|
|
1917
|
+
/** The client has gone. Idempotent. */
|
|
1918
|
+
release(): void;
|
|
1919
|
+
}
|
|
1920
|
+
/** A live session and who is on it. */
|
|
1921
|
+
interface ISessionPoolEntry<TSession> {
|
|
1922
|
+
readonly sessionId: string;
|
|
1923
|
+
readonly session: TSession;
|
|
1924
|
+
/** Bindings on it, drivers and observers. */
|
|
1925
|
+
readonly clients: number;
|
|
1926
|
+
readonly drivers: number;
|
|
1927
|
+
}
|
|
1928
|
+
declare class SessionPool<TSession extends IInteractiveSession> {
|
|
1929
|
+
private readonly options;
|
|
1930
|
+
private readonly entries;
|
|
1931
|
+
private readonly primaryEntry;
|
|
1932
|
+
/** Builds in flight, by the session id asked for (a fresh build under a key of its own). */
|
|
1933
|
+
private readonly building;
|
|
1934
|
+
/** Shutdowns in flight, by session id; an acquire of that id waits for it. */
|
|
1935
|
+
private readonly closing;
|
|
1936
|
+
private readonly leases;
|
|
1937
|
+
private readonly maxLive;
|
|
1938
|
+
private readonly idleGraceMs;
|
|
1939
|
+
private readonly isBusy;
|
|
1940
|
+
private readonly shutdownSession;
|
|
1941
|
+
private clock;
|
|
1942
|
+
private freshBuilds;
|
|
1943
|
+
private drained;
|
|
1944
|
+
constructor(options: ISessionPoolOptions<TSession>);
|
|
1945
|
+
/** A binding for one client, on the primary session. */
|
|
1946
|
+
bind(role: TSessionPoolRole): ISessionPoolBinding<TSession>;
|
|
1947
|
+
/**
|
|
1948
|
+
* Hold session `sessionId` for a client, or a fresh session when no id is given. A live instance
|
|
1949
|
+
* is reused, a build already under way for that id is shared, and an instance still closing is
|
|
1950
|
+
* waited for. Refused with `limit` when the pool is full and no session can be closed, with
|
|
1951
|
+
* `start_failed` when the session cannot start, and with `stopping` once the pool is shut down.
|
|
1952
|
+
*/
|
|
1953
|
+
acquire(sessionId?: string): Promise<ISessionLease<TSession>>;
|
|
1954
|
+
/** The live sessions that have named themselves, and who is on each. */
|
|
1955
|
+
listLive(): ISessionPoolEntry<TSession>[];
|
|
1956
|
+
/** Shut every session down in parallel, each bounded, the primary included. Idempotent. */
|
|
1957
|
+
shutdownAll(message?: string): Promise<void>;
|
|
1958
|
+
private assertOpen;
|
|
1959
|
+
private register;
|
|
1960
|
+
private entryId;
|
|
1961
|
+
/** The primary must be matched by its id, never built twice, so an acquire waits for its name. */
|
|
1962
|
+
private namePrimary;
|
|
1963
|
+
private findLive;
|
|
1964
|
+
private lease;
|
|
1965
|
+
private join;
|
|
1966
|
+
private leave;
|
|
1967
|
+
private touch;
|
|
1968
|
+
/** Start the idle grace of a session nobody is on or about to be on. */
|
|
1969
|
+
private settle;
|
|
1970
|
+
private clearGrace;
|
|
1971
|
+
private busy;
|
|
1972
|
+
/** Close the oldest idle session nobody is on when the pool is full; refuse when none can go. */
|
|
1973
|
+
private makeRoom;
|
|
1974
|
+
private close;
|
|
1975
|
+
private trackClosing;
|
|
1976
|
+
private shutdownQuietly;
|
|
1977
|
+
private startBuild;
|
|
1978
|
+
private finishBuild;
|
|
1979
|
+
}
|
|
1980
|
+
//#endregion
|
|
1981
|
+
//#region src/runtime/runtime-host.d.ts
|
|
1982
|
+
/** Normalized, explicitly discriminated input for every `InteractiveSession` construction path. */
|
|
1983
|
+
type SessionRecipe = TInteractiveSessionOptions;
|
|
1984
|
+
/** Build a runtime `InteractiveSession` from a normalized recipe. The single construction seam. */
|
|
1985
|
+
declare function buildRuntimeSession(recipe: SessionRecipe): InteractiveSession;
|
|
1986
|
+
interface IRuntimeHostOptions {
|
|
1987
|
+
/** The resolved session-build options — the consumer resolves settings/preset/args and passes them in. */
|
|
1988
|
+
session: SessionRecipe;
|
|
1989
|
+
/** The transport registry (e.g. the loopback WS sidecar); the host owns its start/stop lifecycle. */
|
|
1990
|
+
transportRegistry?: ITransportLifecycleRegistryView;
|
|
1991
|
+
/** Bind each raw adapter to the host's session slot before registration/start. */
|
|
1992
|
+
bindTransports?: (session: SessionSlot) => void;
|
|
1993
|
+
/**
|
|
1994
|
+
* Keep several sessions live, one per client that switched (#3189). The host's session becomes
|
|
1995
|
+
* the pool's primary, and further sessions are built from this recipe. Absent, the host holds one
|
|
1996
|
+
* session.
|
|
1997
|
+
*/
|
|
1998
|
+
pool?: IRuntimeHostPoolOptions;
|
|
1999
|
+
}
|
|
2000
|
+
interface IRuntimeHostPoolOptions {
|
|
2001
|
+
/** Live sessions at most, the primary included. */
|
|
2002
|
+
maxLive?: number;
|
|
2003
|
+
/** How long a session no client is on stays live once idle. */
|
|
2004
|
+
idleGraceMs?: number;
|
|
2005
|
+
}
|
|
2006
|
+
interface IRuntimeHostHandle {
|
|
2007
|
+
/**
|
|
2008
|
+
* The live runtime session every presentation drives, behind a slot: whoever holds it reaches the
|
|
2009
|
+
* current session, including after the host switches to another one (#3189).
|
|
2010
|
+
*/
|
|
2011
|
+
readonly session: SessionSlot;
|
|
2012
|
+
/** The live sessions when started with `pool`; its primary is the one `session` starts on. */
|
|
2013
|
+
readonly pool?: SessionPool<InteractiveSession>;
|
|
2014
|
+
/** Stop the transports and shut the session down (bounded) — every pooled one; idempotent. */
|
|
2015
|
+
shutdown(message?: string): Promise<void>;
|
|
2016
|
+
/** Return the complete ordered runner aggregate, including registry-owned abandonment on stop. */
|
|
2017
|
+
waitForCompletion(): Promise<ITransportCompletionRecord[]>;
|
|
2018
|
+
/** Report only the first real failed runner outcome; normal stop abandonment is not a failure. */
|
|
2019
|
+
waitForFailure(): Promise<ITransportFailureRecord | undefined>;
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* Build the runtime session and start its transports. Returns a handle the caller renders over (TUI) or simply
|
|
2023
|
+
* keeps alive (headless `--serve`). The caller owns the process-lifetime wait; `shutdown()` tears it down.
|
|
2024
|
+
*/
|
|
2025
|
+
declare function startRuntimeHost(opts: IRuntimeHostOptions): Promise<IRuntimeHostHandle>;
|
|
2026
|
+
//#endregion
|
|
2027
|
+
//#region src/runtime/session-change-refusal.d.ts
|
|
2028
|
+
declare class SessionChangeRefusal extends Error implements ISessionChangeRefusal {
|
|
2029
|
+
readonly code: TSessionChangeRefusalCode;
|
|
2030
|
+
readonly name: "SessionChangeRefusal";
|
|
2031
|
+
constructor(code: TSessionChangeRefusalCode, message: string);
|
|
2032
|
+
}
|
|
2033
|
+
/** #3289 §1 — a session delete the host declined, with a code the client can branch on. */
|
|
2034
|
+
declare class SessionDeleteRefusal extends Error implements ISessionDeleteRefusal {
|
|
2035
|
+
readonly code: TSessionDeleteRefusalCode;
|
|
2036
|
+
readonly name: "SessionDeleteRefusal";
|
|
2037
|
+
constructor(code: TSessionDeleteRefusalCode, message: string);
|
|
2038
|
+
}
|
|
2039
|
+
//#endregion
|
|
2040
|
+
//#region src/routing/role-model-routing.d.ts
|
|
2041
|
+
/** Resolve the PRIMARY model for a role (first of its fallback chain); `undefined` if the role is unmapped. */
|
|
2042
|
+
declare function resolveRoleModel(map: TRoleModelMap, roleKey: string): IModelRef | undefined;
|
|
2043
|
+
/** The full ordered fallback chain for a role (primary first, then fallbacks); empty if unmapped. */
|
|
2044
|
+
declare function resolveRoleFallbackChain(map: TRoleModelMap, roleKey: string): IModelRef[];
|
|
2045
|
+
/**
|
|
2046
|
+
* Walk a role's fallback chain, trying each `IModelRef` in order until one succeeds. `run(ref)` performs
|
|
2047
|
+
* the actual execution against the given provider+model over the DIP; on a thrown error it advances to
|
|
2048
|
+
* the next fallback (an alternate provider AND model). Throws the LAST error if the whole chain is
|
|
2049
|
+
* exhausted, or immediately if the chain is empty.
|
|
2050
|
+
*
|
|
2051
|
+
* `shouldRetry(err)` gates advancing to the next fallback (default: retry ALL errors). A caller that
|
|
2052
|
+
* only wants provider/transient failures to fall back — not auth/4xx/config errors that will fail
|
|
2053
|
+
* identically on every provider — should pass a predicate; a non-retryable error then rethrows
|
|
2054
|
+
* immediately instead of burning the chain and masking the root cause.
|
|
2055
|
+
*/
|
|
2056
|
+
declare function runWithRoleFallback<T>(chain: IModelRef[], run: (ref: IModelRef) => Promise<T>, shouldRetry?: (err: unknown) => boolean): Promise<T>;
|
|
2057
|
+
//#endregion
|
|
2058
|
+
//#region src/routing/fallback-provider.d.ts
|
|
2059
|
+
/** One model a request may move to, and how to reach it. */
|
|
2060
|
+
interface IFallbackModelTarget {
|
|
2061
|
+
/** The provider (vendor) and model this entry answers on. */
|
|
2062
|
+
ref: IModelRef;
|
|
2063
|
+
/** Build the provider for this entry. A throw means it cannot be reached, and the chain moves on. */
|
|
2064
|
+
create: () => IAIProvider;
|
|
2065
|
+
/** Optional host resolution for credentials held outside settings. */
|
|
2066
|
+
createAsync?: () => Promise<IAIProvider>;
|
|
2067
|
+
}
|
|
2068
|
+
interface IFallbackProviderOptions {
|
|
2069
|
+
/** Context window of a model, or `undefined` when unknown. Defaults to the registered metadata. */
|
|
2070
|
+
contextWindowOf?: (model: string) => number | undefined;
|
|
2071
|
+
/** Told once per entry that could not be built. */
|
|
2072
|
+
onUnreachable?: (target: IFallbackModelTarget, error: unknown) => void;
|
|
2073
|
+
/** Told of every move, beside the request's own `onModelFallback`; for a host with no turn view. */
|
|
2074
|
+
onFallback?: (notice: IModelFallbackNotice) => void;
|
|
2075
|
+
/**
|
|
2076
|
+
* The chain as the user wrote it, kept so a host that swaps the primary can read it again for the
|
|
2077
|
+
* new one rather than drop it.
|
|
2078
|
+
*/
|
|
2079
|
+
entries?: readonly string[];
|
|
2080
|
+
}
|
|
2081
|
+
declare class FallbackProvider implements IAIProvider {
|
|
2082
|
+
private readonly primary;
|
|
2083
|
+
private readonly fallbacks;
|
|
2084
|
+
private readonly options;
|
|
2085
|
+
readonly name: string;
|
|
2086
|
+
readonly version: string;
|
|
2087
|
+
private readonly built;
|
|
2088
|
+
/** Chain position each recent run moved to; a run not listed is on the primary. */
|
|
2089
|
+
private readonly runPositions;
|
|
2090
|
+
private readonly contextWindowOf;
|
|
2091
|
+
capabilityTable?: IAIProvider['capabilityTable'];
|
|
2092
|
+
effortTable?: IAIProvider['effortTable'];
|
|
2093
|
+
endpointIsVendorDefault?: IAIProvider['endpointIsVendorDefault'];
|
|
2094
|
+
canPropagateTraceContext?: IAIProvider['canPropagateTraceContext'];
|
|
2095
|
+
configureNativeWebTools?: IAIProvider['configureNativeWebTools'];
|
|
2096
|
+
getCapabilities?: IAIProvider['getCapabilities'];
|
|
2097
|
+
constructor(primary: IAIProvider, fallbacks: readonly IFallbackModelTarget[], options?: IFallbackProviderOptions);
|
|
2098
|
+
/** The models a request may move to, in order. */
|
|
2099
|
+
get chain(): readonly IModelRef[];
|
|
2100
|
+
/** The options this chain was built with, to build the same chain over another primary. */
|
|
2101
|
+
get chainOptions(): Readonly<IFallbackProviderOptions>;
|
|
2102
|
+
resolveModelRoute(model: string, executionId?: string): IModelRef;
|
|
2103
|
+
chat(messages: TUniversalMessage[], options?: IChatOptions): Promise<TUniversalMessage>;
|
|
2104
|
+
generateResponse(payload: IProviderRequest): Promise<IRawProviderResponse>;
|
|
2105
|
+
supportsTools(): boolean;
|
|
2106
|
+
validateConfig(): boolean;
|
|
2107
|
+
dispose(): Promise<void>;
|
|
2108
|
+
close(): Promise<void>;
|
|
2109
|
+
private startPosition;
|
|
2110
|
+
private refAt;
|
|
2111
|
+
/**
|
|
2112
|
+
* The chain positions this request may use: from where its run stands, skipping any model whose
|
|
2113
|
+
* context window is smaller than the requested one's when the request asks for that.
|
|
2114
|
+
*/
|
|
2115
|
+
private candidatePositions;
|
|
2116
|
+
/** Only a window known to be at least as large counts; an unknown one on either side proves nothing. */
|
|
2117
|
+
private keepsContextWindow;
|
|
2118
|
+
private providerAt;
|
|
2119
|
+
private remember;
|
|
2120
|
+
/**
|
|
2121
|
+
* The request for another model: the same conversation, tools and settings, on that model. What
|
|
2122
|
+
* belongs to the primary's vendor stays behind — a hosted tool it was required to offer, its vendor
|
|
2123
|
+
* option blocks and an effort resolution made against its table — and a trace context goes only
|
|
2124
|
+
* where it can be carried. A hosted tool the request WITHHELD stays withheld: the next model must
|
|
2125
|
+
* not offer what the caller refused.
|
|
2126
|
+
*/
|
|
2127
|
+
private fallbackOptions;
|
|
2128
|
+
}
|
|
2129
|
+
//#endregion
|
|
2130
|
+
//#region src/routing/model-fallback-chain.d.ts
|
|
2131
|
+
/** A request moves along at most this many models after the primary. */
|
|
2132
|
+
declare const MAX_FALLBACK_MODELS = 3;
|
|
2133
|
+
/** The settings key holding the chain. */
|
|
2134
|
+
declare const FALLBACK_MODEL_SETTINGS_KEY = "fallbackModel";
|
|
2135
|
+
interface IModelFallbackPrimary {
|
|
2136
|
+
/** The settings profile the primary comes from; absent for a legacy or environment config. */
|
|
2137
|
+
profile?: string;
|
|
2138
|
+
/** The primary's resolved config, on the model the session runs. */
|
|
2139
|
+
config: IProviderDefinitionConfig;
|
|
2140
|
+
}
|
|
2141
|
+
interface IResolveModelFallbackChainInput {
|
|
2142
|
+
/** The entries as written, flag or settings. */
|
|
2143
|
+
entries: readonly string[];
|
|
2144
|
+
/** Merged provider settings. */
|
|
2145
|
+
settings: TProviderSettingsDocument;
|
|
2146
|
+
primary: IModelFallbackPrimary;
|
|
2147
|
+
providerDefinitions: readonly IProviderDefinition[];
|
|
2148
|
+
/** Host-selected environment for lazy profile credential resolution. */
|
|
2149
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
2150
|
+
resolveCredential?: TProviderCredentialResolver;
|
|
2151
|
+
/** The organization's provider allowlist, by profile name. */
|
|
2152
|
+
allowedProviders?: readonly string[];
|
|
2153
|
+
}
|
|
2154
|
+
interface IModelFallbackChain {
|
|
2155
|
+
targets: IFallbackModelTarget[];
|
|
2156
|
+
/** Why entries were left out, one line each, for the user. */
|
|
2157
|
+
notices: string[];
|
|
2158
|
+
}
|
|
2159
|
+
/** Split a comma-separated `--fallback-model` value into its entries. */
|
|
2160
|
+
declare function parseFallbackModelList(value: string | undefined): string[] | undefined;
|
|
2161
|
+
/** The chain written in settings, or `undefined` when none is. */
|
|
2162
|
+
declare function readFallbackModelSetting(settings: TProviderSettingsDocument): string[] | undefined;
|
|
2163
|
+
/**
|
|
2164
|
+
* The entries to use: the flag's when it is given, the settings' otherwise. The flag replaces the
|
|
2165
|
+
* settings rather than adding to them, so one run can try a different chain.
|
|
2166
|
+
*/
|
|
2167
|
+
declare function selectFallbackModelEntries(flag: readonly string[] | undefined, settings: TProviderSettingsDocument): readonly string[];
|
|
2168
|
+
/**
|
|
2169
|
+
* Read the chain: entries in order, the primary and repeats removed, entries the organization does
|
|
2170
|
+
* not allow dropped, and at most {@link MAX_FALLBACK_MODELS} kept. Every drop is announced.
|
|
2171
|
+
*/
|
|
2172
|
+
declare function resolveModelFallbackChain(input: IResolveModelFallbackChainInput): IModelFallbackChain;
|
|
2173
|
+
interface IApplyModelFallbackInput extends IResolveModelFallbackChainInput {
|
|
2174
|
+
/** The primary provider. */
|
|
2175
|
+
provider: IAIProvider;
|
|
2176
|
+
/** How the decorator reports; `entries` is filled in from `entries` above. */
|
|
2177
|
+
providerOptions?: Omit<IFallbackProviderOptions, 'entries'>;
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Put the chain in front of `provider`: a {@link FallbackProvider} whenever the user wrote a chain,
|
|
2181
|
+
* even one whose every entry was dropped for this primary, because the chain belongs to the session
|
|
2182
|
+
* and a later primary may keep entries this one could not. The notices say what was dropped.
|
|
2183
|
+
*/
|
|
2184
|
+
declare function applyModelFallback(input: IApplyModelFallbackInput): {
|
|
2185
|
+
provider: IAIProvider;
|
|
2186
|
+
notices: string[];
|
|
2187
|
+
};
|
|
2188
|
+
/** The note shown when a turn moved to another model. */
|
|
2189
|
+
declare function describeModelFallback(notice: IModelFallbackNotice): string;
|
|
2190
|
+
//#endregion
|
|
2191
|
+
export { ADVISOR_OFF, ADVISOR_TOOL_NAME, APPEARANCE_SETTINGS_KEYS, AUTO_COMPACT_THRESHOLD_SETTINGS_KEY, AdvisorController, AgentExecutor, BACKGROUND_COMMAND_DESCRIPTION, BACKGROUND_COMMAND_USAGE, BUILT_IN_AGENTS, BackgroundJobOrchestrator, BuiltinCommandSource, BundlePluginInstaller, BundlePluginLoader, CLEAR_COMMAND_DESCRIPTION, COST_COMMAND_DESCRIPTION, CommandRegistry, DEFAULT_AGENT_DEFINED_IN, DEFAULT_AGENT_TYPE, DEFAULT_APPEARANCE_SETTINGS, DEFAULT_AUTO_COMPACT_THRESHOLD, DEFAULT_GOAL_MAX_ITERATIONS, DEFAULT_GOAL_NO_PROGRESS_LIMIT, DEFAULT_MEMORY_EXTRACTOR_POLICY, DEFAULT_STATUS_LINE_COMMAND_SETTINGS, DuplicateSystemCommandSemanticRoleError, EFFORT_LEVEL_LABELS, EXECUTION_ORIGIN_METADATA_KEYS, EXIT_COMMAND_DESCRIPTION, EditCheckpointStore, EditCheckpointsUnavailableError, ExternalEventGrantHistory, ExternalEventIngress, FALLBACK_MODEL_SETTINGS_KEY, FallbackProvider, GIT_DEFAULT_TIMEOUT_MS, GIT_DIFF_USAGE, GIT_ENV_DENYLIST, GIT_MAX_OUTPUT_BYTES, GIT_STATUS_ARGS, GOAL_SIGNAL_TOOL_NAME, GoalController, HELP_COMMAND_DESCRIPTION, HeadlessInteractionChannel, type IActiveModelChangeOptions, type IActiveModelChangeResult, type IAdvisorConsentStore, type IAdvisorControllerOptions, type IAdvisorSetResult, type IAdvisorSpec, type IAdvisorStatus, type IAdvisorTarget, type IAgentDefinition, type IAgentExecutorOptions, type IAgentJobDispatch, type IAgentJobGroups, type IAgentJobHostContext, type IAgentJobLogs, type IAgentJobMonitors, type IAgentJobSchedules, type IAgentRuntime, type IAgentRuntimeConfig, type IAgentSession, type IAgentToolDeps, type IAppearanceSettings, type IAppendMemoryInput, type IAppendMemoryResult, type IApplyModelFallbackInput, type IApprovedMemoryCandidate, type IAutomaticMemoryConfig, type IBackgroundJobOrchestratorOptions, type IBackgroundProcessToolDeps, type IBackgroundTaskRunner, type IBackgroundTaskSpawnerGroupRequest, type IBundlePluginFeatures, type IBundlePluginHookIssue, type IBundlePluginInspection, type IBundlePluginInstallerOptions, type IBundlePluginManifest, type IBundlePluginMcpFault, type IBundlePluginMcpServer, type IBundlePluginSkip, type IBundleSkill, type ICommandAdvisorAdapter, type ICommandCostBudget, type ICommandCostBudgetAdapter, type ICommandEffortAdapter, type ICommandExecutionToolDeps, type ICommandExternalEventGrant, type ICommandExternalEventsAdapter, type ICommandHandoffAdapter, type ICommandHostAdapterAccess, type ICommandHostAdapters, type ICommandHostAgentJobs, type ICommandHostBackgroundTasks, type ICommandHostCatalog, type ICommandHostCheckpoints, type ICommandHostContext, type ICommandHostContextReferences, type ICommandHostContextWindow, type ICommandHostGoal, type ICommandHostMemory, type ICommandHostNoCapability, type ICommandHostPlan, type ICommandHostPresetApplication, type ICommandHostSessionAccess, type ICommandHostSetupState, type ICommandHostTerminalHandoff, type ICommandHostUserInteraction, type ICommandHostWorkspace, type ICommandMCPActivationAdapter, type ICommandMCPActivationSummary, type ICommandMCPOAuthLoginRequest, type ICommandMCPOAuthLoginResult, type ICommandMCPOAuthLogoutResult, type ICommandMCPOAuthRedirectPrompt, type ICommandMCPOAuthStatus, type ICommandMCPSourceProblem, type ICommandModule, type ICommandOutputStyleRegistryAdapter, type ICommandOutputStyleSummary, type ICommandPermissionModeAdapter, type ICommandPermissionRulesAdapter, type ICommandPickerAdapter, type ICommandProcessAdapter, type ICommandProductVocabulary, type ICommandRemoteControlAdapter, type ICommandSandboxAdapter, type ICommandSandboxStatus, type ICommandSessionContextWindow, type ICommandSessionHistory, type ICommandSessionIdentity, type ICommandSessionInfo, type ICommandSessionModel, type ICommandSessionPermissions, type ICommandSessionPreset, type ICommandSessionReplayValidationReport, type ICommandSessionRuntime, type ICommandSettingsAdapter, type ICommandSettingsDocument, type ICommandSkillListEntry, type ICommandWorkspaceAdapter, type ICompactContextResult, type IContextReferenceAddResult, type IContextReferenceClearResult, type IContextReferenceInventoryLimits, type IContextReferenceRemoveResult, type IContextReferenceUpsertResult, type IContributionDescriptor, type IContributionSource, type ICreateExecutionWorkspaceTaskSpawnerOptions, type ICreateGitProcessOptions, type ICreateProgrammaticAgentOptions, type ICreateQueryOptions, type ICreateSessionOptions, type IDurableMemoryReader, type IEditCheckpointFileInspection, type IEditCheckpointFileRecord, type IEditCheckpointInspection, type IEditCheckpointInspectionPlan, type IEditCheckpointManifest, type IEditCheckpointRecorder, type IEditCheckpointRestoreResult, type IEditCheckpointSummary, type IEditCheckpointTurnInput, type IEvalCase, type IEvalCaseResult, type IEvalDefinition, type IEvalMetricScore, type IEvalReport, type IExecutionWorkspaceTaskSpawner, type IExternalEventSource, type IExternalEventSourceOptions, type IFallbackModelTarget, type IFallbackProviderOptions, type IForkExecutionOptions, type IGenerateSessionNameOptions, type IGitDiffArgs, type IGitProcessPort, type IGitProcessRunOptions, type IGitStatusSummary, type IGoalSignal, type IGoalStartOptions, type IGroupChatOrchestratorDeps, type IHandoffOrchestratorDeps, type IHandoffProgress, type IHandoffStaysBehind, type IHeadlessInteractionChannelOptions, type IHeadlessRunnerOptions, type IHeadlessSession, type IHeadlessSessionOptions, type IHeadlessTransport, type IHeadlessTransportOptions, type IHierarchicalOrchestratorDeps, type IHostBundlePluginLoaderOptions, type IHostToolResultSpillStore, type IInProcessSubagentRunnerDeps, type IInspectUserLocalStorageOptions, type IInstalledPluginRecord, type IInteractiveRuntime, type IInteractiveRuntimeOptions, type IInteractiveSessionShutdownOptions, type IKnownMarketplaceEntry, type ILegacyProviderSettings, type ILinkedDeviceSummary, type ILivePromptTracePort, type ILoadContextOptions, type ILoadedBundlePlugin, type IMarketplaceClientOptions, type IMarketplaceManifest, type IMarketplacePluginEntry, type IMemoryBudget, type IMemoryCandidate, type IMemoryCandidateExtractor, type IMemoryCurationQueue, type IMemoryExtractorPolicy, type IMemoryExtractorTrigger, type IMemoryPendingRecord, type IMemoryRecaller, type IMemoryStore, type IMemoryWriter, type IMetric, type IModelCommandToolProjection, type IModelEffortInputs, type IModelEffortResolution, type IModelFallbackChain, type IModelFallbackPrimary, type IModelListSelection, type IModelReapplyOptions, type INodeHostSettingsSource, type IOrchestrationRunContext, type IOrgPolicy, type IOutputStylePrompt, type IParallelOrchestratorDeps, type IParsedGitStatus, type IPerTurnRecallConfig, type IPermissionRuleGroup, type IPermissionRuleLayer, type IPermissionRuleRemoval, type IPermissionsCommandState, type IPlanControllerDeps, type IPluginSettings, type IPreTrustProjectPathInspection, type IPresetApplicationOptions, type IPresetApplicationResult, type IProjectContributionPath, type IProjectGitStatusFile, type IProjectMemorySummary, type IProjectSettingsPath, type IProjectedCommandExecutionToolsDeps, type IProjectedModelCommandTool, type IPromptExecutorOptions, type IPromptFileReferenceDiagnostic, type IPromptFileReferenceHistoryData, type IPromptFileReferenceLimits, type IPromptFileReferenceResolveOptions, type IPromptFileReferenceToken, type IPromptHistoryOptions, type IPromptProvider, type IProviderCommandModuleOptions, type IProviderCommandSettingsAdapter, type IProviderConnectionHost, type IProviderConnectionRequest, type IProviderErrorGuidance, type IProviderProfileNameSuggestionInput, type IProviderProfileNameSuggestionOptions, type IProviderProfileSettings, type IProviderSettingsBuildOptions, type IProviderSetupInput, type IProviderSetupPatch, type IProviderSwitchOptions, type IRawGitStatusRecord, type IReadProviderSettingsOptions, type IRemoteCommandPolicy, type IResetUserConfigResult, type IResolveExecutionAttachInput, type IResolveModelFallbackChainInput, type IResolveUserLocalStorageRootOptions, type IResolvedConfig, type IResolvedPromptFileReference, type IResolvedPromptFileReferences, type IRestrictedWorkspaceProjectAccess, type IReversibleExecutionOptions, type IReversibleToolSafetyContext, type IReversibleToolSafetyInput, type IReversibleToolSafetyReport, type IRuntimeHostHandle, type IRuntimeHostOptions, type IRuntimeHostPoolOptions, type ISelfHostingCommandTemplates, type ISelfHostingVerificationPlan, type ISelfHostingVerificationPlanInput, type ISelfHostingVerificationStep, type ISemanticMemoryAdapter, type ISemanticMemoryQueryResult, type ISequentialOrchestratorDeps, type ISequentialRunContext, type ISessionLease, type ISessionPoolBinding, type ISessionPoolEntry, type ISessionPoolOptions, type ISessionRecordRestoreResult, type ISessionSlotOptions, type ISessionUsageRecord, type ISettingsDocumentStore, type ISettingsInspection, type ISettingsKeyProvenance, type ISettingsLayerCause, type ISettingsLayerInspection, type ISettingsSchemaIssue, type ISkillActivationHistoryData, type ISkillExecutionCallbacks, type ISkillExecutionResult, type ISkillPromptContext, type ISkillRootDescriptor, type ISkillRootInspection, type ISkillSourceInspection, type ISkillSourceSkip, type ISpawnAgentTaskRequest, type ISpawnProcessTaskRequest, type IStartupMemory, type IStatelessRuntimeConfig, type ISubagentOptions, type ISubagentParentContext, type ISubagentPromptOptions, type ISystemCommand, type ISystemCommandSemanticRoles, type ITaskContextFile, type ITaskSelectionOptions, type IToolCallHandoffPolicy, type IToolCallHandoffProvenance, type ITrustedWorkspaceProjectAccess, type IUnknownCommandModuleName, type IUserLocalMemoryDeleteResult, type IUserLocalMemoryItemOptions, type IUserLocalMemoryItemProjection, type IUserLocalMemoryListOptions, type IUserLocalMemoryListProjection, type IUserLocalMemorySetOptions, type IUserLocalStorageCategoryDefinition, type IUserLocalStorageCategoryProjection, type IUserLocalStorageInspection, type IUserLocalStorageItemSummary, type IWorkspaceAncestorTextEntry, type IWorkspaceDirectoryEntry, type IWorkspaceIdentity, type IWorkspaceIdentityResolver, type IWorkspaceMoveRequest, type IWorkspaceProjectAuthority, type IWorkspaceProjectMutation, type IWorkspaceProjectReader, type IWorkspaceProjectSettingsSource, type IWorkspaceProjectSettingsWriter, type IWorkspaceProjectStateStorage, type IWorkspaceTrustCause, type IWorkspaceTrustGrant, type IWorkspaceTrustServiceOptions, type IWorkspaceTrustStore, type IWorkspaceTrustStoreSnapshot, InteractiveSession, LANGUAGE_COMMAND_ARGUMENT_HINT, LANGUAGE_COMMAND_DESCRIPTION, MAX_FALLBACK_MODELS, MAX_PROJECT_DIFF_LINES, MAX_STATUS_FILES, MEMORY_COMMAND_ARGUMENT_HINT, MEMORY_COMMAND_DESCRIPTION, MEMORY_COMMAND_USAGE, MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, MODEL_COMMAND_TOOL_PREFIX, MONITOR_SHELL_TOOL, MarketplaceClient, MonitorCommandRefusedError, NoCurrentProviderProfileError, NodeHostPluginSettingsStore, OUTPUT_FORMATS, OrgPolicyParseError, PERMISSIONS_COMMAND_DESCRIPTION, PERMISSION_MODE_ARGUMENT_HINT, PERMISSION_MODE_COMMAND_DESCRIPTION, PERMISSION_MODE_LABELS, PLUGIN_COMMAND_ARGUMENT_HINT, PLUGIN_COMMAND_DESCRIPTION, PROVIDER_SAFE_TOOL_NAME_PATTERN, PeerMessageIngress, PlanController, type PlanDelegation, PluginCommandSource, ProgrammaticInteractionChannel, ProjectMemoryStore, PromptExecutor, ProviderConfigError, RECOMMENDED_RESPONSE_LANGUAGES, RELOAD_PLUGINS_COMMAND_DESCRIPTION, RENAME_COMMAND_DESCRIPTION, RENAME_COMMAND_USAGE, RESUME_COMMAND_DESCRIPTION, REWIND_COMMAND_ARGUMENT_HINT, REWIND_COMMAND_DESCRIPTION, RUNTIME_RULE_SOURCE, RegexMemoryCandidateExtractor, type ResolveHandoff, SESSION_POOL_IDLE_GRACE_MS, SESSION_POOL_MAX_LIVE, STATUSLINE_COMMAND_ARGUMENT_HINT, STATUSLINE_COMMAND_DESCRIPTION, type SelectNextStep, SemanticMemoryStore, SessionChangeRefusal, SessionDeleteRefusal, SessionPool, SessionRenameUnavailableError, SessionSlot, SessionTerminalHandoffGate, SettingsParseError, SkillCommandSource, SystemCommandExecutor, type TAdvisorTargetResolver, type TAppearanceSettingsPatch, type TAutoCompactThreshold, type TAutoCompactThresholdSource, type TBundlePluginSkipReason, type TCommandModuleSessionRequirement, type TEditCheckpointFileRestoreAction, type TEditCheckpointsUnavailableReason, type TEffortDisposition, type TEffortSelection, type TEffortSource, type TEnabledPlugins, type TEvalRunFn, type TExecutionAttachOutcome, type TExternalEventReceipt, type TExternalEventSettlement, type TFrontmatterJsonResult, type TGitDiffTarget, type TGitProcessFailureReason, type TGitProcessOutcome, type TGoalDecision, type THostSettingsScope, type TInstalledPluginsRegistry, type TInteractiveSessionOptions, type TKnownMarketplacesRegistry, type TMarketplaceSource, type TMemoryCandidateStatus, type TMemoryPolicyMode, type TOutputFormat, type TParseGitDiffArgs, type TParsedInput, type TPermissionRuleKind, type TPlanDecision, type TPoolBusySession, type TProjectFileStatus, type TProjectGitDiffResult, type TProjectGitStatusResult, type TProjectSettingsScope, type TPromptFileReferenceDiagnosticCode, type TProviderConnectionStage, type TProviderFactory, type TProviderSettingsDocument, type TQueryFunction, type TRawGitStatusRecordKind, type TRecommendedResponseLanguage, type TRemoteControlStatus, type TRestoredScheduleDisposition, type TReversibleExecutionIsolation, type TReversibleRollbackLayer, type TReversibleSafetyStatus, type TReversibleSideEffect, type TSandboxCommandMode, type TSandboxSettings, type TSelfHostingLoopEvent, type TSelfHostingLoopState, type TSelfHostingVerificationPhase, type TSessionFactory, type TSessionPoolRole, type TSessionResponseFormat, type TSettings, type TSettingsCheck, type TSettingsData, type TSettingsLayerState, type TSettingsMergeRule, type TSettingsScope, type TSettingsSource, type TShellExecFn, type TSkillSkipReason, type TSubagentRunnerFactory, type TSubagentSuffix, type TSystemCommandLifecycle, type TSystemCommandSemanticRole, type TTaskFileStatus, type TUserLocalMemoryCategory, type TUserLocalMemoryCommandExecutionEffect, type TUserLocalStorageCategory, type TWorkspaceContributionKind, type TWorkspaceProjectAccess, type TWorkspaceProjectAuthorityCandidate, type TWorkspaceProjectMutationDecision, type TWorkspaceProjectSettingsTarget, type TWorkspaceProjectSettingsWriteDecision, type TWorkspaceProjectStateDirectories, type TWorkspaceProjectStateNamespace, type TWorkspaceTrustState, TransportRegistry, USER_LOCAL_MEMORY_CATEGORIES, USER_LOCAL_STORAGE_CATEGORIES, USER_LOCAL_STORAGE_CATEGORY_DEFINITIONS, VALIDATE_SESSION_COMMAND_DESCRIPTION, VALID_PERMISSION_MODES, WorkspaceAuthorityRequiredError, WorkspaceMemoryStore, WorkspaceProjectSessionStore, WorkspaceSessionLogSink, WorkspaceSessionLogSource, WorkspaceTrustService, addCommandContextReference, applyActiveModelChange, applyAppearanceSettings, applyModelFallback, applyPresetToSession, applyProviderConfiguration, applyProviderSwitch, applyStatusLineSettings, approvePendingMemoryCandidate, assembleSubagentPrompt, assertWorkspaceProjectAuthority, assertWorkspaceProjectMutation, assertWorkspaceProjectMutationForAuthority, assertWorkspaceProjectReader, assertWorkspaceProjectSettingsWriter, assertWorkspaceProjectStateStorage, bindTransportAdapter, buildBackgroundCommandSubcommands, buildGoalContinuationPrompt, buildGoalStartPrompt, buildLanguageCommandSubcommands, buildMemoryCommandSubcommands, buildModelListSnapshot, buildPermissionModeSubcommands, buildPluginCommandSubcommands, buildPromptWithFileReferences, buildProviderProfile, buildProviderProfilesSnapshot, buildProviderSetupPatch, buildRewindCommandSubcommands, buildRuntimeSession, buildStatusLineCommandSubcommands, cancelCommandBackgroundTask, checkNodeHostSettingsFile, checkSettingsDocument, clearCommandContextReferences, clearContextReferences, clearConversationHistory, closeCommandBackgroundTask, compactCommandContext, compareSemverVersions, consentScopeFor, createAdvisorTool, createAgentRuntime, createAgentTool, createBackgroundGroupExecutionEntryId, createBackgroundProcessTool, createBackgroundTaskExecutionEntryId, createBuiltinCommandModule, createCommandExecutionTool, createCommandMemoryStores, createContextReferenceItem, createContributionSourcesForProjectAccess, createDefaultRemoteCommandPolicy, createDefaultUserContributionSources, createExecutionOriginMetadata, createExecutionWorkspaceSnapshot, createExecutionWorkspaceTaskSpawner, createExternalEventGrantHistory, createFileTransportSettingsRepository, createGitProcess, createGoalStatusTool, createHeadlessRunner, createHeadlessTransport, createHostBundlePluginLoader, createInProcessSubagentRunner, createInteractiveRuntime, createLineDetailPage, createMainThreadDetailPage, createMainThreadExecutionEntryId, createMemoryTransportSettingsRepository, createModelCommandToolProjection, createNodeHostContributionSource, createNodeHostSessionStore, createNodeHostSettingsSource, createNodeHostSettingsStore, createNodeToolResultSpillStore, createNodeWorkspaceIdentityResolver, createNodeWorkspaceTrustService, createNodeWorkspaceTrustStore, createProgrammaticAgent, createProjectSessionStore, createProjectedCommandExecutionTools, createPromptFileReferenceHistoryEntry, createProviderFromSettings, createProviderSafeModelCommandToolName, createQuery, createRestrictedWorkspaceProjectAccess, createSemanticMemoryStore, createSessionExitHostAction, createSessionRenameHostAction, createSessionRunFn, createSettingsPermissionRulesAdapter, createShowPluginManagerIntent, createShowSessionPickerIntent, createSkillCommand, createSkillExecutionPort, createStatelessRuntime, createSubagentLogger, createSubagentSession, createSystemCommands, createUserPromptHistoryFile, createUserSessionStore, createWorkspaceMemoryStore, createWorkspaceProjectContributionSource, createWorkspaceProjectMutation, createWorkspaceProjectSettingsSources, createWorkspaceProjectSettingsStore, createWorkspaceProjectSettingsWriter, decodeFrontmatter, decodeFrontmatterJson, defineEval, deleteProviderProfile, deleteSettings, deleteUserLocalMemoryItem, deriveContextCapacityHint, describeBundleContribution, describeModelFallback, describeProviderDestination, disableUserLocalMemoryItem, discoverTaskFiles, evaluateReversibleToolSafety, exactMatch, executeGitDiff, executeGitStatus, executeSkill, extractGoalSignal, findUnknownModuleNames, forkCommandEditCheckpoint, formatAdvisorSpec, formatCommandBackgroundTask, formatCommandBackgroundTaskList, formatCommandHelpMessage, formatCommandPermissionsMessage, formatCommandSessionReplayValidationReport, formatEvalReport, formatGitStatus, formatInvalidPermissionModeMessage, formatLanguageUsageMessage, formatOrgPolicyViolationMessage, formatProjectedModelCommandToolPromptDescription, formatPromptFileReferenceDiagnostics, formatTaskContext, generateSessionName, getForkWorkerSuffix, getSubagentSuffix, getWorkspaceProjectIdentity, getWorkspaceProjectReader, getWorkspaceProjectStateStorage, gitDiffArgv, gitEnvironment, gitFailureMessage, groupPermissionRulesBySource, hasBlockingPromptFileReferenceDiagnostics, hasSensitiveCommandMemoryContent, includesText, inspectCommandEditCheckpoint, inspectPreTrustProjectPaths, inspectSettingsLayers, inspectSkillSources, inspectUserLocalMemoryItem, inspectUserLocalStorage, isApiKeyPlaintext, isAppearanceSettingsPatch, isCommandMemoryType, isGoalCancelVerb, isLoopStopVerb, isMemoryType, isNewerSemverVersion, isNotAGitRepositoryFailure, isPermissionMode, isSafeSessionId, isSessionBusy, isSlashCommand, isStatusLineCommandSettingsPatch, listActiveContextReferences, listCommandBackgroundTasks, listCommandContextReferences, listCommandEditCheckpointBranches, listCommandEditCheckpoints, listCommandSessionAllowedTools, listCommandUsedMemoryReferences, listFrameworkProjectContributionPaths, listResumableSessionSummaries, listUnreadableSessions, listUnreadableSessionsForWorkspace, listUserLocalMemoryItems, loadHostBundlePluginInspectionFromScopes, loadHostBundlePluginsFromScopes, loadOrgPolicy, loadTaskContext, mergeProviderPatch, mergeProviders, mergeSettings, normalizeModelCommandName, parseAdvisorSpec, parseCommandBackgroundLogCursor, parseEvalCases, parseExecutionWorkspaceEntryId, parseFallbackModelList, parseGitDiffArgs, parseInput, parseLanguageArgument, parseModelEffort, parsePermissionModeArgument, parsePromptFileReferences, parseSessionNameArgument, parseStatusPorcelainV2, parseStatusRecords, parseTaskFile, parseUnifiedDiffLines, persistSessionRename, planSelfHostingVerification, preprocessShellCommands, probeProviderProfile, promptForApproval, providerDestinationOf, readAppearanceSettings, readAutoCompactThreshold, readAutoCompactThresholdSource, readCommandBackgroundTaskLog, readCommandContextState, readCommandPermissionMode, readCommandPermissionsState, readCommandSessionInfo, readCurrentGitBranchFromNodeHost, readEnabledUserLocalMemoryItem, readFallbackModelSetting, readMergedProviderSettings, readMergedProviderSettingsFromSources, readPackageVersion, readPermissionRuleLayers, readProjectGitDiff, readProjectGitStatus, readProviderSettings, readSettings, readSettingsSourceText, readStatusLineSettings, recordCommandMemoryEvent, regexMatch, rememberProviderDestination, removeCommandContextReference, removeContextReference, removePermissionRule, resetAutoCompactThresholdSetting, resetUserConfig, resolveActiveProvider, resolveEnvDefaultProvider, resolveExecutionAttach, resolveGitBranchFromNodeHost, resolveLatestSessionId, resolveModelEffort, resolveModelFallbackChain, resolveModelListSelection, resolvePermissionModeAdapter, resolvePluginCommandAdapter, resolvePromptFileReferencePaths, resolvePromptFileReferences, resolveProviderSettingsWriteTarget, resolveReusableEmptySessionId, resolveRoleFallbackChain, resolveRoleModel, resolveSessionIdByIdOrName, resolveStartupAdvisorSpec, resolveSubagentLogDir, resolveUserLocalStorageRoot, responseIsJson, restoreCommandEditCheckpoint, restoreSessionRecordIntoSession, restoredScheduleDisposition, retrieveAgentToolDeps, retryCommandPermissionDenial, rollbackCommandEditCheckpoint, runEval, runGroupChat, runHandoff, runHierarchical, runParallel, runSequential, runWithRoleFallback, sandboxApprovalFor, sanitizeProviderProfileName, selectCommandModules, selectFallbackModelEntries, selectRelevantTasks, setCommandAutoCompactThreshold, setCurrentProvider, setUserLocalMemoryItem, startRuntimeHost, storeAgentToolDeps, substituteVariables, suggestProviderProfileName, summarizeBackgroundJobGroup, supportsWorkspaceProjectMutation, switchCommandEditCheckpointBranch, testProviderProfileCommand, toContextReferenceRecords, toPromptFileReferenceRecords, tokeniseSlashCommand, transitionSelfHostingLoop, trimTrailingChars, updateModelInSettings, upsertContextReference, upsertProviderProfile, usedTool, validateCommandSessionReplayLog, validateProviderProfile, withUniqueSessionName, wrapEditCheckpointTools, wrapReversibleExecutionTools, writeAutoCompactThresholdSetting, writeCommandPermissionMode, writeSettings };
|
|
2192
|
+
//# sourceMappingURL=index.d.cts.map
|