@diffra-ai/cli 0.1.1 → 0.1.3
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/CHANGELOG.md +38 -0
- package/dist/bundle/chunks/{anthropic-messages-M3HXJPTI.js → anthropic-messages-5EMOURYI.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-GIFO2563.js → azure-openai-responses-N67KWG2X.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-CVEPACZO.js → chunk-3UNTEQ65.js} +1 -1
- package/dist/bundle/chunks/{chunk-VJQ6ZYW4.js → chunk-4NMBWIZG.js} +5 -5
- package/dist/bundle/chunks/{chunk-INTHKDF2.js → chunk-65DC2T66.js} +1 -1
- package/dist/bundle/chunks/chunk-6ZD23B2R.js +2 -0
- package/dist/bundle/chunks/{chunk-WEJVQTLI.js → chunk-BF423NQ7.js} +1 -1
- package/dist/bundle/chunks/{chunk-262RLABF.js → chunk-CES65UJH.js} +1 -1
- package/dist/bundle/chunks/{chunk-RJRIMI6M.js → chunk-GRYHVZSI.js} +1 -1
- package/dist/bundle/chunks/{chunk-WAH3PGZX.js → chunk-HFTZ6OJJ.js} +2 -2
- package/dist/bundle/chunks/{chunk-N6Q2WLPG.js → chunk-NEFH2K3C.js} +1 -1
- package/dist/bundle/chunks/{chunk-OQFRYL4U.js → chunk-PISJX26Y.js} +1 -1
- package/dist/bundle/chunks/{chunk-VSFRR6IC.js → chunk-QQ6NVGNW.js} +1 -1
- package/dist/bundle/chunks/{chunk-N6QWAQ6I.js → chunk-QYYUGS66.js} +1 -1
- package/dist/bundle/chunks/{chunk-GT3WTHFU.js → chunk-RLMZZV4Q.js} +1 -1
- package/dist/bundle/chunks/chunk-RTPG7C5I.js +2003 -0
- package/dist/bundle/chunks/{chunk-6S2AQWGR.js → chunk-SI7T4LPD.js} +4 -4
- package/dist/bundle/chunks/{chunk-CCH74R6M.js → chunk-VOKUVFV4.js} +1 -1
- package/dist/bundle/chunks/{chunk-OOE7BGUD.js → chunk-VWWMBH3G.js} +1 -1
- package/dist/bundle/chunks/{chunk-B3FUE2LF.js → chunk-XAA355T2.js} +1 -1
- package/dist/bundle/chunks/{cli-EC3ZETTA.js → cli-55VO5MAJ.js} +1 -1
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-YW7YYPAC.js → cloudflare-workers-ai-system-one-HB5U67WC.js} +1 -1
- package/dist/bundle/chunks/{easter-egg-3d-QN5RJMZR.js → easter-egg-3d-VAZ2JWDP.js} +1 -1
- package/dist/bundle/chunks/{execute-3J63CQJG.js → execute-OEFRHFHI.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-F6DN2LQU.js → google-generative-ai-XRHE7R52.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-MDWFDVAW.js → google-vertex-75CQOPKC.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-XO72TVVH.js → llama-cpp-classify-LKIRB7ZR.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-KYVGR5VN.js → mistral-conversations-KLGIHK73.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-SIQN5LUE.js → openai-codex-responses-7L5VV67U.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-B22DYT4F.js → openai-completions-RBF6UXDW.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-4GVNTR54.js → openai-decisions-W3PJQIOF.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-5DVNSQCE.js → openai-responses-W5ZMLOTR.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-SQMQNKJU.js → openrouter-images-4FW6VFV4.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-GZ4HZRKJ.js → pi-messages-RT7FVQ4G.js} +1 -1
- package/dist/bundle/chunks/{runtime-KEVIZBAR.js → runtime-SI4R3AXJ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-GMPGMPLA.js → typesafe-system-one-DSJ7OYVL.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-M75O3ECA.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +13 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/sandbox-command.d.ts +8 -0
- package/dist/cli/sandbox-command.d.ts.map +1 -0
- package/dist/cli/sandbox-command.js +52 -0
- package/dist/cli/sandbox-command.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +20 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +72 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/approval-mode.d.ts +28 -0
- package/dist/core/approval-mode.d.ts.map +1 -0
- package/dist/core/approval-mode.js +34 -0
- package/dist/core/approval-mode.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +15 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +3 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +30 -3
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/fast-model.d.ts +10 -0
- package/dist/core/fast-model.d.ts.map +1 -0
- package/dist/core/fast-model.js +13 -0
- package/dist/core/fast-model.js.map +1 -0
- package/dist/core/keybindings.d.ts +8 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +4 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/sandbox/escalation.d.ts +32 -0
- package/dist/core/sandbox/escalation.d.ts.map +1 -0
- package/dist/core/sandbox/escalation.js +70 -0
- package/dist/core/sandbox/escalation.js.map +1 -0
- package/dist/core/sandbox/launch.d.ts +14 -0
- package/dist/core/sandbox/launch.d.ts.map +1 -0
- package/dist/core/sandbox/launch.js +18 -0
- package/dist/core/sandbox/launch.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +50 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -0
- package/dist/core/sandbox/policy.js +96 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/seatbelt.d.ts +17 -0
- package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
- package/dist/core/sandbox/seatbelt.js +169 -0
- package/dist/core/sandbox/seatbelt.js.map +1 -0
- package/dist/core/sandbox/windows.d.ts +30 -0
- package/dist/core/sandbox/windows.d.ts.map +1 -0
- package/dist/core/sandbox/windows.js +104 -0
- package/dist/core/sandbox/windows.js.map +1 -0
- package/dist/core/settings-defaults.d.ts +28 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +28 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +9 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +58 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +124 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +177 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/tools/bash.d.ts +12 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +27 -7
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +3 -2
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +4 -6
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +2 -2
- package/dist/core/tools/render-utils.js +5 -5
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js +16 -19
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/write.d.ts +3 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +2 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/extensions/agents/agent-tool.d.ts +61 -0
- package/dist/extensions/agents/agent-tool.d.ts.map +1 -0
- package/dist/extensions/agents/agent-tool.js +277 -0
- package/dist/extensions/agents/agent-tool.js.map +1 -0
- package/dist/extensions/agents/background.d.ts +56 -0
- package/dist/extensions/agents/background.d.ts.map +1 -0
- package/dist/extensions/agents/background.js +142 -0
- package/dist/extensions/agents/background.js.map +1 -0
- package/dist/extensions/agents/builtin-agents.d.ts +8 -0
- package/dist/extensions/agents/builtin-agents.d.ts.map +1 -0
- package/dist/extensions/agents/builtin-agents.js +38 -0
- package/dist/extensions/agents/builtin-agents.js.map +1 -0
- package/dist/extensions/agents/call-scopes.d.ts +34 -0
- package/dist/extensions/agents/call-scopes.d.ts.map +1 -0
- package/dist/extensions/agents/call-scopes.js +36 -0
- package/dist/extensions/agents/call-scopes.js.map +1 -0
- package/dist/extensions/agents/definitions.d.ts +64 -0
- package/dist/extensions/agents/definitions.d.ts.map +1 -0
- package/dist/extensions/agents/definitions.js +216 -0
- package/dist/extensions/agents/definitions.js.map +1 -0
- package/dist/extensions/agents/index.d.ts +15 -0
- package/dist/extensions/agents/index.d.ts.map +1 -0
- package/dist/extensions/agents/index.js +327 -0
- package/dist/extensions/agents/index.js.map +1 -0
- package/dist/extensions/agents/runner.d.ts +63 -0
- package/dist/extensions/agents/runner.d.ts.map +1 -0
- package/dist/extensions/agents/runner.js +156 -0
- package/dist/extensions/agents/runner.js.map +1 -0
- package/dist/extensions/approval/auto-classifier.d.ts +32 -0
- package/dist/extensions/approval/auto-classifier.d.ts.map +1 -0
- package/dist/extensions/approval/auto-classifier.js +116 -0
- package/dist/extensions/approval/auto-classifier.js.map +1 -0
- package/dist/extensions/approval/exit-plan-mode.d.ts +24 -0
- package/dist/extensions/approval/exit-plan-mode.d.ts.map +1 -0
- package/dist/extensions/approval/exit-plan-mode.js +99 -0
- package/dist/extensions/approval/exit-plan-mode.js.map +1 -0
- package/dist/extensions/approval/index.d.ts +15 -0
- package/dist/extensions/approval/index.d.ts.map +1 -0
- package/dist/extensions/approval/index.js +329 -0
- package/dist/extensions/approval/index.js.map +1 -0
- package/dist/extensions/approval/plan-reminders.d.ts +9 -0
- package/dist/extensions/approval/plan-reminders.d.ts.map +1 -0
- package/dist/extensions/approval/plan-reminders.js +42 -0
- package/dist/extensions/approval/plan-reminders.js.map +1 -0
- package/dist/extensions/approval/policy.d.ts +52 -0
- package/dist/extensions/approval/policy.d.ts.map +1 -0
- package/dist/extensions/approval/policy.js +124 -0
- package/dist/extensions/approval/policy.js.map +1 -0
- package/dist/extensions/approval/shell-safety.d.ts +11 -0
- package/dist/extensions/approval/shell-safety.d.ts.map +1 -0
- package/dist/extensions/approval/shell-safety.js +264 -0
- package/dist/extensions/approval/shell-safety.js.map +1 -0
- package/dist/extensions/cron/cron-expression.d.ts +30 -0
- package/dist/extensions/cron/cron-expression.d.ts.map +1 -0
- package/dist/extensions/cron/cron-expression.js +119 -0
- package/dist/extensions/cron/cron-expression.js.map +1 -0
- package/dist/extensions/cron/index.d.ts +19 -0
- package/dist/extensions/cron/index.d.ts.map +1 -0
- package/dist/extensions/cron/index.js +215 -0
- package/dist/extensions/cron/index.js.map +1 -0
- package/dist/extensions/cron/loop-args.d.ts +35 -0
- package/dist/extensions/cron/loop-args.d.ts.map +1 -0
- package/dist/extensions/cron/loop-args.js +95 -0
- package/dist/extensions/cron/loop-args.js.map +1 -0
- package/dist/extensions/cron/loop-texts.d.ts +29 -0
- package/dist/extensions/cron/loop-texts.d.ts.map +1 -0
- package/dist/extensions/cron/loop-texts.js +83 -0
- package/dist/extensions/cron/loop-texts.js.map +1 -0
- package/dist/extensions/cron/scheduler.d.ts +79 -0
- package/dist/extensions/cron/scheduler.d.ts.map +1 -0
- package/dist/extensions/cron/scheduler.js +146 -0
- package/dist/extensions/cron/scheduler.js.map +1 -0
- package/dist/extensions/cron/tools.d.ts +47 -0
- package/dist/extensions/cron/tools.d.ts.map +1 -0
- package/dist/extensions/cron/tools.js +141 -0
- package/dist/extensions/cron/tools.js.map +1 -0
- package/dist/extensions/goals/evidence.d.ts +20 -0
- package/dist/extensions/goals/evidence.d.ts.map +1 -0
- package/dist/extensions/goals/evidence.js +77 -0
- package/dist/extensions/goals/evidence.js.map +1 -0
- package/dist/extensions/goals/index.d.ts +45 -0
- package/dist/extensions/goals/index.d.ts.map +1 -0
- package/dist/extensions/goals/index.js +438 -0
- package/dist/extensions/goals/index.js.map +1 -0
- package/dist/extensions/goals/prompts.d.ts +15 -0
- package/dist/extensions/goals/prompts.d.ts.map +1 -0
- package/dist/extensions/goals/prompts.js +51 -0
- package/dist/extensions/goals/prompts.js.map +1 -0
- package/dist/extensions/goals/state.d.ts +88 -0
- package/dist/extensions/goals/state.d.ts.map +1 -0
- package/dist/extensions/goals/state.js +204 -0
- package/dist/extensions/goals/state.js.map +1 -0
- package/dist/extensions/goals/tools.d.ts +40 -0
- package/dist/extensions/goals/tools.d.ts.map +1 -0
- package/dist/extensions/goals/tools.js +118 -0
- package/dist/extensions/goals/tools.js.map +1 -0
- package/dist/extensions/goals/verifier.d.ts +30 -0
- package/dist/extensions/goals/verifier.d.ts.map +1 -0
- package/dist/extensions/goals/verifier.js +89 -0
- package/dist/extensions/goals/verifier.js.map +1 -0
- package/dist/extensions/hooks/aggregate.d.ts +30 -0
- package/dist/extensions/hooks/aggregate.d.ts.map +1 -0
- package/dist/extensions/hooks/aggregate.js +103 -0
- package/dist/extensions/hooks/aggregate.js.map +1 -0
- package/dist/extensions/hooks/config.d.ts +47 -0
- package/dist/extensions/hooks/config.d.ts.map +1 -0
- package/dist/extensions/hooks/config.js +169 -0
- package/dist/extensions/hooks/config.js.map +1 -0
- package/dist/extensions/hooks/file-watcher.d.ts +31 -0
- package/dist/extensions/hooks/file-watcher.d.ts.map +1 -0
- package/dist/extensions/hooks/file-watcher.js +106 -0
- package/dist/extensions/hooks/file-watcher.js.map +1 -0
- package/dist/extensions/hooks/index.d.ts +17 -0
- package/dist/extensions/hooks/index.d.ts.map +1 -0
- package/dist/extensions/hooks/index.js +349 -0
- package/dist/extensions/hooks/index.js.map +1 -0
- package/dist/extensions/hooks/matcher.d.ts +10 -0
- package/dist/extensions/hooks/matcher.d.ts.map +1 -0
- package/dist/extensions/hooks/matcher.js +85 -0
- package/dist/extensions/hooks/matcher.js.map +1 -0
- package/dist/extensions/hooks/runner.d.ts +54 -0
- package/dist/extensions/hooks/runner.d.ts.map +1 -0
- package/dist/extensions/hooks/runner.js +197 -0
- package/dist/extensions/hooks/runner.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +29 -2
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/lsp/config.d.ts +40 -0
- package/dist/extensions/lsp/config.d.ts.map +1 -0
- package/dist/extensions/lsp/config.js +92 -0
- package/dist/extensions/lsp/config.js.map +1 -0
- package/dist/extensions/lsp/connection.d.ts +32 -0
- package/dist/extensions/lsp/connection.d.ts.map +1 -0
- package/dist/extensions/lsp/connection.js +124 -0
- package/dist/extensions/lsp/connection.js.map +1 -0
- package/dist/extensions/lsp/index.d.ts +15 -0
- package/dist/extensions/lsp/index.d.ts.map +1 -0
- package/dist/extensions/lsp/index.js +103 -0
- package/dist/extensions/lsp/index.js.map +1 -0
- package/dist/extensions/lsp/server.d.ts +68 -0
- package/dist/extensions/lsp/server.d.ts.map +1 -0
- package/dist/extensions/lsp/server.js +373 -0
- package/dist/extensions/lsp/server.js.map +1 -0
- package/dist/extensions/lsp/tool.d.ts +43 -0
- package/dist/extensions/lsp/tool.d.ts.map +1 -0
- package/dist/extensions/lsp/tool.js +534 -0
- package/dist/extensions/lsp/tool.js.map +1 -0
- package/dist/extensions/memory/index.d.ts +15 -0
- package/dist/extensions/memory/index.d.ts.map +1 -0
- package/dist/extensions/memory/index.js +336 -0
- package/dist/extensions/memory/index.js.map +1 -0
- package/dist/extensions/memory/memory-agent.d.ts +29 -0
- package/dist/extensions/memory/memory-agent.d.ts.map +1 -0
- package/dist/extensions/memory/memory-agent.js +102 -0
- package/dist/extensions/memory/memory-agent.js.map +1 -0
- package/dist/extensions/memory/prompts.d.ts +18 -0
- package/dist/extensions/memory/prompts.d.ts.map +1 -0
- package/dist/extensions/memory/prompts.js +124 -0
- package/dist/extensions/memory/prompts.js.map +1 -0
- package/dist/extensions/memory/recall.d.ts +14 -0
- package/dist/extensions/memory/recall.d.ts.map +1 -0
- package/dist/extensions/memory/recall.js +80 -0
- package/dist/extensions/memory/recall.js.map +1 -0
- package/dist/extensions/memory/store.d.ts +48 -0
- package/dist/extensions/memory/store.d.ts.map +1 -0
- package/dist/extensions/memory/store.js +132 -0
- package/dist/extensions/memory/store.js.map +1 -0
- package/dist/extensions/skills/bundled/batch/SKILL.md +74 -0
- package/dist/extensions/skills/bundled/review/SKILL.md +93 -0
- package/dist/extensions/skills/index.d.ts +15 -0
- package/dist/extensions/skills/index.d.ts.map +1 -0
- package/dist/extensions/skills/index.js +68 -0
- package/dist/extensions/skills/index.js.map +1 -0
- package/dist/extensions/skills/learn.d.ts +9 -0
- package/dist/extensions/skills/learn.d.ts.map +1 -0
- package/dist/extensions/skills/learn.js +46 -0
- package/dist/extensions/skills/learn.js.map +1 -0
- package/dist/extensions/todo/index.d.ts +14 -0
- package/dist/extensions/todo/index.d.ts.map +1 -0
- package/dist/extensions/todo/index.js +55 -0
- package/dist/extensions/todo/index.js.map +1 -0
- package/dist/extensions/todo/todos.d.ts +64 -0
- package/dist/extensions/todo/todos.d.ts.map +1 -0
- package/dist/extensions/todo/todos.js +145 -0
- package/dist/extensions/todo/todos.js.map +1 -0
- package/dist/extensions/todo/tool.d.ts +23 -0
- package/dist/extensions/todo/tool.d.ts.map +1 -0
- package/dist/extensions/todo/tool.js +104 -0
- package/dist/extensions/todo/tool.js.map +1 -0
- package/dist/extensions/web-fetch/fetch-tool.d.ts +27 -0
- package/dist/extensions/web-fetch/fetch-tool.d.ts.map +1 -0
- package/dist/extensions/web-fetch/fetch-tool.js +319 -0
- package/dist/extensions/web-fetch/fetch-tool.js.map +1 -0
- package/dist/extensions/web-fetch/html-to-markdown.d.ts +7 -0
- package/dist/extensions/web-fetch/html-to-markdown.d.ts.map +1 -0
- package/dist/extensions/web-fetch/html-to-markdown.js +21 -0
- package/dist/extensions/web-fetch/html-to-markdown.js.map +1 -0
- package/dist/extensions/web-fetch/index.d.ts +10 -0
- package/dist/extensions/web-fetch/index.d.ts.map +1 -0
- package/dist/extensions/web-fetch/index.js +13 -0
- package/dist/extensions/web-fetch/index.js.map +1 -0
- package/dist/extensions/web-fetch/page-fetch.d.ts +45 -0
- package/dist/extensions/web-fetch/page-fetch.d.ts.map +1 -0
- package/dist/extensions/web-fetch/page-fetch.js +117 -0
- package/dist/extensions/web-fetch/page-fetch.js.map +1 -0
- package/dist/extensions/web-fetch/pdf-text.d.ts +29 -0
- package/dist/extensions/web-fetch/pdf-text.d.ts.map +1 -0
- package/dist/extensions/web-fetch/pdf-text.js +71 -0
- package/dist/extensions/web-fetch/pdf-text.js.map +1 -0
- package/dist/extensions/web-fetch/preapproved-hosts.d.ts +7 -0
- package/dist/extensions/web-fetch/preapproved-hosts.d.ts.map +1 -0
- package/dist/extensions/web-fetch/preapproved-hosts.js +110 -0
- package/dist/extensions/web-fetch/preapproved-hosts.js.map +1 -0
- package/dist/extensions/web-search/dashscope-search.d.ts +29 -0
- package/dist/extensions/web-search/dashscope-search.d.ts.map +1 -0
- package/dist/extensions/web-search/dashscope-search.js +279 -0
- package/dist/extensions/web-search/dashscope-search.js.map +1 -0
- package/dist/extensions/web-search/index.d.ts +15 -0
- package/dist/extensions/web-search/index.d.ts.map +1 -0
- package/dist/extensions/web-search/index.js +51 -0
- package/dist/extensions/web-search/index.js.map +1 -0
- package/dist/extensions/web-search/search-config.d.ts +53 -0
- package/dist/extensions/web-search/search-config.d.ts.map +1 -0
- package/dist/extensions/web-search/search-config.js +174 -0
- package/dist/extensions/web-search/search-config.js.map +1 -0
- package/dist/extensions/web-search/search-tool.d.ts +29 -0
- package/dist/extensions/web-search/search-tool.d.ts.map +1 -0
- package/dist/extensions/web-search/search-tool.js +149 -0
- package/dist/extensions/web-search/search-tool.js.map +1 -0
- package/dist/extensions/worktree/git-worktree.d.ts +69 -0
- package/dist/extensions/worktree/git-worktree.d.ts.map +1 -0
- package/dist/extensions/worktree/git-worktree.js +199 -0
- package/dist/extensions/worktree/git-worktree.js.map +1 -0
- package/dist/extensions/worktree/index.d.ts +27 -0
- package/dist/extensions/worktree/index.d.ts.map +1 -0
- package/dist/extensions/worktree/index.js +188 -0
- package/dist/extensions/worktree/index.js.map +1 -0
- package/dist/extensions/worktree/startup.d.ts +17 -0
- package/dist/extensions/worktree/startup.d.ts.map +1 -0
- package/dist/extensions/worktree/startup.js +56 -0
- package/dist/extensions/worktree/startup.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +28 -4
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +18 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +87 -20
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/diffra-logo.d.ts +6 -0
- package/dist/modes/interactive/components/diffra-logo.d.ts.map +1 -1
- package/dist/modes/interactive/components/diffra-logo.js +30 -4
- package/dist/modes/interactive/components/diffra-logo.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js +3 -3
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +16 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +84 -46
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -2
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +152 -62
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-status.d.ts +5 -0
- package/dist/modes/interactive/components/tool-status.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-status.js +15 -0
- package/dist/modes/interactive/components/tool-status.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +4 -8
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +38 -36
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +24 -8
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +3 -2
- package/dist/modes/interactive/theme/light.json +3 -2
- package/dist/modes/interactive/theme/system-theme.d.ts +1 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/system-theme.js +41 -14
- package/dist/modes/interactive/theme/system-theme.js.map +1 -1
- package/dist/utils/shell.d.ts +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +12 -2
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +5 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +48 -0
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/approval-modes.md +99 -0
- package/docs/builtin-skills.md +53 -0
- package/docs/cli.md +25 -1
- package/docs/docs.json +44 -0
- package/docs/environment-variables.md +7 -0
- package/docs/extensions.md +27 -2
- package/docs/goals.md +84 -0
- package/docs/hooks.md +112 -0
- package/docs/keybindings.md +1 -0
- package/docs/lsp.md +71 -0
- package/docs/memory.md +71 -0
- package/docs/sandbox.md +108 -0
- package/docs/scheduled-tasks.md +84 -0
- package/docs/security.md +3 -2
- package/docs/settings.md +28 -3
- package/docs/shell-aliases.md +1 -1
- package/docs/skills.md +4 -0
- package/docs/slash-commands.md +15 -0
- package/docs/subagents.md +102 -0
- package/docs/web-tools.md +83 -0
- package/docs/windows.md +2 -1
- package/docs/worktrees.md +52 -0
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/plan-mode/README.md +2 -2
- package/examples/extensions/plan-mode/index.ts +7 -4
- package/examples/extensions/subagent/README.md +2 -0
- package/examples/extensions/subagent/index.ts +3 -0
- package/examples/extensions/todo.ts +4 -0
- package/package.json +9 -8
- package/schemas/keybindings.schema.json +4 -0
- package/schemas/settings.schema.json +421 -0
- package/dist/bundle/chunks/chunk-GCKVPVMH.js +0 -2
- package/dist/bundle/chunks/chunk-UNQMECQ4.js +0 -1240
- package/dist/bundle/chunks/virtual-modules-TRFD5ZOL.js +0 -2
package/docs/goals.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Work Toward a Goal
|
|
2
|
+
|
|
3
|
+
A Goal is an objective the agent keeps working on across turns, without you prompting each one. `/goal <objective>` sets it; after every turn Diffra starts the next one, until the agent proposes that the Goal is complete or blocked and an independent verifier accepts the proposal, or you pause or clear the Goal, or a budget, a failure, or three idle turns stop it. Goals come from the built-in extension `builtin:goals`.
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
/goal make `npm test` pass without skipping tests
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
| Command | Does |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `/goal` | Show the Goal: status, turns, active time, tokens, objective, and the last reason |
|
|
14
|
+
| `/goal <objective>`, `/goal set <objective>` | Set a Goal. A Goal already set is replaced: new meters, new evidence |
|
|
15
|
+
| `/goal edit <objective>` | Change the objective. The evidence starts over and a spent budget gets a new window; a paused Goal stays paused |
|
|
16
|
+
| `/goal pause` | Pause an active Goal. The running turn finishes; no new one starts |
|
|
17
|
+
| `/goal resume` | Resume a paused, blocked, or usage-limited Goal |
|
|
18
|
+
| `/goal clear` | Remove the Goal (also `stop`, `off`, `reset`, `none`, `cancel`) |
|
|
19
|
+
|
|
20
|
+
A keyword counts as a command only on its own: `/goal pause the world` sets that objective. Line breaks in an objective become spaces. The objective is sent again on every turn, so keep it short, around 1,200 characters at most. `set`, `edit`, and `resume` need a trusted project (see `/trust`).
|
|
21
|
+
|
|
22
|
+
A good objective says what done looks like and what must not happen, for example: "All tests in `packages/api` pass with `npm test`; do not change test files."
|
|
23
|
+
|
|
24
|
+
## How a Goal runs
|
|
25
|
+
|
|
26
|
+
Each turn the runtime starts gets a continuation prompt: the objective as runtime data, the budget figures, the verifier's feedback on the last proposal, and rules for proving the work: re-run the decisive checks right before proposing, do not substitute an easier result, judge the previous turn, and treat completion as unproven. A message you send while a Goal is active runs as the next Goal turn; Diffra continues after it.
|
|
27
|
+
|
|
28
|
+
While a Goal is active the agent has two tools:
|
|
29
|
+
|
|
30
|
+
- `get_goal` reads the objective, status, budgets, and verifier feedback.
|
|
31
|
+
- `update_goal` proposes `complete` or `blocked`, with a reason. It only records the proposal; a ready proposal ends the turn. A `blocked` proposal names a `blockerKind`: `authority` (needs your permission or choice), `external` (needs an outside change), and `infeasible` (cannot be met as written) go to the verifier at once; `repeated`, the default, goes to the verifier only when the same blocker with the same reason is reported on three consecutive turns.
|
|
32
|
+
|
|
33
|
+
## The verifier
|
|
34
|
+
|
|
35
|
+
After a turn with a ready proposal, a separate model call judges it: the [`fastModel`](settings.md) when set, otherwise the session model, with no tools and a 2-minute limit. It reads a JSON request with the objective, the proposal, and the evidence of this Goal's turns, newest first: your messages, the agent's replies, and tool results, each capped at 8,000 bytes, up to 256,000 bytes in all. Each record says what it can prove:
|
|
36
|
+
|
|
37
|
+
| Kind | Records | Proves |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `user_input` | Your messages | What you said, confirmed, or chose |
|
|
40
|
+
| `delivered_output` | The agent's replies | Only that the agent said it |
|
|
41
|
+
| `external_fact` | Results of tools the agent ran | Facts about the workspace and the world |
|
|
42
|
+
| `execution_output` | Results of `agent` and `codemode` | Nothing on their own: they can repeat the agent's claims |
|
|
43
|
+
|
|
44
|
+
Missing evidence means rejection. An accepted proposal makes the Goal `complete` or `blocked`; a rejected one keeps it active and its reason goes to the next turn as feedback. When the verifier fails or times out, the Goal pauses.
|
|
45
|
+
|
|
46
|
+
## Budgets
|
|
47
|
+
|
|
48
|
+
| Setting | Default | Range |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `goals.tokenBudget` | 30,000,000 tokens | 1 to 300,000,000; `-1` for none |
|
|
51
|
+
| `goals.maxTurns` | none | 1 to 10,000; `-1` for none |
|
|
52
|
+
| `goals.maxActiveMinutes` | none | 1 to 10,080 (one week); `-1` for none |
|
|
53
|
+
|
|
54
|
+
Tokens count every model call of the Goal's turns (each with its full context), foreground subagents, and verifier checks. Turns count finished Goal turns, including yours. Active time runs while the Goal is active, between turns too; paused time and time while Diffra is closed do not count. A new Goal arms the budgets of the settings; `/goal` refuses to start with an invalid setting.
|
|
55
|
+
|
|
56
|
+
When a budget is spent, the Goal gets one last turn to write a hand-off (what was done, what remains, the next step), then stops as `usage limited`. `/goal resume` gives the spent budget another window ahead of what was used; the meters never reset.
|
|
57
|
+
|
|
58
|
+
## When a Goal pauses
|
|
59
|
+
|
|
60
|
+
| Reason |
|
|
61
|
+
|---|
|
|
62
|
+
| You pressed Escape during a Goal turn |
|
|
63
|
+
| `/goal pause` |
|
|
64
|
+
| Three runtime turns in a row ran no tool besides `get_goal` and `update_goal` and proposed nothing |
|
|
65
|
+
| A turn ended with a model error, or the verifier could not judge |
|
|
66
|
+
| The objective and proposal leave the verifier no room for evidence |
|
|
67
|
+
| Diffra closed during a Goal turn or check |
|
|
68
|
+
| A print-mode run ended while the Goal was still active |
|
|
69
|
+
|
|
70
|
+
While a Goal is paused, your messages are ordinary conversation: the model is told not to continue the objective until you resume it.
|
|
71
|
+
|
|
72
|
+
## Status and sessions
|
|
73
|
+
|
|
74
|
+
The footer shows `◎ goal active`, `○ goal checking`, `! goal paused`, `✕ goal blocked`, or `! goal usage limited`, with the tokens spent and the active time. Every change of the Goal is recorded in the session and drawn as a card in the transcript, so a Goal survives `/resume`; an active one continues when the session opens again.
|
|
75
|
+
|
|
76
|
+
In print mode (`diffra -p "/goal ..."`), the command returns once the Goal stops, so one run drives the Goal to the end.
|
|
77
|
+
|
|
78
|
+
## Differences from Qwen Code
|
|
79
|
+
|
|
80
|
+
- The budgets are the `goals.tokenBudget`, `goals.maxTurns`, and `goals.maxActiveMinutes` settings instead of `model.goalTokenBudget`, `model.goalMaxTurns`, and `model.goalMaxActiveMinutes`. New values apply to the next Goal without a restart.
|
|
81
|
+
- `get_goal` and `update_goal` are declared to the model only while a Goal is active.
|
|
82
|
+
- There is no `propose_goal` tool, no `/goal-draft` skill, and no `goals.modelProposed` setting: only you set Goals.
|
|
83
|
+
- Results of tools a `codemode` script calls are not recorded separately, so they reach the verifier only as the script's `execution_output`.
|
|
84
|
+
- The session token limit and the Stop-hook cap do not pause a Goal: Diffra has no session token limit, and Stop hooks end their own loop.
|
package/docs/hooks.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Run Hooks on Events
|
|
2
|
+
|
|
3
|
+
Hooks run your commands, HTTP endpoints, or prompts when something happens in a session: before and after tool calls, when you submit a prompt, when the agent is about to stop, when a session starts or ends, around compaction, when subagents start and stop, and when watched files change. A hook can block a tool call or a prompt, change a tool's input, add context for the model, or keep the agent working. Hooks come from the built-in extension `builtin:hooks` and are on by default; `"disableAllHooks": true` turns them off.
|
|
4
|
+
|
|
5
|
+
## Configure hooks
|
|
6
|
+
|
|
7
|
+
Declare hooks in the `hooks` setting of `~/.diffra/agent/settings.json` or a project's `.diffra/settings.json`. Each event has matcher groups, and each group has hooks:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"hooks": {
|
|
12
|
+
"PreToolUse": [
|
|
13
|
+
{
|
|
14
|
+
"matcher": "bash",
|
|
15
|
+
"hooks": [{ "type": "command", "command": "node .diffra/hooks/check-command.js", "timeout": 10 }]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"PostToolUse": [
|
|
19
|
+
{
|
|
20
|
+
"matcher": "Write|Edit",
|
|
21
|
+
"hooks": [{ "type": "command", "command": "npx prettier --write \"$(jq -r .tool_input.path)\"" }]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The hooks of user and project settings all run; in a sequential group, project hooks come first. Project settings, and with them project hooks, load only in a [trusted project](configuration.md). The same hook listed twice runs once.
|
|
29
|
+
|
|
30
|
+
| Field | Hook types | Meaning |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `type` | all | `command`, `http`, or `prompt` |
|
|
33
|
+
| `command` | command | Shell command; it gets the event as JSON on stdin |
|
|
34
|
+
| `url` | http | Endpoint that gets the event as a JSON `POST` body |
|
|
35
|
+
| `prompt` | prompt | Prompt for a model; `$ARGUMENTS` becomes the event JSON |
|
|
36
|
+
| `model` | prompt | `provider/model-id`; default: the [`fastModel`](settings.md) or the session model |
|
|
37
|
+
| `timeout` | all | Seconds; defaults: command 60, http 600, prompt 30. A command timeout of 1000 or more is read as milliseconds |
|
|
38
|
+
| `async` | command | Run without waiting; what it prints reaches the model with your next prompt. At most 10 run at once |
|
|
39
|
+
| `env` | command | Extra environment variables |
|
|
40
|
+
| `shell` | command | `bash` (the default shell, see [Shell](settings.md#shell)) or `powershell` |
|
|
41
|
+
| `headers`, `allowedEnvVars` | http | Request headers; `$VAR` and `${VAR}` in them expand only for names in `allowedEnvVars` |
|
|
42
|
+
| `once` | http | Run once per event per session |
|
|
43
|
+
| `name`, `description`, `statusMessage` | all | Shown in `/hooks`; `statusMessage` shows in the footer while the hook runs |
|
|
44
|
+
|
|
45
|
+
A group's `matcher` selects what the hooks run for: empty, `*`, or `.*` match everything; an exact name matches; `A|B` lists names; anything else is a regular expression, not anchored. Tool matchers also accept Claude Code tool names: `Bash`, `Read`, `Write`, `Edit`, `Grep`, `Glob`, `LS`, `WebFetch`, `WebSearch`, `Task`/`Agent`, `TodoWrite`. A group with `"sequential": true` makes the event's hooks run one after another, and each sees the changes of the ones before; otherwise they run in parallel.
|
|
46
|
+
|
|
47
|
+
## Events
|
|
48
|
+
|
|
49
|
+
Every hook gets `hook_event_name`, `session_id`, `transcript_path` (the session file), `cwd`, `timestamp`, and `permission_mode` (`plan`, `default`, `auto_edit`, `auto`, or `yolo`), plus the event's fields:
|
|
50
|
+
|
|
51
|
+
| Event | When | Matcher | Fields | Can |
|
|
52
|
+
|---|---|---|---|---|
|
|
53
|
+
| `PreToolUse` | Before a tool call runs, before [approval](approval-modes.md) checks | tool name | `tool_name`, `tool_input`, `tool_use_id` | Block, ask, replace the input, add context |
|
|
54
|
+
| `PostToolUse` | After a successful call | tool name | `tool_name`, `tool_input`, `tool_response`, `tool_use_id` | Add context, stop the run |
|
|
55
|
+
| `PostToolUseFailure` | After a failed call | tool name | `tool_name`, `tool_input`, `error`, `tool_use_id` | Add context, stop the run |
|
|
56
|
+
| `UserPromptSubmit` | Before your prompt is sent | none | `prompt`, `submitted_prompt` | Block the prompt, add context |
|
|
57
|
+
| `Stop` | When the agent is about to finish | none | `stop_hook_active`, `last_assistant_message` | Keep the agent working |
|
|
58
|
+
| `StopFailure` | When a run ends with an error | error | `error`, `last_assistant_message` | Nothing |
|
|
59
|
+
| `SessionStart` | When a session starts, resumes, clears, or forks | source: `startup`, `resume`, `clear`, `branch` | `source`, `model` | Add context, watch files |
|
|
60
|
+
| `SessionEnd` | When the session ends | reason | `reason` | Nothing |
|
|
61
|
+
| `SubagentStart` | When a [subagent](subagents.md) starts | agent type | `agent_id`, `agent_type` | Nothing |
|
|
62
|
+
| `SubagentStop` | When a subagent finishes | agent type | `agent_id`, `agent_type`, `last_assistant_message` | Nothing |
|
|
63
|
+
| `PreCompact` | Before compaction | `manual` or `auto` | `trigger`, `custom_instructions` | Nothing |
|
|
64
|
+
| `PostCompact` | After compaction | `manual` or `auto` | `trigger`, `compact_summary` | Nothing |
|
|
65
|
+
| `FileChanged` | When a watched file is added, changed, or deleted | file name | `file_path`, `event` (`add`, `change`, `unlink`) | Watch files |
|
|
66
|
+
|
|
67
|
+
## Hook results
|
|
68
|
+
|
|
69
|
+
A command hook's exit code decides what happens:
|
|
70
|
+
|
|
71
|
+
- **0**: success. Stdout may be a JSON object (below). Plain text is context for the model on `SessionStart` and `UserPromptSubmit` and a message for you on other events.
|
|
72
|
+
- **2**: block. Stderr is the reason (or a JSON object). It blocks `PreToolUse`, `UserPromptSubmit`, and `Stop` (which then keeps the agent working).
|
|
73
|
+
- **Anything else**: a warning; nothing is blocked. Failures, timeouts, and invalid JSON never stop Diffra.
|
|
74
|
+
|
|
75
|
+
The JSON object can have:
|
|
76
|
+
|
|
77
|
+
| Field | Meaning |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `decision` | `block` or `deny` blocks (as exit code 2); `allow`, `approve`, and `ask` matter for `PreToolUse` |
|
|
80
|
+
| `reason` | Why; given to the model when a call is blocked or the agent continues |
|
|
81
|
+
| `continue` | `false` stops: the tool call is blocked or the run stops, and on `Stop` the agent continues |
|
|
82
|
+
| `stopReason` | The reason for `continue: false` |
|
|
83
|
+
| `systemMessage` | A message shown to you |
|
|
84
|
+
| `suppressOutput` | Do not show `systemMessage` |
|
|
85
|
+
| `hookSpecificOutput.permissionDecision` | `PreToolUse`: `allow`, `ask` (you confirm in a dialog; without a UI it is denied), or `deny`, with `permissionDecisionReason` |
|
|
86
|
+
| `hookSpecificOutput.updatedInput` | `PreToolUse`: the complete replacement tool input |
|
|
87
|
+
| `hookSpecificOutput.additionalContext` | Context for the model: added to the tool result for tool events, sent with the next prompt for `UserPromptSubmit` and `SessionStart` |
|
|
88
|
+
| `hookSpecificOutput.watchPaths` | `SessionStart` and `FileChanged`: absolute files or directories to watch; a list replaces the previous one, `[]` clears it |
|
|
89
|
+
|
|
90
|
+
When several hooks run for an event, any block blocks, the strictest `permissionDecision` wins (`deny`, then `ask`, then `allow`), the last `updatedInput` wins, and all contexts are kept. `PreToolUse` `allow` does not skip approval checks.
|
|
91
|
+
|
|
92
|
+
A `Stop` hook that keeps blocking stops being obeyed after 8 times in a row. An HTTP hook succeeds with any 2xx response; a JSON body (with `Content-Type: application/json`) is read like stdout, other text becomes a message. A prompt hook's model answers `{"ok": true}`, or `{"ok": false, "reason": "..."}` to block.
|
|
93
|
+
|
|
94
|
+
Command hooks run in the session's working directory with `DIFFRA_PROJECT_DIR` (and `CLAUDE_PROJECT_DIR`, for hooks written for Claude Code) set to it. Stdout and stderr are each read up to 1 MiB. A hook that runs past its timeout is killed.
|
|
95
|
+
|
|
96
|
+
## Watch files
|
|
97
|
+
|
|
98
|
+
`FileChanged` hooks run for files named in their matcher, such as `"matcher": "package.json|.env"`: plain file names, resolved against the working directory, also when they do not exist yet. `SessionStart` and `FileChanged` hooks can add absolute files or directories (watched recursively, without `.git` and `node_modules`) through `watchPaths`. Changes are reported once writes settle for 200 ms.
|
|
99
|
+
|
|
100
|
+
## List hooks
|
|
101
|
+
|
|
102
|
+
`/hooks` lists the configured hooks by event and matcher.
|
|
103
|
+
|
|
104
|
+
## Differences from Qwen Code
|
|
105
|
+
|
|
106
|
+
- Events not supported: `PostToolBatch`, `UserPromptExpansion`, `SessionDelete`, `MessageDisplay`, `Notification`, `PermissionRequest`, `PermissionDenied`, `TodoCreated`, `TodoCompleted`, and `InstructionsLoaded`. Configuring them shows a warning.
|
|
107
|
+
- `SubagentStop` cannot keep a subagent working, and `StopFailure` reports the error as `unknown`.
|
|
108
|
+
- `PreToolUse` runs after Diffra validates the tool input, and a replacement input is not validated again.
|
|
109
|
+
- Project hooks need a trusted project; there is no separate approval dialog for a project's hooks block.
|
|
110
|
+
- Hooks get `DIFFRA_PROJECT_DIR` instead of `QWEN_PROJECT_DIR`, and context is wrapped in `<diffra:hook-context>`.
|
|
111
|
+
- A hook past its timeout is killed at once, without a grace period. HTTP hooks have no URL allowlist or private-network block.
|
|
112
|
+
- `/hooks` prints the list instead of opening a browser dialog.
|
package/docs/keybindings.md
CHANGED
|
@@ -154,6 +154,7 @@ On native Windows, `app.suspend` has no default because Windows terminals do not
|
|
|
154
154
|
| `app.model.cycleBackward` | `shift+ctrl+p` (`alt+p` on Windows and WSL) | Cycle to previous model |
|
|
155
155
|
| `app.models.save` | `ctrl+s` | Save the selected default model or scoped model configuration to settings |
|
|
156
156
|
| `app.thinking.cycle` | `shift+tab` | Cycle thinking level |
|
|
157
|
+
| `app.approvalMode.cycle` | `alt+m` | Cycle approval mode: plan, default, auto-edit, auto, yolo (see [Approve Tool Calls](approval-modes.md)) |
|
|
157
158
|
| `app.thinking.save` | `ctrl+s` | Save current thinking level to settings |
|
|
158
159
|
| `app.thinking.toggle` | `ctrl+t` | Collapse or expand thinking blocks |
|
|
159
160
|
|
package/docs/lsp.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Use Language Servers (Experimental)
|
|
2
|
+
|
|
3
|
+
With LSP on, the agent can ask your project's language servers about code through the `lsp` tool: where a symbol is defined, implemented, and used, its type, the symbols of a file or the workspace, the call hierarchy, compiler diagnostics, and code actions. LSP is experimental and off by default. It comes from the built-in extension `builtin:lsp`.
|
|
4
|
+
|
|
5
|
+
## Turn it on
|
|
6
|
+
|
|
7
|
+
Any of these turns LSP on for the session:
|
|
8
|
+
|
|
9
|
+
- `--experimental-lsp`
|
|
10
|
+
- `DIFFRA_ENABLE_LSP=1`
|
|
11
|
+
- `"tools": { "lspEnabled": true }` in your user settings (`~/.diffra/agent/settings.json`). Project settings cannot turn it on, because it starts programs.
|
|
12
|
+
|
|
13
|
+
`DIFFRA_DISABLE_LSP=1` turns it off and wins over the others. The setting is read when a session starts.
|
|
14
|
+
|
|
15
|
+
## Configure servers
|
|
16
|
+
|
|
17
|
+
Diffra bundles and detects no servers: install them yourself and list them in `.lsp.json` at the project root. Each key is a language id:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"typescript": {
|
|
22
|
+
"command": "typescript-language-server",
|
|
23
|
+
"args": ["--stdio"],
|
|
24
|
+
"extensionToLanguage": { ".ts": "typescript", ".tsx": "typescriptreact" }
|
|
25
|
+
},
|
|
26
|
+
"go": { "command": "gopls" }
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Field | Default | Meaning |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `command` | required for `stdio` | Program to run: a name found on `PATH`, an absolute path, or a path inside the project |
|
|
33
|
+
| `args` | `[]` | Its arguments |
|
|
34
|
+
| `transport` | `stdio` | `stdio`, or `tcp`/`socket` with `socket: { host, port }` or `socket: { path }`; `command` is then optional and started first |
|
|
35
|
+
| `env` | `{}` | Extra environment. `PATH`, `NODE_OPTIONS`, `LD_PRELOAD`, and similar keys are ignored |
|
|
36
|
+
| `extensionToLanguage` | common extensions | File extensions the server serves, mapped to language ids |
|
|
37
|
+
| `initializationOptions` | none | Sent with `initialize` |
|
|
38
|
+
| `settings` | none | Sent with `workspace/didChangeConfiguration` and returned for `workspace/configuration` |
|
|
39
|
+
| `workspaceFolder` | project root | A folder inside the project to open |
|
|
40
|
+
| `startupTimeout`, `shutdownTimeout` | 10000, 5000 ms | Limits for starting and stopping |
|
|
41
|
+
| `restartOnCrash`, `maxRestarts` | `false`, 3 | Restart a server that exits |
|
|
42
|
+
|
|
43
|
+
Servers run without a shell. On Windows, start a `.cmd` shim through `cmd`: `"command": "cmd", "args": ["/c", "typescript-language-server", "--stdio"]`.
|
|
44
|
+
|
|
45
|
+
Servers start with the session, after `<command> --version` shows that the command exists. A repository's `.lsp.json` names programs to run, so its servers start only in a folder you explicitly trusted with `/trust` (or the trust prompt); otherwise `/lsp` shows them as skipped.
|
|
46
|
+
|
|
47
|
+
`/lsp` lists the servers with their command, languages, and status (`starting`, `ready`, `failed` with the reason, or `skipped`).
|
|
48
|
+
|
|
49
|
+
## The lsp tool
|
|
50
|
+
|
|
51
|
+
| Operation | Needs | Returns |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `goToDefinition`, `goToImplementation`, `findReferences` | `filePath`, `line` (`character`) | Locations, as `path:line:column [server]` |
|
|
54
|
+
| `hover` | `filePath`, `line` (`character`) | Type and documentation |
|
|
55
|
+
| `documentSymbol` | `filePath` | Symbols with kind and container |
|
|
56
|
+
| `workspaceSymbol` | `query` | Matching symbols, and the references of the best match |
|
|
57
|
+
| `prepareCallHierarchy` | `filePath`, `line` (`character`) | Call hierarchy items, with JSON to pass on |
|
|
58
|
+
| `incomingCalls`, `outgoingCalls` | `callHierarchyItem` | Callers or callees |
|
|
59
|
+
| `diagnostics` | `filePath` | Errors and warnings of the file |
|
|
60
|
+
| `workspaceDiagnostics` | nothing | Diagnostics of all files the servers reported |
|
|
61
|
+
| `codeActions` | `filePath`, `line` (`endLine`, `endCharacter`, `diagnostics`, `codeActionKinds`) | Available fixes and refactorings |
|
|
62
|
+
|
|
63
|
+
Lines and columns are 1-based. `serverName` asks one server; `limit` caps the results (defaults: 20 definitions, implementations, workspace symbols, call hierarchy items, and code actions; 50 references, document symbols, and workspace diagnostics). With several servers for a file, the first one with results answers. Each request may take 15 seconds; a server that is still loading the project on its first request can need longer, so ask again.
|
|
64
|
+
|
|
65
|
+
Diagnostics come from the server's pull diagnostics where it offers them, otherwise from what it pushed after the file was opened. Edits do not report diagnostics on their own: the agent asks with `diagnostics`.
|
|
66
|
+
|
|
67
|
+
## Differences from Qwen Code
|
|
68
|
+
|
|
69
|
+
- Servers come only from the project's `.lsp.json`; extensions cannot add servers.
|
|
70
|
+
- A project's servers need a trust decision saved for the folder; Diffra's automatic trust of folders without project resources is not enough.
|
|
71
|
+
- There is no `--debug` log of LSP traffic and no line in `/status`.
|
package/docs/memory.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Keep Auto Memory
|
|
2
|
+
|
|
3
|
+
Auto memory lets the agent keep notes across sessions: your preferences and corrections, decisions and context of a project, and pointers to external resources. Diffra saves them in the background after your turns, puts the relevant ones in front of the model, and consolidates them from time to time. It comes from the built-in extension `builtin:memory` and is on by default.
|
|
4
|
+
|
|
5
|
+
## Where memory lives
|
|
6
|
+
|
|
7
|
+
- **User memory**, shared by all projects: `<agent dir>/memories/` (`~/.diffra/agent/memories/` by default)
|
|
8
|
+
- **Project memory**, one per git repository (or per directory outside a repository): `<agent dir>/projects/<repository path>/memory/`
|
|
9
|
+
|
|
10
|
+
`DIFFRA_MEMORY_BASE_DIR` replaces the agent directory as the base. Each directory holds one Markdown file per memory under `user/`, `feedback/`, `project/`, or `reference/`, and a `MEMORY.md` index with one `- [Title](type/file.md) — hook` line per memory:
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
---
|
|
14
|
+
name: Use pnpm
|
|
15
|
+
description: The user prefers pnpm over npm in every project
|
|
16
|
+
type: feedback
|
|
17
|
+
keywords: ["pnpm", "package manager"]
|
|
18
|
+
---
|
|
19
|
+
Use pnpm instead of npm.
|
|
20
|
+
**Why:** npm broke their lockfile workflow.
|
|
21
|
+
**How to apply:** for installs and scripts in any project.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Type | Holds | Directory |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `user` | Who you are: role, expertise, preferences | User |
|
|
27
|
+
| `feedback` | How you want the agent to work | User; project for a convention of one project |
|
|
28
|
+
| `project` | Goals, decisions, and constraints of the project | Project |
|
|
29
|
+
| `reference` | Links to dashboards, tickets, documents | Project; user for your own resources |
|
|
30
|
+
|
|
31
|
+
The index is rebuilt from the memory files after each background run: at most 200 lines and 25,000 characters, listing the 200 newest files. An entry that does not fit is left out whole, and the index ends with a warning that names what was left out.
|
|
32
|
+
|
|
33
|
+
## How memories are used
|
|
34
|
+
|
|
35
|
+
Each run gets the memory policy and both indexes in its system prompt. The policy tells the model where to save memories when you ask, how to choose the type, what not to save (code structure, git history, fix recipes, anything in AGENTS.md, task state), and to verify what a memory claims before relying on it.
|
|
36
|
+
|
|
37
|
+
Before your prompt, up to two memories that share the most words with it are added, with their age and a warning for memories older than a day. Meanwhile a model picks up to five more from the memories' titles, descriptions, and keywords; they join the run at its next turn, or are dropped when the run already ended. A memory is added at most once per session. The model is the [`fastModel`](settings.md) when set, otherwise the session model.
|
|
38
|
+
|
|
39
|
+
## How memories are saved
|
|
40
|
+
|
|
41
|
+
When you ask, the agent writes memory files itself. After a run that answered a new message of yours, a background extractor reads the conversation since the last extraction (up to 40 messages) and the existing memories, and saves durable facts you stated: one fact per file, updating instead of duplicating, never inferred facts or one-off requests. It skips a run in which the agent already wrote memory. Its file tools only reach the memory directories, and it cannot edit `MEMORY.md`. It runs on the `fastModel` or the session model, for up to 5 turns and 2 minutes.
|
|
42
|
+
|
|
43
|
+
Once a day has passed and 5 other sessions have run in the project since the last consolidation, a background dream consolidates the memory after a run: it merges duplicates, fixes stale facts, turns relative dates into absolute ones, and lists files to delete in `.dream-operations.json`, which Diffra applies. It runs for up to 8 turns and 5 minutes.
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
| Command | Does |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `/memory` | Show whether auto memory and dreaming are on and where memory lives; turn either on or off for this session; show an index |
|
|
50
|
+
| `/remember <text>` | Ask the agent to save `text` to the right memory directory and type |
|
|
51
|
+
| `/forget <text>` | Let a model pick the memories `text` describes and delete them |
|
|
52
|
+
| `/dream` | Consolidate now |
|
|
53
|
+
|
|
54
|
+
## Settings
|
|
55
|
+
|
|
56
|
+
| Setting | Default | Meaning |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `memory.enableManagedAutoMemory` | `true` | Save memories in the background after turns |
|
|
59
|
+
| `memory.enableManagedAutoDream` | `true` | Consolidate in the background |
|
|
60
|
+
| `memory.agentMaxTurns` | 5 (extractor), 8 (dream) | Turn limit of the background agents; `0` for none |
|
|
61
|
+
| `memory.agentTimeoutMinutes` | 2 (extractor), 5 (dream) | Time limit in minutes; `0` for none |
|
|
62
|
+
|
|
63
|
+
The background agents use model tokens on every turn they run. Turn `memory.enableManagedAutoMemory` off to stop that.
|
|
64
|
+
|
|
65
|
+
## Differences from Qwen Code
|
|
66
|
+
|
|
67
|
+
- Memory lives under the agent directory instead of `~/.qwen`, and the indexes are in the system prompt instead of being added at the end of each request.
|
|
68
|
+
- Only Qwen Code's default protocol is implemented: there are no `search_memory` and `manage_memory` tools (structured recall), no team memory, and no auto-skill review.
|
|
69
|
+
- `/memory` turns auto memory and dreaming on or off for the session only; set the `memory` settings to keep the change.
|
|
70
|
+
- Memory files have no `category` and `usage_scenarios` fields, and the dream does not read old session transcripts.
|
|
71
|
+
- `/dream` runs the background dreamer instead of asking the main agent.
|
package/docs/sandbox.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Sandbox Commands and Edits
|
|
2
|
+
|
|
3
|
+
The sandbox limits what the model's commands and file edits can change. With it on, commands run by the `bash` and `powershell` tools, and the `write` and `edit` tools, can write only in the working folder, the temp folder, and folders you allow, and can reach the network only if you allow it. The sandbox is off by default.
|
|
4
|
+
|
|
5
|
+
The operating system enforces the limits for commands: Seatbelt on macOS, and a restricted token or a separate sandbox user on Windows. The `write` and `edit` tools run inside Diffra, so Diffra checks their paths against the same policy. Linux has no sandbox backend yet; with the sandbox on, commands there fail instead of running unsandboxed.
|
|
6
|
+
|
|
7
|
+
## Turn it on
|
|
8
|
+
|
|
9
|
+
Add a `sandbox` object to your user settings (`~/.diffra/agent/settings.json`):
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"sandbox": {
|
|
14
|
+
"mode": "workspace-write",
|
|
15
|
+
"network": false,
|
|
16
|
+
"writableRoots": ["~/.npm"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
| Setting | Values | Default | Description |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `sandbox.mode` | `off`, `read-only`, `workspace-write` | `off` | `read-only` allows no writes. `workspace-write` allows writes in the working folder, the temp folder, and `writableRoots`. |
|
|
24
|
+
| `sandbox.network` | boolean | `false` | Lets commands use the network. |
|
|
25
|
+
| `sandbox.writableRoots` | string array | `[]` | More absolute folders that `workspace-write` allows writing, such as a package manager's cache. `~` is your home folder. |
|
|
26
|
+
| `sandbox.windows` | `unelevated`, `elevated` | `unelevated` | How the sandbox works on Windows; see [Windows](#windows). |
|
|
27
|
+
|
|
28
|
+
Diffra reads these settings from your user settings only. A project's `.diffra/settings.json` cannot change them, so a repository you open cannot turn the sandbox off or widen it. Settings apply to the next command after a change; you do not need to restart.
|
|
29
|
+
|
|
30
|
+
Inside every writable folder, `.git`, `.diffra`, and `.agents` stay read-only. Git runs hooks from `.git` the next time you use it outside the sandbox, and `.diffra` and `.agents` hold settings, extensions, and skills that Diffra loads, so a command must not change them. A `git commit` therefore fails inside the sandbox; see [Denied actions](#denied-actions).
|
|
31
|
+
|
|
32
|
+
`diffra sandbox status` prints the settings in effect, and on Windows whether the elevated sandbox is set up.
|
|
33
|
+
|
|
34
|
+
## What the sandbox covers
|
|
35
|
+
|
|
36
|
+
| Covered | Not covered |
|
|
37
|
+
|---|---|
|
|
38
|
+
| Commands of the `bash` and `powershell` tools, also in subagents | Commands you run yourself with `!` |
|
|
39
|
+
| The `write` and `edit` tools | Extensions, MCP servers, hooks, and language servers, which run as you |
|
|
40
|
+
| | Reading files: commands can read what your account can read, except on Windows with the elevated backend |
|
|
41
|
+
|
|
42
|
+
The sandbox protects your files from mistakes and from instructions planted in content the model reads. It is not a boundary for code you install: extensions and MCP servers run with your full rights. For full isolation, run Diffra in a container or a virtual machine; see [Isolate Diffra](containerization.md).
|
|
43
|
+
|
|
44
|
+
## Denied actions
|
|
45
|
+
|
|
46
|
+
When the sandbox blocks a command, the command fails with an error such as `Operation not permitted` or `Access is denied`. When the `write` or `edit` tool targets a path the sandbox does not allow, the tool fails with the reason.
|
|
47
|
+
|
|
48
|
+
In the approval modes that ask before acting (`default`, `auto-edit`, and `auto`), Diffra then asks whether to run that one action without the sandbox. **Yes, run it without the sandbox once** runs it again unsandboxed; **No** keeps the failure, and the model is told the sandbox probably blocked it. In `yolo` and `plan` mode, and without an interactive UI, Diffra never asks: the action stays denied. See [Approve Tool Calls](approval-modes.md).
|
|
49
|
+
|
|
50
|
+
Diffra recognizes a blocked command by its output: a non-zero exit code together with a message such as `Operation not permitted`, `Permission denied`, `Read-only file system`, or `Access is denied`. A command that fails for another reason and prints one of these messages also leads to the question.
|
|
51
|
+
|
|
52
|
+
## macOS
|
|
53
|
+
|
|
54
|
+
Commands run under Seatbelt, the kernel sandbox of macOS, through the system's `/usr/bin/sandbox-exec`. It needs no setup and works on Intel and Apple silicon Macs.
|
|
55
|
+
|
|
56
|
+
- Reads are not limited.
|
|
57
|
+
- Writes outside the writable folders, and into the protected folders, fail with `Operation not permitted`. A command also cannot rename or delete a writable folder itself, which would move its protected folders out of reach.
|
|
58
|
+
- With `network: false`, every socket is blocked: the internet, `localhost`, and Unix sockets such as the ones of `ssh-agent` and Docker. With `network: true`, all of them are allowed; Seatbelt cannot allow some hosts and block others.
|
|
59
|
+
- Package managers write caches in your home folder (`~/.npm`, `~/Library/Caches`). Add those folders to `writableRoots` if commands should install packages.
|
|
60
|
+
|
|
61
|
+
## Windows
|
|
62
|
+
|
|
63
|
+
Windows has two backends. Both run the command through `diffra-sandbox.exe`, a helper Diffra downloads on first use.
|
|
64
|
+
|
|
65
|
+
| | `unelevated` (default) | `elevated` |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| Setup | None | `diffra sandbox setup` once, as administrator |
|
|
68
|
+
| Writes outside the writable folders | Blocked | Blocked |
|
|
69
|
+
| Deletes and moves outside the writable folders | **Not blocked** | Blocked |
|
|
70
|
+
| Reads | Not limited | Limited to what the Users group can read and to your profile, except the folders listed below |
|
|
71
|
+
| Network with `network: false` | Common tools are pointed at a closed proxy; a program can still connect | Blocked by a Windows Firewall rule |
|
|
72
|
+
| The `bash` tool (Git Bash) | Cannot run; the `powershell` tool replaces it | Runs |
|
|
73
|
+
|
|
74
|
+
### Unelevated
|
|
75
|
+
|
|
76
|
+
The command runs as you, with a restricted token. Windows checks every write against the token's restricting identities, which only the writable folders allow. Diffra adds a permission entry for each writable folder the first time a command writes there, and a deny entry for each protected folder that exists at that moment; the entries stay, so later commands start without delay. In a large folder, adding the first entry can take a while.
|
|
77
|
+
|
|
78
|
+
The restricted token does not limit deletes: Windows does not count deleting a file as a write there, so a command can delete, or move out of its folder, any file you can delete. It also does not limit reads or the network. Use the elevated backend when that matters.
|
|
79
|
+
|
|
80
|
+
Git Bash cannot start with a restricted token, so while the sandbox is on with this backend, sessions use the `powershell` tool instead of the `bash` tool.
|
|
81
|
+
|
|
82
|
+
### Elevated
|
|
83
|
+
|
|
84
|
+
`diffra sandbox setup` asks Windows for administrator rights once, then:
|
|
85
|
+
|
|
86
|
+
- creates the local group `DiffraSandboxUsers` and the users `DiffraSandboxOffline` and `DiffraSandboxOnline`, hidden from the sign-in screen, with random passwords that Diffra keeps encrypted for your account (DPAPI) in `~/.diffra/agent/sandbox`;
|
|
87
|
+
- adds a Windows Firewall rule that blocks outbound connections of `DiffraSandboxOffline`, and warns if the firewall is off for a network profile, where the rule has no effect;
|
|
88
|
+
- grants the group read access to the folders and files directly in your profile, except `.ssh`, `.tsh`, `.brev`, `.gnupg`, `.aws`, `.azure`, `.kube`, `.docker`, `.config`, `.npm`, `.pki`, `.terraform.d`, and `.diffra`. In a large profile this takes a few minutes.
|
|
89
|
+
|
|
90
|
+
Then set `"windows": "elevated"` in the `sandbox` settings. Commands run as `DiffraSandboxOffline`, or as `DiffraSandboxOnline` with `network: true`, with a restricted token that limits writes to the writable folders of the current command. Each writable folder gets permission entries for the group and for the current command.
|
|
91
|
+
|
|
92
|
+
Git refuses to work in a repository that another account owns, so Diffra marks the repository of the working folder, and the repositories inside it, as safe for sandboxed commands (`safe.directory`, set through `GIT_CONFIG_*` variables).
|
|
93
|
+
|
|
94
|
+
`diffra sandbox uninstall` removes the firewall rule, the two users with their profiles, and the group, again as administrator. Folders the sandbox used keep their permission entries for the removed group; Windows shows them as an unknown account, and they grant nothing.
|
|
95
|
+
|
|
96
|
+
### HTTPS with `network: true`
|
|
97
|
+
|
|
98
|
+
Windows' own TLS library, Schannel, refuses restricted tokens, which both backends use. Programs that rely on it cannot open HTTPS connections in the sandbox:
|
|
99
|
+
|
|
100
|
+
- Git: Diffra sets `http.sslBackend` to `openssl` for sandboxed commands, so git uses the OpenSSL that Git for Windows ships, with Git's own list of certificate authorities. If your network needs a certificate that only the Windows certificate store has, such as a company proxy's, git fails with a certificate error in the sandbox; add that certificate to the file that git's `http.sslCAInfo` names.
|
|
101
|
+
- `curl`, both Windows' own and the one in Git Bash, and PowerShell's `Invoke-WebRequest` and `Invoke-RestMethod` fail. When a command fails with `SEC_E_NO_CREDENTIALS`, as `curl` does, Diffra asks whether to run it without the sandbox, as for other denials. PowerShell's error message does not tell the cause, so Diffra does not ask there.
|
|
102
|
+
- Node, npm, Python, and Go programs bring their own TLS and work.
|
|
103
|
+
|
|
104
|
+
### The helper
|
|
105
|
+
|
|
106
|
+
Diffra downloads `diffra-sandbox.exe` from Diffra's GitHub releases on first use, checks it against a SHA-256 hash pinned in Diffra, and stores it in `~/.diffra/agent/bin`. With `DIFFRA_OFFLINE` set, Diffra does not download it. Set `DIFFRA_SANDBOX_HELPER` to the path of a `diffra-sandbox.exe` you built from `native/windows-sandbox` to use that instead.
|
|
107
|
+
|
|
108
|
+
The helper sends no telemetry.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Schedule Prompts and Loops
|
|
2
|
+
|
|
3
|
+
Diffra can run a prompt later or repeatedly while a session is open: `/loop` runs a prompt now and again on an interval or at the model's pace, and the model can schedule prompts itself, such as a reminder in 20 minutes. Scheduled tasks come from the built-in extension `builtin:cron` and are on by default.
|
|
4
|
+
|
|
5
|
+
Everything is session-only: nothing is written to disk, and quitting Diffra, `/new`, `/resume`, `/fork`, and `/reload` cancel all jobs. On quit Diffra prints what it cancelled.
|
|
6
|
+
|
|
7
|
+
## /loop
|
|
8
|
+
|
|
9
|
+
| Command | Does |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `/loop 5m check the build` | Run `check the build` now and every 5 minutes |
|
|
12
|
+
| `/loop check the PR every 30m` | The same, with the interval at the end (`every 5 minutes`, `every 2 hours` also work) |
|
|
13
|
+
| `/loop check the deploy` | Run the prompt now; the model decides whether and when to check again |
|
|
14
|
+
| `/loop` | An autonomous loop: keep the work of this conversation moving, at the model's pace |
|
|
15
|
+
| `/loop 30m` | An autonomous loop every 30 minutes |
|
|
16
|
+
| `/loop work through loop.md` | Work the task list in `loop.md` on each tick (with an interval: on each fire) |
|
|
17
|
+
| `/loop list` | List the jobs and the pending wakeup |
|
|
18
|
+
| `/loop clear` | Cancel all of them |
|
|
19
|
+
|
|
20
|
+
The prompt can be a slash command: `/loop 10m /review` runs `/review` every 10 minutes. `every` counts as an interval only when a time follows it: `/loop check every PR` has none.
|
|
21
|
+
|
|
22
|
+
### Intervals
|
|
23
|
+
|
|
24
|
+
Intervals become cron schedules that repeat evenly:
|
|
25
|
+
|
|
26
|
+
| Interval | Schedule |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `Ns` | Rounded up to whole minutes |
|
|
29
|
+
| `Nm`, under 60 | `*/N * * * *` |
|
|
30
|
+
| `Nm`, 60 or more, and `Nh` | `0 */H * * *` with H dividing 24 |
|
|
31
|
+
| `1d` | `0 0 * * *`, midnight |
|
|
32
|
+
| `Nd` | `0 0 */N * *`: midnight on days 1, 1+N, 1+2N, … of each month |
|
|
33
|
+
|
|
34
|
+
An interval that does not divide the hour or day evenly, such as `7m` or `90m`, is rounded to the nearest one that does (`6m`, `2h`), and Diffra says so. `Nd` restarts each month, so the gap across a month boundary can be shorter; Diffra says that too. Day intervals over 30 are refused.
|
|
35
|
+
|
|
36
|
+
### Self-paced and autonomous loops
|
|
37
|
+
|
|
38
|
+
Without an interval, the model runs the prompt and, before ending its turn, calls `loop_wakeup` if another check is useful, with a delay of 60 to 3600 seconds. It leaves the call out when the task is complete, blocked, or there is nothing useful to check, which ends the loop. One wakeup is pending at a time, a chain of wakeups may run for 24 hours, and interrupting a turn with Escape cancels the pending wakeup.
|
|
39
|
+
|
|
40
|
+
A bare `/loop` asks the model to continue what the conversation already established (unfinished work, an open pull request's CI and review threads) without starting new work or doing anything irreversible it was not authorized to do, and to say in one sentence when there is nothing to do. The full guidance goes with the first tick and after a compaction; later ticks get a short reminder.
|
|
41
|
+
|
|
42
|
+
### loop.md
|
|
43
|
+
|
|
44
|
+
A loop over `loop.md` reads `.diffra/loop.md` in the project (only in a trusted project), else `loop.md` in the agent directory, at every tick, up to 25,000 bytes. The model gets the whole list on the first tick and whenever the file changes, and a reminder otherwise. When the file is missing, the tick runs as an autonomous one.
|
|
45
|
+
|
|
46
|
+
## Tools
|
|
47
|
+
|
|
48
|
+
| Tool | Does |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `cron_create` | Schedule `prompt` on a 5-field `cron` expression; `recurring: false` fires once. `durable: true` is refused: jobs cannot outlive the session |
|
|
51
|
+
| `cron_list` | List jobs and the pending wakeup: `id — schedule (type) [session-only]: prompt` |
|
|
52
|
+
| `cron_delete` | Cancel a job or the wakeup by `id` |
|
|
53
|
+
| `loop_wakeup` | Set the next tick of a self-paced loop: `delaySeconds`, `prompt` (usually `/loop …`), `reason` |
|
|
54
|
+
|
|
55
|
+
At most 50 jobs. A recurring job expires 7 days after it was created: it fires one last time, then is deleted.
|
|
56
|
+
|
|
57
|
+
## When prompts run
|
|
58
|
+
|
|
59
|
+
Due prompts run only while Diffra is idle, each as its own turn, one after another; a busy session runs them after the current turn. The transcript shows `Cron: <prompt>` or `Loop: <prompt>`. A job never fires in the minute it was created, and a slot fires once however late: after a sleeping laptop wakes, a job fires once, not once per missed slot.
|
|
60
|
+
|
|
61
|
+
To spread load, a recurring job fires a fixed delay after its slot, up to 10% of its period and at most 15 minutes; a one-shot set for :00 or :30 fires up to 90 seconds early.
|
|
62
|
+
|
|
63
|
+
## Time zones and daylight saving time
|
|
64
|
+
|
|
65
|
+
Cron expressions use the local time zone of the Diffra process (`TZ` changes it). There is no per-job time zone and no UTC option.
|
|
66
|
+
|
|
67
|
+
When daylight saving time starts, the skipped wall times do not exist that day: a job at `30 2 * * *` in a zone that jumps from 02:00 to 03:00 does not fire that day and fires at 02:30 the next day. When it ends, the repeated hour happens twice and a job in it fires twice: `30 1 * * *` fires at 01:30 before and again at 01:30 after the clocks go back. Jobs with a minute or hour step keep their wall-clock schedule across the change.
|
|
68
|
+
|
|
69
|
+
## Settings
|
|
70
|
+
|
|
71
|
+
| Setting | Default | Meaning |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `experimental.cron` | `true` | Scheduled tasks; `false` removes the tools and `/loop` (read at session start) |
|
|
74
|
+
| `experimental.cronRecurringMaxAgeDays` | `7` | Days until a recurring job expires; `0` for never |
|
|
75
|
+
|
|
76
|
+
`DIFFRA_DISABLE_CRON=1` turns scheduled tasks off, and `DIFFRA_CRON_MAX_AGE_DAYS` overrides the expiry.
|
|
77
|
+
|
|
78
|
+
## Differences from Qwen Code
|
|
79
|
+
|
|
80
|
+
- `/loop` is a command, not a bundled skill: Diffra parses the interval and creates the job itself instead of asking the model to call `cron_create`, so the model only runs the prompt. Self-paced and autonomous loops still let the model decide with `loop_wakeup`.
|
|
81
|
+
- There are no durable jobs: Qwen Code supports them only with its daemon, and `durable: true` is refused in standalone sessions there too.
|
|
82
|
+
- There is no `gate` (a shell command that decides whether a fire runs) and no `sessionMode`.
|
|
83
|
+
- A busy session queues due prompts after the current turn; they are never dropped.
|
|
84
|
+
- Jobs end with the session, including `/new`, `/resume`, and `/fork`, not only with the process.
|
package/docs/security.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Run Diffra safely
|
|
2
2
|
|
|
3
|
-
Treat model-generated commands and code as untrusted. Diffra can read, change, and execute files with the permissions of the account that started it, and it does not ask for approval before
|
|
3
|
+
Treat model-generated commands and code as untrusted. Diffra can read, change, and execute files with the permissions of the account that started it, and by default it does not ask for approval before tool calls. [Approval modes](approval-modes.md) can make it ask, let a classifier decide, or keep a session read-only, but they only decide which calls run, not what an allowed call can reach. The optional [sandbox](sandbox.md) limits what the model's commands and edits can write and whether they reach the network. Extensions, package installers, language servers, and other child processes run with those same permissions unless an operating-system or virtualization boundary restricts them.
|
|
4
4
|
|
|
5
5
|
Files, comments, instructions, command output, and model responses can steer the model through prompt injection. Project trust controls which project resources load at startup, but it does not make that content or the resulting actions safe.
|
|
6
6
|
|
|
@@ -15,6 +15,7 @@ Different ways of running Diffra place different limits on what generated comman
|
|
|
15
15
|
| Directly, with the permissions of its operating-system user | Anything that user cannot access. A dedicated user account can narrow those permissions, but Diffra still shares the operating system and network with other users. |
|
|
16
16
|
| Entirely inside a container, virtual machine, or sandbox | Host files and processes that you do not expose to the environment. Credentials and network services remain accessible if you make them available inside it. This is usually the strongest practical option. |
|
|
17
17
|
| Outside the isolated environment, with only its built-in tools running inside | Host resources are protected from actions performed through those tools. Diffra itself and other extensions remain outside the boundary, so this is a narrower form of isolation. |
|
|
18
|
+
| Directly, with the built-in [sandbox](sandbox.md) on | Files outside the writable folders, and the network when it is off, from the model's commands and edits. Reads stay open except on Windows with the elevated backend, and the unelevated Windows backend does not stop deletes. Extensions, MCP servers, and hooks run outside it. |
|
|
18
19
|
|
|
19
20
|
The working folder controls resource discovery and the default location for tools, but it does not prevent commands from accessing other paths available to the Diffra process.
|
|
20
21
|
|
|
@@ -96,4 +97,4 @@ These practices do not replace isolation, but they reduce exposure or make recov
|
|
|
96
97
|
|
|
97
98
|
Follow the repository [Security Policy](https://github.com/DingxinTao0417/diffra-cli/blob/main/SECURITY.md). Do not open a public issue for a security-sensitive report.
|
|
98
99
|
|
|
99
|
-
Expected local-agent behavior, prompt injection from untrusted content,
|
|
100
|
+
Expected local-agent behavior, prompt injection from untrusted content, the documented limits of the built-in sandbox, and behavior from user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a privilege-boundary bypass or access that the local user did not already have.
|