picocode-core 0.9.230 → 0.9.232
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 +3 -2
- package/src/claude-code/engine.js +2 -1
- package/src/claude-code/translate.js +4 -2
- package/src/controller.js +2 -0
- package/src/skills.js +16 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "picocode-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.232",
|
|
4
4
|
"description": "The agent runtime behind pico: sessions, tools, subagents, MCP, memory, and model access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"globby": "^16.2.4",
|
|
31
31
|
"proper-lockfile": "^4.1.2",
|
|
32
32
|
"sharp": "^0.34.5",
|
|
33
|
-
"unpdf": "^1.8.1"
|
|
33
|
+
"unpdf": "^1.8.1",
|
|
34
|
+
"yaml": "^2.9.1"
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -210,7 +210,8 @@ export function createClaudeCodeEngine({ command = claudeCommand(), idleMs = IDL
|
|
|
210
210
|
// call through the bridge lands on the tool_use Claude announced for
|
|
211
211
|
// it (same name, same arguments, oldest first), once every message
|
|
212
212
|
// before it has been handled, since it reaches pico by another channel
|
|
213
|
-
|
|
213
|
+
const covered = host.ownTools ? new Set(host.ownTools) : COVERED_TOOLS
|
|
214
|
+
entry.bridge.setTurn(tools.filter((tool) => !covered.has(tool.name)), async (name, args) => {
|
|
214
215
|
await chain
|
|
215
216
|
const at = unclaimed.findIndex((use) => use.name === name && JSON.stringify(use.args) === JSON.stringify(args ?? {}))
|
|
216
217
|
const use = at >= 0 ? unclaimed.splice(at, 1)[0] : null
|
|
@@ -18,10 +18,12 @@ const BRIDGE_PREFIX = `mcp__${BRIDGE_SERVER}__`
|
|
|
18
18
|
// pico tools Claude Code already has its own version of; offering both
|
|
19
19
|
// would only make the model choose between equivalent tools. Memory is
|
|
20
20
|
// not among them: Claude Code's own is switched off, so every model in a
|
|
21
|
-
// project keeps one store, pico's
|
|
21
|
+
// project keeps one store, pico's. Deliberation is not either: Claude
|
|
22
|
+
// Code has nothing like it. A host that decides this itself passes its
|
|
23
|
+
// own list (boot.engineOwnTools)
|
|
22
24
|
export const COVERED_TOOLS = new Set([
|
|
23
25
|
'read', 'write', 'edit', 'bash', 'glob', 'grep', 'view', 'shell_output', 'shell_kill', 'tool_result',
|
|
24
|
-
'agent_start', 'agent_list', 'agent_collect', 'agent_cancel',
|
|
26
|
+
'agent_start', 'agent_list', 'agent_collect', 'agent_cancel',
|
|
25
27
|
'skill',
|
|
26
28
|
])
|
|
27
29
|
|
package/src/controller.js
CHANGED
|
@@ -799,6 +799,8 @@ export function createController({ boot, run = runTurn, compactRun = compactHist
|
|
|
799
799
|
env: boot.env,
|
|
800
800
|
contextFiles: boot.startupContext?.files ?? [],
|
|
801
801
|
engineState: savedEngineState(engine),
|
|
802
|
+
// the pico tools this engine's model is not offered, when the host decides that in place of the engine
|
|
803
|
+
ownTools: boot.engineOwnTools?.[engine.name] ?? null,
|
|
802
804
|
// subagents the engine runs itself, shown in the activity list
|
|
803
805
|
subagents: { start: (options) => agents.track({ ...options, sessionId: state.session?.id, sessionFile: state.session?.file }) },
|
|
804
806
|
}
|
package/src/skills.js
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
+
import { parse as parseYaml } from 'yaml'
|
|
1
2
|
import { readFile, readdir } from 'node:fs/promises'
|
|
2
3
|
import { join } from 'node:path'
|
|
3
4
|
import { globalSkillsDir, projectSkillsDir } from './paths.js'
|
|
4
5
|
|
|
6
|
+
// a file's frontmatter as YAML reads it, so multi-line and nested values keep their content; frontmatter that is not
|
|
7
|
+
// valid YAML (an unquoted "key: Use when: ...") is read a line at a time, as key: value
|
|
5
8
|
export function parseFrontmatter(text) {
|
|
6
9
|
const match = text.match(/^---\n([\s\S]*?)\n---\n?/)
|
|
7
10
|
if (!match) return { meta: {}, body: text }
|
|
11
|
+
return { meta: readMeta(match[1]), body: text.slice(match[0].length) }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function readMeta(source) {
|
|
15
|
+
try {
|
|
16
|
+
const parsed = parseYaml(source)
|
|
17
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
18
|
+
return Object.fromEntries(Object.entries(parsed).map(([key, value]) => [key, typeof value === 'string' ? value.trim() : value]))
|
|
19
|
+
}
|
|
20
|
+
} catch {}
|
|
8
21
|
const meta = {}
|
|
9
|
-
for (const line of
|
|
22
|
+
for (const line of source.split('\n')) {
|
|
10
23
|
const sep = line.indexOf(':')
|
|
11
|
-
if (sep === -1) continue
|
|
24
|
+
if (sep === -1 || /^\s/.test(line)) continue
|
|
12
25
|
meta[line.slice(0, sep).trim()] = line.slice(sep + 1).trim()
|
|
13
26
|
}
|
|
14
|
-
return
|
|
27
|
+
return meta
|
|
15
28
|
}
|
|
16
29
|
|
|
17
30
|
async function scanDir(dir, source) {
|