Skip to content

event_emitter

Class info

Classes

Name Children Inherits
AgentEventEmitter
llmling_agent.agent.event_emitter
Event emitter delegate that automatically injects context.
    LocationContentItem
    llmling_agent.agent.events
    A file location being accessed or modified.

      🛈 DocStrings

      Event emitter delegate for AgentContext with fluent API.

      AgentEventEmitter

      Event emitter delegate that automatically injects context.

      Provides a fluent, developer-friendly API for emitting domain events with context (tool_call_id, etc.) automatically injected.

      Source code in src/llmling_agent/agent/event_emitter.py
       17
       18
       19
       20
       21
       22
       23
       24
       25
       26
       27
       28
       29
       30
       31
       32
       33
       34
       35
       36
       37
       38
       39
       40
       41
       42
       43
       44
       45
       46
       47
       48
       49
       50
       51
       52
       53
       54
       55
       56
       57
       58
       59
       60
       61
       62
       63
       64
       65
       66
       67
       68
       69
       70
       71
       72
       73
       74
       75
       76
       77
       78
       79
       80
       81
       82
       83
       84
       85
       86
       87
       88
       89
       90
       91
       92
       93
       94
       95
       96
       97
       98
       99
      100
      101
      102
      103
      104
      105
      106
      107
      108
      109
      110
      111
      112
      113
      114
      115
      116
      117
      118
      119
      120
      121
      122
      123
      124
      125
      126
      127
      128
      129
      130
      131
      132
      133
      134
      135
      136
      137
      138
      139
      140
      141
      142
      143
      144
      145
      146
      147
      148
      149
      150
      151
      152
      153
      154
      155
      156
      157
      158
      159
      160
      161
      162
      163
      164
      165
      166
      167
      168
      169
      170
      171
      172
      173
      174
      175
      176
      177
      178
      179
      180
      181
      182
      183
      184
      185
      186
      187
      188
      189
      190
      191
      192
      193
      194
      195
      196
      197
      198
      199
      200
      201
      202
      203
      204
      205
      206
      207
      208
      209
      210
      211
      212
      213
      214
      215
      216
      217
      218
      219
      220
      221
      222
      223
      224
      225
      226
      227
      228
      229
      230
      231
      232
      233
      234
      235
      236
      237
      238
      239
      240
      241
      242
      243
      244
      245
      246
      247
      248
      249
      250
      251
      252
      253
      254
      255
      256
      257
      258
      259
      260
      261
      262
      263
      264
      265
      266
      267
      268
      269
      270
      271
      272
      273
      274
      275
      276
      277
      278
      279
      280
      281
      282
      283
      284
      285
      286
      287
      288
      289
      290
      291
      292
      293
      294
      295
      296
      297
      298
      299
      300
      301
      302
      303
      304
      305
      306
      307
      308
      309
      310
      311
      312
      313
      314
      315
      316
      317
      318
      319
      320
      321
      322
      323
      324
      325
      326
      327
      328
      329
      330
      331
      332
      333
      334
      335
      class AgentEventEmitter:
          """Event emitter delegate that automatically injects context.
      
          Provides a fluent, developer-friendly API for emitting domain events
          with context (tool_call_id, etc.) automatically injected.
          """
      
          def __init__(self, context: AgentContext) -> None:
              """Initialize event emitter with agent context.
      
              Args:
                  context: Agent context to extract metadata from
              """
              self._context = context
      
          async def file_operation(
              self,
              operation: Literal["read", "write", "delete", "list", "edit"],
              path: str,
              success: bool,
              error: str | None = None,
              size: int | None = None,
              title: str | None = None,
              kind: str | None = None,
              locations: list[str] | None = None,
              raw_output: Any | None = None,
          ) -> None:
              """Emit file operation event with rich metadata.
      
              Args:
                  operation: The filesystem operation performed
                  path: The file/directory path that was operated on
                  success: Whether the operation completed successfully
                  error: Error message if operation failed
                  size: Size of file in bytes (for successful operations)
                  title: Display title for the operation
                  kind: Tool operation kind (edit, read, write, etc.)
                  locations: File paths affected by the operation
                  raw_output: Tool result data for failed operations
              """
              from llmling_agent.agent.events import FileOperationEvent
      
              event = FileOperationEvent(
                  operation=operation,
                  path=path,
                  success=success,
                  error=error,
                  size=size,
                  tool_call_id=self._context.tool_call_id,
                  title=title,
                  kind=kind or operation,  # Default kind to operation
                  locations=locations or [path],  # Default to main path
                  raw_input=self._context.tool_input.copy(),  # Auto-inject from context
                  raw_output=raw_output,
              )
              await self._context.agent._event_queue.put(event)
      
          async def file_edit_progress(
              self,
              path: str,
              old_text: str,
              new_text: str,
              status: Literal["in_progress", "completed", "failed"],
              changed_lines: list[int] | None = None,
          ) -> None:
              """Emit file edit progress event with diff information.
      
              Args:
                  path: The file path being edited
                  old_text: Original file content
                  new_text: New file content
                  status: Current status of the edit operation
                  changed_lines: Line numbers that were changed
              """
              from llmling_agent.agent.events import FileEditProgressEvent
      
              event = FileEditProgressEvent(
                  path=path,
                  old_text=old_text,
                  new_text=new_text,
                  status=status,
                  changed_lines=changed_lines or [],
                  tool_call_id=self._context.tool_call_id,
              )
              await self._context.agent._event_queue.put(event)
      
          async def plan_updated(self, entries: list[PlanEntry]) -> None:
              """Emit plan update event.
      
              Args:
                  entries: Current plan entries
              """
              from llmling_agent.agent.events import PlanUpdateEvent
      
              event = PlanUpdateEvent(entries=entries.copy(), tool_call_id=self._context.tool_call_id)
              await self.emit_event(event)
      
          async def progress(self, progress: float, total: float | None, message: str) -> None:
              """Emit progress event (delegates to existing method).
      
              Args:
                  progress: Current progress value
                  total: Total progress value
                  message: Progress message
              """
              await self._context.report_progress(progress, total, message)
      
          async def custom(
              self, event_data: Any, event_type: str = "custom", source: str | None = None
          ) -> None:
              """Emit custom event.
      
              Args:
                  event_data: The custom event data of any type
                  event_type: Type identifier for the custom event
                  source: Optional source identifier
              """
              from llmling_agent.agent.events import CustomEvent
      
              custom_event = CustomEvent(
                  event_data=event_data,
                  event_type=event_type,
                  source=source or self._context.tool_name,
              )
              await self._context.agent._event_queue.put(custom_event)
      
          async def process_started(
              self,
              process_id: str,
              command: str,
              args: list[str] | None = None,
              cwd: str | None = None,
              env: dict[str, str] | None = None,
              output_limit: int | None = None,
              success: bool = True,
              error: str | None = None,
          ) -> None:
              """Emit process start event.
      
              Args:
                  process_id: Unique process identifier
                  command: Command being executed
                  args: Command arguments
                  cwd: Working directory
                  env: Environment variables
                  output_limit: Maximum bytes of output to retain
                  success: Whether the process started successfully
                  error: Error message if start failed
              """
              from llmling_agent.agent.events import ProcessStartEvent
      
              event = ProcessStartEvent(
                  process_id=process_id,
                  command=command,
                  args=args or [],
                  cwd=cwd,
                  env=env or {},
                  output_limit=output_limit,
                  success=success,
                  error=error,
                  tool_call_id=self._context.tool_call_id,
              )
              await self._context.agent._event_queue.put(event)
      
          async def process_output(
              self,
              process_id: str,
              output: str,
              stdout: str | None = None,
              stderr: str | None = None,
              truncated: bool = False,
          ) -> None:
              """Emit process output event.
      
              Args:
                  process_id: Process identifier
                  output: Process output (stdout/stderr combined)
                  stdout: Standard output (if separated)
                  stderr: Standard error (if separated)
                  truncated: Whether output was truncated due to limits
              """
              from llmling_agent.agent.events import ProcessOutputEvent
      
              event = ProcessOutputEvent(
                  process_id=process_id,
                  output=output,
                  stdout=stdout,
                  stderr=stderr,
                  truncated=truncated,
                  tool_call_id=self._context.tool_call_id,
              )
              await self._context.agent._event_queue.put(event)
      
          async def process_exit(
              self,
              process_id: str,
              exit_code: int,
              final_output: str | None = None,
              truncated: bool = False,
          ) -> None:
              """Emit process exit event.
      
              Args:
                  process_id: Process identifier
                  exit_code: Process exit code
                  final_output: Final process output
                  truncated: Whether output was truncated due to limits
              """
              from llmling_agent.agent.events import ProcessExitEvent
      
              event = ProcessExitEvent(
                  process_id=process_id,
                  exit_code=exit_code,
                  success=exit_code == 0,
                  final_output=final_output,
                  truncated=truncated,
                  tool_call_id=self._context.tool_call_id,
              )
              await self._context.agent._event_queue.put(event)
      
          async def process_killed(
              self,
              process_id: str,
              success: bool = True,
              error: str | None = None,
          ) -> None:
              """Emit process kill event.
      
              Args:
                  process_id: Process identifier
                  success: Whether the process was successfully killed
                  error: Error message if kill failed
              """
              from llmling_agent.agent.events import ProcessKillEvent
      
              event = ProcessKillEvent(
                  process_id=process_id,
                  success=success,
                  error=error,
                  tool_call_id=self._context.tool_call_id,
              )
              await self._context.agent._event_queue.put(event)
      
          async def process_released(
              self,
              process_id: str,
              success: bool = True,
              error: str | None = None,
          ) -> None:
              """Emit process release event.
      
              Args:
                  process_id: Process identifier
                  success: Whether resources were successfully released
                  error: Error message if release failed
              """
              from llmling_agent.agent.events import ProcessReleaseEvent
      
              event = ProcessReleaseEvent(
                  process_id=process_id,
                  success=success,
                  error=error,
                  tool_call_id=self._context.tool_call_id,
              )
              await self._context.agent._event_queue.put(event)
      
          async def tool_call_start(
              self,
              title: str,
              kind: ToolKind = "other",
              content: list[ToolCallContentItem] | None = None,
              locations: list[str | LocationContentItem] | None = None,
          ) -> None:
              """Emit tool call start event with rich ACP metadata.
      
              Args:
                  title: Human-readable title describing what the tool is doing
                  kind: Tool kind (read, edit, delete, move, search, execute, think, fetch, other)
                  content: Content produced by the tool call (terminals, diffs, text)
                  locations: File paths or LocationContentItem objects affected by this tool call
              """
              from llmling_agent.agent.events import ToolCallStartEvent
      
              # Convert string paths to LocationContentItem objects
              location_items: list[LocationContentItem] = []
              if locations:
                  for loc in locations:
                      if isinstance(loc, str):
                          location_items.append(LocationContentItem(path=loc))
                      else:
                          location_items.append(loc)
      
              event = ToolCallStartEvent(
                  tool_call_id=self._context.tool_call_id or "",
                  tool_name=self._context.tool_name or "",
                  title=title,
                  kind=kind,
                  content=content or [],
                  locations=location_items,
                  raw_input=self._context.tool_input.copy(),
              )
      
              event = ToolCallStartEvent(
                  tool_call_id=self._context.tool_call_id or "",
                  tool_name=self._context.tool_name or "",
                  title=title,
                  kind=kind,
                  locations=location_items,
                  raw_input=self._context.tool_input.copy(),
              )
              await self._context.agent._event_queue.put(event)
      
          async def emit_event(self, event: RichAgentStreamEvent[Any]) -> None:
              """Emit a typed event into the agent's event stream.
      
              Args:
                  event: The event instance (PlanUpdateEvent, FileOperationEvent, etc.)
              """
              await self._context.agent._event_queue.put(event)
      

      __init__

      __init__(context: AgentContext) -> None
      

      Initialize event emitter with agent context.

      Parameters:

      Name Type Description Default
      context AgentContext

      Agent context to extract metadata from

      required
      Source code in src/llmling_agent/agent/event_emitter.py
      24
      25
      26
      27
      28
      29
      30
      def __init__(self, context: AgentContext) -> None:
          """Initialize event emitter with agent context.
      
          Args:
              context: Agent context to extract metadata from
          """
          self._context = context
      

      custom async

      custom(event_data: Any, event_type: str = 'custom', source: str | None = None) -> None
      

      Emit custom event.

      Parameters:

      Name Type Description Default
      event_data Any

      The custom event data of any type

      required
      event_type str

      Type identifier for the custom event

      'custom'
      source str | None

      Optional source identifier

      None
      Source code in src/llmling_agent/agent/event_emitter.py
      124
      125
      126
      127
      128
      129
      130
      131
      132
      133
      134
      135
      136
      137
      138
      139
      140
      141
      async def custom(
          self, event_data: Any, event_type: str = "custom", source: str | None = None
      ) -> None:
          """Emit custom event.
      
          Args:
              event_data: The custom event data of any type
              event_type: Type identifier for the custom event
              source: Optional source identifier
          """
          from llmling_agent.agent.events import CustomEvent
      
          custom_event = CustomEvent(
              event_data=event_data,
              event_type=event_type,
              source=source or self._context.tool_name,
          )
          await self._context.agent._event_queue.put(custom_event)
      

      emit_event async

      emit_event(event: RichAgentStreamEvent[Any]) -> None
      

      Emit a typed event into the agent's event stream.

      Parameters:

      Name Type Description Default
      event RichAgentStreamEvent[Any]

      The event instance (PlanUpdateEvent, FileOperationEvent, etc.)

      required
      Source code in src/llmling_agent/agent/event_emitter.py
      329
      330
      331
      332
      333
      334
      335
      async def emit_event(self, event: RichAgentStreamEvent[Any]) -> None:
          """Emit a typed event into the agent's event stream.
      
          Args:
              event: The event instance (PlanUpdateEvent, FileOperationEvent, etc.)
          """
          await self._context.agent._event_queue.put(event)
      

      file_edit_progress async

      file_edit_progress(
          path: str,
          old_text: str,
          new_text: str,
          status: Literal["in_progress", "completed", "failed"],
          changed_lines: list[int] | None = None,
      ) -> None
      

      Emit file edit progress event with diff information.

      Parameters:

      Name Type Description Default
      path str

      The file path being edited

      required
      old_text str

      Original file content

      required
      new_text str

      New file content

      required
      status Literal['in_progress', 'completed', 'failed']

      Current status of the edit operation

      required
      changed_lines list[int] | None

      Line numbers that were changed

      None
      Source code in src/llmling_agent/agent/event_emitter.py
       74
       75
       76
       77
       78
       79
       80
       81
       82
       83
       84
       85
       86
       87
       88
       89
       90
       91
       92
       93
       94
       95
       96
       97
       98
       99
      100
      101
      async def file_edit_progress(
          self,
          path: str,
          old_text: str,
          new_text: str,
          status: Literal["in_progress", "completed", "failed"],
          changed_lines: list[int] | None = None,
      ) -> None:
          """Emit file edit progress event with diff information.
      
          Args:
              path: The file path being edited
              old_text: Original file content
              new_text: New file content
              status: Current status of the edit operation
              changed_lines: Line numbers that were changed
          """
          from llmling_agent.agent.events import FileEditProgressEvent
      
          event = FileEditProgressEvent(
              path=path,
              old_text=old_text,
              new_text=new_text,
              status=status,
              changed_lines=changed_lines or [],
              tool_call_id=self._context.tool_call_id,
          )
          await self._context.agent._event_queue.put(event)
      

      file_operation async

      file_operation(
          operation: Literal["read", "write", "delete", "list", "edit"],
          path: str,
          success: bool,
          error: str | None = None,
          size: int | None = None,
          title: str | None = None,
          kind: str | None = None,
          locations: list[str] | None = None,
          raw_output: Any | None = None,
      ) -> None
      

      Emit file operation event with rich metadata.

      Parameters:

      Name Type Description Default
      operation Literal['read', 'write', 'delete', 'list', 'edit']

      The filesystem operation performed

      required
      path str

      The file/directory path that was operated on

      required
      success bool

      Whether the operation completed successfully

      required
      error str | None

      Error message if operation failed

      None
      size int | None

      Size of file in bytes (for successful operations)

      None
      title str | None

      Display title for the operation

      None
      kind str | None

      Tool operation kind (edit, read, write, etc.)

      None
      locations list[str] | None

      File paths affected by the operation

      None
      raw_output Any | None

      Tool result data for failed operations

      None
      Source code in src/llmling_agent/agent/event_emitter.py
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      async def file_operation(
          self,
          operation: Literal["read", "write", "delete", "list", "edit"],
          path: str,
          success: bool,
          error: str | None = None,
          size: int | None = None,
          title: str | None = None,
          kind: str | None = None,
          locations: list[str] | None = None,
          raw_output: Any | None = None,
      ) -> None:
          """Emit file operation event with rich metadata.
      
          Args:
              operation: The filesystem operation performed
              path: The file/directory path that was operated on
              success: Whether the operation completed successfully
              error: Error message if operation failed
              size: Size of file in bytes (for successful operations)
              title: Display title for the operation
              kind: Tool operation kind (edit, read, write, etc.)
              locations: File paths affected by the operation
              raw_output: Tool result data for failed operations
          """
          from llmling_agent.agent.events import FileOperationEvent
      
          event = FileOperationEvent(
              operation=operation,
              path=path,
              success=success,
              error=error,
              size=size,
              tool_call_id=self._context.tool_call_id,
              title=title,
              kind=kind or operation,  # Default kind to operation
              locations=locations or [path],  # Default to main path
              raw_input=self._context.tool_input.copy(),  # Auto-inject from context
              raw_output=raw_output,
          )
          await self._context.agent._event_queue.put(event)
      

      plan_updated async

      plan_updated(entries: list[PlanEntry]) -> None
      

      Emit plan update event.

      Parameters:

      Name Type Description Default
      entries list[PlanEntry]

      Current plan entries

      required
      Source code in src/llmling_agent/agent/event_emitter.py
      103
      104
      105
      106
      107
      108
      109
      110
      111
      112
      async def plan_updated(self, entries: list[PlanEntry]) -> None:
          """Emit plan update event.
      
          Args:
              entries: Current plan entries
          """
          from llmling_agent.agent.events import PlanUpdateEvent
      
          event = PlanUpdateEvent(entries=entries.copy(), tool_call_id=self._context.tool_call_id)
          await self.emit_event(event)
      

      process_exit async

      process_exit(
          process_id: str,
          exit_code: int,
          final_output: str | None = None,
          truncated: bool = False,
      ) -> None
      

      Emit process exit event.

      Parameters:

      Name Type Description Default
      process_id str

      Process identifier

      required
      exit_code int

      Process exit code

      required
      final_output str | None

      Final process output

      None
      truncated bool

      Whether output was truncated due to limits

      False
      Source code in src/llmling_agent/agent/event_emitter.py
      210
      211
      212
      213
      214
      215
      216
      217
      218
      219
      220
      221
      222
      223
      224
      225
      226
      227
      228
      229
      230
      231
      232
      233
      234
      235
      async def process_exit(
          self,
          process_id: str,
          exit_code: int,
          final_output: str | None = None,
          truncated: bool = False,
      ) -> None:
          """Emit process exit event.
      
          Args:
              process_id: Process identifier
              exit_code: Process exit code
              final_output: Final process output
              truncated: Whether output was truncated due to limits
          """
          from llmling_agent.agent.events import ProcessExitEvent
      
          event = ProcessExitEvent(
              process_id=process_id,
              exit_code=exit_code,
              success=exit_code == 0,
              final_output=final_output,
              truncated=truncated,
              tool_call_id=self._context.tool_call_id,
          )
          await self._context.agent._event_queue.put(event)
      

      process_killed async

      process_killed(process_id: str, success: bool = True, error: str | None = None) -> None
      

      Emit process kill event.

      Parameters:

      Name Type Description Default
      process_id str

      Process identifier

      required
      success bool

      Whether the process was successfully killed

      True
      error str | None

      Error message if kill failed

      None
      Source code in src/llmling_agent/agent/event_emitter.py
      237
      238
      239
      240
      241
      242
      243
      244
      245
      246
      247
      248
      249
      250
      251
      252
      253
      254
      255
      256
      257
      258
      async def process_killed(
          self,
          process_id: str,
          success: bool = True,
          error: str | None = None,
      ) -> None:
          """Emit process kill event.
      
          Args:
              process_id: Process identifier
              success: Whether the process was successfully killed
              error: Error message if kill failed
          """
          from llmling_agent.agent.events import ProcessKillEvent
      
          event = ProcessKillEvent(
              process_id=process_id,
              success=success,
              error=error,
              tool_call_id=self._context.tool_call_id,
          )
          await self._context.agent._event_queue.put(event)
      

      process_output async

      process_output(
          process_id: str,
          output: str,
          stdout: str | None = None,
          stderr: str | None = None,
          truncated: bool = False,
      ) -> None
      

      Emit process output event.

      Parameters:

      Name Type Description Default
      process_id str

      Process identifier

      required
      output str

      Process output (stdout/stderr combined)

      required
      stdout str | None

      Standard output (if separated)

      None
      stderr str | None

      Standard error (if separated)

      None
      truncated bool

      Whether output was truncated due to limits

      False
      Source code in src/llmling_agent/agent/event_emitter.py
      181
      182
      183
      184
      185
      186
      187
      188
      189
      190
      191
      192
      193
      194
      195
      196
      197
      198
      199
      200
      201
      202
      203
      204
      205
      206
      207
      208
      async def process_output(
          self,
          process_id: str,
          output: str,
          stdout: str | None = None,
          stderr: str | None = None,
          truncated: bool = False,
      ) -> None:
          """Emit process output event.
      
          Args:
              process_id: Process identifier
              output: Process output (stdout/stderr combined)
              stdout: Standard output (if separated)
              stderr: Standard error (if separated)
              truncated: Whether output was truncated due to limits
          """
          from llmling_agent.agent.events import ProcessOutputEvent
      
          event = ProcessOutputEvent(
              process_id=process_id,
              output=output,
              stdout=stdout,
              stderr=stderr,
              truncated=truncated,
              tool_call_id=self._context.tool_call_id,
          )
          await self._context.agent._event_queue.put(event)
      

      process_released async

      process_released(process_id: str, success: bool = True, error: str | None = None) -> None
      

      Emit process release event.

      Parameters:

      Name Type Description Default
      process_id str

      Process identifier

      required
      success bool

      Whether resources were successfully released

      True
      error str | None

      Error message if release failed

      None
      Source code in src/llmling_agent/agent/event_emitter.py
      260
      261
      262
      263
      264
      265
      266
      267
      268
      269
      270
      271
      272
      273
      274
      275
      276
      277
      278
      279
      280
      281
      async def process_released(
          self,
          process_id: str,
          success: bool = True,
          error: str | None = None,
      ) -> None:
          """Emit process release event.
      
          Args:
              process_id: Process identifier
              success: Whether resources were successfully released
              error: Error message if release failed
          """
          from llmling_agent.agent.events import ProcessReleaseEvent
      
          event = ProcessReleaseEvent(
              process_id=process_id,
              success=success,
              error=error,
              tool_call_id=self._context.tool_call_id,
          )
          await self._context.agent._event_queue.put(event)
      

      process_started async

      process_started(
          process_id: str,
          command: str,
          args: list[str] | None = None,
          cwd: str | None = None,
          env: dict[str, str] | None = None,
          output_limit: int | None = None,
          success: bool = True,
          error: str | None = None,
      ) -> None
      

      Emit process start event.

      Parameters:

      Name Type Description Default
      process_id str

      Unique process identifier

      required
      command str

      Command being executed

      required
      args list[str] | None

      Command arguments

      None
      cwd str | None

      Working directory

      None
      env dict[str, str] | None

      Environment variables

      None
      output_limit int | None

      Maximum bytes of output to retain

      None
      success bool

      Whether the process started successfully

      True
      error str | None

      Error message if start failed

      None
      Source code in src/llmling_agent/agent/event_emitter.py
      143
      144
      145
      146
      147
      148
      149
      150
      151
      152
      153
      154
      155
      156
      157
      158
      159
      160
      161
      162
      163
      164
      165
      166
      167
      168
      169
      170
      171
      172
      173
      174
      175
      176
      177
      178
      179
      async def process_started(
          self,
          process_id: str,
          command: str,
          args: list[str] | None = None,
          cwd: str | None = None,
          env: dict[str, str] | None = None,
          output_limit: int | None = None,
          success: bool = True,
          error: str | None = None,
      ) -> None:
          """Emit process start event.
      
          Args:
              process_id: Unique process identifier
              command: Command being executed
              args: Command arguments
              cwd: Working directory
              env: Environment variables
              output_limit: Maximum bytes of output to retain
              success: Whether the process started successfully
              error: Error message if start failed
          """
          from llmling_agent.agent.events import ProcessStartEvent
      
          event = ProcessStartEvent(
              process_id=process_id,
              command=command,
              args=args or [],
              cwd=cwd,
              env=env or {},
              output_limit=output_limit,
              success=success,
              error=error,
              tool_call_id=self._context.tool_call_id,
          )
          await self._context.agent._event_queue.put(event)
      

      progress async

      progress(progress: float, total: float | None, message: str) -> None
      

      Emit progress event (delegates to existing method).

      Parameters:

      Name Type Description Default
      progress float

      Current progress value

      required
      total float | None

      Total progress value

      required
      message str

      Progress message

      required
      Source code in src/llmling_agent/agent/event_emitter.py
      114
      115
      116
      117
      118
      119
      120
      121
      122
      async def progress(self, progress: float, total: float | None, message: str) -> None:
          """Emit progress event (delegates to existing method).
      
          Args:
              progress: Current progress value
              total: Total progress value
              message: Progress message
          """
          await self._context.report_progress(progress, total, message)
      

      tool_call_start async

      tool_call_start(
          title: str,
          kind: ToolKind = "other",
          content: list[ToolCallContentItem] | None = None,
          locations: list[str | LocationContentItem] | None = None,
      ) -> None
      

      Emit tool call start event with rich ACP metadata.

      Parameters:

      Name Type Description Default
      title str

      Human-readable title describing what the tool is doing

      required
      kind ToolKind

      Tool kind (read, edit, delete, move, search, execute, think, fetch, other)

      'other'
      content list[ToolCallContentItem] | None

      Content produced by the tool call (terminals, diffs, text)

      None
      locations list[str | LocationContentItem] | None

      File paths or LocationContentItem objects affected by this tool call

      None
      Source code in src/llmling_agent/agent/event_emitter.py
      283
      284
      285
      286
      287
      288
      289
      290
      291
      292
      293
      294
      295
      296
      297
      298
      299
      300
      301
      302
      303
      304
      305
      306
      307
      308
      309
      310
      311
      312
      313
      314
      315
      316
      317
      318
      319
      320
      321
      322
      323
      324
      325
      326
      327
      async def tool_call_start(
          self,
          title: str,
          kind: ToolKind = "other",
          content: list[ToolCallContentItem] | None = None,
          locations: list[str | LocationContentItem] | None = None,
      ) -> None:
          """Emit tool call start event with rich ACP metadata.
      
          Args:
              title: Human-readable title describing what the tool is doing
              kind: Tool kind (read, edit, delete, move, search, execute, think, fetch, other)
              content: Content produced by the tool call (terminals, diffs, text)
              locations: File paths or LocationContentItem objects affected by this tool call
          """
          from llmling_agent.agent.events import ToolCallStartEvent
      
          # Convert string paths to LocationContentItem objects
          location_items: list[LocationContentItem] = []
          if locations:
              for loc in locations:
                  if isinstance(loc, str):
                      location_items.append(LocationContentItem(path=loc))
                  else:
                      location_items.append(loc)
      
          event = ToolCallStartEvent(
              tool_call_id=self._context.tool_call_id or "",
              tool_name=self._context.tool_name or "",
              title=title,
              kind=kind,
              content=content or [],
              locations=location_items,
              raw_input=self._context.tool_input.copy(),
          )
      
          event = ToolCallStartEvent(
              tool_call_id=self._context.tool_call_id or "",
              tool_name=self._context.tool_name or "",
              title=title,
              kind=kind,
              locations=location_items,
              raw_input=self._context.tool_input.copy(),
          )
          await self._context.agent._event_queue.put(event)