arisa 3.0.4 → 3.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arisa",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "Telegram + Pi Agent modular assistant",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -3,6 +3,7 @@ import { mkdir, unlink } from "node:fs/promises";
3
3
  import { createAgentSession, SessionManager, defineTool } from "@mariozechner/pi-coding-agent";
4
4
  import { Type } from "@sinclair/typebox";
5
5
  import { createPiRuntime, hasProviderAuth } from "./pi-runtime.js";
6
+ import { loadProjectInstructions } from "./project-instructions.js";
6
7
  import { getChatDir, piAgentDir as agentDir } from "../../runtime/paths.js";
7
8
 
8
9
  export class AgentManager {
@@ -74,6 +75,10 @@ export class AgentManager {
74
75
  sessionManager: SessionManager.continueRecent(cwd)
75
76
  });
76
77
 
78
+ const instructions = await loadProjectInstructions();
79
+ this.logger?.log("agent", `injecting project instructions for chat ${chatId}`);
80
+ await session.prompt(`${instructions}\n\nAcknowledge with exactly: OK`);
81
+
77
82
  const ctx = { session };
78
83
  this.sessions.set(chatId, ctx);
79
84
  return ctx;
@@ -0,0 +1,11 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { fileURLToPath } from "node:url";
3
+
4
+ const instructionsPath = fileURLToPath(new URL("../../../AGENTS.md", import.meta.url));
5
+ let cachedInstructions = null;
6
+
7
+ export async function loadProjectInstructions() {
8
+ if (cachedInstructions !== null) return cachedInstructions;
9
+ cachedInstructions = await readFile(instructionsPath, "utf8");
10
+ return cachedInstructions;
11
+ }