Class: OllamaAgent::Runtime::ExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama_agent/runtime/execution_context.rb

Overview

Immutable execution context carried through runtime boundaries.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mode:, workspace_root:, manifest_id:, metadata: {}) ⇒ ExecutionContext

Returns a new instance of ExecutionContext.

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
18
# File 'lib/ollama_agent/runtime/execution_context.rb', line 11

def initialize(mode:, workspace_root:, manifest_id:, metadata: {})
  raise ArgumentError, "invalid execution mode: #{mode}" unless ExecutionMode.valid?(mode)

  @mode = mode.to_s
  @workspace_root = workspace_root
  @manifest_id = manifest_id
  @metadata = .dup.freeze
end

Instance Attribute Details

#manifest_idObject (readonly)

Returns the value of attribute manifest_id.



9
10
11
# File 'lib/ollama_agent/runtime/execution_context.rb', line 9

def manifest_id
  @manifest_id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



9
10
11
# File 'lib/ollama_agent/runtime/execution_context.rb', line 9

def 
  @metadata
end

#modeObject (readonly)

Returns the value of attribute mode.



9
10
11
# File 'lib/ollama_agent/runtime/execution_context.rb', line 9

def mode
  @mode
end

#workspace_rootObject (readonly)

Returns the value of attribute workspace_root.



9
10
11
# File 'lib/ollama_agent/runtime/execution_context.rb', line 9

def workspace_root
  @workspace_root
end