ask-coding-providers 0.3.0 → 0.3.1

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: b1b9421ae222addaf585ea8b26333306078843d0574a4b71a34cecaa3fc4ff79
4
- data.tar.gz: 8c7d16435c702703f0f661474077389c28d4fc796aafe196bfce4ccd1f7019b2
3
+ metadata.gz: f1e380717ee69fa2d0da0df5a2c706e2b6e8ef3509ea6f6baad0c96d170d62f3
4
+ data.tar.gz: 21d327fadd79f5fbbdce88c71e1009b2f45b03431bd7cf29e258f4bcb07b3b05
5
5
  SHA512:
6
- metadata.gz: 76cbfb82c26608b1d73a44673b09ab6a299a7c604e80566fa8e9555acd4c2443239d28fafafdee6e29589aa9062cef5e4c4bab465bdb103e41db66560e91b2fe
7
- data.tar.gz: 4a704264075d1c25ce32bf4ae73106050c3ffd7aa52f34ed042f8e98c4132d0f150aca5fe88af3114ca4d0b8c066a83c9f545b44ca267b6abf34d7e802f5c829
6
+ metadata.gz: 975feb731eb168bd1a291c395e6421fd882ca9b0a23766602dde39352a187cb79c354df70d531e4516eb6050854e2086bbe3c629185e7751ea6d54c6554eca3a
7
+ data.tar.gz: 23cf6fe197707a8a0d456fbc8299f004cbb87134b17393a634305d227d1ada59b1bf476458ad482cc734317be8b87ae0972e240f6bc87a5d2a08ee1576707c57
@@ -147,7 +147,9 @@ module Ask
147
147
  # @param workspace_path [String] working directory
148
148
  # @param mode [String, nil] permission mode
149
149
  # @param model [String, nil] model override for this session
150
- def create_session(workspace_path, mode: nil, model: nil)
150
+ # @param system_prompt [String, nil] system prompt override for this
151
+ # session (takes precedence over any system_prompt in session_opts)
152
+ def create_session(workspace_path, mode: nil, model: nil, system_prompt: nil)
151
153
  ensure_started
152
154
  sid = "sess_#{SecureRandom.uuid}"
153
155
  @mutex.synchronize do
@@ -155,6 +157,7 @@ module Ask
155
157
  workspace: workspace_path,
156
158
  mode: mode,
157
159
  model: model || @model_id,
160
+ system_prompt: system_prompt,
158
161
  created_at: Time.now,
159
162
  session: nil,
160
163
  subscribers: [],
@@ -364,7 +367,8 @@ module Ask
364
367
  # ── Session construction ──
365
368
 
366
369
  def build_session(entry)
367
- chat = build_chat(entry[:model])
370
+ prompt = entry[:system_prompt] || @session_opts[:system_prompt]
371
+ chat = build_chat(entry[:model], prompt)
368
372
 
369
373
  queue = EmittingApprovalQueue.new(
370
374
  on_submit: ->(a) { emit_approval(entry, a, :pending) },
@@ -393,12 +397,13 @@ module Ask
393
397
  end
394
398
  end
395
399
 
396
- def build_chat(model_id)
400
+ def build_chat(model_id, system_prompt = nil)
397
401
  chat = Ask::Agent::Chat.new(
398
402
  model: model_id,
399
403
  provider: @provider_slug,
400
404
  tools: @tools
401
405
  )
406
+ chat.with_instructions(system_prompt) if system_prompt
402
407
  # Inject pre-configured provider to bypass Ask::Auth.resolve
403
408
  chat.instance_variable_set(:@provider, @provider)
404
409
  chat
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module CodingProviders
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-coding-providers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto