arisa 4.0.22 → 4.0.24

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 (2) hide show
  1. package/AGENTS.md +33 -58
  2. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -1,18 +1,16 @@
1
1
  # Arisa AGENTS
2
2
 
3
- ## Architecture
3
+ ## Core boundaries
4
+ Arisa core owns transport, sessions, artifacts, and tool orchestration:
4
5
  - Telegram transport handles inbound and outbound messaging.
5
6
  - Pi Agent keeps one session per authorized chat.
6
7
  - Incoming messages and files (text, voice, photo, document) and generated files become artifacts.
7
- - A tool registry handles tool discovery, help lookup, config writes, and execution.
8
- - Tools are isolated and each one has its own manifest, entrypoint, and config defaults.
9
- - No tools ship with the core. All installed tools live under `~/.arisa/tools/<toolName>`; the install directory of Arisa (your working directory) contains only the core. Never create or install tools inside the install directory.
8
+ - The tool registry handles tool discovery, help lookup, config writes, and execution.
9
+ - Tools are isolated packages with their own manifest, entrypoint, and config defaults.
10
+ - No tools ship with the core; installed tools live under `~/.arisa/tools/<toolName>`.
11
+ - The Arisa install directory (your working directory) contains only the core. Never create or install tools inside it.
10
12
 
11
- ## Core modification policy
12
- Modifying the Arisa core is the last resort, never the default. All work must be done in tools.
13
- - Always solve the request by creating or editing a tool under `~/.arisa/tools/<toolName>`.
14
- - Treat changing core code as the final option, only after confirming the capability genuinely cannot be delivered through the tool architecture.
15
- - Never modify the core on your own initiative. Always consult the user first, explaining why a core change is unavoidable, and wait for explicit approval before touching core code.
13
+ New capabilities belong in tools by default. Solve requests by creating or editing a tool under `~/.arisa/tools/<toolName>`. Modifying core is the last resort: do it only after confirming the capability cannot be delivered through the tool architecture, explaining why the core change is unavoidable, and receiving explicit user approval.
16
14
 
17
15
  ## Runtime directory rules
18
16
  Do not build runtime paths by hand. Use `src/runtime/paths.js`:
@@ -39,9 +37,9 @@ Each tool declares in `tool.manifest.json`:
39
37
  - `skillHints`: optional skills to apply when using or editing the tool
40
38
 
41
39
  ## Tool-to-Arisa IPC
42
- Arisa does not mount tool-provided web routes in core. If a tool needs to expose a web UI or HTTP endpoint, the tool owns that server, usually through the shared daemon runtime. The tool's server handles its own requests and uses Arisa IPC when it needs to run a registered tool, create/read artifacts, manage tasks, enqueue agent events, or resolve runtime paths.
40
+ Tools that expose a web UI or HTTP endpoint own that server, usually through the shared daemon runtime; Arisa core does not mount tool routes or proxies. Use Arisa IPC when a tool needs registered tools, artifacts, tasks, agent events, or runtime paths.
43
41
 
44
- Installed tools can import the IPC client through `ARISA_PACKAGE_DIR`:
42
+ Import the IPC client through `ARISA_PACKAGE_DIR`:
45
43
 
46
44
  ```js
47
45
  import path from "node:path";
@@ -52,11 +50,6 @@ const { createArisaClient } = await importCore("core/tools/ipc-client.js");
52
50
 
53
51
  const arisa = createArisaClient({ toolName: "example-tool", chatId });
54
52
  await arisa.artifacts.createText({ text: "hello" });
55
- ```
56
-
57
- For tool-owned web UI request/response flows, call another registered tool through IPC instead of adding core HTTP routes or proxies:
58
-
59
- ```js
60
53
  const result = await arisa.tools.run({
61
54
  name: "strudel-agent",
62
55
  text: prompt,
@@ -64,7 +57,7 @@ const result = await arisa.tools.run({
64
57
  }, { timeoutMs: 120_000 });
65
58
  ```
66
59
 
