From 39d43e8876b9d442fb28b91f2677fe3851e9ac28 Mon Sep 17 00:00:00 2001 From: Riley Mathews Date: Tue, 3 Feb 2026 12:54:51 -0600 Subject: add configurable agent option --- lua/99/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lua/99/init.lua') diff --git a/lua/99/init.lua b/lua/99/init.lua index 2340065..ab7e740 100644 --- a/lua/99/init.lua +++ b/lua/99/init.lua @@ -57,6 +57,7 @@ end --- @class _99.StateProps --- @field model string +--- @field agent string --- @field md_files string[] --- @field prompts _99.Prompts --- @field ai_stdout_rows number @@ -73,6 +74,7 @@ end local function create_99_state() return { model = "opencode/claude-sonnet-4-5", + agent = "build", md_files = {}, prompts = require("99.prompt-settings"), ai_stdout_rows = 3, @@ -94,6 +96,7 @@ end --- @class _99.Options --- @field logger _99.Logger.Options? --- @field model string? +--- @field agent string? --- @field md_files string[]? --- @field provider _99.Providers.BaseProvider? --- @field debug_log_prefix string? @@ -471,6 +474,11 @@ function _99.setup(opts) end end + if opts.agent then + assert(type(opts.agent) == "string", "opts.agent is not a string") + _99_state.agent = opts.agent + end + if opts.md_files then assert(type(opts.md_files) == "table", "opts.md_files is not a table") for _, md in ipairs(opts.md_files) do -- cgit v1.3-3-g829e From 50a98f9bde8574145ef1fa9ef6c1c6062b1effd8 Mon Sep 17 00:00:00 2001 From: Riley Mathews Date: Sat, 7 Feb 2026 21:27:04 -0600 Subject: hardcode build as agent --- lua/99/init.lua | 8 -------- lua/99/providers.lua | 2 +- lua/99/request-context.lua | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) (limited to 'lua/99/init.lua') diff --git a/lua/99/init.lua b/lua/99/init.lua index ab7e740..2340065 100644 --- a/lua/99/init.lua +++ b/lua/99/init.lua @@ -57,7 +57,6 @@ end --- @class _99.StateProps --- @field model string ---- @field agent string --- @field md_files string[] --- @field prompts _99.Prompts --- @field ai_stdout_rows number @@ -74,7 +73,6 @@ end local function create_99_state() return { model = "opencode/claude-sonnet-4-5", - agent = "build", md_files = {}, prompts = require("99.prompt-settings"), ai_stdout_rows = 3, @@ -96,7 +94,6 @@ end --- @class _99.Options --- @field logger _99.Logger.Options? --- @field model string? ---- @field agent string? --- @field md_files string[]? --- @field provider _99.Providers.BaseProvider? --- @field debug_log_prefix string? @@ -474,11 +471,6 @@ function _99.setup(opts) end end - if opts.agent then - assert(type(opts.agent) == "string", "opts.agent is not a string") - _99_state.agent = opts.agent - end - if opts.md_files then assert(type(opts.md_files) == "table", "opts.md_files is not a table") for _, md in ipairs(opts.md_files) do diff --git a/lua/99/providers.lua b/lua/99/providers.lua index 5b7dfc0..b638999 100644 --- a/lua/99/providers.lua +++ b/lua/99/providers.lua @@ -141,7 +141,7 @@ local OpenCodeProvider = setmetatable({}, { __index = BaseProvider }) --- @param request _99.Request --- @return string[] function OpenCodeProvider._build_command(_, query, request) - return { "opencode", "run", "--agent", request.context.agent, "-m", request.context.model, query } + return { "opencode", "run", "--agent", "build", "-m", request.context.model, query } end --- @return string diff --git a/lua/99/request-context.lua b/lua/99/request-context.lua index 6260b68..74aaa0b 100644 --- a/lua/99/request-context.lua +++ b/lua/99/request-context.lua @@ -47,7 +47,6 @@ function RequestContext.from_current_buffer(_99, xid) logger = Logger:set_id(xid), xid = xid, model = _99.model, - agent = _99.agent, marks = {}, }, RequestContext) end -- cgit v1.3-3-g829e From d9dfb2336364fa0985137b56d8b13dc806fea7a7 Mon Sep 17 00:00:00 2001 From: theprimeagain Date: Sun, 8 Feb 2026 12:58:55 -0700 Subject: small error with warn --- lua/99/init.lua | 2 +- lua/99/prompt-settings.lua | 3 +++ lua/99/window/init.lua | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lua/99/init.lua') diff --git a/lua/99/init.lua b/lua/99/init.lua index 2340065..dcb1aa3 100644 --- a/lua/99/init.lua +++ b/lua/99/init.lua @@ -336,7 +336,7 @@ end --- @param opts _99.ops.Opts function _99.visual_prompt(opts) - warn("use visual, visual_prompt has been deprecated") + print("use visual, visual_prompt has been deprecated") _99.visual(opts) end diff --git a/lua/99/prompt-settings.lua b/lua/99/prompt-settings.lua index d6f0de3..0bc564d 100644 --- a/lua/99/prompt-settings.lua +++ b/lua/99/prompt-settings.lua @@ -25,6 +25,9 @@ cnum = starting column number 1 based X = how many lines should be highlighted NOTES = A text description of why this highlight is important +NOTES cannot have new lines +You must adhere to the output format +Double check output format before writing it to the file Each location is separated by new lines Each path is specified in absolute pathing You can provide notes you think are relevant per location diff --git a/lua/99/window/init.lua b/lua/99/window/init.lua index 358b83b..492581e 100644 --- a/lua/99/window/init.lua +++ b/lua/99/window/init.lua @@ -420,4 +420,8 @@ function M.clear_active_popups() M.active_windows = {} end +function M.status_window() + M.clear_active_popups() +end + return M -- cgit v1.3-3-g829e From 3d2501afccbc9fab5b0f18811fb7ff55054eda6f Mon Sep 17 00:00:00 2001 From: theprimeagain Date: Sun, 8 Feb 2026 17:50:45 -0700 Subject: throbber, test, and better titling. --- lua/99/init.lua | 9 +++++---- lua/99/ops/throbber.lua | 6 +++--- lua/99/test/throbber.lua | 6 ++++++ lua/99/window/init.lua | 5 +++-- scratch/refresh.lua | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 lua/99/test/throbber.lua (limited to 'lua/99/init.lua') diff --git a/lua/99/init.lua b/lua/99/init.lua index dcb1aa3..eb580c6 100644 --- a/lua/99/init.lua +++ b/lua/99/init.lua @@ -255,10 +255,11 @@ local function set_selection_marks() end --- @param cb fun(context: _99.RequestContext, o: _99.ops.Opts?): nil +--- @param name string --- @param context _99.RequestContext --- @param opts _99.ops.Opts -local function capture_prompt(cb, context, opts) - Window.capture_input({ +local function capture_prompt(cb, name, context, opts) + Window.capture_input(name, { --- @param ok boolean --- @param response string cb = function(ok, response) @@ -330,7 +331,7 @@ function _99.search(opts) ops.search(context, o) return else - capture_prompt(ops.search, context, o) + capture_prompt(ops.search, "Search", context, o) end end @@ -364,7 +365,7 @@ function _99.visual(opts) if opts.additional_prompt then perform_range() else - capture_prompt(perform_range, context, opts) + capture_prompt(perform_range, "Visual", context, opts) end end diff --git a/lua/99/ops/throbber.lua b/lua/99/ops/throbber.lua index 6229e45..b994fcd 100644 --- a/lua/99/ops/throbber.lua +++ b/lua/99/ops/throbber.lua @@ -1,5 +1,5 @@ local time = require("99.time") -local throb_text = { +local throb_icons = { { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, { "◐", "◓", "◑", "◒" }, { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }, @@ -16,7 +16,7 @@ local function create_throbber(ease_fn) ease_fn = ease_fn or function(p) return p end - local icon_set = throb_text[math.random(#throb_text)] + local icon_set = throb_icons[math.random(#throb_icons)] return function(percent) local eased = ease_fn(percent) local index = math.floor(eased * #icon_set) + 1 @@ -89,6 +89,6 @@ function Throbber:stop() self.state = "stopped" end -Throbber._icons = throb_text +Throbber._icons = throb_icons return Throbber diff --git a/lua/99/test/throbber.lua b/lua/99/test/throbber.lua new file mode 100644 index 0000000..26e897b --- /dev/null +++ b/lua/99/test/throbber.lua @@ -0,0 +1,6 @@ +local Throbber = require("99.ops.throbber") +local eq = assert.are.same + +describe("Throbber", function() +end) + diff --git a/lua/99/window/init.lua b/lua/99/window/init.lua index 492581e..6451ede 100644 --- a/lua/99/window/init.lua +++ b/lua/99/window/init.lua @@ -336,13 +336,14 @@ end --- @field on_load? fun(): nil --- @field rules _99.Agents.Rules +--- @param name string --- @param opts _99.window.CaptureInputOpts -function M.capture_input(opts) +function M.capture_input(name, opts) M.clear_active_popups() local config = create_centered_window() local win = create_floating_window(config, { - title = " 99 Prompt ", + title = string.format(" 99 %s ", name), border = "rounded", }) set_defaul_win_options(win, "99-prompt") diff --git a/scratch/refresh.lua b/scratch/refresh.lua index 8f2c8b2..687a698 100644 --- a/scratch/refresh.lua +++ b/scratch/refresh.lua @@ -11,7 +11,7 @@ _99.setup({ }, }) -Window.capture_input({ +Window.capture_input("test", { cb = function(_, _) print("results") end, -- cgit v1.3-3-g829e