Skip to content
Kward Search API index

Class: Kward::CLI::Tabs::TabRuntime

Inherits:
Struct
  • Object
show all
Defined in:
lib/kward/cli/tabs.rb

Constant Summary collapse

TRANSIENT_SHELL_OUTPUT_LIMIT =
200_000

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#agent ⇒ Object

Returns the value of attribute agent

Returns:

  • (Object) —

    the current value of agent



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def agent
  @agent
end

#answer ⇒ Object

Returns the value of attribute answer

Returns:

  • (Object) —

    the current value of answer



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def answer
  @answer
end

#attention ⇒ Object

Returns the value of attribute attention

Returns:

  • (Object) —

    the current value of attention



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def attention
  @attention
end

#background_run ⇒ Object

Returns the value of attribute background_run

Returns:

  • (Object) —

    the current value of background_run



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def background_run
  @background_run
end

#cancellation ⇒ Object

Returns the value of attribute cancellation

Returns:

  • (Object) —

    the current value of cancellation



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def cancellation
  @cancellation
end

#diff ⇒ Object

Returns the value of attribute diff

Returns:

  • (Object) —

    the current value of diff



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def diff
  @diff
end

#driver ⇒ Object

Returns the value of attribute driver

Returns:

  • (Object) —

    the current value of driver



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def driver
  @driver
end

#error ⇒ Object

Returns the value of attribute error

Returns:

  • (Object) —

    the current value of error



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def error
  @error
end

#error_reported ⇒ Object

Returns the value of attribute error_reported

Returns:

  • (Object) —

    the current value of error_reported



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def error_reported
  @error_reported
end

#event_history ⇒ Object

Returns the value of attribute event_history

Returns:

  • (Object) —

    the current value of event_history



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def event_history
  @event_history
end

#label ⇒ Object

Returns the value of attribute label

Returns:

  • (Object) —

    the current value of label



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def label
  @label
end

#local_busy_activity ⇒ Object

Returns the value of attribute local_busy_activity

Returns:

  • (Object) —

    the current value of local_busy_activity



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def local_busy_activity
  @local_busy_activity
end

#markdown_chunks ⇒ Object

Returns the value of attribute markdown_chunks

Returns:

  • (Object) —

    the current value of markdown_chunks



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def markdown_chunks
  @markdown_chunks
end

#pending_question ⇒ Object

Returns the value of attribute pending_question

Returns:

  • (Object) —

    the current value of pending_question



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def pending_question
  @pending_question
end

#pending_runtime_outputs ⇒ Object

Returns the value of attribute pending_runtime_outputs

Returns:

  • (Object) —

    the current value of pending_runtime_outputs



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def pending_runtime_outputs
  @pending_runtime_outputs
end

#plugin_host ⇒ Object

Returns the value of attribute plugin_host

Returns:

  • (Object) —

    the current value of plugin_host



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def plugin_host
  @plugin_host
end

#queued_inputs ⇒ Object

Returns the value of attribute queued_inputs

Returns:

  • (Object) —

    the current value of queued_inputs



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def queued_inputs
  @queued_inputs
end

#seen_events ⇒ Object

Returns the value of attribute seen_events

Returns:

  • (Object) —

    the current value of seen_events



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def seen_events
  @seen_events
end

#session ⇒ Object

Returns the value of attribute session

Returns:

  • (Object) —

    the current value of session



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def session
  @session
end

#shell ⇒ Object

Returns the value of attribute shell

Returns:

  • (Object) —

    the current value of shell



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def shell
  @shell
end

#shell_agent ⇒ Object

Returns the value of attribute shell_agent

Returns:

  • (Object) —

    the current value of shell_agent



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def shell_agent
  @shell_agent
end

#snapshot ⇒ Object

Returns the value of attribute snapshot

Returns:

  • (Object) —

    the current value of snapshot



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def snapshot
  @snapshot
end

#status ⇒ Object

Returns the value of attribute status

Returns:

  • (Object) —

    the current value of status



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def status
  @status
end

#steering ⇒ Object

Returns the value of attribute steering

Returns:

  • (Object) —

    the current value of steering



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def steering
  @steering
end

#stream_state ⇒ Object

Returns the value of attribute stream_state

Returns:

  • (Object) —

    the current value of stream_state



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def stream_state
  @stream_state
end

#thread ⇒ Object

Returns the value of attribute thread

Returns:

  • (Object) —

    the current value of thread



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def thread
  @thread
end

#transient_shell_entries ⇒ Object

Returns the value of attribute transient_shell_entries

Returns:

  • (Object) —

    the current value of transient_shell_entries



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def transient_shell_entries
  @transient_shell_entries
end

#unread ⇒ Object

Returns the value of attribute unread

Returns:

  • (Object) —

    the current value of unread



19
20
21
# File 'lib/kward/cli/tabs.rb', line 19

def unread
  @unread
end

Instance Method Details

#append_pending_runtime_output(text) ⇒ Object



60
61
62
63
# File 'lib/kward/cli/tabs.rb', line 60

def append_pending_runtime_output(text)
  self.pending_runtime_outputs ||= []
  pending_runtime_outputs << text.to_s
end

#append_transient_shell_entry(text) ⇒ Object



73
74
75
76
77
78
79
80
# File 'lib/kward/cli/tabs.rb', line 73

def append_transient_shell_entry(text)
  value = text.to_s
  return if value.empty?

  self.transient_shell_entries ||= []
  transient_shell_entries << value
  trim_transient_shell_entries
end

#clear_transient_shell_entries ⇒ Object



82
83
84
# File 'lib/kward/cli/tabs.rb', line 82

def clear_transient_shell_entries
  self.transient_shell_entries = []
end

#idle? ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/kward/cli/tabs.rb', line 65

def idle?
  !running? && !local_busy?
end

#local_busy? ⇒ Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/kward/cli/tabs.rb', line 56

def local_busy?
  !local_busy_activity.to_s.empty?
end

#record_event(event) ⇒ Object



69
70
71
# File 'lib/kward/cli/tabs.rb', line 69

def record_event(event)
  event_history << event
end

#running? ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/kward/cli/tabs.rb', line 52

def running?
  %w[queued running waiting_for_question].include?(status.to_s)
end