org.llm4s.shared

Members list

Type members

Classlikes

case class CancelCommandMessage(commandId: String) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class CommandCompletedMessage(commandId: String, exitCode: Int, durationMs: Long) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Utility class for generating unique command IDs. This centralizes the command ID generation logic across the codebase.

Utility class for generating unique command IDs. This centralizes the command ID generation logic across the codebase.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class CommandStartedMessage(commandId: String, command: String) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class DeleteOperation(`type`: String, startLine: Int, endLine: Int) extends FileOperation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ErrorMessage(error: String, code: String, commandId: Option[String]) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ErrorMessage

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ExecuteCommandCommand(commandId: String, command: String, workingDirectory: Option[String], timeout: Option[Int], environment: Option[Map[String, String]]) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ExecuteCommandResponse(commandId: String, stdout: String, stderr: String, exitCode: Int, isOutputTruncated: Boolean, durationMs: Long) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ExploreFilesCommand(commandId: String, path: String, recursive: Option[Boolean], excludePatterns: Option[List[String]], maxDepth: Option[Int], returnMetadata: Option[Boolean]) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ExploreFilesResponse(commandId: String, files: List[FileEntry], isTruncated: Boolean, totalFound: Int) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class FileEntry(path: String, isDirectory: Boolean, metadata: Option[FileMetadata])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object FileEntry

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
FileEntry.type
case class FileMetadata(path: String, size: Long, isDirectory: Boolean, lastModified: String)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object FileMetadata

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait FileOperation

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FileOperation

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class GetWorkspaceInfoCommand(commandId: String) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class GetWorkspaceInfoResponse(commandId: String, root: String, defaultExclusions: List[String], limits: WorkspaceLimits) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class HeartbeatMessage(timestamp: Long) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class HeartbeatResponseMessage(timestamp: Long) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class InsertOperation(`type`: String, afterLine: Int, newContent: String) extends FileOperation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ModifyFileCommand(commandId: String, path: String, operations: List[FileOperation]) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ModifyFileResponse(commandId: String, success: Boolean, path: String) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object ProtocolCodec

JSON codec for workspace agent protocol messages.

JSON codec for workspace agent protocol messages.

Provides serialization and deserialization of commands and responses using uPickle's JSON support. All protocol types are serialized polymorphically based on their runtime type.

== Usage Example ==

val command: WorkspaceAgentCommand = ReadFileCommand("cmd-1", "/path/to/file.txt", None, None)
val json = ProtocolCodec.encodeAgentCommand(command)
val decoded = ProtocolCodec.decodeAgentCommand(json)

Attributes

See also

WorkspaceAgentCommand for available commands

WorkspaceAgentResponse for response types

Supertypes
class Object
trait Matchable
class Any
Self type
case class ReadFileCommand(commandId: String, path: String, startLine: Option[Int], endLine: Option[Int]) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ReadFileResponse(commandId: String, content: String, metadata: FileMetadata, isTruncated: Boolean, totalLines: Int, returnedLines: Int) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RegexReplaceOperation(`type`: String, pattern: String, replacement: String, flags: Option[String]) extends FileOperation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ReplaceOperation(`type`: String, startLine: Int, endLine: Int, newContent: String) extends FileOperation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SearchFilesCommand(commandId: String, paths: List[String], query: String, `type`: String, recursive: Option[Boolean], excludePatterns: Option[List[String]], contextLines: Option[Int]) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SearchFilesResponse(commandId: String, matches: List[SearchMatch], isTruncated: Boolean, totalMatches: Int) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SearchMatch(path: String, line: Int, matchText: String, contextBefore: List[String], contextAfter: List[String])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object SearchMatch

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StreamingOutputMessage(commandId: String, outputType: String, content: String, isComplete: Boolean) extends WebSocketMessage

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait WebSocketMessage

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait WorkspaceAgentCommand

Core trait for all workspace agent commands.

Core trait for all workspace agent commands.

Commands are sent from the client to the workspace agent to perform file operations, execute shell commands, or query workspace information. Each command has a unique commandId for request-response correlation.

Attributes

See also

WorkspaceAgentResponse for corresponding responses

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class WorkspaceAgentErrorResponse(commandId: String, error: String, code: String, details: Option[String]) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
class WorkspaceAgentException(val error: String, val code: String, val details: Option[String]) extends RuntimeException

Exception thrown when a workspace agent command fails

Exception thrown when a workspace agent command fails

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Interface that provides methods corresponding to WorkspaceAgentCommands.

Interface that provides methods corresponding to WorkspaceAgentCommands.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Remote implementation of WorkspaceAgentInterface that converts method calls to commands, processes them through a handler, and converts responses back to appropriate return types.

Remote implementation of WorkspaceAgentInterface that converts method calls to commands, processes them through a handler, and converts responses back to appropriate return types.

Value parameters

handler

A function that processes WorkspaceAgentCommands and returns WorkspaceAgentResponses

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Companion object for WorkspaceAgentInterfaceRemote with factory methods.

Companion object for WorkspaceAgentInterfaceRemote with factory methods.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait WorkspaceAgentResponse

Core trait for all workspace agent responses.

Core trait for all workspace agent responses.

Responses are sent from the workspace agent back to the client in response to commands. Each response includes the commandId to correlate with the original request.

Attributes

See also

WorkspaceAgentCommand for corresponding commands

WorkspaceAgentErrorResponse for error cases

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class WorkspaceLimits(maxFileSize: Long, maxDirectoryEntries: Int, maxSearchResults: Int, maxOutputSize: Long)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class WorkspaceSandboxConfig(limits: WorkspaceLimits, excludePatterns: List[String], shellAllowed: Boolean, defaultCommandTimeoutSeconds: Int, readOnlyPaths: List[String], allowedPaths: List[String], networkAllowed: Boolean, allowedCommands: Set[String])

Explicit sandbox configuration for workspace operations.

Explicit sandbox configuration for workspace operations.

Describes allowed/blocked paths, resource limits, shell access, and timeouts. When provided, this config is validated at startup and enforced by the runner.

'''Phase 1:''' Config structure, validation, and documentation. '''Phase 2:''' Enforcement in runner and tools. '''Phase 3:''' Advanced policies (profiles, allowlists).

Value parameters

allowedCommands

Set of bare executable names permitted by executeCommand. Defaults to WorkspaceSandboxConfig.ReadOnlyCommands. Use WorkspaceSandboxConfig.ReadWriteCommands to also permit write-capable commands (cp, mv, rm, mkdir, …).

allowedPaths

If non-empty, only these paths are accessible; if empty, whole workspace

defaultCommandTimeoutSeconds

Default timeout for shell commands

excludePatterns

Glob patterns for paths to exclude from explore/search (e.g. node_modules, .git)

limits

Resource limits (file size, directory entries, search results, output size)

networkAllowed

Documentation: whether network access from commands is assumed (Phase 2: enforce)

readOnlyPaths

Paths under workspace root that are read-only (writes denied)

shellAllowed

Whether executeCommand is allowed (false = read-only file ops only)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class WriteFileCommand(commandId: String, path: String, content: String, mode: Option[String], createDirectories: Option[Boolean]) extends WorkspaceAgentCommand

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class WriteFileResponse(commandId: String, success: Boolean, path: String, bytesWritten: Long) extends WorkspaceAgentResponse

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type