@xeno-corporation/xeno-agent-sdk 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2845,6 +2845,32 @@ interface XenoThreadRunResult {
2845
2845
  }
2846
2846
  declare function runXenoThread(options: XenoThreadRunOptions): Promise<XenoThreadRunResult>;
2847
2847
  declare function runXenoThreadStreamed(options: XenoThreadRunOptions): AsyncGenerator<XenoRuntimeEvent, XenoThreadRunResult, void>;
2848
+ interface JsonRpcRequest$1 {
2849
+ jsonrpc: "2.0";
2850
+ id?: string | number | null;
2851
+ method: string;
2852
+ params?: unknown;
2853
+ }
2854
+ interface JsonRpcSuccess {
2855
+ jsonrpc: "2.0";
2856
+ id: string | number | null;
2857
+ result: unknown;
2858
+ }
2859
+ interface JsonRpcFailure {
2860
+ jsonrpc: "2.0";
2861
+ id: string | number | null;
2862
+ error: {
2863
+ code: number;
2864
+ message: string;
2865
+ data?: unknown;
2866
+ };
2867
+ }
2868
+ interface JsonRpcNotification$1 {
2869
+ jsonrpc: "2.0";
2870
+ method: string;
2871
+ params?: unknown;
2872
+ }
2873
+ type JsonRpcMessage = JsonRpcSuccess | JsonRpcFailure | JsonRpcNotification$1;
2848
2874
  interface XenoAppServerOptions {
2849
2875
  defaultAgentOptions?: Omit<XenoThreadRunOptions, "prompt">;
2850
2876
  }
