@cuylabs/agent-core 0.6.0 → 0.8.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.
Files changed (74) hide show
  1. package/README.md +5 -1
  2. package/dist/{builder-BKkipazh.d.ts → builder-UpOWQMW3.d.ts} +2 -2
  3. package/dist/{chunk-3C4VKG4P.js → chunk-4BDA7DQY.js} +273 -807
  4. package/dist/chunk-7VKQ4WPB.js +73 -0
  5. package/dist/chunk-BFM2YHNM.js +222 -0
  6. package/dist/chunk-CAA7FHIH.js +280 -0
  7. package/dist/chunk-KUVSERLJ.js +50 -0
  8. package/dist/chunk-N6HWIEEA.js +423 -0
  9. package/dist/chunk-N7P4PN3O.js +84 -0
  10. package/dist/{chunk-QWFMX226.js → chunk-RFEKJKTO.js} +252 -13
  11. package/dist/chunk-RZITT45F.js +202 -0
  12. package/dist/{chunk-X635CM2F.js → chunk-SQU2AJHO.js} +1 -1
  13. package/dist/chunk-VNQBHPCT.js +398 -0
  14. package/dist/{chunk-QAQADS4X.js → chunk-WWYYNWEW.js} +2 -1
  15. package/dist/{chunk-O2ZCFQL6.js → chunk-YSLSEQ6B.js} +105 -220
  16. package/dist/context/index.js +1 -1
  17. package/dist/errors/index.d.ts +11 -0
  18. package/dist/errors/index.js +16 -0
  19. package/dist/events-CE72w8W4.d.ts +149 -0
  20. package/dist/host/index.d.ts +45 -0
  21. package/dist/host/index.js +8 -0
  22. package/dist/{index-DZQJD_hp.d.ts → index-CWSchSql.d.ts} +42 -51
  23. package/dist/index.d.ts +98 -190
  24. package/dist/index.js +476 -939
  25. package/dist/inference/index.d.ts +62 -0
  26. package/dist/inference/index.js +27 -0
  27. package/dist/llm-error-D93FNNLY.d.ts +32 -0
  28. package/dist/middleware/index.d.ts +246 -5
  29. package/dist/middleware/index.js +7 -3
  30. package/dist/models/index.d.ts +226 -3
  31. package/dist/models/index.js +41 -3
  32. package/dist/presets/index.d.ts +53 -0
  33. package/dist/presets/index.js +28 -0
  34. package/dist/prompt/index.d.ts +12 -7
  35. package/dist/reasoning/index.d.ts +53 -8
  36. package/dist/reasoning/index.js +2 -7
  37. package/dist/{registry-CuRWWtcT.d.ts → registry-DwYqsQkX.d.ts} +1 -1
  38. package/dist/{runner-G1wxEgac.d.ts → runner-e2YRcUoX.d.ts} +82 -148
  39. package/dist/runtime/index.d.ts +44 -7
  40. package/dist/runtime/index.js +16 -5
  41. package/dist/safety/index.d.ts +38 -0
  42. package/dist/safety/index.js +12 -0
  43. package/dist/scope/index.d.ts +10 -0
  44. package/dist/scope/index.js +14 -0
  45. package/dist/{session-manager-Uawm2Le7.d.ts → session-manager-B_CWGTsl.d.ts} +1 -1
  46. package/dist/signal/index.d.ts +28 -0
  47. package/dist/signal/index.js +6 -0
  48. package/dist/skill/index.d.ts +8 -5
  49. package/dist/storage/index.d.ts +2 -2
  50. package/dist/sub-agent/index.d.ts +17 -8
  51. package/dist/tool/index.d.ts +9 -4
  52. package/dist/tool/index.js +4 -3
  53. package/dist/tool-BHbyUAy3.d.ts +150 -0
  54. package/dist/{tool-DYp6-cC3.d.ts → tool-DLXAR9Ce.d.ts} +5 -99
  55. package/dist/tracking/index.d.ts +3 -1
  56. package/dist/{tool-pFAnJc5Y.d.ts → types-BfNpU8NS.d.ts} +1 -150
  57. package/dist/types-BnpEOYV-.d.ts +50 -0
  58. package/dist/types-CHiPh8U2.d.ts +100 -0
  59. package/dist/types-CQL-SvTn.d.ts +29 -0
  60. package/dist/types-CWm-7rvB.d.ts +55 -0
  61. package/dist/types-KKDrdU9Y.d.ts +325 -0
  62. package/dist/{resolver-DOfZ-xuk.d.ts → types-QA4WhEfz.d.ts} +1 -117
  63. package/dist/types-QKHHQLLq.d.ts +336 -0
  64. package/dist/types-YuWV4ag7.d.ts +72 -0
  65. package/package.json +74 -8
  66. package/dist/capabilities/index.d.ts +0 -97
  67. package/dist/capabilities/index.js +0 -46
  68. package/dist/chunk-6TDTQJ4P.js +0 -116
  69. package/dist/chunk-FG4MD5MU.js +0 -54
  70. package/dist/config-D2xeGEHK.d.ts +0 -52
  71. package/dist/identifiers-BLUxFqV_.d.ts +0 -12
  72. package/dist/index-ipP3_ztp.d.ts +0 -198
  73. package/dist/network-D76DS5ot.d.ts +0 -5
  74. package/dist/types-BWo810L_.d.ts +0 -648
@@ -1,15 +1,23 @@
1
1
  import { LanguageModel } from 'ai';
2
- import { R as ReasoningLevel } from './types-CQaXbRsS.js';
3
- import { T as Tool } from './tool-pFAnJc5Y.js';
4
- import { h as AgentMiddleware, e as StreamProvider, P as PromptConfig, A as AgentEvent, M as MiddlewareRunner } from './runner-G1wxEgac.js';
5
- import { g as SessionManager, c as SessionContext, f as SessionInfo } from './session-manager-Uawm2Le7.js';
6
- import { d as ToolHost } from './tool-DYp6-cC3.js';
2
+ import { P as Preset } from './types-BnpEOYV-.js';
3
+ import { T as Tool } from './tool-BHbyUAy3.js';
4
+ import { A as AgentMiddleware, d as StreamProvider, P as PromptConfig, M as MiddlewareRunner } from './runner-e2YRcUoX.js';
5
+ import { S as SessionManager, f as SessionContext, i as SessionInfo } from './session-manager-B_CWGTsl.js';
6
+ import { T as ToolHost } from './types-CHiPh8U2.js';
7
7
  import { T as TokenUsage, M as Message } from './messages-BYWGn8TY.js';
