pwn 0.5.790 → 0.5.792

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: 43bc28ac60d5883af330355e4b3c12a7d0b8d553f194021a934eab172efe0d51
4
- data.tar.gz: b2c8133b2a5fd7a7be73e2245df3a6e2a35e5eb6319cde8676b109f9b423577a
3
+ metadata.gz: 0d9faf1e37903f9f0bf4c98030427b5f62fae266b50e02a85bf70f7732515abf
4
+ data.tar.gz: cffff5cf764a901a9ebabe6c840daeaa64f52e286185d48856c0166ea268457f
5
5
  SHA512:
6
- metadata.gz: 316290237f20ebf205c02adcada75525462ac152d9c8ce0db918ac87b7d17457b8d1461c81bfad3cf19fc5bb649a6dfec5c05bed384e4389e2dcf19a9985267d
7
- data.tar.gz: 99d090c82e60a2641cf1c53b0a54a4ce09d7cede595d9c03d9958861ab48785a8022e17184bc3fd9b9ec935149477180dbf531668e60695005a7dde3d4001d80
6
+ metadata.gz: a08a110a62e07958a85431b858c4590c41af6d49c42bd3f70dbbacd37231bb4eee363a1279139dfb7b7679f676bde6062ce99ccca19f02f715075510aa8896f3
7
+ data.tar.gz: 9293669aaef1c48e4d48cf67fccf5f237b4517ca2da3e93956053510be5887b5b91ddfed01fa271ceb221db45668a1c59d5c4ea52e6f0a73969ba8cc34da3f3d
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ gemspec
11
11
  # In some circumstances custom flags are passed to gems in order
12
12
  # to build appropriately. Defer to ./reinstall_pwn_gemset.sh
13
13
  # to review these custom flags (e.g. pg, serialport, etc).
14
- gem 'activesupport', '<8.1.4'
14
+ gem 'activesupport', '<8.1.4.1'
15
15
  gem 'anemone', '0.7.2'
16
16
  gem 'authy', '3.0.1'
17
17
  gem 'aws-sdk', '3.3.0'
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.790'
4
+ VERSION = '0.5.792'
5
5
  end
@@ -515,13 +515,22 @@ describe 'pwn-ai curses launch' do # rubocop:disable Metrics/BlockLength -- publ
515
515
  @screen = screen
516
516
  output = double('terminal', tty?: true)
517
517
  previous = [$stdin, $stdout, $stderr]
518
- Timeout.timeout(60, Class.new(Exception)) do # rubocop:disable Lint/InheritException -- must escape Console rescue StandardError
519
- reader = lambda do
520
- key = keys.empty? ? tick.call : keys.shift
521
- Thread.pass if key.nil?
522
- key
518
+ @console = nil
519
+ allow(PWN::Plugins::REPL::AIConsole::Console).to receive(:new).and_wrap_original do |original, *args, **kwargs|
520
+ @console = original.call(*args, **kwargs)
521
+ end
522
+ expired = Class.new(Exception) # rubocop:disable Lint/InheritException -- must escape Console rescue StandardError
523
+ begin
524
+ Timeout.timeout(60, expired) do
525
+ reader = lambda do
526
+ key = keys.empty? ? tick.call : keys.shift
527
+ Thread.pass if key.nil?
528
+ key
529
+ end
530
+ PWN::Plugins::REPL::AIConsole.run(pry: @pry, input: input, output: output, curses: screen, getch: reader)
523
531
  end
524
- PWN::Plugins::REPL::AIConsole.run(pry: @pry, input: input, output: output, curses: screen, getch: reader)
532
+ rescue expired
533
+ raise expired, "execution expired phase=#{@launch_phase.inspect} session=#{@pry.config.pwn_ai_session_id} paint=#{@paint.join[-240]}"
525
534
  end
526
535
  expect([$stdin, $stdout]).to eq(previous.take(2))
527
536
  expect(PWN::Plugins::Log.raw_stderr).to equal(previous[2])
@@ -2674,15 +2683,26 @@ describe 'pwn-ai curses launch' do # rubocop:disable Metrics/BlockLength -- publ
2674
2683
  expect(opts[:messages]).to include(hash_including(role: 'user', content: 'Previous fixture question'), hash_including(role: 'assistant', content: 'Previous fixture answer'))
2675
2684
  { choices: [{ message: { role: 'assistant', content: 'Selected route.', tool_calls: [] } }] }
