@diffra-ai/cli 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/bundle/chunks/{anthropic-messages-YTASKTAG.js → anthropic-messages-T6QSBW2I.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-2JI3BQFX.js → azure-openai-responses-QHACUEEL.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-CAD23HR7.js → chunk-2CWIL3U7.js} +1 -1
- package/dist/bundle/chunks/{chunk-GNFHDZLP.js → chunk-3OQXW6CV.js} +1 -1
- package/dist/bundle/chunks/{chunk-MPWP6WCT.js → chunk-ACRSTWI3.js} +1 -1
- package/dist/bundle/chunks/{chunk-ZW3S4FQY.js → chunk-EMYFX4WY.js} +1 -1
- package/dist/bundle/chunks/{chunk-PCXT7GLW.js → chunk-GU5QXRH2.js} +114 -85
- package/dist/bundle/chunks/{chunk-7QEHJ36J.js → chunk-HGCDVLYI.js} +1 -1
- package/dist/bundle/chunks/{chunk-SI7T4LPD.js → chunk-J3RI6JJL.js} +2 -2
- package/dist/bundle/chunks/{chunk-6RKODDUE.js → chunk-JZ2OAQAK.js} +1 -1
- package/dist/bundle/chunks/{chunk-AI3Y7XHP.js → chunk-TXISM6X7.js} +4 -4
- package/dist/bundle/chunks/{chunk-IDYI4NPC.js → chunk-UVU7AFFV.js} +1 -1
- package/dist/bundle/chunks/chunk-YTFC5DOS.js +2 -0
- package/dist/bundle/chunks/{chunk-YDKIXS42.js → chunk-ZTDZEFOK.js} +1 -1
- package/dist/bundle/chunks/{cli-2W6362ZV.js → cli-B74BATSM.js} +1 -1
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-MN7VZOHO.js → cloudflare-workers-ai-system-one-IRTLSYMY.js} +1 -1
- package/dist/bundle/chunks/{execute-OEFRHFHI.js → execute-YR7Q5B3S.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-QROUBJ3Y.js → google-generative-ai-J4JVZXHV.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-RHSCDEG4.js → google-vertex-A36RXRWN.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-QCKHKADQ.js → llama-cpp-classify-WD5MJBC7.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-WO6QUI4U.js → mistral-conversations-YIKS5LKW.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-XFI3MXBY.js → openai-codex-responses-UBNJIYCO.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-2UHGTBTY.js → openai-completions-WBIL7MLK.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-BPJODLLR.js → openai-decisions-6T6CQTOT.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-CCD734Z2.js → openai-responses-W2CLKVKJ.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-WSQ42OX2.js → openrouter-images-ZP4QC3RD.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-I264JUT4.js → pi-messages-VHFVA66D.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-O3PSKAI2.js → typesafe-system-one-GORHCFHB.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-CMUMO27Q.js → virtual-modules-XMXHVMFN.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/core/agent-session.d.ts +68 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +173 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/background-commands.d.ts +71 -0
- package/dist/core/background-commands.d.ts.map +1 -0
- package/dist/core/background-commands.js +158 -0
- package/dist/core/background-commands.js.map +1 -0
- package/dist/core/decisions.d.ts +144 -0
- package/dist/core/decisions.d.ts.map +1 -0
- package/dist/core/decisions.js +74 -0
- package/dist/core/decisions.js.map +1 -0
- package/dist/core/explain-tool-call.d.ts +20 -0
- package/dist/core/explain-tool-call.d.ts.map +1 -0
- package/dist/core/explain-tool-call.js +39 -0
- package/dist/core/explain-tool-call.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +11 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +15 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +29 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/tools/background-tasks.d.ts +35 -0
- package/dist/core/tools/background-tasks.d.ts.map +1 -0
- package/dist/core/tools/background-tasks.js +110 -0
- package/dist/core/tools/background-tasks.js.map +1 -0
- package/dist/core/tools/bash.d.ts +11 -3
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +67 -17
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +8 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +22 -0
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +1 -1
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +2 -1
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/write.d.ts +1 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +6 -0
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +15 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/turn-files.d.ts +99 -0
- package/dist/core/turn-files.d.ts.map +1 -0
- package/dist/core/turn-files.js +270 -0
- package/dist/core/turn-files.js.map +1 -0
- package/dist/extensions/agents/agent-tool.d.ts +0 -1
- package/dist/extensions/agents/agent-tool.d.ts.map +1 -1
- package/dist/extensions/agents/agent-tool.js +2 -1
- package/dist/extensions/agents/agent-tool.js.map +1 -1
- package/dist/extensions/agents/index.d.ts +4 -3
- package/dist/extensions/agents/index.d.ts.map +1 -1
- package/dist/extensions/agents/index.js +33 -32
- package/dist/extensions/agents/index.js.map +1 -1
- package/dist/extensions/approval/exit-plan-mode.d.ts +5 -1
- package/dist/extensions/approval/exit-plan-mode.d.ts.map +1 -1
- package/dist/extensions/approval/exit-plan-mode.js +131 -19
- package/dist/extensions/approval/exit-plan-mode.js.map +1 -1
- package/dist/extensions/approval/index.d.ts.map +1 -1
- package/dist/extensions/approval/index.js +46 -23
- package/dist/extensions/approval/index.js.map +1 -1
- package/dist/extensions/approval/policy.d.ts +5 -12
- package/dist/extensions/approval/policy.d.ts.map +1 -1
- package/dist/extensions/approval/policy.js +26 -4
- package/dist/extensions/approval/policy.js.map +1 -1
- package/dist/extensions/hooks/index.d.ts.map +1 -1
- package/dist/extensions/hooks/index.js +12 -1
- package/dist/extensions/hooks/index.js.map +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +3 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/questions/index.d.ts +41 -0
- package/dist/extensions/questions/index.d.ts.map +1 -0
- package/dist/extensions/questions/index.js +132 -0
- package/dist/extensions/questions/index.js.map +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/docs/approval-modes.md +7 -3
- package/docs/cli.md +12 -1
- package/docs/codemode.md +1 -1
- package/docs/extensions.md +36 -1
- package/docs/json.md +19 -0
- package/docs/sdk.md +63 -1
- package/docs/session-format.md +2 -0
- package/docs/settings.md +1 -1
- package/docs/slash-commands.md +1 -1
- package/docs/subagents.md +2 -2
- package/package.json +6 -6
- package/dist/bundle/chunks/chunk-RAT6HXXD.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export { type Args, parseArgs } from "./cli/args.ts";
|
|
2
2
|
export { CONFIG_DIR_NAME, getAgentDir, getDocsPath, getExamplesPath, getPackageDir, getReadmePath, VERSION, } from "./config.ts";
|
|
3
3
|
export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, parseSkillBlock, type SessionStats, } from "./core/agent-session.ts";
|
|
4
|
+
export { APPROVAL_MODE_INFO, APPROVAL_MODES, type ApprovalMode } from "./core/approval-mode.ts";
|
|
4
5
|
export { readStoredCredential } from "./core/auth-storage.ts";
|
|
6
|
+
export type { BackgroundCommand, BackgroundCommandStatus } from "./core/background-commands.ts";
|
|
5
7
|
export type { CacheWarmingDecision, CacheWarmingStatus } from "./core/cache-warmer.ts";
|
|
6
8
|
export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesResult, type CompactionResult, type CutPointResult, calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, type FileOperations, findCutPoint, findTurnStartIndex, type GenerateBranchSummaryOptions, generateBranchSummary, generateSummary, generateSummaryWithUsage, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.ts";
|
|
9
|
+
export type { ApprovalAnswer, ApprovalCause, ApprovalRemember, ApprovalRequest, ApprovalSubject, PlanApprovalAnswer, PlanApprovalRequest, Question, QuestionAnswer, QuestionOption, QuestionsRequest, SandboxApproval, ToolCallApproval, } from "./core/decisions.ts";
|
|
7
10
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
|
|
11
|
+
export { type ExplainedCall, type ExplainOptions, explainToolCall } from "./core/explain-tool-call.ts";
|
|
8
12
|
export type { AfterProviderResponseEvent, AgentActivityOutcome, AgentBeforeSettleEvent, AgentBeforeSettleEventResult, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartCustomEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeAgentStartUserEvent, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BoundaryContextPreview, BoundaryResult, BoundaryState, BuildSystemPromptOptions, CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult, CompactionEntryDraft, CompactOptions, ContextEditEntryDraft, ContextEvent, ContextEventResult, ContextUsage, ContextWithSystemEvent, CustomEntryDraft, CustomMessageEntryDraft, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolOptions, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionToolContext, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionVirtualModel, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingHints, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownMessageType, MarkdownTransformContext, MarkdownTransformer, MarkdownTransformerOptions, MarkdownTransformerRegistration, McpServersChangeEvent, MessageEndEvent, MessageEndEventResult, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelSelectEvent, ModelSelectSource, NormalizedBuildSystemPromptOptions, PowerShellToolCallEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ProviderStreamEvent, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBoundaryDraft, SessionCompactEvent, SessionCompactFailedEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ThinkingLevelSelectEvent, ToolAnnotations, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolExposure, ToolInfo, ToolLoadout, ToolLoadoutChanges, ToolNamespace, ToolRendererResolver, ToolRenderers, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TurnEndEvent, TurnEndEventResult, TurnStartEvent, UIPromptEndEvent, UIPromptKind, UIPromptStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
9
13
|
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isPowerShellToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
10
14
|
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.ts";
|
|
@@ -22,16 +26,20 @@ export { type BranchSummaryEntry, buildContextEntries, buildSessionContext, buil
|
|
|
22
26
|
export { type CacheWarmingMode, type CompactionModelOverride, type CompactionSettings, type DefaultProjectTrust, type FullscreenExitOutput, type ImageSettings, type PackageSource, type QuietStartup, type RetrySettings, SettingsManager, type SettingsManagerCreateOptions, type TuiMode, } from "./core/settings-manager.ts";
|
|
23
27
|
export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, type Skill, type SkillFrontmatter, } from "./core/skills.ts";
|
|
24
28
|
export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
29
|
+
export type { TaskStopper } from "./core/tools/background-tasks.ts";
|
|
25
30
|
export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.ts";
|
|
26
31
|
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
27
32
|
export { formatReadLineRange } from "./core/tools/render-utils.ts";
|
|
28
|
-
export { hasTrustRequiringProjectResources, type ProjectTrustDecision, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, } from "./core/trust-manager.ts";
|
|
33
|
+
export { findTrustRequiringProjectResources, getProjectTrustOptions, getProjectTrustParentPath, hasTrustRequiringProjectResources, type ProjectTrustDecision, type ProjectTrustOption, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, } from "./core/trust-manager.ts";
|
|
34
|
+
export type { TurnFileChange, TurnFileChanges, UndoTurnResult } from "./core/turn-files.ts";
|
|
29
35
|
export { type ModelRoute, type ModelRouteReason, type ModelRouteRequest, VIRTUAL_MODEL_STATE_ENTRY, type VirtualModelDefinition, type VirtualModelStateData, } from "./core/virtual-models.ts";
|
|
36
|
+
export type { ExitPlanModeDetails } from "./extensions/approval/exit-plan-mode.ts";
|
|
30
37
|
export { type CodemodeExtensionOptions, createCodemodeExtension } from "./extensions/codemode/index.ts";
|
|
31
38
|
export type { CodemodeStoreEntryData, CodemodeToolDetails } from "./extensions/codemode/tool.ts";
|
|
32
39
|
export { builtInExtensions } from "./extensions/index.ts";
|
|
33
40
|
export type { LoadedMcpConfig, McpExposure, McpServerConfig, McpServerEntry } from "./extensions/mcp/config.ts";
|
|
34
41
|
export { createMcpExtension, type McpExtensionOptions, type McpTransportFactory } from "./extensions/mcp/index.ts";
|
|
42
|
+
export { ASK_USER_QUESTION_TOOL_NAME, type AskUserQuestionDetails, createQuestionsExtension, } from "./extensions/questions/index.ts";
|
|
35
43
|
export { createToolSearchExtension } from "./extensions/tool-search/index.ts";
|
|
36
44
|
export { type MainOptions, main } from "./main.ts";
|
|
37
45
|
export { InteractiveMode, type InteractiveModeOptions, type JsonAgentSessionEvent, type ModelInfo, type PrintModeOptions, RpcClient, type RpcClientOptions, type RpcCommand, type RpcEventListener, type RpcExtensionUIRequest, type RpcExtensionUIResponse, type RpcResponse, type RpcSessionState, runPrintMode, runRpcMode, } from "./modes/index.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EACN,eAAe,EACf,WAAW,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,EACzB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,KAAK,oBAAoB,GACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,GACL,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,12 @@ export { parseArgs } from "./cli/args.js";
|
|
|
3
3
|
// Config paths
|
|
4
4
|
export { CONFIG_DIR_NAME, getAgentDir, getDocsPath, getExamplesPath, getPackageDir, getReadmePath, VERSION, } from "./config.js";
|
|
5
5
|
export { AgentSession, parseSkillBlock, } from "./core/agent-session.js";
|
|
6
|
+
export { APPROVAL_MODE_INFO, APPROVAL_MODES } from "./core/approval-mode.js";
|
|
6
7
|
export { readStoredCredential } from "./core/auth-storage.js";
|
|
7
8
|
// Compaction
|
|
8
9
|
export { calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, findCutPoint, findTurnStartIndex, generateBranchSummary, generateSummary, generateSummaryWithUsage, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.js";
|
|
9
10
|
export { createEventBus } from "./core/event-bus.js";
|
|
11
|
+
export { explainToolCall } from "./core/explain-tool-call.js";
|
|
10
12
|
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isPowerShellToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.js";
|
|
11
13
|
export { convertToLlm } from "./core/messages.js";
|
|
12
14
|
export { ModelRegistry } from "./core/model-registry.js";
|
|
@@ -29,12 +31,13 @@ export { generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff
|
|
|
29
31
|
// Tools
|
|
30
32
|
export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
31
33
|
export { formatReadLineRange } from "./core/tools/render-utils.js";
|
|
32
|
-
export { hasTrustRequiringProjectResources, ProjectTrustStore, } from "./core/trust-manager.js";
|
|
34
|
+
export { findTrustRequiringProjectResources, getProjectTrustOptions, getProjectTrustParentPath, hasTrustRequiringProjectResources, ProjectTrustStore, } from "./core/trust-manager.js";
|
|
33
35
|
export { VIRTUAL_MODEL_STATE_ENTRY, } from "./core/virtual-models.js";
|
|
34
36
|
// Built-in extensions. The CLI loads them; SDK sessions add them to their extension factories.
|
|
35
37
|
export { createCodemodeExtension } from "./extensions/codemode/index.js";
|
|
36
38
|
export { builtInExtensions } from "./extensions/index.js";
|
|
37
39
|
export { createMcpExtension } from "./extensions/mcp/index.js";
|
|
40
|
+
export { ASK_USER_QUESTION_TOOL_NAME, createQuestionsExtension, } from "./extensions/questions/index.js";
|
|
38
41
|
export { createToolSearchExtension } from "./extensions/tool-search/index.js";
|
|
39
42
|
// Main entry point
|
|
40
43
|
export { main } from "./main.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,eAAe;AACf,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,aAAa;AACb,OAAO,EAMN,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAA0C,MAAM,qBAAqB,CAAC;AAyJ7F,OAAO,EACN,sBAAsB,EACtB,UAAU,EACV,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAIN,eAAe,EACf,gCAAgC,GAEhC,MAAM,0BAA0B,CA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vD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\nexport type { CacheWarmingDecision, CacheWarmingStatus } from \"./core/cache-warmer.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentActivityOutcome,\n\tAgentBeforeSettleEvent,\n\tAgentBeforeSettleEventResult,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartCustomEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeAgentStartUserEvent,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBoundaryContextPreview,\n\tBoundaryResult,\n\tBoundaryState,\n\tBuildSystemPromptOptions,\n\tCacheWarmingDecisionEvent,\n\tCacheWarmingDecisionEventResult,\n\tCompactionEntryDraft,\n\tCompactOptions,\n\tContextEditEntryDraft,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tContextWithSystemEvent,\n\tCustomEntryDraft,\n\tCustomMessageEntryDraft,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExecuteToolOptions,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionToolContext,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionVirtualModel,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingHints,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownMessageType,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMarkdownTransformerOptions,\n\tMarkdownTransformerRegistration,\n\tMcpServersChangeEvent,\n\tMessageEndEvent,\n\tMessageEndEventResult,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectSource,\n\tNormalizedBuildSystemPromptOptions,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tProviderStreamEvent,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionBoundaryDraft,\n\tSessionCompactEvent,\n\tSessionCompactFailedEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tThinkingLevelSelectEvent,\n\tToolAnnotations,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolExposure,\n\tToolInfo,\n\tToolLoadout,\n\tToolLoadoutChanges,\n\tToolNamespace,\n\tToolRendererResolver,\n\tToolRenderers,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTurnEndEvent,\n\tTurnEndEventResult,\n\tTurnStartEvent,\n\tUIPromptEndEvent,\n\tUIPromptKind,\n\tUIPromptStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport type { RegisteredMcpServer } from \"./core/mcp-servers.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageInstallFailure,\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionProjection,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CacheWarmingMode,\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype QuietStartup,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport { formatReadLineRange } from \"./core/tools/render-utils.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\nexport {\n\ttype ModelRoute,\n\ttype ModelRouteReason,\n\ttype ModelRouteRequest,\n\tVIRTUAL_MODEL_STATE_ENTRY,\n\ttype VirtualModelDefinition,\n\ttype VirtualModelStateData,\n} from \"./core/virtual-models.ts\";\n// Built-in extensions. The CLI loads them; SDK sessions add them to their extension factories.\nexport { type CodemodeExtensionOptions, createCodemodeExtension } from \"./extensions/codemode/index.ts\";\nexport type { CodemodeStoreEntryData, CodemodeToolDetails } from \"./extensions/codemode/tool.ts\";\nexport { builtInExtensions } from \"./extensions/index.ts\";\nexport type { LoadedMcpConfig, McpExposure, McpServerConfig, McpServerEntry } from \"./extensions/mcp/config.ts\";\nexport { createMcpExtension, type McpExtensionOptions, type McpTransportFactory } from \"./extensions/mcp/index.ts\";\nexport { createToolSearchExtension } from \"./extensions/tool-search/index.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeAppearance,\n\ttype ThemeBg,\n\ttype ThemeColor,\n\ttype ThemeStyle,\n\ttype ThemeToken,\n\ttheme,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,eAAe;AACf,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX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D,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\nexport { APPROVAL_MODE_INFO, APPROVAL_MODES, type ApprovalMode } from \"./core/approval-mode.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\nexport type { BackgroundCommand, BackgroundCommandStatus } from \"./core/background-commands.ts\";\nexport type { CacheWarmingDecision, CacheWarmingStatus } from \"./core/cache-warmer.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport type {\n\tApprovalAnswer,\n\tApprovalCause,\n\tApprovalRemember,\n\tApprovalRequest,\n\tApprovalSubject,\n\tPlanApprovalAnswer,\n\tPlanApprovalRequest,\n\tQuestion,\n\tQuestionAnswer,\n\tQuestionOption,\n\tQuestionsRequest,\n\tSandboxApproval,\n\tToolCallApproval,\n} from \"./core/decisions.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport { type ExplainedCall, type ExplainOptions, explainToolCall } from \"./core/explain-tool-call.ts\";\n// Extension system\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentActivityOutcome,\n\tAgentBeforeSettleEvent,\n\tAgentBeforeSettleEventResult,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartCustomEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeAgentStartUserEvent,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBoundaryContextPreview,\n\tBoundaryResult,\n\tBoundaryState,\n\tBuildSystemPromptOptions,\n\tCacheWarmingDecisionEvent,\n\tCacheWarmingDecisionEventResult,\n\tCompactionEntryDraft,\n\tCompactOptions,\n\tContextEditEntryDraft,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tContextWithSystemEvent,\n\tCustomEntryDraft,\n\tCustomMessageEntryDraft,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExecuteToolOptions,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionToolContext,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionVirtualModel,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingHints,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownMessageType,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMarkdownTransformerOptions,\n\tMarkdownTransformerRegistration,\n\tMcpServersChangeEvent,\n\tMessageEndEvent,\n\tMessageEndEventResult,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectSource,\n\tNormalizedBuildSystemPromptOptions,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tProviderStreamEvent,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionBoundaryDraft,\n\tSessionCompactEvent,\n\tSessionCompactFailedEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tThinkingLevelSelectEvent,\n\tToolAnnotations,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolExposure,\n\tToolInfo,\n\tToolLoadout,\n\tToolLoadoutChanges,\n\tToolNamespace,\n\tToolRendererResolver,\n\tToolRenderers,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTurnEndEvent,\n\tTurnEndEventResult,\n\tTurnStartEvent,\n\tUIPromptEndEvent,\n\tUIPromptKind,\n\tUIPromptStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport type { RegisteredMcpServer } from \"./core/mcp-servers.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageInstallFailure,\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionProjection,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CacheWarmingMode,\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype QuietStartup,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport type { TaskStopper } from \"./core/tools/background-tasks.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport { formatReadLineRange } from \"./core/tools/render-utils.ts\";\nexport {\n\tfindTrustRequiringProjectResources,\n\tgetProjectTrustOptions,\n\tgetProjectTrustParentPath,\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\ttype ProjectTrustOption,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\nexport type { TurnFileChange, TurnFileChanges, UndoTurnResult } from \"./core/turn-files.ts\";\nexport {\n\ttype ModelRoute,\n\ttype ModelRouteReason,\n\ttype ModelRouteRequest,\n\tVIRTUAL_MODEL_STATE_ENTRY,\n\ttype VirtualModelDefinition,\n\ttype VirtualModelStateData,\n} from \"./core/virtual-models.ts\";\nexport type { ExitPlanModeDetails } from \"./extensions/approval/exit-plan-mode.ts\";\n// Built-in extensions. The CLI loads them; SDK sessions add them to their extension factories.\nexport { type CodemodeExtensionOptions, createCodemodeExtension } from \"./extensions/codemode/index.ts\";\nexport type { CodemodeStoreEntryData, CodemodeToolDetails } from \"./extensions/codemode/tool.ts\";\nexport { builtInExtensions } from \"./extensions/index.ts\";\nexport type { LoadedMcpConfig, McpExposure, McpServerConfig, McpServerEntry } from \"./extensions/mcp/config.ts\";\nexport { createMcpExtension, type McpExtensionOptions, type McpTransportFactory } from \"./extensions/mcp/index.ts\";\nexport {\n\tASK_USER_QUESTION_TOOL_NAME,\n\ttype AskUserQuestionDetails,\n\tcreateQuestionsExtension,\n} from \"./extensions/questions/index.ts\";\nexport { createToolSearchExtension } from \"./extensions/tool-search/index.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeAppearance,\n\ttype ThemeBg,\n\ttype ThemeColor,\n\ttype ThemeStyle,\n\ttype ThemeToken,\n\ttheme,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
|
package/docs/approval-modes.md
CHANGED
|
@@ -29,10 +29,12 @@ The footer shows the mode unless it is `yolo`. A mode change is recorded in the
|
|
|
29
29
|
When a call needs approval, Diffra shows a dialog with three choices:
|
|
30
30
|
|
|
31
31
|
- **Yes, allow once** runs this call.
|
|
32
|
-
- **Yes, always allow** remembers the answer for the rest of the session: for shell commands, every command that starts with the same programs (for example `npm`); for edits,
|
|
32
|
+
- **Yes, always allow** remembers the answer for the rest of the session: for shell commands, every command that starts with the same programs (for example `npm`); for edits, every edit, without changing the mode; for other tools, every call of that tool.
|
|
33
33
|
- **No** blocks the call, and the model is told you denied it.
|
|
34
34
|
|
|
35
|
-
Dialogs appear one at a time.
|
|
35
|
+
Dialogs appear one at a time. Hosts that render approvals themselves (the desktop app) get the call as a structured request instead: the command or the edit's diff, why it needs approval (the mode, plan mode, auto mode, or a hook), what "always" would remember, and an explanation of the call by the fast model on request; denying can add a note for the model. See [Structured decisions](extensions.md#structured-decisions).
|
|
36
|
+
|
|
37
|
+
Without an interactive UI (print and JSON mode), a call that needs approval is blocked and the model is told why. Use `yolo` mode, or `auto` for calls the classifier can approve, in unattended runs.
|
|
36
38
|
|
|
37
39
|
## Plan mode
|
|
38
40
|
|
|
@@ -45,6 +47,8 @@ In plan mode the model explores with read-only tools and writes a plan. Every mo
|
|
|
45
47
|
- **Yes, and manually approve edits** continues in `default`.
|
|
46
48
|
- **No, keep planning** stays in plan mode.
|
|
47
49
|
|
|
50
|
+
Hosts that render plan approvals (the desktop app) save the plan as a file in the project's `.diffra/plans/`, named after its first line; a revised plan replaces the file until one is approved. You can edit the file before approving, and the model then follows your version. These hosts can also run the plan as a goal, pick the model and thinking level to implement it with, or send feedback when you keep planning.
|
|
51
|
+
|
|
48
52
|
Only your answer approves a plan; no mode or setting approves it for you. When plan mode ends another way, such as with `/plan exit`, the next model request tells the model that plan mode is over and no plan approval is pending.
|
|
49
53
|
|
|
50
54
|
A shell command that is neither recognized as read-only nor as state-modifying asks for a one-time approval of that exact command. It does not approve related commands or the plan.
|
|
@@ -96,4 +100,4 @@ Each hint is cut to 200 characters; each list keeps its first 50 entries and `en
|
|
|
96
100
|
- The cycle key is `alt+m`, not Shift+Tab, which cycles the thinking level in Diffra.
|
|
97
101
|
- The classifier makes one request per call and returns its reason; Qwen Code runs a fast stage and, after a block, a second reviewing stage.
|
|
98
102
|
- There are no `permissions.allow`, `permissions.ask`, or `permissions.deny` rules. Session approvals are the only remembered answers, and they end with the session.
|
|
99
|
-
- Approved plans are kept in the session (the `exit_plan_mode` call)
|
|
103
|
+
- Approved plans are kept in the session (the `exit_plan_mode` call). Only hosts that render plan approvals also write them to `.diffra/plans/` in the project.
|
package/docs/cli.md
CHANGED
|
@@ -151,6 +151,17 @@ The MCP resource tools (`list_mcp_resources`, `list_mcp_resource_templates`, `re
|
|
|
151
151
|
| `find` | Find paths using glob patterns |
|
|
152
152
|
| `ls` | List directory contents |
|
|
153
153
|
|
|
154
|
+
<a id="background-commands"></a>
|
|
155
|
+
|
|
156
|
+
`bash` and `powershell` run a command in the background when the model sets `run_in_background`, for dev servers, watchers, and long builds. The call returns a task ID at once, and the command keeps running after the turn. The first background command of a session adds two tools:
|
|
157
|
+
|
|
158
|
+
| Tool | Purpose |
|
|
159
|
+
|---|---|
|
|
160
|
+
| `bash_output` | Read the output a background command wrote since the last read, and its status: running, exited with its exit code, stopped, or failed |
|
|
161
|
+
| `task_stop` | Stop a background command with its child processes, or cancel a [background agent](subagents.md#background-agents) |
|
|
162
|
+
|
|
163
|
+
A command that exits by itself sends the agent a `<task-notification>` and starts a turn when the agent is idle; a stopped command sends none. Each command keeps up to 512 Ki characters of its latest output in memory (at least the last 256 Ki once it wrote more) and its full output in a file in the system temp directory. Quitting, or starting, resuming, or forking a session, kills running commands. `--tools` that names `bash` or `powershell` also allows `bash_output` and `task_stop`, and `/tasks` lists the commands.
|
|
164
|
+
|
|
154
165
|
Built-in extensions add more tools. They are off by default; the MCP extension turns `codemode` and `tool_search` on when an MCP server needs them (see [MCP](mcp.md#control-tool-exposure)). To enable them yourself, name them in `--tools` or `defaultTools`.
|
|
155
166
|
|
|
156
167
|
| Built-in extension | Purpose |
|
|
@@ -159,7 +170,7 @@ Built-in extensions add more tools. They are off by default; the MCP extension t
|
|
|
159
170
|
| `tool_search` | Search tools that are not declared to the model (`codemode` and `deferred` exposure, such as MCP tools) and declare the matches for the next call |
|
|
160
171
|
| `todo_write` | Keep a user-visible task list for multi-step work (see [Todo list](#todo-list)) |
|
|
161
172
|
|
|
162
|
-
More built-in extension tools are on without configuration: `web_fetch` reads a URL and is active by default, and `web_search` is active while a search backend is available (see [Fetch and Search the Web](web-tools.md)); `agent` delegates to [subagents](subagents.md) and `task_stop` cancels background ones; `enter_worktree` and `exit_worktree` work in a [git worktree](worktrees.md); `cron_create`, `cron_list`, `cron_delete`, and `loop_wakeup` [schedule prompts](scheduled-tasks.md); `exit_plan_mode` is declared in [plan mode](approval-modes.md#plan-mode).
|
|
173
|
+
More built-in extension tools are on without configuration: `web_fetch` reads a URL and is active by default, and `web_search` is active while a search backend is available (see [Fetch and Search the Web](web-tools.md)); `agent` delegates to [subagents](subagents.md) and `task_stop` cancels background ones; `enter_worktree` and `exit_worktree` work in a [git worktree](worktrees.md); `cron_create`, `cron_list`, `cron_delete`, and `loop_wakeup` [schedule prompts](scheduled-tasks.md); `exit_plan_mode` is declared in [plan mode](approval-modes.md#plan-mode); `ask_user_question` asks you one to four questions with options when a decision is yours, and is allowed in every approval mode.
|
|
163
174
|
|
|
164
175
|
### Enable codemode
|
|
165
176
|
|
package/docs/codemode.md
CHANGED
|
@@ -40,7 +40,7 @@ Every tool the session can call is a method of `tools`, named by its identifier:
|
|
|
40
40
|
|
|
41
41
|
What a call resolves to depends on the tool:
|
|
42
42
|
|
|
43
|
-
- Tools with an output schema resolve to a structured value. `bash` resolves to `{ output, truncated, full_output_path?, exit_code, wall_time_seconds }`, also for non-zero exit codes. Its `output` is not limited to the 2000 lines or 50KB the model sees: it holds up to 1 MiB, and longer output keeps its first and last 512 KiB around an omission marker, with `truncated` set and the full output in `full_output_path`.
|
|
43
|
+
- Tools with an output schema resolve to a structured value. `bash` resolves to `{ output, truncated, full_output_path?, exit_code, wall_time_seconds }`, also for non-zero exit codes. Its `output` is not limited to the 2000 lines or 50KB the model sees: it holds up to 1 MiB, and longer output keeps its first and last 512 KiB around an omission marker, with `truncated` set and the full output in `full_output_path`. With `run_in_background`, `bash` resolves to `{ task_id, output_file? }` at once instead.
|
|
44
44
|
- MCP tools resolve to their `CallToolResult`, including `isError` and `structuredContent`.
|
|
45
45
|
- `read` resolves to the file's text, or for an image to an image block `{ type: "image", data, mimeType, note }` that `image()` shows. `data` is the base64 image the model would see and `note` the text that goes with it, such as resize hints.
|
|
46
46
|
- Other tools, such as `edit` and `write`, resolve to their text output.
|
package/docs/extensions.md
CHANGED
|
@@ -696,7 +696,7 @@ If the run is aborted while `agent_before_settle` handlers are running, valid re
|
|
|
696
696
|
|
|
697
697
|
#### ui_prompt_start / ui_prompt_end
|
|
698
698
|
|
|
699
|
-
Notification-only lifecycle events for blocking user-facing extension UI prompts. They fire around `ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`, `ctx.ui.editor()`, and `ctx.ui.
|
|
699
|
+
Notification-only lifecycle events for blocking user-facing extension UI prompts. They fire around `ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`, `ctx.ui.editor()`, `ctx.ui.custom()`, and the structured decisions `ctx.ui.approve()`, `ctx.ui.askQuestions()` and `ctx.ui.approvePlan()` so host/status integrations can report "waiting for user" instead of just "running".
|
|
700
700
|
|
|
701
701
|
Nested or overlapping prompts are coalesced into one outer waiting span. Handlers are invoked best-effort and are not awaited before showing or closing the prompt.
|
|
702
702
|
|
|
@@ -2151,6 +2151,22 @@ diffra.registerToolRenderer((toolName, next) => {
|
|
|
2151
2151
|
});
|
|
2152
2152
|
```
|
|
2153
2153
|
|
|
2154
|
+
### diffra.registerTaskStopper(stop) / diffra.getBackgroundCommands()
|
|
2155
|
+
|
|
2156
|
+
`registerTaskStopper()` lets the built-in `task_stop` tool stop the extension's own background tasks. `task_stop` is registered while a stopper is, and asks the stoppers about every task ID that is not one of the session's [background shell commands](cli.md#background-commands). A stopper returns the model-facing result for an ID it owns, `undefined` for other IDs, and throws when that task already finished. The built-in subagents extension uses it for background agents:
|
|
2157
|
+
|
|
2158
|
+
```typescript
|
|
2159
|
+
diffra.registerTaskStopper((taskId) => {
|
|
2160
|
+
const job = jobs.get(taskId);
|
|
2161
|
+
if (!job) return undefined;
|
|
2162
|
+
if (job.done) throw new Error(`Background task "${taskId}" is not running.`);
|
|
2163
|
+
job.cancel();
|
|
2164
|
+
return `Cancelled job "${taskId}".`;
|
|
2165
|
+
});
|
|
2166
|
+
```
|
|
2167
|
+
|
|
2168
|
+
`getBackgroundCommands()` returns the session's background shell commands, as [`session.getBackgroundCommands()`](sdk.md#background-commands) does.
|
|
2169
|
+
|
|
2154
2170
|
### diffra.getSettings()
|
|
2155
2171
|
|
|
2156
2172
|
Return a copy of the effective settings, with global and project settings merged and overrides applied.
|
|
@@ -2861,6 +2877,25 @@ const text = await ctx.ui.editor("Edit:", "prefilled text");
|
|
|
2861
2877
|
ctx.ui.notify("Done!", "info"); // "info" | "warning" | "error"
|
|
2862
2878
|
```
|
|
2863
2879
|
|
|
2880
|
+
#### Structured decisions
|
|
2881
|
+
|
|
2882
|
+
Approvals, the agent's questions and plan approvals reach hosts that can render them as structured requests. A host implements the optional `ctx.ui` methods it supports; where one is missing, the built-in extensions fall back to `select`, `confirm` and `input`, so the TUI and RPC mode work unchanged.
|
|
2883
|
+
|
|
2884
|
+
```typescript
|
|
2885
|
+
interface ExtensionUIContext {
|
|
2886
|
+
// ...
|
|
2887
|
+
approve?(request: ApprovalRequest, opts?): Promise<ApprovalAnswer | undefined>;
|
|
2888
|
+
askQuestions?(request: QuestionsRequest, opts?): Promise<QuestionAnswer[] | undefined>;
|
|
2889
|
+
approvePlan?(request: PlanApprovalRequest, opts?): Promise<PlanApprovalAnswer | undefined>;
|
|
2890
|
+
}
|
|
2891
|
+
```
|
|
2892
|
+
|
|
2893
|
+
- `approve` gets a tool call (`kind: "tool-call"`) with its `subject` (a shell command, an edit with its unified diff, or another tool), its `cause` (the approval mode, plan mode, auto mode blocking or unable to review, or a PreToolUse hook), the `remember` choice "always" would apply, and `explain({ language })`, which explains the call with the fast model. It also gets sandbox escalations (`kind: "sandbox"`). The answer is `once`, `always`, or `deny` with optional feedback for the model; undefined denies.
|
|
2894
|
+
- `askQuestions` gets the questions of the built-in `ask_user_question` tool; each answer is chosen option labels, the user's own text, or no preference. Undefined means the user dismissed them.
|
|
2895
|
+
- `approvePlan` gets the plan of `exit_plan_mode`, its file in `.diffra/plans/` (edits the user makes to it before approving reach the model), the mode before plan mode and whether `/goal` is available. The answer approves it (mode, run as a goal, model, thinking level) or keeps planning with optional feedback.
|
|
2896
|
+
|
|
2897
|
+
Extensions can use these methods for their own decisions; check that the host implements one before calling it. They emit `ui_prompt_start` and `ui_prompt_end` like the dialogs, with the kinds `approval`, `questions` and `plan-approval`.
|
|
2898
|
+
|
|
2864
2899
|
#### Timed Dialogs with Countdown
|
|
2865
2900
|
|
|
2866
2901
|
Dialogs support a `timeout` option that auto-dismisses with a live countdown display:
|
package/docs/json.md
CHANGED
|
@@ -120,6 +120,7 @@ Use `toolCallId` to correlate the lifecycle. `partialResult` is the latest parti
|
|
|
120
120
|
|---|---|---|
|
|
121
121
|
| `queue_update` | `steering`, `followUp` | The pending steering or follow-up queue changed. Both fields contain the complete current queue. |
|
|
122
122
|
| `entry_appended` | `entry` | An extension appended a custom session entry through `diffra.appendEntry()`. |
|
|
123
|
+
| `turn_files` | `turn` | The record of the files a turn's `edit` and `write` calls changed was written, or the turn was undone. `turn` is its current state; see [Undoing a turn's file changes](sdk.md#turn-file-changes). |
|
|
123
124
|
| `session_info_changed` | `name` | The session display name changed. An absent `name` means it was cleared. |
|
|
124
125
|
| `thinking_level_changed` | `level` | The active thinking level changed. |
|
|
125
126
|
|
|
@@ -179,6 +180,24 @@ Compaction and branch-summary retry emit:
|
|
|
179
180
|
|
|
180
181
|
For a branch summary, `source` is `"branchSummary"` and `reason` is absent. The `reason` on a compaction retry is `"manual"`, `"threshold"`, or `"overflow"`.
|
|
181
182
|
|
|
183
|
+
## Background command events
|
|
184
|
+
|
|
185
|
+
Commands that `bash` or `powershell` started with `run_in_background` (see [Background commands](cli.md#background-commands)) report their lifecycle and output:
|
|
186
|
+
|
|
187
|
+
| Event | Fields | Meaning |
|
|
188
|
+
|---|---|---|
|
|
189
|
+
| `background_command_start` | `command` | A background command started. |
|
|
190
|
+
| `background_command_output` | `id`, `chunk` | The command wrote output. Output is coalesced to at most one event per command every 100 ms. |
|
|
191
|
+
| `background_command_end` | `command` | The command exited, was stopped, or failed. |
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{"type":"background_command_start","command":{"id":"bash-1a2b3c4d","toolCallId":"call_abc123","command":"npm run dev","cwd":"/path","shell":"bash","status":"running","exitCode":null,"startedAt":1733234401000,"outputFile":"/tmp/diffra-bash-background-0123456789abcdef.log"}}
|
|
195
|
+
{"type":"background_command_output","id":"bash-1a2b3c4d","chunk":"Listening on http://localhost:3000\n"}
|
|
196
|
+
{"type":"background_command_end","command":{"id":"bash-1a2b3c4d","...":"...","status":"exited","exitCode":0,"endedAt":1733234461000}}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`status` is `"running"`, `"exited"`, `"stopped"`, or `"failed"`; `exitCode` is a number once the command exited and `null` otherwise, and `error` says why a command failed. The [SDK](sdk.md#background-commands) describes every field.
|
|
200
|
+
|
|
182
201
|
## RPC-only events
|
|
183
202
|
|
|
184
203
|
A direct RPC [`bash`](rpc-commands.md#bash) command emits one `bash_execution_update` for each output chunk. Its optional `id` matches the command ID. The final command response can contain truncated output, but these events stream all output:
|
package/docs/sdk.md
CHANGED
|
@@ -93,6 +93,68 @@ Session events report message updates, tool execution, queues, compaction, retri
|
|
|
93
93
|
|
|
94
94
|
Use `agent_settled` when the host needs to know that Diffra will not continue automatically.
|
|
95
95
|
|
|
96
|
+
<a id="turn-file-changes"></a>
|
|
97
|
+
|
|
98
|
+
## Undoing a turn's file changes
|
|
99
|
+
|
|
100
|
+
A turn is one agent run: from the prompt that starts it until the session settles, including steering and follow-up messages delivered during the run. Its id is the session entry id of the message that started it.
|
|
101
|
+
|
|
102
|
+
While a turn runs, the session records every file the built-in `edit` and `write` tools change, with its content before the turn first wrote it and its content when the turn ended. Calls that a `tool_call` handler blocks or that fail before writing are not recorded. Shell commands are not tracked: a file that only a command changed is not recorded, although the end state of a recorded file includes what commands did to it during the turn. Tools that replace the built-in `edit` and `write` are not tracked either.
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
session.subscribe((event) => {
|
|
106
|
+
if (event.type === "turn_files") renderEditedFiles(event.turn);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const latest = session.getTurnFileChanges().at(-1);
|
|
110
|
+
if (latest) {
|
|
111
|
+
const result = await session.undoTurn(latest.turnId);
|
|
112
|
+
if (result.kind === "refused") console.log(result.reason, result.paths);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- `getTurnFileChanges()` returns the turns on the current branch that changed files, oldest first. Each file has an absolute `path`, a `kind` (`added`, `modified` or `deleted`), the lines added and removed, and whether it is `undoable`.
|
|
117
|
+
- `turn_files` is emitted when a turn's record is written, before `agent_settled`, and when a turn is undone. `turn` is the turn's current state.
|
|
118
|
+
- `undoTurn(turnId)` writes back the content each file had before the turn and deletes the files it added; folders it created stay. It returns `{ kind: "undone", paths }`, or `{ kind: "refused", reason, paths }` without changing any file:
|
|
119
|
+
|
|
120
|
+
| `reason` | Meaning |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `running` | A run is active. |
|
|
123
|
+
| `not-found` | The current branch has no record of the turn. |
|
|
124
|
+
| `already-undone` | The turn was undone on this branch. |
|
|
125
|
+
| `later-turn` | A later turn on the branch, not undone, changed some of the same files (`paths`). Undo it first. |
|
|
126
|
+
| `changed-on-disk` | Some files (`paths`) no longer match the end of the turn. |
|
|
127
|
+
| `not-undoable` | Some files (`paths`) were larger than 1 MiB, so they have no snapshot, or their snapshot was lost. |
|
|
128
|
+
|
|
129
|
+
Line counts are 0 for binary files and files over 1 MiB. A change of more than 1000 lines counts as replacing every line of the file.
|
|
130
|
+
|
|
131
|
+
Records are custom session entries (`diffra.turn-files`, and `diffra.turn-files-undo` for an undo), so they survive a restart and belong to their branch: tree navigation and forks see only the turns on their own branch. File contents are not stored in the session file: snapshots, named by the SHA-256 of their content, live in a `.snapshots` folder next to it (`<session>.jsonl` keeps them in `<session>.snapshots/`), or in memory for `SessionManager.inMemory()`. Undoing changes files only: the conversation, and so the model, does not learn that the files were restored.
|
|
132
|
+
|
|
133
|
+
<a id="background-commands"></a>
|
|
134
|
+
|
|
135
|
+
## Background commands
|
|
136
|
+
|
|
137
|
+
The `bash` and `powershell` tools start a command in the background when the model sets `run_in_background` (see [Background commands](cli.md#background-commands)). The command keeps running after its tool call and the run, until it exits, is stopped, or the session is disposed; `dispose()` kills it with its child processes. The session lists such commands, streams their output, and stops them:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
session.subscribe((event) => {
|
|
141
|
+
if (event.type === "background_command_start") openTab(event.command.id, session.readBackgroundOutput(event.command.id));
|
|
142
|
+
if (event.type === "background_command_output") appendToTab(event.id, event.chunk);
|
|
143
|
+
if (event.type === "background_command_end") markEnded(event.command.id, event.command.status, event.command.exitCode);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
for (const command of session.getBackgroundCommands()) {
|
|
147
|
+
if (command.status === "running") session.stopBackgroundCommand(command.id);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- `getBackgroundCommands()` returns the session's commands, oldest first, as `BackgroundCommand` snapshots: `id`, `toolCallId` (the `bash` or `powershell` call that started it), `command`, `cwd`, `shell` (`"bash"` or `"powershell"`), `status` (`"running"`, `"exited"`, `"stopped"`, or `"failed"`), `exitCode` (a number once it exited, otherwise `null`), `startedAt` and `endedAt` (epoch milliseconds), `error` (why it failed), and `outputFile`.
|
|
152
|
+
- `readBackgroundOutput(id)` returns the end of a command's output held in memory, or `undefined` for an unknown ID. The buffer holds up to 512 Ki characters; when it is full, it drops its older half, so at least the last 256 Ki remain. The text is decoded as UTF-8 with ANSI escapes and carriage returns kept. `outputFile` has the full raw output.
|
|
153
|
+
- `stopBackgroundCommand(id)` kills a running command with its child processes and returns `true`; `background_command_end` follows with status `"stopped"`. It returns `false` when no command with this ID is running.
|
|
154
|
+
- `background_command_start` and `background_command_end` carry a `command` snapshot. `background_command_output` carries the command's `id` and a text `chunk`; output is coalesced to at most one event per command every 100 ms.
|
|
155
|
+
|
|
156
|
+
A command that ends by itself (`"exited"` or `"failed"`) also sends the agent a `<task-notification>` custom message and starts a turn when the session is idle. A stopped command sends none. The session emits no events after `dispose()`.
|
|
157
|
+
|
|
96
158
|
## Configuring a session
|
|
97
159
|
|
|
98
160
|
Without overrides, the factory creates a `ModelRuntime`, file-backed `SettingsManager`, persistent `SessionManager`, `DefaultResourceLoader`, and the configured default tools.
|
|
@@ -115,7 +177,7 @@ Inline extension factories can be supplied through `DefaultResourceLoader`. Give
|
|
|
115
177
|
|
|
116
178
|
The CLI loads `codemode`, `tool_search`, and MCP as built-in extensions. SDK sessions do not; add `createCodemodeExtension()`, `createToolSearchExtension()`, and `createMcpExtension()` to the `extensionFactories` of `DefaultResourceLoader`. `codemode` and `tool_search` are registered inactive: enable them through the `defaultTools` setting (`["+codemode", "+tool_search"]` keeps the other default tools), or let the MCP extension activate them: `codemode` for servers with `codemode` exposure, `tool_search` for servers with `deferred` exposure. The MCP extension connects its servers on `session_start`, so call `session.bindExtensions()`. See [Codemode and MCP](../examples/sdk/14-codemode-mcp.ts).
|
|
117
179
|
|
|
118
|
-
`builtInExtensions` is the full list the CLI loads: approval modes, hooks, MCP, subagents, todo, memory, goals, loops and the others. Pass it as `extensionFactories` to give SDK sessions the CLI's behavior; `disabledBuiltinExtensions` leaves single ones out. A host that implements `ExtensionUIContext` calls `initTheme()` once and returns the exported `theme` from its `theme` getter, as RPC mode does.
|
|
180
|
+
`builtInExtensions` is the full list the CLI loads: approval modes, hooks, MCP, subagents, todo, memory, goals, loops and the others. Pass it as `extensionFactories` to give SDK sessions the CLI's behavior; `disabledBuiltinExtensions` leaves single ones out. A host that implements `ExtensionUIContext` calls `initTheme()` once and returns the exported `theme` from its `theme` getter, as RPC mode does. A host that renders approvals, questions and plan approvals itself implements the optional `approve`, `askQuestions` and `approvePlan` methods; see [Structured decisions](extensions.md#structured-decisions). `explainToolCall()` explains a tool call with a given model, for hosts that need it outside an approval.
|
|
119
181
|
|
|
120
182
|
See the focused examples for [models](../examples/sdk/02-custom-model.ts), [tools](../examples/sdk/05-tools.ts), [extensions](../examples/sdk/06-extensions.ts), and [full control](../examples/sdk/12-full-control.ts).
|
|
121
183
|
|
package/docs/session-format.md
CHANGED
|
@@ -173,6 +173,8 @@ Use `customType` to identify your extension's entries on reload. Interactive mod
|
|
|
173
173
|
|
|
174
174
|
Diffra stores [virtual model](virtual-models.md) router state as custom entries with `customType` `diffra.virtual-model-state` and `data` `{ provider, modelId, state }`.
|
|
175
175
|
|
|
176
|
+
Diffra records the files a turn's `edit` and `write` calls changed (see [Undoing a turn's file changes](sdk.md#turn-file-changes)) as custom entries with `customType` `diffra.turn-files` and `data` `{ turnId, snapshotDir?, files }`. Each file has `path`, `additions`, `deletions`, and `before` and `after` states: `{ "kind": "missing" }`, `{ "kind": "snapshot", "sha256" }` for content stored as the file `<snapshotDir>/<sha256>`, or `{ "kind": "too-large", "size" }`. `snapshotDir` is the absolute path of the `.snapshots` folder next to the session file that recorded the turn, and is absent for in-memory sessions. An undo appends `diffra.turn-files-undo` with `data` `{ turnId }`.
|
|
177
|
+
|
|
176
178
|
### CustomMessageEntry
|
|
177
179
|
|
|
178
180
|
Extension-injected messages that DO participate in LLM context.
|
package/docs/settings.md
CHANGED
|
@@ -57,7 +57,7 @@ See [Choose a Model](models.md) for model selection and thinking controls.
|
|
|
57
57
|
| `ui.hideBuiltinWorktreeIndicator` | boolean | `false` | Hide the active worktree in the footer. |
|
|
58
58
|
| `webSearch` | object | unset | Search backend of `web_search`: `enabled`, `model`, `webExtractor`, `timeoutMs`, `maxPerSession`, and `allowedHosts`. See [Fetch and Search the Web](web-tools.md#settings). |
|
|
59
59
|
|
|
60
|
-
Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. Built-in extensions add `web_fetch` and the scheduling tools `cron_create`, `cron_list`, `cron_delete`, and `loop_wakeup`,
|
|
60
|
+
Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. Built-in extensions add `web_fetch` and the scheduling tools `cron_create`, `cron_list`, `cron_delete`, and `loop_wakeup`, `enter_worktree` and `exit_worktree`, and `ask_user_question`, active by default, and `web_search`, active while a search backend is available (see [Fetch and Search the Web](web-tools.md)). `defaultTools` can also name `codemode`, `tool_search`, and `todo_write`, which built-in extensions register inactive, and other extension tools registered inactive.
|
|
61
61
|
|
|
62
62
|
A list of only `+name` and `-name` entries changes the inherited selection instead of replacing it. For example, this enables `codemode` next to the default tools:
|
|
63
63
|
|
package/docs/slash-commands.md
CHANGED
|
@@ -49,7 +49,7 @@ Review a session before exporting or sharing it. Sessions can contain prompts, t
|
|
|
49
49
|
| `/mcp` | Manage MCP servers: sign in, reconnect, enable or disable, and change exposure |
|
|
50
50
|
| `/approval-mode [mode] [--user\|--project]` | Show or change the [approval mode](approval-modes.md); `--user` or `--project` also saves it as the default |
|
|
51
51
|
| `/agents [create\|manage]` | Create, view, edit, or delete [subagents](subagents.md) |
|
|
52
|
-
| `/tasks` | List background agents and their status |
|
|
52
|
+
| `/tasks` | List background agents and [background shell commands](cli.md#background-commands) and their status |
|
|
53
53
|
| `/hooks` | List the configured [hooks](hooks.md) |
|
|
54
54
|
| `/memory` | Show [auto memory](memory.md) and turn it or dreaming on or off for the session |
|
|
55
55
|
| `/remember <text>` | Ask the agent to save something to auto memory |
|
package/docs/subagents.md
CHANGED
|
@@ -58,7 +58,7 @@ The system prompt must be at least 10 characters long. Files that fail to load a
|
|
|
58
58
|
| `subagent_type` | no | The agent to use; `general-purpose` when omitted |
|
|
59
59
|
| `run_in_background` | no | `false` waits for the answer; `true` returns at once |
|
|
60
60
|
|
|
61
|
-
A subagent never gets `todo_write`, `exit_plan_mode`, or `task_stop`. It gets `agent` only while it may nest: subagents can start subagents up to `agents.maxSubagentDepth` levels (default 5); `1` stops nesting. Nested agents always run in the foreground.
|
|
61
|
+
A subagent never gets `todo_write`, `exit_plan_mode`, `ask_user_question`, or `task_stop`. It gets `agent` only while it may nest: subagents can start subagents up to `agents.maxSubagentDepth` levels (default 5); `1` stops nesting. Nested agents always run in the foreground.
|
|
62
62
|
|
|
63
63
|
Without a limit in its definition, a subagent runs until it answers. Its answer becomes the tool result. When it stops early, the result says why and includes what it produced, for example `Subagent did not complete (terminate mode: MAX_TURNS). It ran out of turns, ...`. Its model usage counts toward the session's usage.
|
|
64
64
|
|
|
@@ -68,7 +68,7 @@ While a foreground subagent runs, its row shows its recent tool calls, tool uses
|
|
|
68
68
|
|
|
69
69
|
Agents run in the background unless the call sets `run_in_background: false`, the definition sets `background: false`, or the `agents.defaultBackground` setting is `false`. The call returns a `task_id` at once. A panel above the editor lists running background agents with their latest tool call. When an agent finishes, Diffra adds a `<task-notification>` message with its status, result, and usage; it starts a new turn when the main agent is idle and waits for the current run otherwise.
|
|
70
70
|
|
|
71
|
-
At most `agents.maxParallelAgents` (default 10) background agents run at once; others wait in order. The model cancels one with `task_stop` (`task_id`), and `/tasks` lists
|
|
71
|
+
At most `agents.maxParallelAgents` (default 10) background agents run at once; others wait in order. The model cancels one with `task_stop` (`task_id`), which also stops [background shell commands](cli.md#background-commands), and `/tasks` lists both. Starting, resuming, or forking a session, and quitting, cancels running background agents.
|
|
72
72
|
|
|
73
73
|
## Approval
|
|
74
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diffra-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"diffraConfig": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"prepublishOnly": "npm run clean && npm run build"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@diffra-ai/agent-core": "0.
|
|
45
|
-
"@diffra-ai/ai": "0.
|
|
46
|
-
"@diffra-ai/codemode": "0.
|
|
47
|
-
"@diffra-ai/mcp": "0.
|
|
48
|
-
"@diffra-ai/tui": "0.
|
|
44
|
+
"@diffra-ai/agent-core": "0.2.0",
|
|
45
|
+
"@diffra-ai/ai": "0.2.0",
|
|
46
|
+
"@diffra-ai/codemode": "0.2.0",
|
|
47
|
+
"@diffra-ai/mcp": "0.2.0",
|
|
48
|
+
"@diffra-ai/tui": "0.2.0",
|
|
49
49
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
50
50
|
"brace-expansion": "5.0.12",
|
|
51
51
|
"chalk": "6.0.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{AgentSession,AgentSessionRuntime,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelSelectorComponent,OAuthSelectorComponent,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,SkillInvocationMessageComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,buildContextEntries,buildSessionContext,buildSessionProjection,builtInExtensions,calculateContextTokens,collectEntriesForBranchSummary,compact,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,getLatestCompactionEntry,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-PCXT7GLW.js";import{formatReadLineRange,truncateToVisualLines}from"./chunk-SI7T4LPD.js";import{ArminComponent}from"./chunk-6ZD23B2R.js";import{Container,SelectList,Theme,getAvailableThemes,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint,theme}from"./chunk-4NMBWIZG.js";import{CredentialSynchronizationError,ModelRuntime,ProjectTrustStore,VIRTUAL_MODEL_STATE_ENTRY,hasTrustRequiringProjectResources}from"./chunk-AI3Y7XHP.js";import{readStoredCredential}from"./chunk-65DC2T66.js";import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatSize,getPowerShellConfig,getShellConfig,truncateHead,truncateLine,truncateTail}from"./chunk-GRYHVZSI.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-XAA355T2.js";import{__export}from"./chunk-JXWJOIH4.js";var dist_exports={};__export(dist_exports,{AgentSession:()=>AgentSession,AgentSessionRuntime:()=>AgentSessionRuntime,ArminComponent:()=>ArminComponent,AssistantMessageComponent:()=>AssistantMessageComponent,BashExecutionComponent:()=>BashExecutionComponent,BorderedLoader:()=>BorderedLoader,BranchSummaryMessageComponent:()=>BranchSummaryMessageComponent,CONFIG_DIR_NAME:()=>CONFIG_DIR_NAME,CURRENT_SESSION_VERSION:()=>CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent:()=>CompactionSummaryMessageComponent,CredentialSynchronizationError:()=>CredentialSynchronizationError,CustomEditor:()=>CustomEditor,CustomMessageComponent:()=>CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS:()=>DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES:()=>DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES:()=>DEFAULT_MAX_LINES,DefaultPackageManager:()=>DefaultPackageManager,DefaultResourceLoader:()=>DefaultResourceLoader,DynamicBorder:()=>DynamicBorder,ExtensionEditorComponent:()=>ExtensionEditorComponent,ExtensionInputComponent:()=>ExtensionInputComponent,ExtensionRunner:()=>ExtensionRunner,ExtensionSelectorComponent:()=>ExtensionSelectorComponent,FooterComponent:()=>FooterComponent,InteractiveMode:()=>InteractiveMode,LoginDialogComponent:()=>LoginDialogComponent,ModelRegistry:()=>ModelRegistry,ModelRuntime:()=>ModelRuntime,ModelSelectorComponent:()=>ModelSelectorComponent,OAuthSelectorComponent:()=>OAuthSelectorComponent,ProjectTrustStore:()=>ProjectTrustStore,RpcClient:()=>RpcClient,SessionManager:()=>SessionManager,SessionSelectorComponent:()=>SessionSelectorComponent,SettingsManager:()=>SettingsManager,SettingsSelectorComponent:()=>SettingsSelectorComponent,ShowImagesSelectorComponent:()=>ShowImagesSelectorComponent,SkillInvocationMessageComponent:()=>SkillInvocationMessageComponent,Theme:()=>Theme,ThemeSelectorComponent:()=>ThemeSelectorComponent,ThinkingSelectorComponent:()=>ThinkingSelectorComponent,ToolExecutionComponent:()=>ToolExecutionComponent,TreeSelectorComponent:()=>TreeSelectorComponent,UserMessageComponent:()=>UserMessageComponent,UserMessageSelectorComponent:()=>UserMessageSelectorComponent,VERSION:()=>VERSION,VIRTUAL_MODEL_STATE_ENTRY:()=>VIRTUAL_MODEL_STATE_ENTRY,buildContextEntries:()=>buildContextEntries,buildSessionContext:()=>buildSessionContext,buildSessionProjection:()=>buildSessionProjection,builtInExtensions:()=>builtInExtensions,calculateContextTokens:()=>calculateContextTokens,collectEntriesForBranchSummary:()=>collectEntriesForBranchSummary,compact:()=>compact,convertToLlm:()=>convertToLlm,convertToPng:()=>convertToPng,copyToClipboard:()=>copyToClipboard,createAgentSession:()=>createAgentSession,createAgentSessionFromServices:()=>createAgentSessionFromServices,createAgentSessionRuntime:()=>createAgentSessionRuntime,createAgentSessionServices:()=>createAgentSessionServices,createBashTool:()=>createBashTool,createBashToolDefinition:()=>createBashToolDefinition,createCodemodeExtension:()=>createCodemodeExtension,createCodingTools:()=>createCodingTools,createEditTool:()=>createEditTool,createEditToolDefinition:()=>createEditToolDefinition,createEventBus:()=>createEventBus,createExtensionRuntime:()=>createExtensionRuntime,createFindTool:()=>createFindTool,createFindToolDefinition:()=>createFindToolDefinition,createGrepTool:()=>createGrepTool,createGrepToolDefinition:()=>createGrepToolDefinition,createLocalBashOperations:()=>createLocalBashOperations,createLocalPowerShellOperations:()=>createLocalPowerShellOperations,createLsTool:()=>createLsTool,createLsToolDefinition:()=>createLsToolDefinition,createMcpExtension:()=>createMcpExtension,createPowerShellTool:()=>createPowerShellTool,createPowerShellToolDefinition:()=>createPowerShellToolDefinition,createReadOnlyTools:()=>createReadOnlyTools,createReadTool:()=>createReadTool,createReadToolDefinition:()=>createReadToolDefinition,createSyntheticSourceInfo:()=>createSyntheticSourceInfo,createToolSearchExtension:()=>createToolSearchExtension,createWriteTool:()=>createWriteTool,createWriteToolDefinition:()=>createWriteToolDefinition,defineTool:()=>defineTool,detectSupportedImageMimeTypeFromFile:()=>detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions:()=>discoverAndLoadExtensions,estimateTokens:()=>estimateTokens,findCutPoint:()=>findCutPoint,findTurnStartIndex:()=>findTurnStartIndex,formatDimensionNote:()=>formatDimensionNote,formatReadLineRange:()=>formatReadLineRange,formatSize:()=>formatSize,formatSkillsForPrompt:()=>formatSkillsForPrompt,generateBranchSummary:()=>generateBranchSummary,generateDiffString:()=>generateDiffString,generateSummary:()=>generateSummary,generateSummaryWithUsage:()=>generateSummaryWithUsage,generateUnifiedPatch:()=>generateUnifiedPatch,getAgentDir:()=>getAgentDir,getDocsPath:()=>getDocsPath,getExamplesPath:()=>getExamplesPath,getLanguageFromPath:()=>getLanguageFromPath,getLastAssistantUsage:()=>getLastAssistantUsage,getLatestCompactionEntry:()=>getLatestCompactionEntry,getMarkdownTheme:()=>getMarkdownTheme,getPackageDir:()=>getPackageDir,getPowerShellConfig:()=>getPowerShellConfig,getReadmePath:()=>getReadmePath,getSelectListTheme:()=>getSelectListTheme,getSettingsListTheme:()=>getSettingsListTheme,getShellConfig:()=>getShellConfig,hasTrustRequiringProjectResources:()=>hasTrustRequiringProjectResources,highlightCode:()=>highlightCode,initTheme:()=>initTheme,isBashToolResult:()=>isBashToolResult,isEditToolResult:()=>isEditToolResult,isFindToolResult:()=>isFindToolResult,isGrepToolResult:()=>isGrepToolResult,isLsToolResult:()=>isLsToolResult,isPowerShellToolResult:()=>isPowerShellToolResult,isReadToolResult:()=>isReadToolResult,isToolCallEventType:()=>isToolCallEventType,isWriteToolResult:()=>isWriteToolResult,keyHint:()=>keyHint,keyText:()=>keyText,loadProjectContextFiles:()=>loadProjectContextFiles,loadSkills:()=>loadSkills,loadSkillsFromDir:()=>loadSkillsFromDir,main:()=>main,migrateSessionEntries:()=>migrateSessionEntries,parseArgs:()=>parseArgs,parseFrontmatter:()=>parseFrontmatter,parseSessionEntries:()=>parseSessionEntries,parseSkillBlock:()=>parseSkillBlock,prepareBranchEntries:()=>prepareBranchEntries,rawKeyHint:()=>rawKeyHint,readStoredCredential:()=>readStoredCredential,renderDiff:()=>renderDiff,resizeImage:()=>resizeImage,resolveCliModel:()=>resolveCliModel,resolveModelScopeWithDiagnostics:()=>resolveModelScopeWithDiagnostics,runPrintMode:()=>runPrintMode,runRpcMode:()=>runRpcMode,serializeConversation:()=>serializeConversation,sessionEntryToContextMessages:()=>sessionEntryToContextMessages,shouldCompact:()=>shouldCompact,stripFrontmatter:()=>stripFrontmatter,theme:()=>theme,truncateHead:()=>truncateHead,truncateLine:()=>truncateLine,truncateTail:()=>truncateTail,truncateToVisualLines:()=>truncateToVisualLines,withFileMutationQueue:()=>withFileMutationQueue,wrapRegisteredTool:()=>wrapRegisteredTool,wrapRegisteredTools:()=>wrapRegisteredTools});var SHOW_IMAGES_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},ShowImagesSelectorComponent=class extends Container{selectList;constructor(currentValue,onSelect,onCancel){super();let items=[{value:"yes",label:"Yes",description:"Show images inline in terminal"},{value:"no",label:"No",description:"Show text placeholder instead"}];this.addChild(new DynamicBorder),this.selectList=new SelectList(items,5,getSelectListTheme(),SHOW_IMAGES_SELECT_LIST_LAYOUT),this.selectList.setSelectedIndex(currentValue?0:1),this.selectList.onSelect=item=>{onSelect(item.value==="yes")},this.selectList.onCancel=()=>{onCancel()},this.addChild(this.selectList),this.addChild(new DynamicBorder)}getSelectList(){return this.selectList}};var THEME_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},ThemeSelectorComponent=class extends Container{selectList;onPreview;constructor(currentTheme,onSelect,onCancel,onPreview){super(),this.onPreview=onPreview;let themes=getAvailableThemes(),themeItems=themes.map(name=>({value:name,label:name,description:name===currentTheme?"(current)":void 0}));this.addChild(new DynamicBorder),this.selectList=new SelectList(themeItems,10,getSelectListTheme(),THEME_SELECT_LIST_LAYOUT);let currentIndex=themes.indexOf(currentTheme);currentIndex!==-1&&this.selectList.setSelectedIndex(currentIndex),this.selectList.onSelect=item=>{onSelect(item.value)},this.selectList.onCancel=()=>{onCancel()},this.selectList.onSelectionChange=item=>{this.onPreview(item.value)},this.addChild(this.selectList),this.addChild(new DynamicBorder)}getSelectList(){return this.selectList}};export{ShowImagesSelectorComponent,ThemeSelectorComponent,dist_exports};
|