8
+ import { A as AgentEvent } from './events-CE72w8W4.js';
9
+ import { R as ReasoningLevel } from './types-CQaXbRsS.js';
8
10
  import { a as MCPManager } from './types-VQgymC1N.js';
11
+ import { A as AgentSignal } from './types-YuWV4ag7.js';
9
12
  import { U as UndoResult, T as TurnChangeTracker } from './tracker-DClqYqTj.js';
10
- import { P as PromptBuilder } from './builder-BKkipazh.js';
11
- import { x as DoomLoopHandler, H as PendingIntervention, I as InterventionController, q as AgentTurnStepRuntimeConfig } from './types-BWo810L_.js';
13
+ import { P as PromptBuilder } from './builder-UpOWQMW3.js';
14
+ import { P as PendingIntervention, g as InterventionController } from './types-KKDrdU9Y.js';
15
+ import { s as DoomLoopHandler, o as AgentTurnStepRuntimeConfig } from './types-QKHHQLLq.js';
12
16
 
17
+ /**
18
+ * Tools whose outputs should never be pruned automatically.
19
+ */
20
+ declare const PRUNE_PROTECTED_TOOLS: readonly ["skill"];
13
21
  /**
14
22
  * Configuration for automatic context compaction.
15
23
  */
@@ -151,51 +159,17 @@ interface AgentConfig {
151
159
  * Simplest way to enable tracing.
152
160
  */
153
161
  tracing?: TracingConfig;
154
- }
155
-
156
- /**
157
- * Agent preset - a reusable configuration profile.
158
- */
159
- interface Preset {
160
- /** Unique identifier for this preset */
161
- name: string;
162
- /** Human-readable description */
163
- description: string;
164
162
  /**
165
- * Tool allow patterns (glob-like).
166
- * If provided, only tools matching these patterns are candidates.
167
- */
168
- allowTools?: string[];
169
- /**
170
- * Tool deny patterns (glob-like).
171
- * Deny patterns apply only after allow matching, so explicit allows win.
172
- */
173
- denyTools?: string[];
174
- /**
175
- * Override system prompt.
176
- * Use `{basePrompt}` to include the parent's system prompt.
163
+ * Event signal for multi-consumer dispatch.
164
+ *
165
+ * Every event yielded by `chat()` is also emitted here, enabling
166
+ * passive observers (SSE routes, TUI renderers, plugins) to
167
+ * subscribe without consuming the primary generator.
168
+ *
169
+ * Defaults to an in-process `LocalSignal`. A distributed runtime
170
+ * can supply its own implementation to bridge events externally.
177
171
  */
178
- systemPrompt?: string;
179
- /** Override temperature (0-1). */
180
- temperature?: number;
181
- /** Override max steps. */
182
- maxSteps?: number;
183
- /** Override reasoning level. */
184
- reasoningLevel?: ReasoningLevel;
185
- /** Override model. */
186
- model?: LanguageModel;
187
- }
188
- /**
189
- * Result of applying a preset - ready for `fork()`.
190
- */
191
- interface AppliedPreset {
192
- name: string;
193
- systemPrompt?: string;
194
- tools?: Tool.AnyInfo[];
195
- temperature?: number;
196
- maxSteps?: number;
197
- reasoningLevel?: ReasoningLevel;
198
- model?: LanguageModel;
172
+ signal?: AgentSignal;
199
173
  }
200
174
 
201
175
  interface AgentForkOptions {
@@ -270,6 +244,8 @@ declare class Agent {
270
244
  private mcpManager?;
271
245
  /** Whether MCP has been connected (lazy init) */
272
246
  private mcpConnected;
247
+ /** Whether skill tools have been resolved (lazy init) */
248
+ private skillToolsResolved;
273
249
  /** Cached MCP tools (refreshed on connect) */
274
250
  private mcpToolsCache?;
275
251
  /** Prompt pipeline builder (when using layered prompt mode) */
@@ -284,7 +260,17 @@ declare class Agent {
284
260
  private telemetrySettings?;
285
261
  /** Tracing shutdown function (from `tracing` config auto-setup) */
286
262
  private tracingShutdown?;
263
+ /** Multi-consumer event dispatch */
264
+ private readonly _signal;
287
265
  constructor(config: AgentConstructionOptions);
266
+ /**
267
+ * Event signal — subscribe to events without consuming the generator.
268
+ *
269
+ * Every event yielded by `chat()` is also dispatched here, allowing
270
+ * multiple passive observers (SSE routes, TUI, plugins) to listen
271
+ * concurrently.
272
+ */
273
+ get signal(): AgentSignal;
288
274
  /** Agent name (identity for spans, Dapr workflows, etc.) */
289
275
  get name(): string;
290
276
  /** Working directory for file operations */
@@ -310,6 +296,11 @@ declare class Agent {
310
296
  * Check if current model supports reasoning
311
297
  */
312
298
  supportsReasoning(): boolean;
299
+ /**
300
+ * Ensure skill tools are registered when `prompt.skills` is configured.
301
+ * Lazy initialization — resolves the registry and adds tools on first use.
302
+ */
303
+ private ensureSkillTools;
313
304
  /**
314
305
  * Ensure MCP is connected and return tools
315
306
  * Lazy initialization - only connects on first use
@@ -1064,4 +1055,4 @@ declare class SubAgentTracker {
1064
1055
  */
1065
1056
  declare function createSubAgentTools(parent: Agent, config: SubAgentToolConfig): Tool.AnyInfo[];
1066
1057
 
1067
- export { type AppliedPreset as A, type CompactionConfig as C, DEFAULT_MAX_CONCURRENT as D, type Preset as P, type SubAgentCompletedResult as S, type TracingConfig as T, Agent as a, type AgentConfig as b, type AgentProfile as c, DEFAULT_MAX_SPAWN_DEPTH as d, DEFAULT_SESSION_TITLE_PREFIX as e, type SubAgentHandle as f, type SubAgentStatus as g, type SubAgentToolConfig as h, SubAgentTracker as i, type SubAgentUsage as j, createAgent as k, createSubAgentTools as l };
1058
+ export { type AgentConfig as A, type CompactionConfig as C, DEFAULT_MAX_CONCURRENT as D, PRUNE_PROTECTED_TOOLS as P, type SubAgentCompletedResult as S, type TracingConfig as T, Agent as a, type AgentProfile as b, DEFAULT_MAX_SPAWN_DEPTH as c, DEFAULT_SESSION_TITLE_PREFIX as d, type SubAgentHandle as e, type SubAgentStatus as f, type SubAgentToolConfig as g, SubAgentTracker as h, type SubAgentUsage as i, createAgent as j, createSubAgentTools as k };
package/dist/index.d.ts CHANGED
@@ -1,38 +1,56 @@
1
- import { P as Preset, A as AppliedPreset, a as Agent } from './index-DZQJD_hp.js';
2
- export { b as AgentConfig, c as AgentProfile, C as CompactionConfig, D as DEFAULT_MAX_CONCURRENT, d as DEFAULT_MAX_SPAWN_DEPTH, e as DEFAULT_SESSION_TITLE_PREFIX, S as SubAgentCompletedResult, f as SubAgentHandle, g as SubAgentStatus, h as SubAgentToolConfig, i as SubAgentTracker, j as SubAgentUsage, T as TracingConfig, k as createAgent, l as createSubAgentTools } from './index-DZQJD_hp.js';
3
- import { LanguageModel, ToolSet } from 'ai';
1
+ import { A as AgentConfig, a as Agent } from './index-CWSchSql.js';
2
+ export { b as AgentProfile, C as CompactionConfig, D as DEFAULT_MAX_CONCURRENT, c as DEFAULT_MAX_SPAWN_DEPTH, d as DEFAULT_SESSION_TITLE_PREFIX, P as PRUNE_PROTECTED_TOOLS, S as SubAgentCompletedResult, e as SubAgentHandle, f as SubAgentStatus, g as SubAgentToolConfig, h as SubAgentTracker, i as SubAgentUsage, T as TracingConfig, j as createAgent, k as createSubAgentTools } from './index-CWSchSql.js';
3
+ import { LanguageModel, Tool as Tool$1, TelemetrySettings, ModelMessage } from 'ai';
4
+ import { M as Message, T as TokenUsage } from './messages-BYWGn8TY.js';
5
+ export { A as AssistantMessage, a as MessageBase, b as MessageError, c as MessageRole, S as Session, d as SystemMessage, e as ToolMessage, U as UserMessage } from './messages-BYWGn8TY.js';
6
+ import { T as Tool } from './tool-BHbyUAy3.js';
7
+ export { C as CompatibleSchema, I as InferSchemaOutput, d as defineTool } from './tool-BHbyUAy3.js';
8
+ import { T as ToolHost } from './types-CHiPh8U2.js';
9
+ export { D as DirEntry, E as ExecOptions, a as ExecResult, F as FileStat } from './types-CHiPh8U2.js';
10
+ import { M as MiddlewareRunner, d as StreamProvider, E as EnhancedTools } from './runner-e2YRcUoX.js';
11
+ export { A as AgentMiddleware, f as AgentModelHooks, B as BlockedModelCall, g as EnvironmentInfo, I as InstructionFile, h as ModelCallContext, e as ModelCallInput, i as ModelCallOutput, c as ModelFamily, j as PluginCommand, k as PluginContext, l as PluginInit, a as PromptBuildContext, P as PromptConfig, b as PromptSection, S as StreamChunk, m as StreamProviderConfig, n as StreamProviderFactory, o as StreamProviderInput, p as StreamProviderResult, T as ToolCallDecision } from './runner-e2YRcUoX.js';
12
+ import { g as InterventionController } from './types-KKDrdU9Y.js';
13
+ export { A as AnyInferenceResult, a as AnyStreamResult, C as CustomStreamProvider, b as CustomStreamResult, D as DEFAULT_MAX_OUTPUT_TOKENS, h as DEFAULT_RETRY_CONFIG, c as InferenceCustomResult, d as InferenceStepInfo, I as InferenceStreamInput, e as InferenceStreamResult, L as LLMStreamInput, f as LLMStreamResult, O as OUTPUT_TOKEN_MAX, i as OnInterventionApplied, P as PendingIntervention, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, S as StepInfo, T as ToolExecutionMode, l as calculateDelay, m as createRetryHandler, n as createRetryState, s as shouldRetry, o as sleep, w as withRetry } from './types-KKDrdU9Y.js';
4
14
  import { R as ReasoningLevel } from './types-CQaXbRsS.js';
5
- export { a as ReasoningConfig } from './types-CQaXbRsS.js';
6
- import { E as ErrorCategory, T as ToolExecutionMode, L as LLMStreamInput, A as AnyStreamResult, P as ProcessorOptions, a as ProcessorOutput } from './types-BWo810L_.js';
7
- export { b as AgentTurnActiveToolCall, c as AgentTurnBoundaryMetadata, d as AgentTurnBoundarySnapshot, e as AgentTurnCommitApplier, f as AgentTurnCommitBatch, g as AgentTurnCommitOptions, h as AgentTurnEngine, i as AgentTurnEngineOptions, j as AgentTurnPhase, k as AgentTurnResolvedToolCall, l as AgentTurnState, m as AgentTurnStateAdvanceOptions, n as AgentTurnStepCommitSnapshot, o as AgentTurnStepCommitToolCall, p as AgentTurnStepCommitToolResult, q as AgentTurnStepRuntimeConfig, C as CommitOutputOptions, r as CommitStepOptions, s as CreateAgentTurnStateOptions, t as CreateAgentTurnStepCommitBatchOptions, u as CustomStreamProvider, v as CustomStreamResult, D as DEFAULT_RETRY_CONFIG, w as DoomLoopAction, x as DoomLoopHandler, y as DoomLoopRequest, I as InterventionController, z as LLMError, B as LLMErrorOptions, F as LLMStreamResult, O as OUTPUT_TOKEN_MAX, G as OnInterventionApplied, H as PendingIntervention, J as PrepareModelStepOptions, K as PreparedAgentModelStep, R as ResponseHeaders, M as RetryConfig, N as RetryHandlerOptions, Q as RetryState, S as RunModelStepOptions, U as RunToolBatchOptions, V as RunToolBatchResult, W as StepInfo, X as advanceAgentTurnState, Y as calculateDelay, Z as createAgentTurnEngine, _ as createAgentTurnState, $ as createRetryHandler, a0 as createRetryState, a1 as failAgentTurnState, a2 as shouldRetry, a3 as sleep, a4 as withRetry } from './types-BWo810L_.js';
8
- import { M as MiddlewareRunner } from './runner-G1wxEgac.js';
9
- export { A as AgentEvent, h as AgentMiddleware, i as AgentModelHooks, j as AgentStatus, g as AgentTurnBoundaryKind, k as ApprovalEvent, B as BlockedModelCall, E as EnhancedTools, l as EnvironmentInfo, I as InstructionFile, m as ModelCallContext, f as ModelCallInput, n as ModelCallOutput, c as ModelFamily, d as ProcessorResult, a as PromptBuildContext, P as PromptConfig, b as PromptSection, S as StreamChunk, o as StreamInput, e as StreamProvider, p as StreamProviderConfig, q as StreamProviderFactory, r as StreamProviderInput, s as StreamProviderResult, T as ToolCallDecision } from './runner-G1wxEgac.js';
10
- import { T as TokenUsage } from './messages-BYWGn8TY.js';
11
- export { A as AssistantMessage, M as Message, a as MessageBase, b as MessageError, c as MessageRole, S as Session, d as SystemMessage, e as ToolMessage, U as UserMessage } from './messages-BYWGn8TY.js';
12
- import { T as Tool } from './tool-pFAnJc5Y.js';
13
- export { C as CompatibleSchema, I as InferSchemaOutput, R as RemoteSkillEntry, e as RemoteSkillIndex, d as SkillConfig, b as SkillContent, f as SkillDiscoveryError, S as SkillDiscoveryResult, a as SkillMetadata, c as SkillResource, g as SkillResourceType, h as SkillScope, i as SkillSource, j as SkillSourceType, k as defineTool } from './tool-pFAnJc5Y.js';
14
- import { e as TurnTrackerContext, d as ToolHost } from './tool-DYp6-cC3.js';
15
- export { D as DirEntry, E as ExecOptions, f as ExecResult, F as FileOperationMeta, g as FileStat, N as NormalizedToolReplayPolicy, b as ToolContext, T as ToolMetadata, h as ToolReplayMode, a as ToolReplayPolicy, c as ToolResult, i as ToolSideEffectLevel } from './tool-DYp6-cC3.js';
16
- export { ContextLimits, ContextManager, DEFAULT_CONTEXT_LIMITS, PruneContextOptions, PruneResult, SummarizationOptions, estimateConversationTokens, estimateMessageTokens, estimateTokens, findCutPoint, generateSummary, isContextOverflowing, pruneContext, pruneToolResults, shouldPruneContext } from './context/index.js';
17
- export { F as FileBaseline, T as TurnChangeTracker, a as TurnFileChange, b as TurnSummary, c as TurnTrackerConfig, U as UndoResult, d as createTurnTracker } from './tracker-DClqYqTj.js';
18
- export { DEFAULT_INSTRUCTION_PATTERNS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_FILE_SIZE, PRIORITY_BASE, PRIORITY_CUSTOM, PRIORITY_ENVIRONMENT, PRIORITY_INSTRUCTIONS, PRIORITY_OVERRIDE, PRIORITY_SKILLS, detectModelFamily, discoverInstructions, formatEnvironment, formatInstructions, gatherEnvironment, getAvailableFamilies, getTemplate, loadGlobalInstructions, summarizeEnvironment } from './prompt/index.js';
19
- export { P as PromptBuilder, c as createPromptBuilder } from './builder-BKkipazh.js';
20
- export { c as ModelCapabilities, d as ModelCapabilityResolver, M as ModelEntry, N as NetworkStatus, P as ProviderCompatibility, R as ResolverOptions, g as configureResolver, h as getDefaultResolver } from './resolver-DOfZ-xuk.js';
21
- export { g as getModelId, a as getProviderId } from './identifiers-BLUxFqV_.js';
22
- export { g as getNetworkStatus } from './network-D76DS5ot.js';
23
- export { b as buildReasoningOptions, a as buildReasoningOptionsSync, g as getReasoningConfig, c as getReasoningConfigSync, s as supportsReasoning, d as supportsReasoningSync } from './config-D2xeGEHK.js';
24
- export { B as BranchEntry, C as CompactionEntry, a as CreateSessionOptions, F as FileEntry, M as MessageEntry, b as MetadataEntry, S as STORAGE_VERSION, c as SessionContext, d as SessionEntry, e as SessionHeader, f as SessionInfo, g as SessionManager, h as SessionStorage } from './session-manager-Uawm2Le7.js';
25
- export { FileStorage, FileStorageOptions, MemoryStorage, buildMessagesFromEntries, configureDefaultSessionManager, deserializeMessage, generateEntryId, getDataDir, getDefaultSessionManager, getLeafId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL } from './storage/index.js';
26
- export { AgentTaskChatAdapter, AgentTaskCheckpointReason, AgentTaskCheckpointStrategy, AgentTaskCheckpointStrategyInput, AgentTaskExecutionCheckpoint, AgentTaskExecutionContext, AgentTaskExecutionRun, AgentTaskExecutionSnapshot, AgentTaskObserver, AgentTaskPayload, AgentTaskResult, AgentTaskRunner, AgentTaskRunnerOptions, AgentWorkflowAssistantMessageSnapshot, AgentWorkflowCommitResult, AgentWorkflowMessageSnapshot, AgentWorkflowModelStepPlan, AgentWorkflowModelStepResult, AgentWorkflowOperationPlan, AgentWorkflowOutputCommitPlan, AgentWorkflowReplayDecision, AgentWorkflowStepCommitPlan, AgentWorkflowSystemMessageSnapshot, AgentWorkflowToolBatchResult, AgentWorkflowToolCallPlan, AgentWorkflowToolCallResult, AgentWorkflowToolCallSnapshot, AgentWorkflowToolMessageSnapshot, AgentWorkflowTurnPhase, AgentWorkflowTurnState, AgentWorkflowUserMessageSnapshot, CreateAgentWorkflowTurnStateOptions, applyAgentWorkflowCommitResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolBatchResult, applyAgentWorkflowToolCallResult, cloneAgentWorkflowTurnState, commitOutput, commitStep, convertAgentMessagesToModelMessages, createAgentTaskRunner, createAgentTurnStepCommitBatch, createAgentWorkflowTurnState, defaultAgentTaskCheckpointStrategy, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, prepareModelStep, recordAgentWorkflowReplayDecision, restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, runModelStep, runToolBatch, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages } from './runtime/index.js';
27
- import { R as RiskLevel, A as ApprovalConfig, a as ApprovalRule } from './index-ipP3_ztp.js';
28
- export { b as ApprovalAction, c as ApprovalMiddlewareConfig, d as ApprovalRequest, O as OtelMiddlewareConfig, T as TelemetryConfig, e as TelemetryConfigResult, f as approvalMiddleware, g as createTelemetryConfig, o as otelMiddleware } from './index-ipP3_ztp.js';
29
- export { ChangeSet, Checkpoint, CheckpointConfig, CheckpointManager, FileChange, TrackedToolMetadata, clearCheckpoints, createCheckpointManager, extractFilePathsFromArgs, shouldCaptureBaseline, withFileTracking } from './tracking/index.js';
15
+ export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from './types-CQaXbRsS.js';
16
+ import { ContextManager } from './context/index.js';
17
+ export { ContextLimits, DEFAULT_CONTEXT_LIMITS, PruneContextOptions, PruneResult, SummarizationOptions, estimateConversationTokens, estimateMessageTokens, estimateTokens, findCutPoint, generateSummary, isContextOverflowing, pruneContext, pruneToolResults, shouldPruneContext } from './context/index.js';
18
+ import { T as TurnChangeTracker } from './tracker-DClqYqTj.js';
19
+ export { F as FileBaseline, a as TurnFileChange, b as TurnSummary, c as TurnTrackerConfig, U as UndoResult, d as createTurnTracker } from './tracker-DClqYqTj.js';
20
+ import { P as PromptBuilder } from './builder-UpOWQMW3.js';
21
+ export { c as createPromptBuilder } from './builder-UpOWQMW3.js';
22
+ import { S as SessionManager } from './session-manager-B_CWGTsl.js';
23
+ export { B as BranchEntry, C as CompactionEntry, a as ConfigChangeEntry, b as CreateSessionOptions, E as EntryBase, F as FileEntry, M as MessageEntry, c as MetadataEntry, d as STORAGE_VERSION, e as SerializedMessage, f as SessionContext, g as SessionEntry, h as SessionHeader, i as SessionInfo, j as SessionStorage } from './session-manager-B_CWGTsl.js';
24
+ import { A as AgentEvent } from './events-CE72w8W4.js';
25
+ export { a as AgentStatus, b as AgentTurnBoundaryKind, c as ApprovalEvent, P as ProcessorResult, S as StepProcessingResult, d as StreamInput } from './events-CE72w8W4.js';
26
+ export { A as AgentTurnActiveToolCall, a as AgentTurnBoundaryMetadata, b as AgentTurnBoundarySnapshot, c as AgentTurnCommitApplier, d as AgentTurnCommitBatch, e as AgentTurnCommitOptions, f as AgentTurnEngine, g as AgentTurnEngineOptions, h as AgentTurnPhase, i as AgentTurnResolvedToolCall, j as AgentTurnState, k as AgentTurnStateAdvanceOptions, l as AgentTurnStepCommitSnapshot, m as AgentTurnStepCommitToolCall, n as AgentTurnStepCommitToolResult, o as AgentTurnStepRuntimeConfig, C as CommitOutputOptions, p as CommitStepOptions, q as CreateAgentTurnStateOptions, r as CreateAgentTurnStepCommitBatchOptions, D as DoomLoopAction, s as DoomLoopHandler, t as DoomLoopRequest, P as PrepareModelStepOptions, u as PreparedAgentModelStep, v as ProcessorOptions, w as ProcessorOutput, R as RunModelStepOptions, x as RunToolBatchOptions, y as RunToolBatchResult, S as StepProcessingOptions, z as StepProcessingOutput, B as advanceAgentTurnState, E as createAgentTurnEngine, F as createAgentTurnState, G as failAgentTurnState } from './types-QKHHQLLq.js';
27
+ export { ExecuteAgentToolCallOptions, ExecuteAgentToolCallResult, MAX_BYTES, MAX_LINES, TRUNCATE_DIR, TRUNCATE_GLOB, ToolRegistry, ToolSpec, TruncateResult, defaultRegistry, executeAgentToolCall, formatSize, normalizeToolReplayPolicy, truncateOutput } from './tool/index.js';
28
+ export { AdapterSettings, CacheCapabilitySource, CapabilityCache, CapabilityOverrides, Directory, EngineSpec, ModelCapabilityResolver, Directory as ModelDirectory, Resolver as ModelResolver, ModelSpec, NetworkStatus, PatternCapabilitySource, RemoteCapabilityFetcher, RemoteCapabilitySource, ResolutionResult, Resolver, SyncResolver, applyCapabilityOverride, configureResolver, createResolver, extractModelId, extractProvider, findCapabilityOverride, getDefaultResolver, getModelId, getNetworkStatus, getProviderCompatibility, getProviderId, inferContextWindow, inferProvider, likelySupportsReasoning } from './models/index.js';
29
+ export { C as CapabilitySource, D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, M as ModelCapabilities, a as ModelEntry, O as OutputModality, P as ProviderCompatibility, R as ResolverOptions, S as SourcePriority, b as SourceResult } from './types-QA4WhEfz.js';
30
30
  export { H as HttpTransportConfig, M as MCPConfig, a as MCPManager, b as MCPPrompt, c as MCPResource, d as MCPServerConfig, e as MCPServerStatus, S as SseTransportConfig, f as StdioTransportConfig } from './types-VQgymC1N.js';
31
31
  export { createMCPManager, defineServer, httpServer, sseServer, stdioServer } from './mcp/index.js';
32
+ export { AgentTaskChatAdapter, AgentTaskCheckpointReason, AgentTaskCheckpointStrategy, AgentTaskCheckpointStrategyInput, AgentTaskExecutionCheckpoint, AgentTaskExecutionContext, AgentTaskExecutionRun, AgentTaskExecutionSnapshot, AgentTaskObserver, AgentTaskPayload, AgentTaskResult, AgentTaskRunner, AgentTaskRunnerOptions, AgentWorkflowAssistantMessageSnapshot, AgentWorkflowCommitResult, AgentWorkflowMessageSnapshot, AgentWorkflowModelStepPlan, AgentWorkflowModelStepResult, AgentWorkflowOperationPlan, AgentWorkflowOutputCommitPlan, AgentWorkflowReplayDecision, AgentWorkflowStepCommitPlan, AgentWorkflowSystemMessageSnapshot, AgentWorkflowToolBatchResult, AgentWorkflowToolCallPlan, AgentWorkflowToolCallResult, AgentWorkflowToolCallSnapshot, AgentWorkflowToolMessageSnapshot, AgentWorkflowTurnPhase, AgentWorkflowTurnState, AgentWorkflowUserMessageSnapshot, ContextOverflowError, CreateAgentWorkflowTurnStateOptions, DoomLoopError, applyAgentWorkflowCommitResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolBatchResult, applyAgentWorkflowToolCallResult, cloneAgentWorkflowTurnState, commitOutput, commitStep, convertAgentMessagesToModelMessages, createAgentTaskRunner, createAgentTurnStepCommitBatch, createAgentWorkflowTurnState, defaultAgentTaskCheckpointStrategy, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, prepareModelStep, processStepStream, processStream, recordAgentWorkflowReplayDecision, restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, runModelStep, runToolBatch, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages } from './runtime/index.js';
33
+ export { ApprovalMiddlewareConfig, CacheTTL, OtelMiddlewareConfig, PromptCacheConfig, TelemetryConfig, TelemetryConfigResult, approvalMiddleware, createTelemetryConfig, otelMiddleware, promptCacheMiddleware } from './middleware/index.js';
34
+ export { DEFAULT_INSTRUCTION_PATTERNS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_FILE_SIZE, PRIORITY_BASE, PRIORITY_CUSTOM, PRIORITY_ENVIRONMENT, PRIORITY_INSTRUCTIONS, PRIORITY_OVERRIDE, PRIORITY_SKILLS, detectModelFamily, discoverInstructions, formatEnvironment, formatInstructions, gatherEnvironment, getAvailableFamilies, getTemplate, loadGlobalInstructions, summarizeEnvironment } from './prompt/index.js';
35
+ export { R as RemoteSkillEntry, e as RemoteSkillIndex, d as SkillConfig, b as SkillContent, f as SkillDiscoveryError, S as SkillDiscoveryResult, a as SkillMetadata, c as SkillResource, g as SkillResourceType, h as SkillScope, i as SkillSource, j as SkillSourceType } from './types-BfNpU8NS.js';
36
+ export { buildAnthropicOptions, buildBedrockOptions, buildGoogleOptions, buildGroqOptions, buildOpenAIOptions, buildOpenRouterOptions, buildReasoningOptions, buildReasoningOptionsSync, buildXAIOptions, getProviderOptionsKey, getReasoningConfig, getReasoningConfigSync, supportsReasoning, supportsReasoningSync } from './reasoning/index.js';
37
+ export { A as AppliedPreset, P as Preset } from './types-BnpEOYV-.js';
38
+ export { Presets, applyPreset, careful, code, createPreset, explore, filterTools, mergePresets, plan, quick, review, watch } from './presets/index.js';
39
+ export { DockerHostOptions, dockerHost, localHost } from './host/index.js';
40
+ export { a as Scope, b as ScopeAttributeValue, c as ScopeAttributes, d as ScopeKind, e as ScopeOptions, S as ScopeSnapshot } from './types-CQL-SvTn.js';
41
+ export { createScope, currentScope, restoreScope, snapshotScope, withinScope } from './scope/index.js';
42
+ export { Inference, LLM, buildToolSet, stream, streamOnce, streamStep } from './inference/index.js';
43
+ export { FileStorage, FileStorageOptions, MemoryStorage, buildEntryPath, buildMessagesFromEntries, configureDefaultSessionManager, createMessageEntry, createMetadataEntry, deserializeMessage, extractSessionInfo, generateEntryId, getDataDir, getDefaultSessionManager, getGitRootHash, getLeafId, getProjectId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL, toJSONLBatch } from './storage/index.js';
44
+ export { ChangeSet, Checkpoint, CheckpointConfig, CheckpointManager, FileChange, TrackedToolMetadata, clearCheckpoints, createCheckpointManager, extractFilePathsFromArgs, shouldCaptureBaseline, withFileTracking } from './tracking/index.js';
45
+ export { A as ApprovalAction, a as ApprovalConfig, b as ApprovalRequest, c as ApprovalRule, R as RiskLevel } from './types-CWm-7rvB.js';
46
+ export { ApprovalDeniedError, ApprovalHandler, ApprovalTimeoutError, createApprovalHandler, getToolRisk } from './safety/index.js';
47
+ export { E as ErrorCategory, L as LLMError, a as LLMErrorOptions, R as ResponseHeaders } from './llm-error-D93FNNLY.js';
48
+ export { getErrorCategory, getRetryDelay, isRetryable, isRetryableCategory, parseRetryDelay } from './errors/index.js';
32
49
  export { DEFAULT_EXTERNAL_DIRS, DEFAULT_MAX_SCAN_DEPTH, DEFAULT_SKILL_MAX_SIZE, SKILL_FILENAME, createSkillResourceTool, createSkillTool, createSkillTools, discoverSkills, inferResourceType, loadResourceContent, loadSkillContent, loadSkillMetadata, parseFrontmatter } from './skill/index.js';
33
- export { S as SkillRegistry, c as createSkillRegistry, e as emptySkillRegistry } from './registry-CuRWWtcT.js';
34
- export { AdapterSettings, EngineSpec, Directory as ModelDirectory, Resolver as ModelResolver, ModelSpec, SyncResolver, createResolver } from './models/index.js';
35
- export { ExecuteAgentToolCallOptions, ExecuteAgentToolCallResult, MAX_BYTES, MAX_LINES, TRUNCATE_DIR, TRUNCATE_GLOB, ToolRegistry, ToolSpec, TruncateResult, defaultRegistry, executeAgentToolCall, formatSize, normalizeToolReplayPolicy, truncateOutput } from './tool/index.js';
50
+ export { S as SkillRegistry, c as createSkillRegistry, e as emptySkillRegistry } from './registry-DwYqsQkX.js';
51
+ export { A as AgentSignal, E as EventOf, T as TypedHandler, U as Unsubscribe, W as WildcardHandler } from './types-YuWV4ag7.js';
52
+ export { LocalSignal } from './signal/index.js';
53
+ export { F as FileOperationMeta, N as NormalizedToolReplayPolicy, b as ToolContext, T as ToolMetadata, e as ToolReplayMode, a as ToolReplayPolicy, c as ToolResult, f as ToolSideEffectLevel, d as TurnTrackerContext } from './tool-DLXAR9Ce.js';
36
54
  import 'zod';
37
55
  import '@ai-sdk/provider-utils';
38
56
 
@@ -49,106 +67,34 @@ interface AgentState {
49
67
  error?: Error;
50
68
  }
51
69
 
52
- /**
53
- * Filter tools using preset allow/deny patterns.
54
- *
55
- * Explicit allow matches win over deny matches. This lets presets define a
56
- * broad deny rule like `"*"` and then carve out a safe allow-list.
57
- */
58
- declare function filterTools(tools: Tool.AnyInfo[], options: {
59
- allow?: string[];
60
- deny?: string[];
61
- }): Tool.AnyInfo[];
62
-
63
- /**
64
- * Apply a preset to available tools and a parent system prompt.
65
- */
66
- declare function applyPreset(preset: Preset, availableTools: Tool.AnyInfo[], baseSystemPrompt?: string): AppliedPreset;
67
- /**
68
- * Merge multiple presets. Later presets override earlier scalar values.
69
- */
70
- declare function mergePresets(...presets: Preset[]): Preset;
71
- /**
72
- * Create a custom preset with sensible defaults.
73
- */
74
- declare function createPreset(options: Partial<Preset> & {
75
- name: string;
76
- }): Preset;
77
-
78
- declare const Presets: {
79
- readonly explore: Preset;
80
- readonly plan: Preset;
81
- readonly review: Preset;
82
- readonly quick: Preset;
83
- readonly careful: Preset;
84
- readonly code: Preset;
85
- readonly watch: Preset;
86
- };
87
-
88
- /**
89
- * Doom loop error thrown when repeated tool calls are detected.
90
- */
91
- declare class DoomLoopError extends Error {
92
- readonly toolName: string;
93
- readonly repeatCount: number;
94
- readonly input: unknown;
95
- constructor(toolName: string, repeatCount: number, input: unknown);
96
- }
97
-
98
- /**
99
- * Context overflow error.
100
- */
101
- declare class ContextOverflowError extends Error {
102
- readonly inputTokens: number;
103
- readonly limit: number;
104
- constructor(inputTokens: number, limit: number);
105
- }
106
-
107
- declare function isRetryableCategory(category: ErrorCategory): boolean;
108
-
109
- declare function isRetryable(error: unknown): boolean;
110
- declare function getRetryDelay(error: unknown): number | undefined;
111
- declare function getErrorCategory(error: unknown): ErrorCategory;
112
-
113
- /**
114
- * Build a Vercel AI SDK `ToolSet` from `Tool.Info` definitions.
115
- */
116
- declare function buildToolSet(options: {
117
- tools: Record<string, Tool.Info>;
118
- cwd: string;
119
- sessionID: string;
120
- messageID: string;
70
+ /** Everything the chat loop needs from the Agent instance. */
71
+ interface ChatLoopDeps {
72
+ sessionId: string;
73
+ message: string;
121
74
  abort: AbortSignal;
122
- turnTracker?: TurnTrackerContext;
123
- host?: ToolHost;
124
- middleware?: MiddlewareRunner;
125
- executionMode?: ToolExecutionMode;
126
- }): Promise<ToolSet>;
127
-
128
- /**
129
- * Create a stream for LLM completion with optional retry support.
130
- */
131
- declare function stream(input: LLMStreamInput): Promise<AnyStreamResult>;
132
- /**
133
- * Create a stream without retry.
134
- */
135
- declare function streamOnce(input: LLMStreamInput): Promise<AnyStreamResult>;
136
- /**
137
- * Create a single-step stream.
138
- */
139
- declare function streamStep(input: LLMStreamInput): Promise<AnyStreamResult>;
140
-
141
- declare const LLM: {
142
- readonly buildToolSet: typeof buildToolSet;
143
- readonly stream: typeof stream;
144
- readonly streamOnce: typeof streamOnce;
145
- readonly streamStep: typeof streamStep;
146
- };
75
+ systemOverride?: string;
76
+ sessions: SessionManager;
77
+ tools: Record<string, Tool.Info>;
78
+ config: Required<Pick<AgentConfig, "model" | "systemPrompt" | "cwd" | "maxOutputTokens" | "maxSteps">> & AgentConfig;
79
+ turnTracker: TurnChangeTracker;
80
+ interventionCtrl: InterventionController;
81
+ middlewareRunner: MiddlewareRunner;
82
+ contextManager: ContextManager;
83
+ rememberedDoomLoopTools: Set<string>;
84
+ reasoningLevel: ReasoningLevel;
85
+ promptBuilder?: PromptBuilder;
86
+ host: ToolHost;
87
+ mcpTools: Record<string, Tool$1>;
88
+ telemetrySettings?: TelemetrySettings;
89
+ toModelMessages: (messages: Message[]) => ModelMessage[];
90
+ setIsStreaming: (value: boolean) => void;
91
+ }
147
92
 
148
93
  /**
149
- * Process an LLM stream and emit events.
94
+ * Run the core chat loop: input commit → step loop → output commit →
95
+ * auto-compaction → turn summary → complete.
150
96
  */
151
- declare function processStream(stream: AnyStreamResult, options: ProcessorOptions): Promise<ProcessorOutput>;
97
+ declare function runChatLoop(deps: ChatLoopDeps): AsyncGenerator<AgentEvent>;
152
98
 
153
99
  /**
154
100
  * Concurrent sub-agent execution.
@@ -211,78 +157,40 @@ declare function runConcurrent(tasks: Array<{
211
157
  }): Promise<SubAgentResult[]>;
212
158
 
213
159
  /**
214
- * Get the risk level for a tool.
215
- */
216
- declare function getToolRisk(tool: string, customRisks?: Record<string, RiskLevel>): RiskLevel;
217
-
218
- /**
219
- * Thrown when a user or rule denies an operation.
160
+ * Agent defaults constants used by the Agent constructor.
220
161
  */
221
- declare class ApprovalDeniedError extends Error {
222
- readonly tool: string;
223
- readonly args: unknown;
224
- constructor(tool: string, args: unknown, message?: string);
225
- }
226
162
  /**
227
- * Thrown when an approval request times out.
163
+ * Generic fallback system prompt.
164
+ *
165
+ * Only used when the consumer provides a flat `systemPrompt` string
166
+ * without any value (i.e. the field exists but is empty/undefined).
167
+ * When the prompt pipeline is active, this is never used.
168
+ *
169
+ * Domain-specific prompts (coding, browsing, etc.) belong in
170
+ * consumer packages like agent-code, not here.
228
171
  */
229
- declare class ApprovalTimeoutError extends Error {
230
- readonly tool: string;
231
- readonly timeoutMs: number;
232
- constructor(tool: string, timeoutMs: number);
233
- }
172
+ declare const DEFAULT_SYSTEM_PROMPT = "You are a capable AI assistant with access to tools.\n\nThink step by step about what you need to do.\nUse the available tools to accomplish tasks.\nVerify your results after each action.\n\nIf a tool fails, try an alternative approach \u2014 do not give up after a single error.\nKeep working until the task is fully resolved or you have exhausted all options.";
173
+ /** Default max steps */
174
+ declare const DEFAULT_MAX_STEPS = 50;
175
+ /** Default max output tokens */
176
+ declare const DEFAULT_MAX_TOKENS = 32000;
234
177
 
235
178
  /**
236
- * Creates an approval handler for managing tool execution permissions.
179
+ * Check if a model requires a custom stream provider.
237
180
  */
238
- declare function createApprovalHandler(config?: ApprovalConfig): {
239
- request: (sessionId: string, tool: string, args: unknown, customRisks?: Record<string, RiskLevel>) => Promise<void>;
240
- cancelAll: (reason?: string) => void;
241
- addRule: (rule: ApprovalRule) => void;
242
- getRules: () => readonly ApprovalRule[];
243
- clearSessionRules: () => void;
244
- };
245
- type ApprovalHandler = ReturnType<typeof createApprovalHandler>;
246
-
181
+ declare function needsCustomStreamProvider(model: LanguageModel, customPatterns?: string[]): boolean;
247
182
  /**
248
- * LocalHost executes tools on the local machine.
249
- *
250
- * Default ToolHost implementation. Uses Node's `child_process.spawn`
251
- * for commands and `node:fs/promises` for file operations.
183
+ * Check if tools array has stream provider factory attached.
252
184
  */
253
-
185
+ declare function hasStreamProviderFactory(tools: unknown): tools is EnhancedTools & {
186
+ __streamProviderFactory: NonNullable<EnhancedTools["__streamProviderFactory"]>;
187
+ };
254
188
  /**
255
- * Create a ToolHost that runs everything on the local machine.
189
+ * Auto-detect and configure stream provider from model and tools.
256
190
  *
257
- * @param defaultCwd Working directory for commands when none is specified.
258
- * Defaults to `process.cwd()`.
259
- */
260
- declare function localHost(defaultCwd?: string): ToolHost;
261
-
262
- /**
263
- * Configuration for creating a Docker-backed `ToolHost`.
191
+ * Returns the configured stream provider, or undefined if standard
192
+ * AI SDK streaming should be used.
264
193
  */
265
- interface DockerHostOptions {
266
- /**
267
- * The container to connect to. Either:
268
- * - A string container name or ID
269
- * - A Dockerode `Container`-like object
270
- */
271
- container: string | {
272
- id: string;
273
- modem?: unknown;
274
- };
275
- /** User to run commands as inside the container. */
276
- user?: string;
277
- /** Default working directory inside the container. */
278
- workdir?: string;
279
- /**
280
- * Dockerode constructor options.
281
- * Only used when `container` is a string.
282
- */
283
- dockerOptions?: Record<string, unknown>;
284
- }
285
-
286
- declare function dockerHost(options: DockerHostOptions): Promise<ToolHost>;
194
+ declare function autoDetectStreamProvider(model: LanguageModel, tools: unknown, explicitProvider: unknown): StreamProvider | undefined;
287
195
 
288
- export { Agent, type AgentState, AnyStreamResult, AppliedPreset, ApprovalConfig, ApprovalDeniedError, type ApprovalHandler, ApprovalRule, ApprovalTimeoutError, ContextOverflowError, type DockerHostOptions, DoomLoopError, ErrorCategory, LLM, LLMStreamInput, MiddlewareRunner, Preset, Presets, ProcessorOptions, ProcessorOutput, ReasoningLevel, RiskLevel, type SubAgentResult, TokenUsage, Tool, ToolHost, TurnTrackerContext, applyPreset, createApprovalHandler, createPreset, dockerHost, filterTools, getErrorCategory, getRetryDelay, getToolRisk, isRetryable, isRetryableCategory, localHost, mergePresets, processStream, runConcurrent };
196
+ export { Agent, AgentConfig, AgentEvent, type AgentState, type ChatLoopDeps, ContextManager, DEFAULT_MAX_STEPS, DEFAULT_MAX_TOKENS, DEFAULT_SYSTEM_PROMPT, EnhancedTools, InterventionController, Message, MiddlewareRunner, PromptBuilder, ReasoningLevel, SessionManager, StreamProvider, type SubAgentResult, TokenUsage, Tool, ToolHost, TurnChangeTracker, autoDetectStreamProvider, hasStreamProviderFactory, needsCustomStreamProvider, runChatLoop, runConcurrent };