67
- 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 (`run`), artifacts (`createText`, `listRecent`, `get`), tasks (`add`, `list`, `cancel`), agent events (`enqueueEvent`), and runtime paths (`getChatToolStateDir`, `getToolStateDir`, `getChatToolTmpDir`, `getToolTmpDir`, `getChatArtifactsDir`). Do not add raw access to `agentManager`, `taskStore`, `artifactStore`, or `toolRegistry`.
60
+ 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 (`run`), artifacts (`createText`, `listRecent`, `get`), tasks (`add`, `list`, `cancel`), agent events (`enqueueEvent`), and runtime paths (`getChatToolStateDir`, `getToolStateDir`, `getChatToolTmpDir`, `getToolTmpDir`, `getChatArtifactsDir`). Do not expose raw `agentManager`, `taskStore`, `artifactStore`, or `toolRegistry` access.
68
61
 
69
62
  ## Conceptual pipe model
70
63
  There are two different moments where pipes can happen:
@@ -159,43 +152,31 @@ If `run_tool` returns `missingConfig`, the agent should:
159
152
 
160
153
  Do not assume a rigid question/answer protocol. Continue the conversation naturally and infer the config value from the user reply when possible.
161
154
 
162
- ## Official tool catalog
163
- The official tool catalog lives at `https://github.com/clasen/Arisa/tree/main/tools`. Each subdirectory is an installable tool following the standard tool contract.
164
-
165
- When a capability is missing, check the catalog before building anything:
166
- 1. List the catalog: `curl -s https://api.github.com/repos/clasen/Arisa/contents/tools`.
167
- 2. Read the manifest of any candidate: `https://raw.githubusercontent.com/clasen/Arisa/main/tools/<name>/tool.manifest.json` (the `description`, `input`, and `output` fields tell you whether it solves the need). Also read the catalog `README.md` to check the tool's install footprint.
168
- 3. If a catalog tool solves the problem, decide by install footprint (the `Install footprint` column in the catalog `README.md`):
169
- - **Low footprint** (no extra npm dependencies, no external binaries): install it and resolve the user's request in the same turn, without asking first. Favor autonomy here.
170
- - **Medium/High footprint** (heavy dependency trees, external binaries, or interactive setup such as a login): propose it to the user, say which tool it is and what it does, and wait for their confirmation in the chat before installing.
171
- - A missing config secret (for example an API key) is handled by the missing-config flow and is not, on its own, a reason to ask before installing.
172
- 4. Only when nothing in the catalog fits, fall back to creating a new tool.
173
-
174
- ### Installing a tool
175
- After deciding to install (low footprint), after the user confirms, or when the user directly asks to install a tool from any source they choose:
176
- 1. Download the tool directory into `~/.arisa/tools/<name>`. For the official catalog, clone shallowly and copy the subdirectory, for example:
177
- `git clone --depth 1 https://github.com/clasen/Arisa /tmp/arisa-catalog && cp -R /tmp/arisa-catalog/tools/<name> ~/.arisa/tools/<name>`.
178
- 2. Install dependencies inside the tool directory (`pnpm install`, fall back to `npm install`).
179
- 3. Run it through `run_tool`; the registry picks up new tools automatically and exposes the Arisa package root through `ARISA_PACKAGE_DIR`. If it returns `missingConfig`, follow the missing config flow.
180
-
181
- ## Tool creation
182
- Reason in terms of capabilities, not tool names.
155
+ ## Capability resolution
156
+ Reason in terms of capabilities, not tool names. Do not stop at "I cannot do that" when the task is realistically implementable through the tool architecture.
183
157
 
184
158
  When the user asks for something new:
185
- 1. check whether an existing registered tool can already satisfy the task
186
- 2. also check whether the task can be satisfied indirectly through an existing capability
187
- 3. check whether a tool in the official catalog satisfies the task and propose installing it
188
- 4. only propose creating a new tool when the needed capability is truly missing
189
-
190
- Do not stop at "I cannot do that" when the task is realistically implementable through the tool architecture.
191
- The default attitude is:
192
- - identify that no current tool satisfies the request
193
- - state that the missing capability can be added
194
- - propose installing from the official catalog, or propose or start creating the needed tool
159
+ 1. check whether an existing registered tool, or an indirect use of one, can satisfy the task
160
+ 2. check the official catalog at `https://github.com/clasen/Arisa/tree/main/tools` before building anything
161
+ 3. install from the catalog when it fits, or create a new tool only when the needed capability is truly missing
162
+
163
+ To evaluate the official catalog:
164
+ 1. List it: `curl -s https://api.github.com/repos/clasen/Arisa/contents/tools`.
165
+ 2. Read each candidate manifest at `https://raw.githubusercontent.com/clasen/Arisa/main/tools/<name>/tool.manifest.json`; `description`, `input`, and `output` show whether it solves the need.
166
+ 3. Read the catalog `README.md` and use its `Install footprint` column:
167
+ - **Low footprint**: install it and resolve the request in the same turn, without asking first.
168
+ - **Medium/High footprint**: tell the user which tool it is, what it does, and wait for confirmation before installing.
169
+ - Missing config secrets are handled by the missing-config flow and are not, on their own, a reason to ask before installing.
170
+
171
+ When installing any approved or low-footprint tool:
172
+ 1. Download it into `~/.arisa/tools/<name>`. For the official catalog, clone shallowly and copy the subdirectory, for example:
173
+ `git clone --depth 1 https://github.com/clasen/Arisa /tmp/arisa-catalog && cp -R /tmp/arisa-catalog/tools/<name> ~/.arisa/tools/<name>`.
174
+ 2. Install dependencies inside the tool directory with `pnpm install`, falling back to `npm install`. Do not ask the user to install dependencies manually.
175
+ 3. Run it through `run_tool`; the registry picks up new tools automatically and exposes the Arisa package root through `ARISA_PACKAGE_DIR`. If it returns `missingConfig`, follow the missing config flow.
195
176
 
196
177
  When creating or editing tools:
197
- - always create tools under `~/.arisa/tools/<toolName>`, never inside the Arisa install directory
198
- - use the path helpers in `src/runtime/paths.js`
178
+ - follow the core boundary above: create or edit installed tools under `~/.arisa/tools/<toolName>`, never inside the Arisa install directory
179
+ - use the path helpers in `src/runtime/paths.js` for state, config, artifacts, and tmp paths
199
180
  - import Arisa core helpers dynamically through `ARISA_PACKAGE_DIR` (for example `await importCore("core/tools/tool-result.js")`); never use `../../src/...` or rewritten absolute paths
200
181
  - follow the tools in the official catalog as the reference pattern for new tools
201
182
  - keep all help text, usage instructions, manifests, and user-facing operational strings in English
@@ -214,13 +195,7 @@ Tools may declare skills in `tool.manifest.json`:
214
195
 
215
196
  The tool registry resolves these from the installed skills directory and injects them into the tool request as `skills`. `list_tools` exposes the hints and `tool_help` shows their resolution status. Skills are guidance for the agent/tool; they are not separate runtime dependencies.
216
197
 
217
- ## Dependency installation
218
- Tool dependencies are installed as part of building or running the tool, not delegated to the user.
219
- - Prefer `pnpm install`.
220
- - Fall back to `npm install`.
221
- - Do not ask the user to do it manually.
222
-
223
198
  ## Safety
224
199
  - Prefer tool manifests and CLI help over assumptions.
225
- - Keep tool config and runtime data inside the user runtime area.
226
- - Be proactive about extending capabilities, but do it through the project's tool architecture, not through ad hoc one-off behavior.
200
+ - Keep config and runtime data inside the user runtime area through the path helpers above.
201
+ - Be proactive about extending capabilities through the tool architecture, not ad hoc one-off behavior.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arisa",
3
- "version": "4.0.22",
3
+ "version": "4.0.24",
4
4
  "description": "Telegram + Pi Agent modular assistant",
5
5
  "type": "module",
6
6
  "main": "src/index.js",