2676
2685
  end
2677
- keys = "/model openai console-fixture\n/sessions resume resumed console\n".chars
2678
- submitted = false
2686
+ keys = "/model openai console-fixture\n".chars
2687
+ phase = :model
2679
2688
  launch(keys) do
2680
- if !submitted && @pry.config.pwn_ai_session_id == sid
2681
- submitted = true
2682
- keys.concat("what color is a lemon?\n".chars)
2689
+ @launch_phase = phase
2690
+ idle = @console && !@console.send(:busy?)
2691
+ case phase
2692
+ when :model
2693
+ if idle && @paint.join.include?('model=console-fixture')
2694
+ phase = :resume
2695
+ keys.concat("/sessions resume resumed console\n".chars)
2696
+ end
2683
2697
  nil
2684
- elsif @paint.any? { |row| row.include?('Selected route.') }
2685
- "\u0004"
2698
+ when :resume
2699
+ if idle && @pry.config.pwn_ai_session_id == sid
2700
+ phase = :ask
2701
+ keys.concat("what color is a lemon?\n".chars)
2702
+ end
2703
+ nil
2704
+ else
2705
+ "\u0004" if @paint.join.include?('Selected route.')
2686
2706
  end
2687
2707
  end
2688
2708
  expect(@pry.config.pwn_ai_session_id).to eq(sid)
@@ -1900,9 +1900,11 @@
1900
1900
  {"messages":[{"role":"user","content":"PWN::Backups.capture Usage"},{"role":"assistant","content":"`PWN::Backups.capture`: Supported Method Parameters\n\nPWN::Backups.capture(path: ‘/path/to/source’, label: ‘learning’)\n"}]}
1901
1901
  {"messages":[{"role":"user","content":"PWN::Backups.configure Usage"},{"role":"assistant","content":"`PWN::Backups.configure`: Supported Method Parameters\n\nPWN::Backups.configure(root: nil)\n"}]}
1902
1902
  {"messages":[{"role":"user","content":"PWN::Backups.directory Usage"},{"role":"assistant","content":"`PWN::Backups.directory`: Supported Method Parameters\n\nPWN::Backups.directory(label: ‘maintenance’) Caller must hold transaction through the final source mutation and ledger.\n"}]}
1903
+ {"messages":[{"role":"user","content":"PWN::Backups.expirable_name? Usage"},{"role":"assistant","content":"`PWN::Backups.expirable_name?`: "}]}
1903
1904
  {"messages":[{"role":"user","content":"PWN::Backups.help Usage"},{"role":"assistant","content":"`PWN::Backups.help`: "}]}
1904
1905
  {"messages":[{"role":"user","content":"PWN::Backups.legacy_inventory Usage"},{"role":"assistant","content":"`PWN::Backups.legacy_inventory`: "}]}
1905
1906
  {"messages":[{"role":"user","content":"PWN::Backups.legacy_unreferenced Usage"},{"role":"assistant","content":"`PWN::Backups.legacy_unreferenced`: "}]}
1907
+ {"messages":[{"role":"user","content":"PWN::Backups.owned_directory? Usage"},{"role":"assistant","content":"`PWN::Backups.owned_directory?`: "}]}
1906
1908
  {"messages":[{"role":"user","content":"PWN::Backups.reconcile Usage"},{"role":"assistant","content":"`PWN::Backups.reconcile`: Supported Method Parameters\n\nPWN::Backups.reconcile(generation: ‘name’, expected_sha256: ‘digest’, confirmed: true)\n"}]}
1907
1909
  {"messages":[{"role":"user","content":"PWN::Backups.reference_pins Usage"},{"role":"assistant","content":"`PWN::Backups.reference_pins`: "}]}
1908
1910
  {"messages":[{"role":"user","content":"PWN::Backups.relocate_legacy Usage"},{"role":"assistant","content":"`PWN::Backups.relocate_legacy`: Supported Method Parameters\n\nPWN::Backups.relocate_legacy(paths: [], dry_run: true, writers_stopped: false)\n"}]}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.790
4
+ version: 0.5.792
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "<"
17
17
  - !ruby/object:Gem::Version
18
- version: 8.1.4
18
+ version: 8.1.4.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "<"
24
24
  - !ruby/object:Gem::Version
25
- version: 8.1.4
25
+ version: 8.1.4.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: anemone
28
28
  requirement: !ruby/object:Gem::Requirement