sapper-iq 1.2.4 → 1.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sapper.mjs +24 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sapper-iq",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "AI-powered development assistant that executes commands and builds projects",
5
5
  "main": "sapper.mjs",
6
6
  "bin": {
package/sapper.mjs CHANGED
@@ -8634,31 +8634,31 @@ async function runSapper() {
8634
8634
  spinner.start('Thinking...');
8635
8635
  const aiStartTime = Date.now();
8636
8636
  let response;
8637
- try {
8638
- // Build chat options pass native tools when supported
8639
- const chatOpts = { model: selectedModel, messages, stream: true };
8640
- if (effectiveContextLength()) {
8641
- chatOpts.options = { num_ctx: effectiveContextLength() };
8642
- }
8643
- // Thinking can be forced on, forced off, or auto-disabled for simple prompts.
8644
- if (turnThinkingEnabled) chatOpts.think = true;
8645
- if (useNativeTools) {
8646
- // Filter tool defs by agent restrictions if any
8647
- if (currentAgentTools) {
8648
- const toolNameMap = {
8649
- list_directory: 'LIST', read_file: 'READ', search_files: 'SEARCH',
8650
- write_file: 'WRITE', patch_file: 'PATCH', create_directory: 'MKDIR',
8651
- ls: 'LS', cat: 'CAT', head: 'HEAD', tail: 'TAIL', grep: 'GREP', find: 'FIND',
8652
- pwd: 'PWD', cd: 'CD', rmdir: 'RMDIR', changes: 'CHANGES',
8653
- fetch_web: 'FETCH', recall_memory: 'MEMORY', open_url: 'OPEN', run_shell: 'SHELL'
8654
- };
8655
- chatOpts.tools = nativeToolDefs.filter(t =>
8656
- isToolAllowedForAgent(currentAgentTools, toolNameMap[t.function.name])
8657
- );
8658
- } else {
8659
- chatOpts.tools = nativeToolDefs;
8660
- }
8637
+ // Build chat options — pass native tools when supported
8638
+ const chatOpts = { model: selectedModel, messages, stream: true };
8639
+ if (effectiveContextLength()) {
8640
+ chatOpts.options = { num_ctx: effectiveContextLength() };
8641
+ }
8642
+ // Thinking can be forced on, forced off, or auto-disabled for simple prompts.
8643
+ if (turnThinkingEnabled) chatOpts.think = true;
8644
+ if (useNativeTools) {
8645
+ // Filter tool defs by agent restrictions if any
8646
+ if (currentAgentTools) {
8647
+ const toolNameMap = {
8648
+ list_directory: 'LIST', read_file: 'READ', search_files: 'SEARCH',
8649
+ write_file: 'WRITE', patch_file: 'PATCH', create_directory: 'MKDIR',
8650
+ ls: 'LS', cat: 'CAT', head: 'HEAD', tail: 'TAIL', grep: 'GREP', find: 'FIND',
8651
+ pwd: 'PWD', cd: 'CD', rmdir: 'RMDIR', changes: 'CHANGES',
8652
+ fetch_web: 'FETCH', recall_memory: 'MEMORY', open_url: 'OPEN', run_shell: 'SHELL'
8653
+ };
8654
+ chatOpts.tools = nativeToolDefs.filter(t =>
8655
+ isToolAllowedForAgent(currentAgentTools, toolNameMap[t.function.name])
8656
+ );
8657
+ } else {
8658
+ chatOpts.tools = nativeToolDefs;
8661
8659
  }
8660
+ }
8661
+ try {
8662
8662
  response = await ollama.chat(chatOpts);
8663
8663
  } catch (ollamaError) {
8664
8664
  const errMsg = ollamaError && ollamaError.message ? ollamaError.message : String(ollamaError);