Class: Agentilda::Linear::Action

Inherits:
Data
  • Object
show all
Defined in:
lib/agentilda/linear/import.rb

Overview

One thing that would happen in Linear.

args is deliberately shaped as the Linear MCP server's save_issue arguments, because that server addresses everything by the names a human already knows — a team by its key, a project by its name, a workflow state by its name, an issue by its identifier. Emitting exactly that shape means the JSON this produces can drive either transport unchanged: Push turns it into GraphQL, and the skill hands it to the MCP tools as-is. One contract, so the two cannot drift.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsHash (readonly)

Returns the MCP argument shape.

Returns:

  • (Hash)

    the MCP argument shape



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#digestString (readonly)

Returns fingerprint of args, recorded after a push.

Returns:

  • (String)

    fingerprint of args, recorded after a push



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#identifierString? (readonly)

Returns what Linear already calls it, when it exists.

Returns:

  • (String, nil)

    what Linear already calls it, when it exists



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#kindSymbol (readonly)

Returns :issue for a plan, :subissue for a unit of one.

Returns:

  • (Symbol)

    :issue for a plan, :subissue for a unit of one



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#opSymbol (readonly)

Returns :create, :update or :skip.

Returns:

  • (Symbol)

    :create, :update or :skip



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#ordinalString (readonly)

Returns the plan this belongs to, e.g. "003.00".

Returns:

  • (String)

    the plan this belongs to, e.g. "003.00"



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#reasonString (readonly)

Returns why this operation and not another.

Returns:

  • (String)

    why this operation and not another



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#titleString (readonly)

Returns for the human reading the dry run.

Returns:

  • (String)

    for the human reading the dry run



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

#unitString? (readonly)

Returns the Unit#key, nil for a plan's own issue.

Returns:

  • (String, nil)

    the Unit#key, nil for a plan's own issue



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/agentilda/linear/import.rb', line 35

Action = Data.define(:kind, :op, :ordinal, :unit, :identifier, :title, :digest, :args, :reason) do
  # @return [Boolean] whether this would change anything
  def pending? = op != :skip

  # @return [Boolean] whether this issue hangs off another
  def child? = kind == :subissue

  # @return [Hash] for `--format json`
  def to_h_json
    {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
  end
end

Instance Method Details

#child?Boolean

Returns whether this issue hangs off another.

Returns:

  • (Boolean)

    whether this issue hangs off another



40
# File 'lib/agentilda/linear/import.rb', line 40

def child? = kind == :subissue

#pending?Boolean

Returns whether this would change anything.

Returns:

  • (Boolean)

    whether this would change anything



37
# File 'lib/agentilda/linear/import.rb', line 37

def pending? = op != :skip

#to_h_jsonHash

Returns for --format json.

Returns:

  • (Hash)

    for --format json



43
44
45
# File 'lib/agentilda/linear/import.rb', line 43

def to_h_json
  {kind:, op:, plan: ordinal, unit:, identifier:, title:, digest:, args:}.compact
end