brainiac 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d73484edd8f42558e933347b45b50f5aa27065a86798ae4d764e44b0d07534f9
4
- data.tar.gz: bcc9a1a5bf6094ef8138cf345e2e517004c412d983c4475c80b89cb005bbf6aa
3
+ metadata.gz: e0e0e919150a76bcf0b7f289b72cfdbc8000bc0cacf94bc9103685cf49331415
4
+ data.tar.gz: 58174d5dcf9d0c3641f9a96317f6d94a4dda153481d586659275e8e81623fd24
5
5
  SHA512:
6
- metadata.gz: 1ecd465ba660b6a145c15a9fa7fd17a13dad35bf2dff802b18dcba92949964b5df0be02e26ebc643a74582f010cecf520fc7d04cd32b4acda83891768cd0c6c1
7
- data.tar.gz: ca830bd810461ff79c474bf5a2744f187a29ee8040d7af0b14c7143dd76c92dbb6e1117f942e51610ecb8e3bdb9d48739a48f7862006f8f84a4d7a66bb40481a
6
+ metadata.gz: 73331c38b19e2ef1bb2d352b0a9b6cf6259d7075022e6ea529ad1203fd8dc30369d83b7d88e603c1ab04a59ec2a96856b01a59fc669a4b43c1efbba847ea2399
7
+ data.tar.gz: 917ea682b6749cef4a17d76a2a40d10deabb175c30af77044dc5a3d8be7132ab7f52e8722f8881bc11689c3d597ad83039e107e336cf40d891a0a222396df405
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brainiac (0.1.4)
4
+ brainiac (0.1.5)
5
5
  puma (~> 7.2)
6
6
  rackup (~> 2.3)
7
7
  sinatra (~> 4.1)
@@ -84,7 +84,7 @@ DEPENDENCIES
84
84
  CHECKSUMS
85
85
  ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
86
86
  base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
87
- brainiac (0.1.4)
87
+ brainiac (0.1.5)
88
88
  json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
89
89
  language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
90
90
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
@@ -353,10 +353,10 @@ def register_work_item(branch:, worktree: nil, project: nil, agent: nil, source:
353
353
  work_item_id
354
354
  end
355
355
 
356
- # Update dispatch overrides on a work item (cli_provider, model, effort).
356
+ # Update dispatch overrides on a work item (cli_provider, model, effort, profile).
357
357
  # Only non-nil values are stored; nil values are removed from existing overrides.
358
358
  # Returns true if the work item was found and updated, false otherwise.
359
- def update_work_item_overrides(cli_provider: nil, model: nil, effort: nil, work_item_id: nil, branch: nil) # rubocop:disable Naming/PredicateMethod
359
+ def update_work_item_overrides(cli_provider: nil, model: nil, effort: nil, profile: nil, work_item_id: nil, branch: nil) # rubocop:disable Naming/PredicateMethod
360
360
  map = load_work_item_map
361
361
 
362
362
  target_id = work_item_id
@@ -375,6 +375,7 @@ def update_work_item_overrides(cli_provider: nil, model: nil, effort: nil, work_
375
375
  overrides["cli_provider"] = cli_provider if cli_provider
376
376
  overrides["model"] = model if model
377
377
  overrides["effort"] = effort if effort
378
+ overrides["profile"] = profile if profile
378
379
  overrides.compact!
379
380
 
380
381
  if overrides.empty?
@@ -417,16 +418,26 @@ end
417
418
  # inline_cli_provider: — [cli:X] from current message (nil if not specified)
418
419
  # inline_model: — resolved model from current message (nil if not specified)
419
420
  # inline_effort: — [effort:X] from current message (nil if not specified)
421
+ # inline_profile: — [profile:X]/[p:X] from current message (nil if not specified)
420
422
  #
421
- # Returns: { cli_provider: String|nil, model: String|nil, effort: String|nil }
422
- def resolve_work_item_overrides(work_item_id: nil, branch: nil, inline_cli_provider: nil, inline_model: nil, inline_effort: nil)
423
+ # A profile sticks to the work item like model/effort do: [p:k+] once and every later
424
+ # untagged reply keeps running on k+ until a different [p:X] (e.g. [p:q]) replaces it.
425
+ # Unknown profile names are never persisted, so a typo can't pin a work item to a
426
+ # profile that doesn't exist (profile_spawn_env ignores it for this dispatch too).
427
+ #
428
+ # Returns: { cli_provider:, model:, effort:, profile: } (each String or nil)
429
+ def resolve_work_item_overrides(work_item_id: nil, branch: nil, inline_cli_provider: nil, inline_model: nil, inline_effort: nil,
430
+ inline_profile: nil)
423
431
  stored = work_item_overrides_for(work_item_id: work_item_id, branch: branch)
432
+ inline_profile = inline_profile&.to_s&.downcase
433
+ persist_profile = inline_profile && profile_entry(inline_profile) ? inline_profile : nil
424
434
 
425
435
  # Inline tags override stored values
426
436
  resolved = {
427
437
  cli_provider: inline_cli_provider || stored["cli_provider"],
428
438
  model: inline_model || stored["model"],
429
- effort: inline_effort || stored["effort"]
439
+ effort: inline_effort || stored["effort"],
440
+ profile: inline_profile || stored["profile"]
430
441
  }
431
442
 
432
443
  # Persist any new inline overrides to the work item for future dispatches
@@ -434,6 +445,7 @@ def resolve_work_item_overrides(work_item_id: nil, branch: nil, inline_cli_provi
434
445
  new_overrides[:cli_provider] = inline_cli_provider if inline_cli_provider
435
446
  new_overrides[:model] = inline_model if inline_model
436
447
  new_overrides[:effort] = inline_effort if inline_effort
448
+ new_overrides[:profile] = persist_profile if persist_profile
437
449
 
438
450
  update_work_item_overrides(work_item_id: work_item_id, branch: branch, **new_overrides) if new_overrides.any? && (work_item_id || branch)
439
451
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Brainiac
4
4
  # @return [String] the current gem version
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis