picocode-core 0.9.228 → 0.9.229
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 +1 -1
- package/src/claude-code/translate.js +1 -1
- package/src/controller.js +11 -12
- package/src/daemon-runtime.js +1 -1
- package/src/init.js +1 -1
- package/src/tools/index.js +2 -23
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ const BRIDGE_PREFIX = `mcp__${BRIDGE_SERVER}__`
|
|
|
21
21
|
// project keeps one store, pico's
|
|
22
22
|
export const COVERED_TOOLS = new Set([
|
|
23
23
|
'read', 'write', 'edit', 'bash', 'glob', 'grep', 'view', 'shell_output', 'shell_kill', 'tool_result',
|
|
24
|
-
'
|
|
24
|
+
'agent_start', 'agent_list', 'agent_collect', 'agent_cancel', 'deliberate',
|
|
25
25
|
'skill',
|
|
26
26
|
])
|
|
27
27
|
|
package/src/controller.js
CHANGED
|
@@ -66,7 +66,7 @@ export const SESSION_COLORS = {
|
|
|
66
66
|
gray: '#9ca3af',
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const AGENT_TOOLS = ['
|
|
69
|
+
const AGENT_TOOLS = ['agent_start', 'agent_list', 'agent_collect', 'agent_cancel']
|
|
70
70
|
const CONTEXT_COLORS = ['#67b7ff', '#c792ea', '#f7c66a', '#f78c6c', '#6be795']
|
|
71
71
|
|
|
72
72
|
function createEmitter() {
|
|
@@ -84,9 +84,9 @@ function createEmitter() {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// each of these takes the host's own wording when it gives one (boot.prompts), with {{placeholders}} filled in
|
|
87
|
-
function parallelPrompt(task,
|
|
88
|
-
if (template) return fillPrompt(template, { task
|
|
89
|
-
return `Use parallel agents for the following task: ${task}\n\
|
|
87
|
+
function parallelPrompt(task, template) {
|
|
88
|
+
if (template) return fillPrompt(template, { task })
|
|
89
|
+
return `Use parallel agents for the following task: ${task}\n\nUse agent_start to delegate distinct, focused parts of the task to the configured worker model, as many as the task needs. Collect workers with agent_collect, critically evaluate their results, and synthesize the final response. When useful, 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.`
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function deliberatePrompt(decision, rounds, template) {
|
|
@@ -158,7 +158,7 @@ export function createController({ boot, run = runTurn, compactRun = compactHist
|
|
|
158
158
|
|
|
159
159
|
let abort = null
|
|
160
160
|
let sendAfterToolTriggered = false
|
|
161
|
-
let
|
|
161
|
+
let nextParallelTurn = false
|
|
162
162
|
let pendingSystemNotes = []
|
|
163
163
|
const warnedTools = new Set()
|
|
164
164
|
|
|
@@ -923,8 +923,9 @@ export function createController({ boot, run = runTurn, compactRun = compactHist
|
|
|
923
923
|
|
|
924
924
|
async function performAgentTurn() {
|
|
925
925
|
if (state.busy || peerTransition || shuttingDown) return
|
|
926
|
-
|
|
927
|
-
|
|
926
|
+
// a /parallel turn: the main agent only delegates
|
|
927
|
+
const parallelTurn = nextParallelTurn
|
|
928
|
+
nextParallelTurn = false
|
|
928
929
|
const controller = new AbortController()
|
|
929
930
|
abort = controller
|
|
930
931
|
emit('turn', 'start')
|
|
@@ -959,9 +960,7 @@ export function createController({ boot, run = runTurn, compactRun = compactHist
|
|
|
959
960
|
onAgentsCollected: discardCollectedAgentNotes,
|
|
960
961
|
askUser,
|
|
961
962
|
signal: controller.signal,
|
|
962
|
-
|
|
963
|
-
requireAgentPlan: !!researchAgentLimit,
|
|
964
|
-
allowNames: researchAgentLimit ? AGENT_TOOLS : undefined,
|
|
963
|
+
allowNames: parallelTurn ? AGENT_TOOLS : undefined,
|
|
965
964
|
// the tools the host turned off for this model, read at every turn
|
|
966
965
|
denyNames: typeof boot.disabledTools === 'function' ? boot.disabledTools(state.model) : boot.disabledTools,
|
|
967
966
|
onToolUpdate,
|
|
@@ -1554,8 +1553,8 @@ export function createController({ boot, run = runTurn, compactRun = compactHist
|
|
|
1554
1553
|
return true
|
|
1555
1554
|
}
|
|
1556
1555
|
if (!modelAvailable(boot.researchModel)) return false
|
|
1557
|
-
|
|
1558
|
-
send(parallelPrompt(task, boot.
|
|
1556
|
+
nextParallelTurn = true
|
|
1557
|
+
send(parallelPrompt(task, boot.prompts?.parallel?.request))
|
|
1559
1558
|
return true
|
|
1560
1559
|
}
|
|
1561
1560
|
|
package/src/daemon-runtime.js
CHANGED
|
@@ -194,7 +194,7 @@ export function createDaemonRuntime({ createSession, onEmpty = () => {}, batchMs
|
|
|
194
194
|
return { result, incremental: true }
|
|
195
195
|
}
|
|
196
196
|
if (op === 'configure') {
|
|
197
|
-
const allowed = ['researchModel', 'shellModel', 'deliberationModel', 'participantAModel', 'participantBModel', '
|
|
197
|
+
const allowed = ['researchModel', 'shellModel', 'deliberationModel', 'participantAModel', 'participantBModel', 'clouds', 'compactToolHistory', 'gitFooter', 'wideSidebar']
|
|
198
198
|
for (const [key, value] of Object.entries(args[0])) { if (!allowed.includes(key)) throw new Error('unsupported session setting'); record.ctl.boot[key] = value }
|
|
199
199
|
publish(record, 'change')
|
|
200
200
|
return
|
package/src/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const INIT_PROMPT = `Initialize or improve this repository's AGENTS.md guidance for future pico sessions.
|
|
2
2
|
|
|
3
|
-
Do this discovery yourself as the main agent. Do not call
|
|
3
|
+
Do this discovery yourself as the main agent. Do not call agent_start, agent_list, agent_collect, or delegate any part of this task to another agent.
|
|
4
4
|
|
|
5
5
|
Inspect the repository directly and then create or update its AGENTS.md files. Read enough of the actual project to understand its structure and workflows, including the relevant manifests, documentation, configuration, source layout, tests, scripts, and existing instruction files. Use targeted searches and representative files rather than exhaustively reading every file. If an AGENTS.md already exists, preserve useful human-authored guidance and improve it conservatively instead of replacing it blindly. Check CLAUDE.md files for useful repository guidance when relevant, but write canonical guidance to AGENTS.md.
|
|
6
6
|
|
package/src/tools/index.js
CHANGED
|
@@ -7,10 +7,8 @@ import { createGlob } from './glob.js'
|
|
|
7
7
|
import { createGrep } from './grep.js'
|
|
8
8
|
import { createView } from './view.js'
|
|
9
9
|
|
|
10
|
-
export function createToolset({ toolResult, cwd, env, tracker, skills, shells, sessionId, sessionFile, wakeups, memory, agents, peers, deliberations, onAgentsCollected, askUser, mcpTools = [], userTools = [], hostTools = [], signal, maxToolCalls,
|
|
10
|
+
export function createToolset({ toolResult, cwd, env, tracker, skills, shells, sessionId, sessionFile, wakeups, memory, agents, peers, deliberations, onAgentsCollected, askUser, mcpTools = [], userTools = [], hostTools = [], signal, maxToolCalls, allowNames, denyNames, onToolUpdate, viewer }) {
|
|
11
11
|
const recorder = createRecorder(onToolUpdate)
|
|
12
|
-
let agentStarts = 0
|
|
13
|
-
let plannedAgentStarts = requireAgentPlan ? null : maxAgentStarts
|
|
14
12
|
const deps = { cwd, env, recorder, tracker, signal, shells, sessionId, sessionFile }
|
|
15
13
|
|
|
16
14
|
const local = [
|
|
@@ -173,35 +171,16 @@ export function createToolset({ toolResult, cwd, env, tracker, skills, shells, s
|
|
|
173
171
|
|
|
174
172
|
if (agents) {
|
|
175
173
|
local.push(
|
|
176
|
-
{
|
|
177
|
-
name: 'agent_plan',
|
|
178
|
-
description: 'Declare the background worker budget for the current assistant turn before starting any workers. The main agent is excluded. Set count to the number of workers you intend to start this turn; collecting a worker does not restore budget. Interpret any user-requested count semantically; otherwise use the configured default.',
|
|
179
|
-
schema: {
|
|
180
|
-
description: describeParam,
|
|
181
|
-
count: { type: 'integer', description: `background workers permitted this turn, excluding the main agent (1-${maxAgentStarts || 100})` },
|
|
182
|
-
reason: { type: 'string', description: 'brief explanation of how the count follows the user request or research scope' },
|
|
183
|
-
},
|
|
184
|
-
execute: ({ count, reason }) => {
|
|
185
|
-
const ceiling = maxAgentStarts || 100
|
|
186
|
-
if (!Number.isInteger(count) || count < 1 || count > ceiling) throw new Error(`agent budget must be between 1 and ${ceiling}`)
|
|
187
|
-
if (agentStarts > 0) throw new Error('agent budget must be declared before starting agents')
|
|
188
|
-
plannedAgentStarts = count
|
|
189
|
-
return { agentLimit: count, reason }
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
174
|
{
|
|
193
175
|
name: 'agent_start',
|
|
194
|
-
description: 'Start one background worker,
|
|
176
|
+
description: 'Start one background worker, as many as the task needs. Workers do not receive the parent conversation, only the supplied prompt and their available project context and tools. Make the prompt self-contained by including all conversation-specific terms, goals, constraints, and decisions the worker cannot discover itself. Continue only independent work until you collect its result with agent_collect.',
|
|
195
177
|
schema: {
|
|
196
178
|
prompt: { type: 'string', description: 'complete, self-contained task and desired output, including necessary context from the parent conversation' },
|
|
197
179
|
description: describeParam,
|
|
198
180
|
tools: { type: 'array', items: { type: 'string' }, description: 'tool names to allow; omit for the configured worker tools', optional: true },
|
|
199
181
|
},
|
|
200
182
|
execute: ({ prompt, description, tools }) => {
|
|
201
|
-
if (plannedAgentStarts == null) throw new Error('call agent_plan before starting research agents')
|
|
202
|
-
if (agentStarts >= plannedAgentStarts) throw new Error(`agent limit reached for this turn (${plannedAgentStarts}); completed or collected workers do not restore budget within the turn`)
|
|
203
183
|
const agent = agents.start({ prompt, description, tools, sessionId, sessionFile })
|
|
204
|
-
agentStarts++
|
|
205
184
|
return { agentId: agent.id, status: agent.status, model: agent.model }
|
|
206
185
|
},
|
|
207
186
|
},
|