picocode-core 0.9.135 → 0.9.136

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocode-core",
3
- "version": "0.9.135",
3
+ "version": "0.9.136",
4
4
  "description": "The agent runtime behind pico: sessions, tools, subagents, MCP, memory, and model access",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/controller.js CHANGED
@@ -28,6 +28,7 @@ import { connectOpenAI, openaiCredentials, disconnectOpenAI } from './openai-aut
28
28
  import { agentScratchDir, ensureDir } from './paths.js'
29
29
  import { loadCodexModels } from './codex-models.js'
30
30
  import { fuzzyScore } from './fuzzy.js'
31
+ import { MAX_DELIBERATION_ROUNDS } from './deliberation.js'
31
32
  import { buildUserContent, finalizeUserContent, inputTextFromContent, mediaTypeFor } from './attachments.js'
32
33
 
33
34
  export const EFFORT_LEVELS = [
@@ -73,8 +74,9 @@ function parallelPrompt(task, agentLimit) {
73
74
  return `Use parallel agents for the following task: ${task}\n\nFirst call agent_plan. Interpret any agent-count instruction in the user's task semantically and declare that count; if the user gave no count, declare the configured default budget of ${agentLimit}. Then use agent_start within that enforced budget to delegate distinct, focused parts of the task to the configured worker model. Collect workers with agent_collect, critically evaluate their results, and synthesize the final response. When useful and the budget permits, use independent workers to check important disputed or weak conclusions. Do not delegate final synthesis. Do not emit progress updates while agents run; Pico displays agent activity automatically.`
74
75
  }
75
76
 
76
- function deliberatePrompt(decision) {
77
- return `Deliberate on the following decision: ${decision}\n\nImmediately call deliberate with a self-contained brief. Do not research first, start ordinary agents, or approximate the deliberation yourself. The deliberation participants own all supporting research.`
77
+ function deliberatePrompt(decision, rounds) {
78
+ const withRounds = rounds ? ` and rounds set to ${rounds}` : ''
79
+ return `Deliberate on the following decision: ${decision}\n\nImmediately call deliberate with a self-contained brief${withRounds}. Do not research first, start ordinary agents, or approximate the deliberation yourself. The deliberation participants own all supporting research.`
78
80
  }
79
81
 
80
82
  function workerSystemPrompt(scratchpad) {
@@ -985,13 +987,16 @@ export function createController({ boot }) {
985
987
  return true
986
988
  }
987
989
 
988
- function sendDeliberate(decision) {
990
+ // rounds, when given, is passed along to the tool call; the tool itself
991
+ // clamps to its 1..5 range
992
+ function sendDeliberate(decision, rounds) {
989
993
  if (!decision) {
990
994
  flash('usage: /deliberate <decision>')
991
995
  return true
992
996
  }
993
997
  if (!modelAvailable(boot.deliberationModel)) return false
994
- send(deliberatePrompt(decision))
998
+ const n = Number(rounds)
999
+ send(deliberatePrompt(decision, Number.isInteger(n) && n >= 1 && n <= MAX_DELIBERATION_ROUNDS ? n : null))
995
1000
  return true
996
1001
  }
997
1002