@@ -2854,6 +2880,7 @@ declare class XenoAppServer {
2854
2880
  constructor(options?: XenoAppServerOptions);
2855
2881
  start(input?: Readable, output?: Writable): Promise<void>;
2856
2882
  stop(): void;
2883
+ handleJsonRpcRequest(request: JsonRpcRequest$1): Promise<JsonRpcMessage[]>;
2857
2884
  private handleRequest;
2858
2885
  private success;
2859
2886
  private error;
@@ -3886,7 +3913,6 @@ interface JsonRpcNotification {
3886
3913
  params?: Record<string, unknown>;
3887
3914
  }
3888
3915
  type JsonRpcResponse = JsonRpcSuccessResponse | JsonRpcErrorResponse;
3889
- type JsonRpcMessage = JsonRpcRequest | JsonRpcResponse | JsonRpcNotification;
3890
3916
  interface MCPInitializeParams {
3891
3917
  protocolVersion: string;
3892
3918
  capabilities: {
@@ -5356,4 +5382,4 @@ declare class AgentEvaluator {
5356
5382
  clearResults(): void;
5357
5383
  get resultCount(): number;
5358
5384
  }
5359
- export { type A2AMessage, type A2AMessageType, ARCHITECT_CAPABILITIES, ARCHITECT_TOOL_NAMES, type ActiveLayerInfo, type AgentArtifact, type AgentCapabilities, type AgentCard, AgentDebugger, type AgentDefinition, type AgentDefinitionIssue, AgentDefinitionLoader, type AgentDefinitionLoaderOptions, type AgentDefinitionMetadata, AgentDefinitionResolver, type AgentDefinitionScanResult, type AgentDefinitionScope, type AgentDefinitionShadowRef, type AgentEffortLevel, AgentEvaluator, AgentInterruptedError, type AgentIpcChannel, type AgentLoadSnapshot, AgentLoop, type AgentLoopConfig, type AgentLoopOptions, AgentProtocol, AgentRegistry, type AgentRunAgentDefinitionRef, type AgentRunCreateInput, type AgentRunEvent, type AgentRunListOptions, type AgentRunRecord, type AgentRunStatus, AgentRunStore, type AgentRunTermination, type AgentRunTerminationReason, type AgentRunTerminationStatus, type AgentRunUsage, type AgentSandbox, type AgentSelectionStrategy, type AgentStreamCallbacks, type AgentTask, type AgentTaskHandler, type AgentTaskResult, type AgentTaskStatus, type AgentTeam, type AgentToAppChannel, type AgentToAppMessages, type AgentToolPolicy, type AnalysisResult, type ApiMessage, type AppAgentBaseOptions, AppAgentFactory, type AppAgentResult, type AppContext, AppContextInjector, AppContextManager, type AppContextProvider, type AppId, type AppToAgentChannel, type AppToAgentMessages, type AppType, type ArchitectAgentOptions, type ArchitectToolAdapter, type AskUserHandler, type AskUserRequest, type AskUserResponse, type AudioProjectInfo, type AudioStemSeparationResult, type AudioToolAdapter, type AudioTrackType, type AudioTranscriptionResult, type AudioTranscriptionSegment, type AuditDecision, type AuditEvent, AuditLogger, type AuditReplayReport, type AuditReplayStep, type AuditRiskLevel, type AuditStatus, type AuditTraceGapEntry, type AuditTraceReport, type AuditTraceSummary, type AuditTraceTimelineEntry, type AuditTraceToolSummary, type AugmentContextOptions, AutoCheckpointHandler, AutoMemory, type AutoMemoryContext, type AutoMemoryTrigger, BackgroundProcessManager, type BackgroundTask, type BaseHookDefinition, type BlockContent, type BlockType, type BoundedShellOutput, type BreakpointCallback, type BuildResult, COMPAT_TOOL_ALIASES, CONFIG_VERSION, type CanvasSize, type CellRangeData, type ChartConfig, type ChatCompletionChunk, type ChatCompletionRequest, type ChatCompletionResponse, type ChatMessage, type ChatParams, type ChatResponse, type CheckpointData, type CheckpointInfo, CheckpointManager, type CheckpointTrigger, type ClashResult, type ClipContext, type CodeApplyOptions, type CodeApplyResult, type CodeValidationIssue, type CodeValidationResult, CodeValidator, type CodingBenchmarkAssessment, type CodingBenchmarkMeasurement, type CodingBenchmarkOptions, type CodingBenchmarkReport, type CodingBenchmarkThreshold, type CommandHookDefinition, type CompletionGuard, type CompletionGuardContext, type CompletionGuardDecision, type CompletionGuardEvaluationContext, CompletionGuardRegistry, type CompletionGuardResult, type CompletionGuardResultObject, type CompletionGuardStopReason, type CompletionGuardToolPolicy, type CompletionGuardToolPolicyMode, type CompletionGuardTurnStats, type CompletionGuardVeto, type ComponentData, type CompressionLLMFn, type CompressionStats, type ConfigProfile, type ConnectConfiguredMCPServersOptions, type ConnectConfiguredMCPServersResult, type ContentBlock, type ContextCompressedData, ContextManager, type ContextManagerConfig, type ContextSection, type ContextSource, type ControlPlaneLockHandle, type ControlPlaneLockRecord, ConversationStore, type CreateAuditBackedPermissionEngineOptions, type CreateDelegatedBranchAgent, type CreateDelegatedBranchAgentOptions, type CreateDelegatedXenoAgentOptions, type CreateXenoAgentOptions, type CreateXenoAgentResult, type CrossAppHandler, type CrossAppMessage, CrossAppRouter, CrossAppRouterError, type CrossAppRouterOptions, DEFAULT_API_KEY, DEFAULT_MEMORY_BUDGETS, DEFAULT_MODEL, DEFAULT_PROMPT_SECTIONS_TOKEN_BUDGET, DEFAULT_SUBAGENT_BRANCH_POLICY, DEFAULT_SUBAGENT_REMOTE_MCP_BY_ROLE, DEFAULT_SUBAGENT_ROLES, DEFAULT_SUBAGENT_ROLE_PRECEDENCE, DEFAULT_SUBAGENT_TEAM_PRESET, DOCS_CAPABILITIES, DOCS_TOOL_NAMES, type DebugBreakpoint, type DebugSnapshot, type DebugStep, type DebugStepCallback, type DefaultToolRegistryOptions, type DelegatedBranchAgent, type DelegatedBranchAgentCallbacks, type DelegatedXenoTurnResult, type DelegationBudget, type DelegationLimits, type DelegationSummaryData, type DependencyEdge, type DescendantInstructionHint, type DispatchAgentHandler, type DispatchAgentRequest, type DispatchAgentResponse, type DocComment, type DocsAgentOptions, type DocsToolAdapter, type DocumentContext, type DualLLMMode, DualLLMProvider, type DualLLMProviderConfig, type DualLLMProviderLike, type DualLLMStatus, ENGINE_CAPABILITIES, ENGINE_TOOL_NAMES, ElectronAgentBridge, type ElectronAgentConfig, type EngineAgentOptions, type EngineToolAdapter, type EntityInfo, type Episode, type EpisodeOutcome, EpisodicStore, type EpisodicStoreOptions, type ErrorData, type EvalReport, type EvalResult, type EvalRunOptions, type EvalTask, type ExecuteToolRequest, type ExecuteToolResult, type ExecutionMode, type ExportableSoulSigner, type ExtendedAppType, FALLBACK_MODELS, type FileEntry, type FileSnapshot, type FilterConfig, HIGH_RISK_PERMISSIONS, type HookDecision, type HookDefinition, type HookEventName, type HookExecutionResult, type HookExecutionStatus, type HookInputBase, type HookInvocationInput, type HookPermissionMode, type HookRunResult, HookRunner, type HookRuntimeOptions, type HttpHookDefinition, IDENTITY_PATHS, type IdentityFrontmatter, type IdentityLayer, type IdentityLoadResult, IdentityLoader, type IdentityLoaderOptions, type IdentityPaths, IdentityResolver, type IdentitySource, type ImageContentBlock, type ImageDocumentInfo, type ImageLayerInfo, type ImageLayerType, type ImageToolAdapter, type ImageUrlBlock, type InitializeSessionRuntimeOptions, type InspectSystemPromptOptions, type InstallSignalHandlersOptions, type IpcHandler, type JsonRpcErrorResponse, type JsonRpcMessage, type JsonRpcNotification, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccessResponse, type JsonSchemaSubset, type JsonSchemaType, type JsonSchemaValidationError, type JsonSchemaValidationResult, type LLMCompletionResult, type LLMProvider, type LLMProviderCapabilities, type LLMProviderMessage, type ToolDefinition as LLMProviderToolDefinition, type LLMToolDefinition, type LayerContext, LlmClient, type LlmClientDeps, LocalLLMProvider, type LocalLLMProviderConfig, type LocalRuntimePreflightResult, LogLevel, MANIFEST_FILENAME, type MCPApprovalDecision, type MCPConfigFile, type MCPConfiguredServer, type MCPInitializeParams, type MCPInitializeResult, MCPManager, type MCPPrompt, type MCPPromptGetParams, type MCPPromptGetResult, type MCPPromptsListResult, type MCPRegistryAccessPolicy, type MCPRegistryEntryDescriptor, type MCPRegistryEntryKind, type MCPRegistryFilter, type MCPResource, type MCPResourceReadParams, type MCPResourceReadResult, type MCPResourceSubscribeParams, type MCPResourceUnsubscribeParams, type MCPResourcesListResult, MCPServer, type MCPServerConfig, type MCPServerModeOptions, type MCPServerPromptRegistration, type MCPServerResourceRegistration, type MCPServerScope, type MCPServerState, type MCPTool, type MCPToolCallParams, type MCPToolCallResult, type MCPToolsListResult, type MCPTransport, type MCPTransportConnection, MEMORY_FILES, MOTION_CAPABILITIES, MOTION_SYSTEM_PROMPT, MOTION_TOOL_NAMES, type ManifestValidationResult, type MaterialConfig, type MemoryBudget, type MemoryEntry, type MemoryFile, type MemoryLevel, MemoryManager, type MemoryManagerOptions, type MeshInfo, type Message, MessageFlow, type MessageFlowDeps, type ModeSwitchRequest, type ModelInfo, type ModelProvider, ModelProviderRegistry, type MotionAgentOptions, type MotionPromptParams, NOTES_CAPABILITIES, NOTES_TOOL_NAMES, type NotePageInfo, type NoteSearchResult, type NotesAgentOptions, type NotesToolAdapter, type OnChunkCallback, type OnTaskCompleteInput, type OnTaskCompleteResult, PIXEL_CAPABILITIES, PIXEL_SYSTEM_PROMPT, PIXEL_TOOL_NAMES, PROJECT_STATE_VERSION, type PermissionConfig, type PermissionDecision, type PermissionDecisionEvent, type PermissionDecisionHook, PermissionEngine, type PermissionInfo, type PermissionPromptFn, type PermissionPromptInfo, type PermissionPromptOperation, type PermissionPromptPreview, type PermissionPromptPreviewLine, type PermissionRequestContext, type PermissionRequestInfo, type PermissionRequestResult, type PermissionRule, type PersistentPermissionState, type PixelAgentOptions, type PixelPromptParams, type PlatformInfo, type PluginActivationEvent, type PluginAuthor, type PluginCapability, type PluginCommandContribution, type PluginCommandHandler, type PluginContext, type PluginContributions, type PluginEngineConstraint, type PluginEvent, PluginEventBus, type PluginEventListener, type PluginEventType, type PluginHook, PluginHost, type PluginHostInfo, type PluginHostOptions, type PluginInfo, type PluginListing, type PluginLogger, PluginManager, type PluginManagerOptions, type PluginManifest, PluginMarketplace, type PluginMarketplaceOptions, type PluginPermission, type PluginPromptContribution, type PluginPublishOptions, PluginSandbox, type PluginSandboxOptions, type PluginScaffoldOptions, type PluginSearchOptions, type PluginSettingContribution, PluginSettingsManager, type PluginStatus, type PluginStorage, type PluginTestCase, type PluginTestResult, PluginToolBuilder, type PluginToolContribution, type PluginUIPanel, type ProfileMCPServerConfig, ProfileManager, type ProjectConfig, type ProjectInfo, type ProjectMcpApprovalDecision, type ProjectSessionContext, type ProjectSessionContextEntry, type ProjectSessionSummary, type ProjectTokenUsageSummary, type PromptContext, type PromptFn, type PromptMemoryContextInfo, type PromptSectionContext, type PromptSectionProvider, PromptSectionRegistry, type ProviderStatus, type RecalledEpisode, type RecalledSkill, type RecentSessionEntry, type RecentSessionsIndex, type ReducedResult, type ReducerOptions, type RegisteredTool, type RenderConfig, type ResolveXenoSdkApiKeyOptions, type ResolvedIdentity, type ResolvedMemory, type ResolvedProvider, type ResolvedSubagentWorkflowAnswer, type ResourceContentBlock, type RoomInfo, type RunDelegatedXenoTurnOptions, type RunStreamOptions, type RuntimeManifestFileEntry, type RuntimeManifestInspectionResult, type RuntimePluginManifestEntry, SDK_DEFAULT_MAX_ITERATIONS, SDK_DEFAULT_MAX_TOKENS, SDK_VERSION, SESSION_FORMAT_VERSION, SHEETS_CAPABILITIES, SHEETS_TOOL_NAMES, SLIDES_CAPABILITIES, SLIDES_TOOL_NAMES, SOUND_CAPABILITIES, SOUND_SYSTEM_PROMPT, SOUND_TOOL_NAMES, SSETransport, SUBAGENT_ROLE_ALIASES, SUBAGENT_TEAM_PRESETS, type SandboxCheckResult, type ScoredMemory, ScreenCapture, type ScreenCaptureConfig, type SearchConfig, type SearchProvider, type Session, type SessionCreateOptions, type SessionData, type SessionEndData, type SessionIntegrationConfig, SessionLock, SessionLock as SessionLockManager, SessionManager, type SessionMeta, SessionRegistry, type SessionResumeOptions, type SessionRuntimeBaseOptions, type SessionRuntimeState, type SessionStartData, type SessionStatus, type SessionSummary, type SetupAIHandlersOptions, type ShapeConfig, type SheetsAgentOptions, type SheetsToolAdapter, type ShutdownCleanup, type Skill, SkillStore, type SkillStoreOptions, type SlideInfo, type SlidesAgentOptions, type SlidesToolAdapter, type SortConfig, type SoulCompletion, SoulEngine, type SoulEngineOptions, type SoulMessage, type SoulSigner, type SoundAgentOptions, type SoundPromptParams, type SpeechRecognizer, type SpeechRecognizerCallbacks, type SpeechRecognizerConfig, StdioTransport, type StemSeparationResult, type StopReason, type StoredConversation, type StoredMessage, type StoredToolCall, type StreamResult, type SubagentBranchPolicy, type SubagentExecuteFn, type SubagentExecutionRequest, type SubagentExecutionResponse, type SubagentRemoteMcpAccess, type SubagentResult, type SubagentRole, type SubagentTask, type SubagentTeamPreset, type SubagentTeamPresetDefinition, type SubagentWorkflowMode, type SubagentWorkflowOptions, type SubagentWorkflowResult, type SynthesizeSkillInput, type SystemPromptInspectionResult, THREE_D_CAPABILITIES, THREE_D_TOOL_NAMES, type TaskCompletionCallback, type TestResult, type TextBlock, type ThreeDAgentOptions, type ThreeDToolAdapter, type TimelineInfo, type TokenUsageTotals, type ToolAssistantContentBlock, type ToolCallData, type ToolDefinition, type ToolExecutor, type ToolManifestEntry, type ToolMiddleware, type ToolMiddlewareContext, ToolMiddlewareRegistry, ToolOrchestrator, type ToolOrchestratorCallbacks, type ToolOrchestratorConfig, ToolRegistry, type ToolRegistryOptions, type ToolResult, type ToolResultBlock, type ToolResultContent, type ToolResultData, type ToolRuntimeContext, type ToolUseBlock, type TraceGraph, type TraceGraphEdge, type TraceGraphNode, type TrackContext, type TranscriptEvent, type TranscriptEventData, type TranscriptEventType, TranscriptWriter, type TranscriptionResult, type TranscriptionSegment, type TransitionConfig, type TurnDiffSummary, TurnDiffTracker, type TurnDiffTrackerOptions, type TurnFileDiff, TurnRestoreManager, UnifiedExecManager, type UnifiedExecOutput, type UnifiedExecOutputChunk, type UnifiedExecOutputDelta, type UnifiedExecProcess, type UnifiedExecReadDeltaOptions, type UnifiedExecStartOptions, type UnifiedExecStatus, type UnifiedExecStream, type ValidateXenoSdkApiKeyOptions, type VectorDocument, VectorMemoryStore, type VectorSearchResult, type VectorStoreAdapter, type VectorStoreOptions, type VideoToolAdapter, WORKFLOW_CAPABILITIES, WORKFLOW_TOOL_NAMES, type WebSearchResult, type WorkflowAgentOptions, type WorkflowExecutionResult, type WorkflowInfo, type WorkflowNodeConfig, type WorkflowToolAdapter, WorkspaceIndex, type WorkspaceScanOptions, XENO_API_BASE, XENO_RT_DEFAULT_URL, XenoAppServer, type XenoAppServerOptions, XenoAuthError, type XenoAuthErrorCode, type XenoConfig, type XenoCredentialSource, type XenoCredentialType, type XenoJwtPayload, type XenoProjectState, type XenoResolvedApiKey, type XenoRuntimeEvent, type XenoRuntimeEventBase, XenoRuntimeEventBus, type XenoRuntimeEventDraft, type XenoRuntimeEventSink, type XenoRuntimeEventType, type XenoThreadRunOptions, type XenoThreadRunResult, XenoTraceGraphRecorder, type XenoUserConfig, acquireControlPlaneLock, activateSessionRuntime, addProjectAllowedDirectory, addProjectAllowedTool, appendBoundedShellOutput, appendGuidanceToResult, approveMcpServer, areSignalHandlersInstalled, artifactCompareTool, askUserTool, assertUsableXenoApiKey, auditRiskLevelForTool, backgroundProcessManager, bashTool, benchmarkCodingTools, buildAuditReplayReport, buildAuditTraceReport, buildDefaultSubagentTasks, buildDelegatedRoleSystemPrompt, buildHookEnvironment, buildMotionSystemPrompt, buildPixelSystemPrompt, buildPromptMemoryContext, buildSoundSystemPrompt, buildSystemPrompt, calculateCost, canonicalPayload, canonicalizeToolName, checkSandbox, cleanupSessionRuntime, clearMcpServerApproval, clearProjectAllowedTools, clearProjectLastSessionSummary, clearProjectMcpApproval, clearProjectMcpApprovals, coerceSubagentRole, coerceSubagentTeamPreset, configureSearch, copyTextToClipboard, create3DTools, createAgentDefinitionFile, createAgentDefinitionPromptSection, createAgentRunId, createArchitectTools, createArtifactCompareTool, createAskUserTool, createAudioTools, createAuditBackedPermissionEngine, createBashTool, createDefaultToolRegistry, createDelegatedXenoAgent, createDispatchAgentTool, createDocsTools, createEd25519Signer, createEditTool, createElfAnalyzeTool, createEngineTools, createGcodeAnalyzeTool, createGlobTool, createGrepTool, createHtmlSanitizerAuditTool, createImageTools, createLsTool, createMcpPromptRegisteredTool, createMcpRegisteredTool, createMcpResourceRegisteredTool, createMemoryReadTool, createMemoryWriteTool, createNotebookEditTool, createNotebookReadTool, createNotesTools, createReadImageTool, createReadTool, createSheetsTools, createSlidesTools, createSpeechRecognizer, createSqliteAnalyzeTool, createThinkTool, createToolAlias, createToolRuntimeContext, createVideoTools, createWebSearchTool, createWorkflowTools, createWriteTool, createXenoAgent, decodeJwtPayload, defaultToolRuntimeContext, deleteSession, denyMcpServer, detectLanguage, deterministicReduce, dispatchAgentTool, editTool, elfAnalyzeTool, ensureConfigDir, ensureProjectStateDir, extractJsonObject, extractToolPath, forgetRecentSession, forgetRecentSessionById, formatBoundedShellOutput, formatCost, formatJsonSchemaErrors, formatModelList, formatPromptContextBreakdown, gcodeAnalyzeTool, generateSessionId, getAgentRunDir, getAgentRunStoreDir, getAvailableModels, getBenchmarkComputeBudgetHintForCommand, getBenchmarkForegroundTimeoutForCommand, getChatModels, getConfigDir, getDefaultProviderRegistry, getGlobIgnores, getGrepIgnores, getHighRiskPermissions, getJwtExpiry, getLogLevel, getMcpApprovalDecision, getMcpPromptToolName, getMcpResourceToolName, getMcpToolName, getModelName, getPersistentShellSession, getPersistentShellSpawnSpec, getProjectAgentDefinitionDirs, getProjectAgentDefinitionsDir, getProjectLastSessionSummary, getProjectMcpApproval, getProjectStatePath, getRecentSessionsIndexPath, getSubagentTeamPresetDefinition, getToolRiskLevel, getUserAgentDefinitionsDir, gitBranchTool, gitCommitTool, gitDiffTool, gitLogTool, gitStatusTool, globTool, grepTool, hasProjectOnboardingCompleted, hookResultStatus, htmlSanitizerAuditTool, initializeSessionRuntime, inspectRuntimeManifests, inspectSystemPrompt, installSignalHandlers, isChatModel, isDangerousCommand, isExpiredJwt, isJwt, isLocalModel, isNotBeforeJwt, isPathWithinAllowed, isScreenCaptureAvailable, isSpeechRecognitionAvailable, isValidAgentDefinitionName, isValidModel, isValidSessionId, isWorkspaceTrusted, listProjectAllowedTools, listProjectMcpApprovals, listSessions, loadConfig, loadConfiguredMcpServers, loadMcpConfigFile, loadProjectConfig, loadProjectState, loadRecentSessionsIndex, loadSession, lookupRecentSession, lsTool, matchesMcpRegistryEntryPolicy, memoryReadTool, memoryWriteTool, mergeConfigs, normalizeHookDecision, normalizeSubagentBranchPolicy, normalizeWorkingDirectory, notebookEditTool, notebookReadTool, parseSessionId, parseSubagentRemoteMcpPolicy, parseSubagentRoleList, preflightLocalModel, publishPlugin, readImageTool, readManifestFromDisk, readSessionFormatVersion, readTool, readXenoApiKey, recordRecentSession, registerShutdownCleanup, registry, removeMcpServerConfig, removeProjectAllowedTool, renderAgentDefinition, renderAgentDefinitions, renderAuditReplayMarkdown, renderAuditReplayReport, renderAuditTraceMarkdown, renderAuditTraceReport, renderAuditTraceSummaries, renderCodingBenchmarkMarkdown, renderCodingBenchmarkReport, requestBackground, resetAllPersistentShellSessions, resetBashBenchmarkGuards, resetMcpServerApprovals, resetPersistentShellSession, resolveAgentDefinition, resolveAgentToolPolicy, resolveDelegatedExecutionMode, resolveSubagentRemoteMcpAccess, resolveSubagentWorkflowAnswer, resolveXenoSdkApiKey, runCommandHook, runDelegatedXenoTurn, runDelegationPlan, runHookDefinition, runHooks, runHttpHook, runSubagentWorkflow, runXenoThread, runXenoThreadStreamed, sanitizeEnvironment, saveConfig, saveMcpConfigFile, saveProjectState, saveSession, scaffoldPlugin, scanAgentDefinitions, scoreMemories, setLogLevel, setProjectLastSessionSummary, setProjectMcpApproval, setProjectOnboardingCompleted, setWorkspaceTrusted, setupAIHandlers, shouldSourceShellProfile, shouldUseIsolatedStdinForCommand, sqliteAnalyzeTool, summarizeAuditInputRecord, summarizeAuditTraces, summarizeRuntimeInput, summarizeSubagentResults, syncMcpToolsToRegistry, synthesizeSkill, taskOutputTool, taskStopTool, testPlugin, thinkTool, toAgentDefinitionMetadata, toLLMProvider, unifiedExecManager, updateProjectState, upsertMcpServerConfig, validateAgentDefinition, validateDelegationPlan, validateJsonSchema, validateManifest, validateXenoSdkApiKey, verifySignature, verifySoulRecord, webFetchTool, webSearchTool, writeTool };
5385
+ export { type A2AMessage, type A2AMessageType, ARCHITECT_CAPABILITIES, ARCHITECT_TOOL_NAMES, type ActiveLayerInfo, type AgentArtifact, type AgentCapabilities, type AgentCard, AgentDebugger, type AgentDefinition, type AgentDefinitionIssue, AgentDefinitionLoader, type AgentDefinitionLoaderOptions, type AgentDefinitionMetadata, AgentDefinitionResolver, type AgentDefinitionScanResult, type AgentDefinitionScope, type AgentDefinitionShadowRef, type AgentEffortLevel, AgentEvaluator, AgentInterruptedError, type AgentIpcChannel, type AgentLoadSnapshot, AgentLoop, type AgentLoopConfig, type AgentLoopOptions, AgentProtocol, AgentRegistry, type AgentRunAgentDefinitionRef, type AgentRunCreateInput, type AgentRunEvent, type AgentRunListOptions, type AgentRunRecord, type AgentRunStatus, AgentRunStore, type AgentRunTermination, type AgentRunTerminationReason, type AgentRunTerminationStatus, type AgentRunUsage, type AgentSandbox, type AgentSelectionStrategy, type AgentStreamCallbacks, type AgentTask, type AgentTaskHandler, type AgentTaskResult, type AgentTaskStatus, type AgentTeam, type AgentToAppChannel, type AgentToAppMessages, type AgentToolPolicy, type AnalysisResult, type ApiMessage, type AppAgentBaseOptions, AppAgentFactory, type AppAgentResult, type AppContext, AppContextInjector, AppContextManager, type AppContextProvider, type AppId, type AppToAgentChannel, type AppToAgentMessages, type AppType, type ArchitectAgentOptions, type ArchitectToolAdapter, type AskUserHandler, type AskUserRequest, type AskUserResponse, type AudioProjectInfo, type AudioStemSeparationResult, type AudioToolAdapter, type AudioTrackType, type AudioTranscriptionResult, type AudioTranscriptionSegment, type AuditDecision, type AuditEvent, AuditLogger, type AuditReplayReport, type AuditReplayStep, type AuditRiskLevel, type AuditStatus, type AuditTraceGapEntry, type AuditTraceReport, type AuditTraceSummary, type AuditTraceTimelineEntry, type AuditTraceToolSummary, type AugmentContextOptions, AutoCheckpointHandler, AutoMemory, type AutoMemoryContext, type AutoMemoryTrigger, BackgroundProcessManager, type BackgroundTask, type BaseHookDefinition, type BlockContent, type BlockType, type BoundedShellOutput, type BreakpointCallback, type BuildResult, COMPAT_TOOL_ALIASES, CONFIG_VERSION, type CanvasSize, type CellRangeData, type ChartConfig, type ChatCompletionChunk, type ChatCompletionRequest, type ChatCompletionResponse, type ChatMessage, type ChatParams, type ChatResponse, type CheckpointData, type CheckpointInfo, CheckpointManager, type CheckpointTrigger, type ClashResult, type ClipContext, type CodeApplyOptions, type CodeApplyResult, type CodeValidationIssue, type CodeValidationResult, CodeValidator, type CodingBenchmarkAssessment, type CodingBenchmarkMeasurement, type CodingBenchmarkOptions, type CodingBenchmarkReport, type CodingBenchmarkThreshold, type CommandHookDefinition, type CompletionGuard, type CompletionGuardContext, type CompletionGuardDecision, type CompletionGuardEvaluationContext, CompletionGuardRegistry, type CompletionGuardResult, type CompletionGuardResultObject, type CompletionGuardStopReason, type CompletionGuardToolPolicy, type CompletionGuardToolPolicyMode, type CompletionGuardTurnStats, type CompletionGuardVeto, type ComponentData, type CompressionLLMFn, type CompressionStats, type ConfigProfile, type ConnectConfiguredMCPServersOptions, type ConnectConfiguredMCPServersResult, type ContentBlock, type ContextCompressedData, ContextManager, type ContextManagerConfig, type ContextSection, type ContextSource, type ControlPlaneLockHandle, type ControlPlaneLockRecord, ConversationStore, type CreateAuditBackedPermissionEngineOptions, type CreateDelegatedBranchAgent, type CreateDelegatedBranchAgentOptions, type CreateDelegatedXenoAgentOptions, type CreateXenoAgentOptions, type CreateXenoAgentResult, type CrossAppHandler, type CrossAppMessage, CrossAppRouter, CrossAppRouterError, type CrossAppRouterOptions, DEFAULT_API_KEY, DEFAULT_MEMORY_BUDGETS, DEFAULT_MODEL, DEFAULT_PROMPT_SECTIONS_TOKEN_BUDGET, DEFAULT_SUBAGENT_BRANCH_POLICY, DEFAULT_SUBAGENT_REMOTE_MCP_BY_ROLE, DEFAULT_SUBAGENT_ROLES, DEFAULT_SUBAGENT_ROLE_PRECEDENCE, DEFAULT_SUBAGENT_TEAM_PRESET, DOCS_CAPABILITIES, DOCS_TOOL_NAMES, type DebugBreakpoint, type DebugSnapshot, type DebugStep, type DebugStepCallback, type DefaultToolRegistryOptions, type DelegatedBranchAgent, type DelegatedBranchAgentCallbacks, type DelegatedXenoTurnResult, type DelegationBudget, type DelegationLimits, type DelegationSummaryData, type DependencyEdge, type DescendantInstructionHint, type DispatchAgentHandler, type DispatchAgentRequest, type DispatchAgentResponse, type DocComment, type DocsAgentOptions, type DocsToolAdapter, type DocumentContext, type DualLLMMode, DualLLMProvider, type DualLLMProviderConfig, type DualLLMProviderLike, type DualLLMStatus, ENGINE_CAPABILITIES, ENGINE_TOOL_NAMES, ElectronAgentBridge, type ElectronAgentConfig, type EngineAgentOptions, type EngineToolAdapter, type EntityInfo, type Episode, type EpisodeOutcome, EpisodicStore, type EpisodicStoreOptions, type ErrorData, type EvalReport, type EvalResult, type EvalRunOptions, type EvalTask, type ExecuteToolRequest, type ExecuteToolResult, type ExecutionMode, type ExportableSoulSigner, type ExtendedAppType, FALLBACK_MODELS, type FileEntry, type FileSnapshot, type FilterConfig, HIGH_RISK_PERMISSIONS, type HookDecision, type HookDefinition, type HookEventName, type HookExecutionResult, type HookExecutionStatus, type HookInputBase, type HookInvocationInput, type HookPermissionMode, type HookRunResult, HookRunner, type HookRuntimeOptions, type HttpHookDefinition, IDENTITY_PATHS, type IdentityFrontmatter, type IdentityLayer, type IdentityLoadResult, IdentityLoader, type IdentityLoaderOptions, type IdentityPaths, IdentityResolver, type IdentitySource, type ImageContentBlock, type ImageDocumentInfo, type ImageLayerInfo, type ImageLayerType, type ImageToolAdapter, type ImageUrlBlock, type InitializeSessionRuntimeOptions, type InspectSystemPromptOptions, type InstallSignalHandlersOptions, type IpcHandler, type JsonRpcErrorResponse, type JsonRpcMessage, type JsonRpcNotification, type JsonRpcRequest$1 as JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccessResponse, type JsonSchemaSubset, type JsonSchemaType, type JsonSchemaValidationError, type JsonSchemaValidationResult, type LLMCompletionResult, type LLMProvider, type LLMProviderCapabilities, type LLMProviderMessage, type ToolDefinition as LLMProviderToolDefinition, type LLMToolDefinition, type LayerContext, LlmClient, type LlmClientDeps, LocalLLMProvider, type LocalLLMProviderConfig, type LocalRuntimePreflightResult, LogLevel, MANIFEST_FILENAME, type MCPApprovalDecision, type MCPConfigFile, type MCPConfiguredServer, type MCPInitializeParams, type MCPInitializeResult, MCPManager, type MCPPrompt, type MCPPromptGetParams, type MCPPromptGetResult, type MCPPromptsListResult, type MCPRegistryAccessPolicy, type MCPRegistryEntryDescriptor, type MCPRegistryEntryKind, type MCPRegistryFilter, type MCPResource, type MCPResourceReadParams, type MCPResourceReadResult, type MCPResourceSubscribeParams, type MCPResourceUnsubscribeParams, type MCPResourcesListResult, MCPServer, type MCPServerConfig, type MCPServerModeOptions, type MCPServerPromptRegistration, type MCPServerResourceRegistration, type MCPServerScope, type MCPServerState, type MCPTool, type MCPToolCallParams, type MCPToolCallResult, type MCPToolsListResult, type MCPTransport, type MCPTransportConnection, MEMORY_FILES, MOTION_CAPABILITIES, MOTION_SYSTEM_PROMPT, MOTION_TOOL_NAMES, type ManifestValidationResult, type MaterialConfig, type MemoryBudget, type MemoryEntry, type MemoryFile, type MemoryLevel, MemoryManager, type MemoryManagerOptions, type MeshInfo, type Message, MessageFlow, type MessageFlowDeps, type ModeSwitchRequest, type ModelInfo, type ModelProvider, ModelProviderRegistry, type MotionAgentOptions, type MotionPromptParams, NOTES_CAPABILITIES, NOTES_TOOL_NAMES, type NotePageInfo, type NoteSearchResult, type NotesAgentOptions, type NotesToolAdapter, type OnChunkCallback, type OnTaskCompleteInput, type OnTaskCompleteResult, PIXEL_CAPABILITIES, PIXEL_SYSTEM_PROMPT, PIXEL_TOOL_NAMES, PROJECT_STATE_VERSION, type PermissionConfig, type PermissionDecision, type PermissionDecisionEvent, type PermissionDecisionHook, PermissionEngine, type PermissionInfo, type PermissionPromptFn, type PermissionPromptInfo, type PermissionPromptOperation, type PermissionPromptPreview, type PermissionPromptPreviewLine, type PermissionRequestContext, type PermissionRequestInfo, type PermissionRequestResult, type PermissionRule, type PersistentPermissionState, type PixelAgentOptions, type PixelPromptParams, type PlatformInfo, type PluginActivationEvent, type PluginAuthor, type PluginCapability, type PluginCommandContribution, type PluginCommandHandler, type PluginContext, type PluginContributions, type PluginEngineConstraint, type PluginEvent, PluginEventBus, type PluginEventListener, type PluginEventType, type PluginHook, PluginHost, type PluginHostInfo, type PluginHostOptions, type PluginInfo, type PluginListing, type PluginLogger, PluginManager, type PluginManagerOptions, type PluginManifest, PluginMarketplace, type PluginMarketplaceOptions, type PluginPermission, type PluginPromptContribution, type PluginPublishOptions, PluginSandbox, type PluginSandboxOptions, type PluginScaffoldOptions, type PluginSearchOptions, type PluginSettingContribution, PluginSettingsManager, type PluginStatus, type PluginStorage, type PluginTestCase, type PluginTestResult, PluginToolBuilder, type PluginToolContribution, type PluginUIPanel, type ProfileMCPServerConfig, ProfileManager, type ProjectConfig, type ProjectInfo, type ProjectMcpApprovalDecision, type ProjectSessionContext, type ProjectSessionContextEntry, type ProjectSessionSummary, type ProjectTokenUsageSummary, type PromptContext, type PromptFn, type PromptMemoryContextInfo, type PromptSectionContext, type PromptSectionProvider, PromptSectionRegistry, type ProviderStatus, type RecalledEpisode, type RecalledSkill, type RecentSessionEntry, type RecentSessionsIndex, type ReducedResult, type ReducerOptions, type RegisteredTool, type RenderConfig, type ResolveXenoSdkApiKeyOptions, type ResolvedIdentity, type ResolvedMemory, type ResolvedProvider, type ResolvedSubagentWorkflowAnswer, type ResourceContentBlock, type RoomInfo, type RunDelegatedXenoTurnOptions, type RunStreamOptions, type RuntimeManifestFileEntry, type RuntimeManifestInspectionResult, type RuntimePluginManifestEntry, SDK_DEFAULT_MAX_ITERATIONS, SDK_DEFAULT_MAX_TOKENS, SDK_VERSION, SESSION_FORMAT_VERSION, SHEETS_CAPABILITIES, SHEETS_TOOL_NAMES, SLIDES_CAPABILITIES, SLIDES_TOOL_NAMES, SOUND_CAPABILITIES, SOUND_SYSTEM_PROMPT, SOUND_TOOL_NAMES, SSETransport, SUBAGENT_ROLE_ALIASES, SUBAGENT_TEAM_PRESETS, type SandboxCheckResult, type ScoredMemory, ScreenCapture, type ScreenCaptureConfig, type SearchConfig, type SearchProvider, type Session, type SessionCreateOptions, type SessionData, type SessionEndData, type SessionIntegrationConfig, SessionLock, SessionLock as SessionLockManager, SessionManager, type SessionMeta, SessionRegistry, type SessionResumeOptions, type SessionRuntimeBaseOptions, type SessionRuntimeState, type SessionStartData, type SessionStatus, type SessionSummary, type SetupAIHandlersOptions, type ShapeConfig, type SheetsAgentOptions, type SheetsToolAdapter, type ShutdownCleanup, type Skill, SkillStore, type SkillStoreOptions, type SlideInfo, type SlidesAgentOptions, type SlidesToolAdapter, type SortConfig, type SoulCompletion, SoulEngine, type SoulEngineOptions, type SoulMessage, type SoulSigner, type SoundAgentOptions, type SoundPromptParams, type SpeechRecognizer, type SpeechRecognizerCallbacks, type SpeechRecognizerConfig, StdioTransport, type StemSeparationResult, type StopReason, type StoredConversation, type StoredMessage, type StoredToolCall, type StreamResult, type SubagentBranchPolicy, type SubagentExecuteFn, type SubagentExecutionRequest, type SubagentExecutionResponse, type SubagentRemoteMcpAccess, type SubagentResult, type SubagentRole, type SubagentTask, type SubagentTeamPreset, type SubagentTeamPresetDefinition, type SubagentWorkflowMode, type SubagentWorkflowOptions, type SubagentWorkflowResult, type SynthesizeSkillInput, type SystemPromptInspectionResult, THREE_D_CAPABILITIES, THREE_D_TOOL_NAMES, type TaskCompletionCallback, type TestResult, type TextBlock, type ThreeDAgentOptions, type ThreeDToolAdapter, type TimelineInfo, type TokenUsageTotals, type ToolAssistantContentBlock, type ToolCallData, type ToolDefinition, type ToolExecutor, type ToolManifestEntry, type ToolMiddleware, type ToolMiddlewareContext, ToolMiddlewareRegistry, ToolOrchestrator, type ToolOrchestratorCallbacks, type ToolOrchestratorConfig, ToolRegistry, type ToolRegistryOptions, type ToolResult, type ToolResultBlock, type ToolResultContent, type ToolResultData, type ToolRuntimeContext, type ToolUseBlock, type TraceGraph, type TraceGraphEdge, type TraceGraphNode, type TrackContext, type TranscriptEvent, type TranscriptEventData, type TranscriptEventType, TranscriptWriter, type TranscriptionResult, type TranscriptionSegment, type TransitionConfig, type TurnDiffSummary, TurnDiffTracker, type TurnDiffTrackerOptions, type TurnFileDiff, TurnRestoreManager, UnifiedExecManager, type UnifiedExecOutput, type UnifiedExecOutputChunk, type UnifiedExecOutputDelta, type UnifiedExecProcess, type UnifiedExecReadDeltaOptions, type UnifiedExecStartOptions, type UnifiedExecStatus, type UnifiedExecStream, type ValidateXenoSdkApiKeyOptions, type VectorDocument, VectorMemoryStore, type VectorSearchResult, type VectorStoreAdapter, type VectorStoreOptions, type VideoToolAdapter, WORKFLOW_CAPABILITIES, WORKFLOW_TOOL_NAMES, type WebSearchResult, type WorkflowAgentOptions, type WorkflowExecutionResult, type WorkflowInfo, type WorkflowNodeConfig, type WorkflowToolAdapter, WorkspaceIndex, type WorkspaceScanOptions, XENO_API_BASE, XENO_RT_DEFAULT_URL, XenoAppServer, type XenoAppServerOptions, XenoAuthError, type XenoAuthErrorCode, type XenoConfig, type XenoCredentialSource, type XenoCredentialType, type XenoJwtPayload, type XenoProjectState, type XenoResolvedApiKey, type XenoRuntimeEvent, type XenoRuntimeEventBase, XenoRuntimeEventBus, type XenoRuntimeEventDraft, type XenoRuntimeEventSink, type XenoRuntimeEventType, type XenoThreadRunOptions, type XenoThreadRunResult, XenoTraceGraphRecorder, type XenoUserConfig, acquireControlPlaneLock, activateSessionRuntime, addProjectAllowedDirectory, addProjectAllowedTool, appendBoundedShellOutput, appendGuidanceToResult, approveMcpServer, areSignalHandlersInstalled, artifactCompareTool, askUserTool, assertUsableXenoApiKey, auditRiskLevelForTool, backgroundProcessManager, bashTool, benchmarkCodingTools, buildAuditReplayReport, buildAuditTraceReport, buildDefaultSubagentTasks, buildDelegatedRoleSystemPrompt, buildHookEnvironment, buildMotionSystemPrompt, buildPixelSystemPrompt, buildPromptMemoryContext, buildSoundSystemPrompt, buildSystemPrompt, calculateCost, canonicalPayload, canonicalizeToolName, checkSandbox, cleanupSessionRuntime, clearMcpServerApproval, clearProjectAllowedTools, clearProjectLastSessionSummary, clearProjectMcpApproval, clearProjectMcpApprovals, coerceSubagentRole, coerceSubagentTeamPreset, configureSearch, copyTextToClipboard, create3DTools, createAgentDefinitionFile, createAgentDefinitionPromptSection, createAgentRunId, createArchitectTools, createArtifactCompareTool, createAskUserTool, createAudioTools, createAuditBackedPermissionEngine, createBashTool, createDefaultToolRegistry, createDelegatedXenoAgent, createDispatchAgentTool, createDocsTools, createEd25519Signer, createEditTool, createElfAnalyzeTool, createEngineTools, createGcodeAnalyzeTool, createGlobTool, createGrepTool, createHtmlSanitizerAuditTool, createImageTools, createLsTool, createMcpPromptRegisteredTool, createMcpRegisteredTool, createMcpResourceRegisteredTool, createMemoryReadTool, createMemoryWriteTool, createNotebookEditTool, createNotebookReadTool, createNotesTools, createReadImageTool, createReadTool, createSheetsTools, createSlidesTools, createSpeechRecognizer, createSqliteAnalyzeTool, createThinkTool, createToolAlias, createToolRuntimeContext, createVideoTools, createWebSearchTool, createWorkflowTools, createWriteTool, createXenoAgent, decodeJwtPayload, defaultToolRuntimeContext, deleteSession, denyMcpServer, detectLanguage, deterministicReduce, dispatchAgentTool, editTool, elfAnalyzeTool, ensureConfigDir, ensureProjectStateDir, extractJsonObject, extractToolPath, forgetRecentSession, forgetRecentSessionById, formatBoundedShellOutput, formatCost, formatJsonSchemaErrors, formatModelList, formatPromptContextBreakdown, gcodeAnalyzeTool, generateSessionId, getAgentRunDir, getAgentRunStoreDir, getAvailableModels, getBenchmarkComputeBudgetHintForCommand, getBenchmarkForegroundTimeoutForCommand, getChatModels, getConfigDir, getDefaultProviderRegistry, getGlobIgnores, getGrepIgnores, getHighRiskPermissions, getJwtExpiry, getLogLevel, getMcpApprovalDecision, getMcpPromptToolName, getMcpResourceToolName, getMcpToolName, getModelName, getPersistentShellSession, getPersistentShellSpawnSpec, getProjectAgentDefinitionDirs, getProjectAgentDefinitionsDir, getProjectLastSessionSummary, getProjectMcpApproval, getProjectStatePath, getRecentSessionsIndexPath, getSubagentTeamPresetDefinition, getToolRiskLevel, getUserAgentDefinitionsDir, gitBranchTool, gitCommitTool, gitDiffTool, gitLogTool, gitStatusTool, globTool, grepTool, hasProjectOnboardingCompleted, hookResultStatus, htmlSanitizerAuditTool, initializeSessionRuntime, inspectRuntimeManifests, inspectSystemPrompt, installSignalHandlers, isChatModel, isDangerousCommand, isExpiredJwt, isJwt, isLocalModel, isNotBeforeJwt, isPathWithinAllowed, isScreenCaptureAvailable, isSpeechRecognitionAvailable, isValidAgentDefinitionName, isValidModel, isValidSessionId, isWorkspaceTrusted, listProjectAllowedTools, listProjectMcpApprovals, listSessions, loadConfig, loadConfiguredMcpServers, loadMcpConfigFile, loadProjectConfig, loadProjectState, loadRecentSessionsIndex, loadSession, lookupRecentSession, lsTool, matchesMcpRegistryEntryPolicy, memoryReadTool, memoryWriteTool, mergeConfigs, normalizeHookDecision, normalizeSubagentBranchPolicy, normalizeWorkingDirectory, notebookEditTool, notebookReadTool, parseSessionId, parseSubagentRemoteMcpPolicy, parseSubagentRoleList, preflightLocalModel, publishPlugin, readImageTool, readManifestFromDisk, readSessionFormatVersion, readTool, readXenoApiKey, recordRecentSession, registerShutdownCleanup, registry, removeMcpServerConfig, removeProjectAllowedTool, renderAgentDefinition, renderAgentDefinitions, renderAuditReplayMarkdown, renderAuditReplayReport, renderAuditTraceMarkdown, renderAuditTraceReport, renderAuditTraceSummaries, renderCodingBenchmarkMarkdown, renderCodingBenchmarkReport, requestBackground, resetAllPersistentShellSessions, resetBashBenchmarkGuards, resetMcpServerApprovals, resetPersistentShellSession, resolveAgentDefinition, resolveAgentToolPolicy, resolveDelegatedExecutionMode, resolveSubagentRemoteMcpAccess, resolveSubagentWorkflowAnswer, resolveXenoSdkApiKey, runCommandHook, runDelegatedXenoTurn, runDelegationPlan, runHookDefinition, runHooks, runHttpHook, runSubagentWorkflow, runXenoThread, runXenoThreadStreamed, sanitizeEnvironment, saveConfig, saveMcpConfigFile, saveProjectState, saveSession, scaffoldPlugin, scanAgentDefinitions, scoreMemories, setLogLevel, setProjectLastSessionSummary, setProjectMcpApproval, setProjectOnboardingCompleted, setWorkspaceTrusted, setupAIHandlers, shouldSourceShellProfile, shouldUseIsolatedStdinForCommand, sqliteAnalyzeTool, summarizeAuditInputRecord, summarizeAuditTraces, summarizeRuntimeInput, summarizeSubagentResults, syncMcpToolsToRegistry, synthesizeSkill, taskOutputTool, taskStopTool, testPlugin, thinkTool, toAgentDefinitionMetadata, toLLMProvider, unifiedExecManager, updateProjectState, upsertMcpServerConfig, validateAgentDefinition, validateDelegationPlan, validateJsonSchema, validateManifest, validateXenoSdkApiKey, verifySignature, verifySoulRecord, webFetchTool, webSearchTool, writeTool };
package/dist/index.js CHANGED
@@ -1144,7 +1144,7 @@ ${e.transcript.slice(0,4e3)}`}])).trim();if(r)return r}catch{}return this.heuris
1144
1144
  `).map(o=>o.trim()).filter(o=>o.length>0);if(t.length===0)return`Task "${e.task}" ended: ${e.outcome}.`;let r=t[0]??"",s=t.length>1?t[t.length-1]??"":"";return s&&s!==r?`${r} \u2026 ${s}`:r}maybeSign(e){return this.signer?{...e,signature:this.signer.sign(er(e))}:e}};Zs();Ve();ti();ni();ri();ci();ui();Mi();Di();Oi();Ai();Li();Ta();Bi();Ui();Ki();oa();ia();ma();ya();Sa();ka();Pa();Ia();Oa();$a();de();K();Hn();import{randomUUID as zP}from"crypto";import{appendFileSync as HP,existsSync as Bg,mkdirSync as eo,readFileSync as Hg,readdirSync as GP,renameSync as WP,rmSync as XP,writeFileSync as to}from"fs";import{homedir as JP}from"os";import{basename as Fg,dirname as Gg,join as ce,resolve as KP}from"path";import{mkdirSync as OP,readFileSync as LP,rmSync as Lg,writeFileSync as $P}from"fs";import{hostname as $g}from"os";import{dirname as NP}from"path";function jP(){return new Date().toISOString()}function BP(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function Ng(n){try{return JSON.parse(LP(n,"utf8"))}catch{return null}}function FP(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function qP(n){return n.hostname!==$g()?!0:FP(n.pid)}function Og(n,e){OP(NP(n),{recursive:!0}),$P(n,JSON.stringify(e,null,2)+`
1145
1145
  `,{encoding:"utf8",flag:"wx"})}function UP(n,e){let t=Ng(n);t?.pid!==e.pid||t.hostname!==e.hostname||Lg(n,{force:!0})}function jg(n,e,t){let r=jP(),s={schemaVersion:1,name:e,pid:process.pid,hostname:$g(),processStartedAt:BP(),version:t,acquiredAt:r,updatedAt:r};try{Og(n,s)}catch(o){if(o.code!=="EEXIST")throw o;let a=Ng(n);if(a&&qP(a))throw new Error(`${e} is already locked by PID ${a.pid} on ${a.hostname}.`);Lg(n,{force:!0}),Og(n,s)}return{record:s,release:()=>{UP(n,s)}}}var qg=1,VP=ce(JP(),".xeno-agent"),YP=ce(process.env.XENO_AGENT_HOME??VP,"daemon"),Ac=ce(YP,"runs");function ne(){return new Date().toISOString()}function QP(n=new Date){return n.toISOString().replace(/[^0-9]/g,"").slice(0,14)}function Pc(n){return n.replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,80)}function Ec(n){return KP(n)}function no(n){return Ec(n).toLowerCase()}function Ug(n,e){let t=no(n),r=no(e);return t===r||t.startsWith(`${r}\\`)||t.startsWith(`${r}/`)}function ZP(n,e){return!!(no(n.cwd)===no(e)||n.git?.root&&Ug(e,n.git.root)||n.git?.worktree&&Ug(e,n.git.worktree))}function eA(n){return Pc(Buffer.from(Ec(n)).toString("base64url"))}function tA(){return{input:0,output:0,total:0}}function Rc(n){try{return JSON.parse(Hg(n,"utf8"))}catch{return null}}function nA(n,e){eo(Gg(n),{recursive:!0});let t=`${n}.${process.pid}.${Date.now()}.tmp`;to(t,JSON.stringify(e,null,2)+`
1146
1146
  `,"utf8"),WP(t,n)}function rA(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function sA(n){return n==="completed"||n==="failed"||n==="cancelled"||n==="interrupted"}function oA(n,e){return n.pinned!==e.pinned?n.pinned?-1:1:Date.parse(e.updatedAt)-Date.parse(n.updatedAt)}function JB(){return Ac}function KB(n){return ce(Ac,n)}function iA(n=new Date){return`run_${QP(n)}_${zP().slice(0,8)}`}var zg=class{constructor(e=Ac){this.runsDir=e;eo(this.runsDir,{recursive:!0})}create(e){let t=iA(),r=ce(this.runsDir,t);eo(r,{recursive:!0});let s=ne(),o=ce(r,"events.jsonl"),i={schemaVersion:qg,runId:t,sessionId:t,rootRunId:t,cwd:Ec(e.cwd),workspaceId:eA(e.cwd),prompt:e.prompt,...e.title?{title:e.title}:{},status:"starting",model:e.model,...e.effort?{effort:e.effort}:{},...e.agent?{agent:e.agent}:{},...e.git?{git:e.git}:{},permissionMode:e.permissionMode,...e.cliVersion?{createdByCliVersion:e.cliVersion}:{},createdBySdkVersion:e.sdkVersion??fn,createdAt:s,updatedAt:s,lastActivityAt:s,pinned:!!e.pinned,attachedClients:0,...e.cliVersion?{cliVersion:e.cliVersion}:{},...e.sdkVersion?{sdkVersion:e.sdkVersion}:{},stdoutPath:ce(r,"stdout.log"),stderrPath:ce(r,"stderr.log"),eventsPath:o,usage:tA(),children:[],tags:[]};return to(i.stdoutPath,"","utf8"),to(i.stderrPath,"","utf8"),to(i.eventsPath,"","utf8"),this.write(i),this.appendEvent(t,"run_created",{cwd:i.cwd,model:i.model,...i.agent?{agent:i.agent}:{},...i.git?{git:i.git}:{},permissionMode:i.permissionMode,pinned:i.pinned}),i}get(e){let t=Rc(this.recordPath(e));return t?this.refreshRecordStatus(t):null}list(e={}){if(!Bg(this.runsDir))return[];let t=GP(this.runsDir,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>this.get(r.name)).filter(r=>r!==null).filter(r=>e.all||!e.cwd||ZP(r,e.cwd)).filter(r=>!e.status||e.status.includes(r.status)).sort(oA);return typeof e.limit=="number"&&e.limit>0?t.slice(0,e.limit):t}markSpawned(e,t,r){return this.update(e,s=>({...s,status:"running",workerPid:t,...r?{workerVersion:r}:{},startedAt:s.startedAt??ne(),lastActivityAt:ne()}))}markStarted(e,t){return this.update(e,r=>({...r,status:"running",workerPid:t.pid,...t.workerVersion?{workerVersion:t.workerVersion}:{},...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{},startedAt:r.startedAt??ne(),lastActivityAt:ne()}))}markCompleted(e,t){return this.update(e,r=>({...r,status:t.status,...t.statusReason?{statusReason:t.statusReason}:{},exitCode:t.exitCode??null,usage:t.usage??r.usage,endedAt:ne(),lastActivityAt:ne()}))}markCancelled(e,t){return this.update(e,r=>({...r,status:"cancelled",statusReason:t,endedAt:ne(),lastActivityAt:ne()}))}markPaused(e,t="Paused by user."){let r=this.update(e,s=>({...s,status:"paused",statusReason:t,lastActivityAt:ne()}));return r&&this.appendEvent(e,"run_paused",{reason:t}),r}markResumed(e,t="Resumed by user."){let r=this.update(e,s=>{let o={...s,status:"running",statusReason:t,lastActivityAt:ne()};return delete o.endedAt,delete o.exitCode,o});return r&&this.appendEvent(e,"run_resumed",{reason:t}),r}setPinned(e,t){let r=this.update(e,s=>({...s,pinned:t,lastActivityAt:ne()}));return r&&this.appendEvent(e,t?"run_pinned":"run_unpinned",{pinned:t}),r}appendEvent(e,t,r={}){let s=Rc(this.recordPath(e)),o=s?.eventsPath??ce(this.runsDir,e,"events.jsonl");eo(Gg(o),{recursive:!0});let i={schemaVersion:qg,runId:e,type:t,timestamp:ne(),payload:r};HP(o,JSON.stringify(i)+`
1147
- `,"utf8"),s&&this.update(e,a=>({...a,lastActivityAt:i.timestamp}))}readEvents(e){let t=this.get(e);return!t||!Bg(t.eventsPath)?[]:Hg(t.eventsPath,"utf8").split(/\r?\n/).map(r=>r.trim()).filter(Boolean).map(r=>{try{return JSON.parse(r)}catch{return null}}).filter(r=>r!==null)}delete(e){XP(ce(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(sA(e.status))return e;if(e.workerPid&&!rA(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??ne(),updatedAt:ne()};return this.write(t),t}return e}update(e,t){let r=Rc(this.recordPath(e));if(!r)return null;let s=t(r);return s.updatedAt=ne(),this.write(s),s}write(e){let t=jg(ce(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,fn);try{nA(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return ce(this.runsDir,Pc(Fg(e)),"run.json")}runDir(e){return ce(this.runsDir,Pc(Fg(e)))}};import{createInterface as dA}from"readline";rn();Hn();async function Kg(n){let e=n.runtimeEventBus??new ht,t=[],r=n.captureTraceGraph?new zn("thread-run"):void 0;e.subscribe(i=>{t.push(i),r?.record(i),n.onRuntimeEvent?.(i)});let{agent:s}=await De({...n,runtimeEventBus:e,onRuntimeEvent:void 0});return{output:await s.run(n.prompt),events:t,...r?{traceGraph:r.toGraph()}:{},tokenUsage:s.tokenUsage}}async function*yF(n){let e=n.runtimeEventBus??new ht,t=[],r=n.captureTraceGraph?new zn("thread-run-streamed"):void 0,s=[],o,i=!1,a,c;e.subscribe(u=>{t.push(u),r?.record(u),n.onRuntimeEvent?.(u),s.push(u),o?.(),o=void 0});let l=(async()=>{try{let{agent:u}=await De({...n,runtimeEventBus:e,onRuntimeEvent:void 0});a={output:await u.run(n.prompt),events:t,...r?{traceGraph:r.toGraph()}:{},tokenUsage:u.tokenUsage}}catch(u){c=u}finally{i=!0,o?.(),o=void 0}})();for(;!i||s.length>0;){let u=s.shift();if(u){yield u;continue}await new Promise(d=>{o=d})}if(await l,c)throw c;return a??{output:"",events:t,...r?{traceGraph:r.toGraph()}:{},tokenUsage:{input:0,output:0,total:0}}}Hn();var _c=class{constructor(e={}){this.options=e}stopping=!1;async start(e=process.stdin,t=process.stdout){let r=dA({input:e,crlfDelay:1/0});this.write(t,{jsonrpc:"2.0",method:"server.ready",params:{name:"xeno-app-server",protocolVersion:1}});for await(let s of r){if(this.stopping)break;let o=s.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch(a){this.write(t,this.error(null,-32700,"Parse error",a));continue}await this.handleRequest(i,t)}}stop(){this.stopping=!0}async handleRequest(e,t){try{if(e.method==="health"){this.write(t,this.success(e.id??null,{ok:!0}));return}if(e.method==="exec.start"){let r=vt(e.params),s=typeof r.command=="string"?r.command:"";if(!s.trim()){this.write(t,this.error(e.id??null,-32602,"exec.start requires params.command"));return}this.write(t,this.success(e.id??null,yt.start(s,{cwd:typeof r.cwd=="string"?r.cwd:void 0,timeoutMs:so(r.timeoutMs),maxOutputBytes:so(r.maxOutputBytes),env:pA(r.env)})));return}if(e.method==="exec.write"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"",o=typeof r.text=="string"?r.text:"";this.write(t,this.success(e.id??null,{ok:yt.writeStdin(s,o)}));return}if(e.method==="exec.output"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"";this.write(t,this.success(e.id??null,yt.readOutput(s)));return}if(e.method==="exec.output.delta"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"";this.write(t,this.success(e.id??null,yt.readOutputDelta(s,mA(r.cursor)??0,{maxChunks:so(r.maxChunks),maxBytes:so(r.maxBytes)})));return}if(e.method==="exec.terminate"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"";this.write(t,this.success(e.id??null,{ok:yt.terminate(s)}));return}if(e.method==="exec.list"){this.write(t,this.success(e.id??null,yt.list()));return}if(e.method==="thread.run"){let r=vt(e.params),s=typeof r.prompt=="string"?r.prompt:"";if(!s.trim()){this.write(t,this.error(e.id??null,-32602,"thread.run requires params.prompt"));return}let o=vt(r.options),i=await Kg({...this.options.defaultAgentOptions,...o,prompt:s,onRuntimeEvent:a=>{this.write(t,{jsonrpc:"2.0",method:"runtime.event",params:a})}});this.write(t,this.success(e.id??null,i));return}if(e.method==="server.stop"){this.write(t,this.success(e.id??null,{ok:!0})),this.stop();return}this.write(t,this.error(e.id??null,-32601,`Unknown method: ${e.method}`))}catch(r){let s=r instanceof Error?r.message:String(r);this.write(t,this.error(e.id??null,-32e3,s))}}success(e,t){return{jsonrpc:"2.0",id:e,result:t}}error(e,t,r,s){return{jsonrpc:"2.0",id:e,error:{code:t,message:r,...s?{data:gA(s)}:{}}}}write(e,t){e.write(`${JSON.stringify(t)}
1147
+ `,"utf8"),s&&this.update(e,a=>({...a,lastActivityAt:i.timestamp}))}readEvents(e){let t=this.get(e);return!t||!Bg(t.eventsPath)?[]:Hg(t.eventsPath,"utf8").split(/\r?\n/).map(r=>r.trim()).filter(Boolean).map(r=>{try{return JSON.parse(r)}catch{return null}}).filter(r=>r!==null)}delete(e){XP(ce(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(sA(e.status))return e;if(e.workerPid&&!rA(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??ne(),updatedAt:ne()};return this.write(t),t}return e}update(e,t){let r=Rc(this.recordPath(e));if(!r)return null;let s=t(r);return s.updatedAt=ne(),this.write(s),s}write(e){let t=jg(ce(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,fn);try{nA(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return ce(this.runsDir,Pc(Fg(e)),"run.json")}runDir(e){return ce(this.runsDir,Pc(Fg(e)))}};import{createInterface as dA}from"readline";rn();Hn();async function Kg(n){let e=n.runtimeEventBus??new ht,t=[],r=n.captureTraceGraph?new zn("thread-run"):void 0;e.subscribe(i=>{t.push(i),r?.record(i),n.onRuntimeEvent?.(i)});let{agent:s}=await De({...n,runtimeEventBus:e,onRuntimeEvent:void 0});return{output:await s.run(n.prompt),events:t,...r?{traceGraph:r.toGraph()}:{},tokenUsage:s.tokenUsage}}async function*yF(n){let e=n.runtimeEventBus??new ht,t=[],r=n.captureTraceGraph?new zn("thread-run-streamed"):void 0,s=[],o,i=!1,a,c;e.subscribe(u=>{t.push(u),r?.record(u),n.onRuntimeEvent?.(u),s.push(u),o?.(),o=void 0});let l=(async()=>{try{let{agent:u}=await De({...n,runtimeEventBus:e,onRuntimeEvent:void 0});a={output:await u.run(n.prompt),events:t,...r?{traceGraph:r.toGraph()}:{},tokenUsage:u.tokenUsage}}catch(u){c=u}finally{i=!0,o?.(),o=void 0}})();for(;!i||s.length>0;){let u=s.shift();if(u){yield u;continue}await new Promise(d=>{o=d})}if(await l,c)throw c;return a??{output:"",events:t,...r?{traceGraph:r.toGraph()}:{},tokenUsage:{input:0,output:0,total:0}}}Hn();var _c=class{constructor(e={}){this.options=e}stopping=!1;async start(e=process.stdin,t=process.stdout){let r=dA({input:e,crlfDelay:1/0});this.write(t,{jsonrpc:"2.0",method:"server.ready",params:{name:"xeno-app-server",protocolVersion:1}});for await(let s of r){if(this.stopping)break;let o=s.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch(a){this.write(t,this.error(null,-32700,"Parse error",a));continue}await this.handleRequest(i,t)}}stop(){this.stopping=!0}async handleJsonRpcRequest(e){let t=[],r={write(s){for(let o of s.split(/\r?\n/)){let i=o.trim();i&&t.push(JSON.parse(i))}return!0}};return await this.handleRequest(e,r),t}async handleRequest(e,t){try{if(e.method==="health"){this.write(t,this.success(e.id??null,{ok:!0}));return}if(e.method==="exec.start"){let r=vt(e.params),s=typeof r.command=="string"?r.command:"";if(!s.trim()){this.write(t,this.error(e.id??null,-32602,"exec.start requires params.command"));return}this.write(t,this.success(e.id??null,yt.start(s,{cwd:typeof r.cwd=="string"?r.cwd:void 0,timeoutMs:so(r.timeoutMs),maxOutputBytes:so(r.maxOutputBytes),env:pA(r.env)})));return}if(e.method==="exec.write"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"",o=typeof r.text=="string"?r.text:"";this.write(t,this.success(e.id??null,{ok:yt.writeStdin(s,o)}));return}if(e.method==="exec.output"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"";this.write(t,this.success(e.id??null,yt.readOutput(s)));return}if(e.method==="exec.output.delta"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"";this.write(t,this.success(e.id??null,yt.readOutputDelta(s,mA(r.cursor)??0,{maxChunks:so(r.maxChunks),maxBytes:so(r.maxBytes)})));return}if(e.method==="exec.terminate"){let r=vt(e.params),s=typeof r.processId=="string"?r.processId:"";this.write(t,this.success(e.id??null,{ok:yt.terminate(s)}));return}if(e.method==="exec.list"){this.write(t,this.success(e.id??null,yt.list()));return}if(e.method==="thread.run"){let r=vt(e.params),s=typeof r.prompt=="string"?r.prompt:"";if(!s.trim()){this.write(t,this.error(e.id??null,-32602,"thread.run requires params.prompt"));return}let o=vt(r.options),i=await Kg({...this.options.defaultAgentOptions,...o,prompt:s,onRuntimeEvent:a=>{this.write(t,{jsonrpc:"2.0",method:"runtime.event",params:a})}});this.write(t,this.success(e.id??null,i));return}if(e.method==="server.stop"){this.write(t,this.success(e.id??null,{ok:!0})),this.stop();return}this.write(t,this.error(e.id??null,-32601,`Unknown method: ${e.method}`))}catch(r){let s=r instanceof Error?r.message:String(r);this.write(t,this.error(e.id??null,-32e3,s))}}success(e,t){return{jsonrpc:"2.0",id:e,result:t}}error(e,t,r,s){return{jsonrpc:"2.0",id:e,error:{code:t,message:r,...s?{data:gA(s)}:{}}}}write(e,t){e.write(`${JSON.stringify(t)}
1148
1148
  `)}};function vt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:{}}function pA(n){if(typeof n!="object"||n===null||Array.isArray(n))return;let e=Object.entries(n).filter(t=>typeof t[0]=="string"&&(typeof t[1]=="string"||t[1]===void 0));return Object.fromEntries(e)}function so(n){let e=typeof n=="number"?n:Number.parseInt(String(n??""),10);if(!(!Number.isFinite(e)||e<=0))return Math.floor(e)}function mA(n){let e=typeof n=="number"?n:Number.parseInt(String(n??""),10);if(!(!Number.isFinite(e)||e<0))return Math.floor(e)}function gA(n){return n instanceof Error?{name:n.name,message:n.message,stack:n.stack}:{value:String(n)}}se();ee();Q();import*as St from"path";import{randomUUID as fA}from"crypto";var kt=class{sessionDir;sessionId;transcriptPath;markdownPath;workspaceMarkdownPath;markdownHeaderWritten=!1;workspaceHeaderWritten=!1;workspaceMirrorDisabled=!1;sequence=0;writeQueue=Promise.resolve();pendingWrites=0;constructor(e){this.sessionDir=e,this.sessionId=St.basename(e),this.transcriptPath=St.join(e,"transcript.jsonl"),this.markdownPath=St.join(e,"transcript.md"),this.workspaceMarkdownPath=void 0}async append(e){let t=fA(),r=new Date().toISOString(),s={id:t,timestamp:r,sequence:this.sequence++,...e};return this.writeQueue=this.writeQueue.then(async()=>{this.pendingWrites++;try{let o=JSON.stringify(s);await ot(this.transcriptPath,o);try{await this.appendMarkdownEvent(s)}catch(i){F("Transcript markdown mirror warning",i)}}finally{this.pendingWrites--}}),await this.writeQueue,t}stringify(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}formatMessageContent(e){return typeof e=="string"?e.trim().length>0?e:"(empty)":`\`\`\`json
1149
1149
  ${this.stringify(e)}
1150
1150
  \`\`\``}formatEventMarkdown(e){let t=e.timestamp;if(e.type==="user_message"||e.type==="assistant_message"){let r=e.data,s=e.type==="user_message"?"User":"Assistant";return[`## ${t} - ${s}`,"",this.formatMessageContent(r.content)].join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeno-corporation/xeno-agent-sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "XENO Agent SDK built from the same engine as XENO CODE",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",