63 Commits

Author SHA1 Message Date
8ad811c977 feat: sync upstream pi-mono (386 commits)
从上游 badlogic/pi-mono 同步 386 个提交,手动解决所有冲突:

保留 SproutClaw 独有功能:
- RPC: reload 命令、bash 流式输出、get_extensions 命令
- settings-manager: showChangelogOnStartup 设置
- agent-session: turnIndex getter
- 移除 pi 版本检查通知(interactive-mode)
- skills 系统、启动脚本、自定义工具脚本

直接采用上游版本:
- packages/ai 模型列表及测试文件
- packages/coding-agent 文档
- 其余未冲突的全部上游代码

升级 @mistralai/mistralai 至 2.2.6(修复 promptCacheKey 类型错误)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 20:18:02 +08:00
Vegard Stikbakke
1287b69fe0 fix(coding-agent): run legacy WSL bash commands via stdin
closes #5893
2026-06-19 15:08:25 +02:00
Armin Ronacher
daab056ac1 fix(agent): ignore late tool progress updates
closes #5573
2026-06-12 18:59:32 +02:00
root
cf5edd6394 feat(sproutclaw): modularize webui, extensions, and agent config layout
Some checks failed
CI / build-check-test (push) Has been cancelled
Restructure local extensions into per-feature directories, split WebUI
into backend modules with slash commands and systemd support, and track
prompts/skills under .pi/agent for portable Gitea deployment.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 16:57:08 +08:00
Mario Zechner
b63d26332f Finish harness tool registry semantics 2026-05-28 12:34:02 +02:00
Mario Zechner
2e02c74dcb chore: pin dependencies and use native TypeScript 2026-05-20 12:46:17 +02:00
Mario Zechner
b1893b3d77 fix(agent): preserve oversized tail output with trailing newline
closes #4715
2026-05-18 23:05:34 +02:00
Mario Zechner
4f40f62b7b refactor(agent): harden harness session semantics 2026-05-16 00:32:16 +02:00
Mario Zechner
80c918c247 refactor(agent): isolate node filesystem session dependencies 2026-05-15 00:53:33 +02:00
Mario Zechner
a31ce0f47f refactor(agent): return results from compaction helpers 2026-05-14 21:56:45 +02:00
Mario Zechner
b7ea82105a refactor(agent): run harness loop directly 2026-05-14 21:33:34 +02:00
Mario Zechner
846906e4d1 refactor(agent): add result-based execution env 2026-05-14 18:26:29 +02:00
Armin Ronacher
c00f1cf130 fix(agent): correct uuidv7 sequence handling 2026-05-13 15:53:53 +02:00
Armin Ronacher
3d9e14d748 fix(compaction): clamp summary output tokens
Fixes #4390.
2026-05-11 16:36:27 +02:00
Mario Zechner
f348a06294 test(agent): cover harness stream configuration 2026-05-10 19:10:54 +02:00
Mario Zechner
e25415dd5f refactor(agent): finalize harness resource config 2026-05-10 00:49:00 +02:00
Mario Zechner
79db9d62ef refactor(agent): make harness resources explicit 2026-05-10 00:18:50 +02:00
Mario Zechner
322759a3f0 refactor(agent): snapshot harness turn state 2026-05-09 23:34:58 +02:00
Mario Zechner
f13e6a88ab test(agent): pin harness resource formatting 2026-05-09 19:55:48 +02:00
Mario Zechner
401017a3e8 refactor(agent): rename resource formatting helpers 2026-05-09 19:44:08 +02:00
Mario Zechner
90c017b05b Merge remote-tracking branch 'origin/main' into bigrefactor
# Conflicts:
#	package-lock.json
#	packages/agent/package.json
2026-05-08 13:38:20 +02:00
Mario Zechner
e1647aaa00 refactor(agent): make resource invocation explicit 2026-05-08 13:35:54 +02:00
Mario Zechner
3e5ad67e0f chore: migrate pi packages to earendil works scope 2026-05-07 15:59:42 +02:00
Mario Zechner
65206cfba8 docs(agent): document harness resource types 2026-05-07 11:26:15 +02:00
Mario Zechner
ddb18640e3 feat(agent): return diagnostics from resource loaders 2026-05-06 21:59:48 +02:00
Mario Zechner
617d8b317d refactor(agent): tighten harness environment and resources 2026-05-06 19:41:17 +02:00
Mario Zechner
e1ca501da8 refactor(agent): expose concrete harness 2026-05-06 13:21:08 +02:00
Mario Zechner
530f14c018 refactor(agent): expose concrete harness session 2026-05-06 12:57:19 +02:00
Mario Zechner
d29e47c771 feat(agent): add harness factory helpers 2026-05-04 01:15:53 +02:00
Mario Zechner
3d0f57187d refactor(agent): simplify harness session repo layout 2026-05-04 00:06:35 +02:00
Mario Zechner
cdde2e893d refactor(agent): consolidate harness session abstraction 2026-05-03 22:01:40 +02:00
Mario Zechner
e612149369 refactor(agent): tighten harness session storage 2026-05-03 13:21:14 +02:00
Mario Zechner
83599e789d feat(agent): split harness compaction and session modules 2026-05-03 03:13:45 +02:00
Mario Zechner
a5b27367d3 feat(agent): add initial harness foundation 2026-05-03 00:35:36 +02:00
Mario Zechner
73b7b2c564 feat(agent): add post-turn stop callback 2026-05-02 01:20:26 +02:00
Armin Ronacher
35ff2689ee fix(typebox): migrate to v1 with extension compat (#3474)
* fix(typebox): migrate to v1 with extension compat

Replace AJV-based validation with TypeBox-native validation, keep legacy extension imports working (including @sinclair/typebox/compiler), and restore coercion for serialized/plain JSON schemas.

This change closes #3112.

* fix(typebox): use canonical imports and harden coercion

Switch first-party code to canonical typebox imports while retaining legacy extension aliases in the loader.

Remove obsolete runtime codegen guards, expand serialized JSON-schema coercion coverage, and update related tests and fixtures.

Fixes #3112.

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-22 19:59:33 +02:00
Mario Zechner
049e320570 feat(agent): add terminating tool result hints closes #3525 2026-04-22 13:26:01 +02:00
Mario Zechner
759d551527 fix(agent): emit parallel tool completion eagerly\n\ncloses #3503 2026-04-22 00:15:56 +02:00
Aliou Diallo
bfa11a50e4 feat(agent,coding-agent): per-tool executionMode override for sequential tool execution (#3345)
* feat(agent,coding-agent): add per-tool executionMode field to AgentTool and ToolDefinition

Add optional executionMode?: ToolExecutionMode to AgentTool and
ToolDefinition interfaces. Propagate through wrapToolDefinition and
createToolDefinitionFromAgentTool. No behavioral change yet — agent
loop will read this field in a follow-up.

* feat(agent): support per-tool executionMode override for sequential execution

When a tool defines executionMode='sequential', the agent loop
forces sequential execution of all tool calls in that batch,
even if the global config is parallel.

* feat(coding-agent): re-export ToolExecutionMode from @mariozechner/pi-agent-core

Makes the type available to extensions that want to set
executionMode on tool definitions.

* feat(coding-agent): add tic-tac-toe extension example with executionMode: sequential

Demonstrates per-tool executionMode: the agent plays via move/play
tool calls that share a cursor. Without sequential execution, play
can resolve before earlier moves finish, landing on the wrong cell.
2026-04-18 00:45:57 +02:00
Mario Zechner
9022a5b5ea fix(agent): await subscribed event handlers 2026-03-30 14:13:30 +02:00
Mario Zechner
cbe1a8b732 fix(agent): simplify state API and update consumers fixes #2633 2026-03-30 12:43:34 +02:00
Mario Zechner
b5f425ad15 feat(agent,coding-agent): add prepareArguments hook for pre-validation argument preparation
Add AgentTool.prepareArguments and ToolDefinition.prepareArguments hook
that runs before schema validation in the agent loop. This lets tools
silently accept legacy argument shapes from resumed old sessions without
polluting the public schema.

The built-in edit tool uses this to fold legacy top-level oldText/newText
into edits[] when resuming sessions that predate the edits-only schema.

- AgentTool/ToolDefinition: typed prepareArguments returning Static<TParameters>
- agent-loop: prepareToolCallArguments() runs before validateToolArguments()
- edit tool: prepareEditArguments folds legacy fields, validateEditInput is strict
- Documented in extensions.md with edit-tool example
2026-03-29 21:06:22 +02:00
Mario Zechner
7fe7081745 fix(coding-agent): document mutable tool_call input closes #2611 2026-03-27 04:01:20 +01:00
Mario Zechner
208a2cc123 fix(agent): defer steering until after tool execution 2026-03-16 20:23:28 +01:00
Mario Zechner
63ac2df24d fix(coding-agent): sync tool hooks with agent event processing closes #2113 2026-03-14 03:10:04 +01:00
Mario Zechner
7506b8e9ba fix(agent): remove broken async loop test 2026-03-13 22:48:55 +01:00
Mario Zechner
92882dc4cc fix(ai): improve anthropic oauth flow fixes #2119 2026-03-13 22:38:34 +01:00
Mario Zechner
b050c582a1 fix(agent,coding-agent): resume queued messages after auto-compaction 2026-02-06 11:36:19 +01:00
Burak Varlı
9a438465eb fix(ai): signature support for non-Anthropic models in Amazon Bedrock provider (#727)
* Add Amazon Bedrock models test suite for agent package

Tests basic prompts, multi-turn conversations with thinking, and
synthetic thinking signatures across all Bedrock models.

Known issues are categorized and skipped:
- Models requiring inference profile (5)
- Invalid model IDs for us-east-1 region (6)
- Max tokens config exceeds model limit (2)
- No signature support in reasoningContent (10)
- Rejects reasoning content in user messages (25)
- Validates signature format - Anthropic newer models (7)

* Fix Bedrock signature support for non-Anthropic models

Only include the signature field in reasoningContent.reasoningText for
Anthropic Claude models. Other models (OpenAI, Qwen, Minimax, Moonshot,
etc.) reject this field with:
"This model doesn't support the reasoningContent.reasoningText.signature field"

This fix enables multi-turn conversations with thinking content for
10 additional Bedrock models that previously failed.

https://buildwithpi.ai/session?7e39c05f66ea358da3f993c267fe3e29

* Add a CHANGELOG entry
2026-01-14 19:21:35 +01:00
Mario Zechner
fd268479a4 feat(ai): Add Amazon Bedrock provider (#494)
Adds support for Amazon Bedrock with Claude models including:
- Full streaming support via Converse API
- Reasoning/thinking support for Claude models
- Cross-region inference model ID handling
- Multiple AWS credential sources (profile, IAM keys, API keys)
- Image support in messages and tool results
- Unicode surrogate sanitization

Also adds 'Adding a New Provider' documentation to AGENTS.md and README.

Co-authored-by: nickchan2 <nickchan2@users.noreply.github.com>
2026-01-13 00:32:59 +01:00