arisa 5.1.2 → 5.1.8

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.
Files changed (39) hide show
  1. package/AGENTS.md +12 -4
  2. package/ARISA-MASTER-SLAVE-SPEC.md +844 -0
  3. package/README.md +25 -0
  4. package/package.json +1 -1
  5. package/src/core/agent/agent-manager.js +55 -12
  6. package/src/core/config/config-defaults.js +3 -1
  7. package/src/core/tools/daemon-processes.js +48 -6
  8. package/src/core/tools/daemon-runtime.js +370 -138
  9. package/src/core/tools/ipc-client.js +3 -0
  10. package/src/core/tools/official-tool-catalog.js +32 -0
  11. package/src/core/tools/official-tool-installer.js +183 -0
  12. package/src/core/tools/tool-registry.js +203 -18
  13. package/src/core/tools/tool-resource-note-store.js +78 -0
  14. package/src/index.js +25 -2
  15. package/src/official-tools.lock.json +40 -0
  16. package/src/runtime/arisa-capabilities.js +43 -3
  17. package/src/runtime/create-app.js +9 -0
  18. package/src/runtime/create-headless-app.js +77 -0
  19. package/src/runtime/doctor.js +27 -2
  20. package/src/runtime/headless-tool-executor.js +45 -0
  21. package/src/runtime/paths.js +16 -4
  22. package/src/runtime/secure-request-file.js +21 -0
  23. package/src/runtime/slave-bootstrap-url.js +51 -0
  24. package/src/runtime/slave-cli.js +267 -0
  25. package/src/runtime/slave-service.js +225 -0
  26. package/src/runtime/tool-usage-report.js +11 -3
  27. package/src/transport/telegram/bot.js +37 -7
  28. package/test/capabilities-security.test.js +29 -0
  29. package/test/daemon-catalog-conformance.test.js +3 -1
  30. package/test/daemon-runtime.test.js +58 -2
  31. package/test/official-tool-installer.test.js +107 -0
  32. package/test/paths.test.js +6 -12
  33. package/test/slave-cli.test.js +282 -0
  34. package/test/telegram-text-artifact.test.js +24 -1
  35. package/test/tool-capability-search.test.js +55 -0
  36. package/test/tool-registry-run.test.js +70 -1
  37. package/test/tool-resource-note.test.js +50 -0
  38. package/test/tool-usage.test.js +10 -5
  39. package/test-fixtures/fake-daemon.js +12 -1
package/AGENTS.md CHANGED
@@ -76,7 +76,12 @@ const result = await arisa.tools.run({
76
76
  }, { timeoutMs: 120_000 });
77
77
  ```
78
78
 
79
- The IPC channel is a local socket under `~/.arisa/state`. Every request must include `toolName`; chat-scoped capabilities also require `chatId`. Exposed capabilities are explicit: tools (`list`, `help`, `skills`, `setConfig`, `run`), artifacts (`createText`, `listRecent`, `get`, `deliver`), tasks (`add`, `list`, `cancel`, `cancelAll`), agent events (`enqueueEvent`), and runtime paths (`getChatToolStateDir`, `getToolStateDir`, `getChatToolTmpDir`, `getToolTmpDir`, `getChatArtifactsDir`). Do not expose raw `agentManager`, `taskStore`, `artifactStore`, or `toolRegistry` access.
79
+ The IPC channel is a local socket under `~/.arisa/state`. Every request must include `toolName`; chat-scoped capabilities also require `chatId`. Exposed capabilities are explicit: tools (`list`, `help`, `skills`, `setConfig`, `setResourceNote`, `getResourceNote`, `run`), artifacts (`createText`, `listRecent`, `get`, `deliver`), tasks (`add`, `list`, `cancel`, `cancelAll`), agent events (`enqueueEvent`), and runtime paths (`getChatToolStateDir`, `getToolStateDir`, `getChatToolTmpDir`, `getToolTmpDir`, `getChatArtifactsDir`). Do not expose raw `agentManager`, `taskStore`, `artifactStore`, or `toolRegistry` access.
80
+
81
+ ## Tool resource notes
82
+ A tool resource may have one deterministic chat-scoped operational note of at most 200 characters, keyed by the exact pair `toolName:resourceId`. Notes live in the chat state file returned by `getChatToolResourceNotesFile(chatId)`. They are separate from semantic memory and contain no credentials.
83
+
84
+ Use `set_tool_resource_note` to set or clear a note. Tool events must put the exact resource identifier in `task.source.resourceId` or pass `resourceId` to `agent.enqueueEvent`; Arisa injects the matching note into the prompt before reasoning. Tool executions may pass `resourceId` to `run_tool`, which injects the note as `request.resourceNote`. Never infer resource identifiers from free-form prompt text.
80
85
 
81
86
  ## Conceptual pipe model
82
87
  There are two different moments where pipes can happen:
@@ -188,9 +193,12 @@ Reason in terms of capabilities, not tool names. Do not stop at "I cannot do tha
188
193
  Before asking the user for recurrent context, inspect available tools by `category` and `keywords`, especially `memory`, `context`, `contacts`, and `essential`.
189
194
 
190
195
  When the user asks for something new:
191
- 1. check whether an existing registered tool, or an indirect use of one, can satisfy the task
192
- 2. check the official catalog at `https://github.com/clasen/Arisa/tree/main/tools` before building anything
193
- 3. install from the catalog when it fits, or create a new tool only when the needed capability is truly missing
196
+ 1. call `list_tools` with a concise capability query; it searches registered tool names, descriptions, categories, keywords, inputs, and outputs, and automatically falls back to official catalog manifests when no installed tool matches
197
+ 2. call `tool_help` for every plausible installed match before concluding the capability is missing
198
+ 3. if the search returned no installed or official match, inspect the official catalog at `https://github.com/clasen/Arisa/tree/main/tools` before offering to build anything
199
+ 4. install from the catalog when it fits, or create a new tool only when the needed capability is truly missing
200
+
201
+ Never offer to create or extend a tool after inspecting only a few familiar tool names. A negative capability claim requires both a complete registered-tool scan and an official-catalog scan. For example, a request to read X bookmarks must match the `bookmarks` keyword on `x-session-reader`, even if `x-reader` and `x-dm` do not expose that action.
194
202
 
195
203
  To evaluate the official catalog:
196
204
  1. List it: `curl -s https://api.github.com/repos/clasen/Arisa/contents/tools`.