Class: EnvironmentSnapshot

Inherits:
Data
  • Object
show all
Defined in:
lib/shell_session.rb

Overview

Immutable snapshot of the shell’s environment for change detection. Compared between commands to produce natural-language summaries of what changed — the agent discovers its environment through Bash tool responses.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch

Returns:

  • (Object)

    the current value of branch



23
24
25
26
# File 'lib/shell_session.rb', line 23

EnvironmentSnapshot = Data.define(:pwd, :branch, :repo, :project_files) do
  # Sentinel for "never detected" — diffs against this produce a full snapshot.
  def self.blank = new(pwd: nil, branch: nil, repo: nil, project_files: [])
end

#project_filesObject (readonly)

Returns the value of attribute project_files

Returns:

  • (Object)

    the current value of project_files



23
24
25
26
# File 'lib/shell_session.rb', line 23

EnvironmentSnapshot = Data.define(:pwd, :branch, :repo, :project_files) do
  # Sentinel for "never detected" — diffs against this produce a full snapshot.
  def self.blank = new(pwd: nil, branch: nil, repo: nil, project_files: [])
end

#pwdObject (readonly)

Returns the value of attribute pwd

Returns:

  • (Object)

    the current value of pwd



23
24
25
26
# File 'lib/shell_session.rb', line 23

EnvironmentSnapshot = Data.define(:pwd, :branch, :repo, :project_files) do
  # Sentinel for "never detected" — diffs against this produce a full snapshot.
  def self.blank = new(pwd: nil, branch: nil, repo: nil, project_files: [])
end

#repoObject (readonly)

Returns the value of attribute repo

Returns:

  • (Object)

    the current value of repo



23
24
25
26
# File 'lib/shell_session.rb', line 23

EnvironmentSnapshot = Data.define(:pwd, :branch, :repo, :project_files) do
  # Sentinel for "never detected" — diffs against this produce a full snapshot.
  def self.blank = new(pwd: nil, branch: nil, repo: nil, project_files: [])
end

Class Method Details

.blankObject

Sentinel for “never detected” — diffs against this produce a full snapshot.



25
# File 'lib/shell_session.rb', line 25

def self.blank = new(pwd: nil, branch: nil, repo: nil, project_files: [])