Commit Graph

238 Commits

Author SHA1 Message Date
NCBM d74b03923f core/tools: add fetch tool with SSRF policy and catalog wiring 2026-07-24 19:07:08 +08:00
NCBM acdc62f2a9 release: plyngent 0.2.0 v0.2.0 2026-07-24 17:51:43 +08:00
NCBM 908e68665b core/agent: run_aside side turns; CLI /btw with --tools 2026-07-24 17:42:34 +08:00
NCBM 559a3410bc core/config: write LF strings as TOML multi-line literals 2026-07-24 17:21:50 +08:00
NCBM da4d3d097a core/config: persist provider models as TOML inline tables 2026-07-24 17:11:39 +08:00
NCBM 03e04f9a38 core/cli: plugins list/enable/disable commands and /plugins slash 2026-07-24 16:44:44 +08:00
NCBM 1d718582ac core/tools: drop process workspace/todo globals; require bound state 2026-07-24 16:32:33 +08:00
NCBM 4215a8cea0 core/config: top-level [plugins] enable/disable allowlist 2026-07-24 16:19:50 +08:00
NCBM 278c930fae docs: tool plugins guide and config cross-links 2026-07-24 16:05:10 +08:00
NCBM ac3230647a test/agent: bind todo tools via SessionState instead of process global 2026-07-24 16:00:17 +08:00
NCBM 8baaa3f2e1 core/tools: hang workspace policy on InstanceState 2026-07-24 15:58:55 +08:00
NCBM 6c6cec05c4 core/cli: bind todo persist via session state, not process global 2026-07-24 15:49:57 +08:00
NCBM 3c0eb8ffad core/tools: session on_todo_change and MemoryViewStore seed helpers 2026-07-24 15:47:57 +08:00
NCBM 7a3704edc1 core/tools: resolve_path accepts instance workspace root 2026-07-24 15:41:59 +08:00
NCBM 90c07061f3 core/tools: persist soft-confirm grants under session.data 2026-07-24 15:41:39 +08:00
NCBM 3d5380a3d4 core/tools: todo tools commit via session.data transactions 2026-07-24 15:31:26 +08:00
NCBM e82a226f91 core/tools: serialize domain objects on PersistentDataView commit 2026-07-24 15:31:06 +08:00
NCBM 96518974be core/tools: allowlisted entry-point plugin loader 2026-07-24 15:09:11 +08:00
NCBM 07e3c5caa5 core/tools: PTY tools use instance-aware manager facade 2026-07-24 15:06:18 +08:00
NCBM 662e95f693 core/cli: /tools --list shows tags and catalog source 2026-07-24 15:04:33 +08:00
NCBM 7253ca84dd core/tools: prefer instance workspace and session todo views 2026-07-24 15:02:52 +08:00
NCBM 12c8adda3a test/tools: catalog, grants, and async tool helpers 2026-07-24 14:57:03 +08:00
NCBM 2f6133f685 core/cli: catalog select, session state, tag-aware yolo 2026-07-24 14:56:48 +08:00
NCBM 15dde7cdaf core/tools: async builtins with policy tags 2026-07-24 14:56:33 +08:00
NCBM 4feb0e0d26 core/tools: catalog, tags, state context, and PersistentDataView 2026-07-24 14:56:19 +08:00
NCBM 30beec6600 core/config: split agent system_prompt and tool_directives 2026-07-21 22:55:51 +08:00
NCBM db7c097466 test/cli: isolate oneshot chat from user-data database 2026-07-21 22:44:26 +08:00
NCBM b06bb1d409 core/agent: shift persist_from when prepending system prompt 2026-07-21 22:44:09 +08:00
NCBM b51d4780ab core/agent: refresh synthetic_tool todo nags to live stack 2026-07-21 22:42:27 +08:00
NCBM 6d74d31cea core/config: default system prompt for coding agent tools 2026-07-20 18:21:27 +08:00
NCBM 767578723e core/runtime: configurable provider HTTP request timeouts 2026-07-20 18:08:27 +08:00
NCBM 71b9f91e14 core/agent: keep more recent tool results in soft-compact
Raise DEFAULT_RECENT_TOOL_RESULTS from 4 to 12 so near-term tool
payloads stay full-size longer when trimming older dumps for context.
2026-07-20 17:34:01 +08:00
NCBM 879e28ea4c core/agent: synthetic_tool review always when stack non-empty
needs_review is true for any non-empty stack so end-of-turn inject
keeps firing under synthetic_tool. Message history keeps only the last
todo-nag tool pair (dedupe by todo-nag- tool_call_id).
2026-07-20 16:20:01 +08:00
NCBM 614ffaaf8f ci: publish only after CI check succeeds
Merge release into ci.yml: tag pushes run check then publish (needs:
check). Remove standalone python-publish so PyPI never ships on red CI.
Retag (delete+push v*) still retriggers the pipeline.
2026-07-20 04:44:57 +08:00
NCBM 7bdd9ff8b7 chore: pin ruff and basedpyright for prek and lockfile
Match prek additional_dependencies and pyproject dev pins to pdm.lock
(ruff==0.15.22, basedpyright==1.39.9). Format fix for ruff 0.15.22.
2026-07-20 04:35:26 +08:00
NCBM bec14e76af release: plyngent 0.1.3
Bump package version; refresh lock (ruff 0.15.22, platformdirs 4.10.1).
prek.toml already tracks latest ruff/basedpyright via additional_dependencies.
v0.1.3
2026-07-20 04:30:07 +08:00
NCBM 59017fd61b core/agent: synthetic_tool nag uses real todo_list render body
developer/user keep OPEN WORK prose; synthetic_tool injects forged
todo_list call with stack.render() only so the result matches a real
tool output.
2026-07-20 04:10:21 +08:00
NCBM 2e6cb3834a core/agent: drop system todo nag; emit events for synthetic_tool
Remove system strategy (legacy maps to developer). synthetic_tool still
forges the call but uses real stack text as the tool result, and now
yields ToolCall/Result events so the CLI flushes and does not glue nag
text to the next assistant stream.
2026-07-20 03:55:50 +08:00
NCBM f6d14ed549 core/agent: configurable todo nag strategies
Add [agent] todo_nag_strategy: developer (default), system, user,
synthetic_tool (forged todo_list pair), or none. Shared inject helper
used for turn-start and end-of-turn nags; CLI wires agent config.
2026-07-20 03:33:02 +08:00
NCBM a4ab11c9a2 core/agent: stronger open-work signals in todo stack prompts
Split tags: [TODO OPEN WORK] for pending/in_progress (undone work) vs
[TODO HYGIENE] for all-terminal leftover groups. End-of-turn review lists
open titles; tool docs stress open items as unfinished work.
2026-07-20 03:17:44 +08:00
NCBM 0d783b6d96 core/tools: claim PTY controlling TTY after setsid (sudo without -S)
After setsid(), ioctl(TIOCSCTTY) (or reopen slave) so the session leader
has a real controlling terminal. Live-tested: open_pty([sudo,echo,test])
shows a password prompt; ask_into_pty + read_pty yields test with exit 0.
2026-07-20 03:15:56 +08:00
NCBM d6616d0da3 core/tools: timed human allow for denylisted commands
Denylist hits ask the user (default deny, timeout) instead of only hard
rejecting when a policy hook is installed. Independent of YOLO soft-confirm;
session grants skip re-prompt for the same basename. CLI installs the hook
via install_cli_limit_hooks.
2026-07-20 03:02:34 +08:00
NCBM a677e06af4 core/tools: add ask_into_pty for human-local PTY input
Prompt the human (optional no-echo secret) and write only to the PTY.
Tool results never include the answer so secrets stay off external APIs.
Empty/Ctrl-C cancel without writing; submit defaults to trailing newline.
2026-07-20 02:47:19 +08:00
NCBM aadcd237db core/cli: soft-fail GET /models cancel/timeout on provider switch
Map CancelledError and TimeoutError from models() to RuntimeError so
merged_model_choices falls back to config/cache. Stub remote fetch in
/provider unit tests so they never hit the network.
2026-07-19 22:38:22 +08:00
NCBM 58ff646034 core/cli: config open via VISUAL/EDITOR or system default
Prefer $VISUAL then $EDITOR (blocking). Without either, fall back to
xdg-open / open / startfile (non-blocking) for config paths only.
/edit stays blocking-only so the temp buffer can be re-read.
2026-07-19 22:33:02 +08:00
NCBM d528f65c4c core/tools: edit_replace max_replaces and richer match messages
Default still replaces first match only. Report how many matches were
found, how many replaced, and remaining hits so agents can raise
max_replaces or narrow old_string.
2026-07-19 21:55:16 +08:00
NCBM 0ec0d542e8 core/cli: keep database url :memory:; default url None
Unset/empty url still maps to durable user-data chat.db.
Explicit :memory: is not rewritten; CLI warns when not quiet.
DatabaseConfig.url default is None; engine treats None as memory.
2026-07-19 21:38:21 +08:00
NCBM 182546d60e core/tools: narrow list[object] for batch command argv typing
basedpyright treated bare list elements as Unknown after isinstance(list);
cast to list[object] so prek basedpyright exits clean.
2026-07-19 20:39:16 +08:00
NCBM e1e4df0f3f core/agent: strengthen todo prompts when stack not empty
Inject turn-start [TODO REMINDER] for non-empty stacks; rewrite end-of-turn
[TODO OPEN] copy so open items read as unfinished work. needs_review now
always true while open items remain (even if todo_* ran this turn); terminal-only
stacks still need review if untouched. Update tool docs and tests.
2026-07-19 20:34:01 +08:00
NCBM a54fa534f3 test/tools: clean shell confirm format test 2026-07-19 13:05:43 +08:00