picocode-core 0.9.146 → 0.9.148

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.146",
3
+ "version": "0.9.148",
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
@@ -673,7 +673,10 @@ export function createController({ boot }) {
673
673
  const pendingMessages = state.queued
674
674
  if (expeditedMessages.length > 0 || pendingMessages.length > 0) {
675
675
  set({ expedited: [], queued: [] })
676
- if (result.interrupted && !sendAfterToolTriggered) {
676
+ // an interrupt is the user taking the wheel: nothing pending may
677
+ // auto-send, expedited or not; it all returns to the composer
678
+ if (result.interrupted) {
679
+ sendAfterToolTriggered = false
677
680
  emit('input', [...expeditedMessages, ...pendingMessages].join('\n'))
678
681
  } else {
679
682
  const next = sendAfterToolTriggered ? expeditedMessages : [...expeditedMessages, ...pendingMessages]
package/src/prompts.js DELETED
@@ -1,41 +0,0 @@
1
- import { mkdir, readFile, readdir, unlink, writeFile } from 'node:fs/promises'
2
- import { join } from 'node:path'
3
- import { picoHome } from './paths.js'
4
- import { parseFrontmatter } from './skills.js'
5
-
6
- export function globalPromptsDir() {
7
- return join(picoHome(), 'prompts')
8
- }
9
-
10
- export function promptName(name) {
11
- return String(name ?? '').trim().toLowerCase().replace(/[^a-z0-9_-]+/g, '-').replace(/^-+|-+$/g, '')
12
- }
13
-
14
- const promptFile = (name) => join(globalPromptsDir(), `${promptName(name)}.md`)
15
-
16
- export async function listPrompts() {
17
- let files = []
18
- try { files = await readdir(globalPromptsDir()) } catch { return [] }
19
- return Promise.all(files.filter((file) => file.endsWith('.md')).sort().map(async (file) => {
20
- const text = await readFile(join(globalPromptsDir(), file), 'utf-8')
21
- const { meta, body } = parseFrontmatter(text)
22
- return { name: file.slice(0, -3), description: meta.description || '', body: body.trim() }
23
- }))
24
- }
25
-
26
- export async function savePrompt({ previous, name, description, body }) {
27
- const slug = promptName(name)
28
- if (!slug || !String(body ?? '').trim()) throw new Error('prompt name and text are required')
29
- await mkdir(globalPromptsDir(), { recursive: true })
30
- const summary = String(description ?? '').trim().replace(/\s*\n\s*/g, ' ')
31
- const text = `---\ndescription: ${summary}\n---\n\n${String(body).trim()}\n`
32
- await writeFile(promptFile(slug), text)
33
- const old = promptName(previous)
34
- if (old && old !== slug) await unlink(promptFile(old)).catch(() => {})
35
- return true
36
- }
37
-
38
- export async function removePrompt(name) {
39
- await unlink(promptFile(name))
40
- return true
41
- }