volute 0.14.1 → 0.15.0
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/dist/cli.js +1 -1
- package/dist/{package-I7Z6G44Y.js → package-TDCEK6C2.js} +1 -1
- package/package.json +1 -1
- package/templates/claude/src/agent.ts +4 -1
- package/templates/claude/src/lib/hooks/reply-instructions.ts +28 -0
- package/templates/pi/src/agent.ts +8 -1
- package/templates/pi/src/lib/reply-instructions-extension.ts +30 -0
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ if (!process.env.VOLUTE_HOME) {
|
|
|
9
9
|
var command = process.argv[2];
|
|
10
10
|
var args = process.argv.slice(3);
|
|
11
11
|
if (command === "--version" || command === "-v") {
|
|
12
|
-
const { default: pkg } = await import("./package-
|
|
12
|
+
const { default: pkg } = await import("./package-TDCEK6C2.js");
|
|
13
13
|
console.log(pkg.version);
|
|
14
14
|
process.exit(0);
|
|
15
15
|
}
|
|
@@ -4,7 +4,7 @@ import "./chunk-K3NQKI34.js";
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "volute",
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.15.0",
|
|
8
8
|
description: "CLI for creating and managing self-modifying AI minds powered by the Claude Agent SDK",
|
|
9
9
|
type: "module",
|
|
10
10
|
license: "MIT",
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import { toSDKContent } from "./lib/content.js";
|
|
|
9
9
|
import { createAutoCommitHook } from "./lib/hooks/auto-commit.js";
|
|
10
10
|
import { createIdentityReloadHook } from "./lib/hooks/identity-reload.js";
|
|
11
11
|
import { createPreCompactHook } from "./lib/hooks/pre-compact.js";
|
|
12
|
+
import { createReplyInstructionsHook } from "./lib/hooks/reply-instructions.js";
|
|
12
13
|
import { createSessionContextHook } from "./lib/hooks/session-context.js";
|
|
13
14
|
import { log } from "./lib/logger.js";
|
|
14
15
|
import { createMessageChannel } from "./lib/message-channel.js";
|
|
@@ -93,6 +94,8 @@ export function createMind(options: {
|
|
|
93
94
|
cwd: options.cwd,
|
|
94
95
|
});
|
|
95
96
|
|
|
97
|
+
const replyInstructions = createReplyInstructionsHook(session.messageChannels);
|
|
98
|
+
|
|
96
99
|
return query({
|
|
97
100
|
prompt: session.channel.iterable,
|
|
98
101
|
options: {
|
|
@@ -108,7 +111,7 @@ export function createMind(options: {
|
|
|
108
111
|
hooks: {
|
|
109
112
|
PostToolUse: postToolUseHooks,
|
|
110
113
|
PreCompact: [{ hooks: [preCompact.hook] }],
|
|
111
|
-
UserPromptSubmit: [{ hooks: [sessionContext.hook] }],
|
|
114
|
+
UserPromptSubmit: [{ hooks: [sessionContext.hook, replyInstructions.hook] }],
|
|
112
115
|
},
|
|
113
116
|
},
|
|
114
117
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HookCallback } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import type { MessageChannelInfo } from "../auto-reply.js";
|
|
3
|
+
|
|
4
|
+
export function createReplyInstructionsHook(messageChannels: Map<string, MessageChannelInfo>) {
|
|
5
|
+
let fired = false;
|
|
6
|
+
|
|
7
|
+
const hook: HookCallback = async () => {
|
|
8
|
+
if (fired) return {};
|
|
9
|
+
|
|
10
|
+
const entry = messageChannels.values().next().value;
|
|
11
|
+
if (!entry?.channel) return {};
|
|
12
|
+
|
|
13
|
+
fired = true;
|
|
14
|
+
|
|
15
|
+
const context = entry.autoReply
|
|
16
|
+
? `Auto-reply is enabled for this session — your text output will automatically be sent back to ${entry.channel}. To send to a different channel: volute send <channel> "message"`
|
|
17
|
+
: `To reply to this message, use: volute send ${entry.channel} "your message"`;
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
hookSpecificOutput: {
|
|
21
|
+
hookEventName: "UserPromptSubmit" as const,
|
|
22
|
+
additionalContext: context,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return { hook };
|
|
28
|
+
}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { extractImages, extractText } from "./lib/content.js";
|
|
16
16
|
import { createEventHandler } from "./lib/event-handler.js";
|
|
17
17
|
import { log } from "./lib/logger.js";
|
|
18
|
+
import { createReplyInstructionsExtension } from "./lib/reply-instructions-extension.js";
|
|
18
19
|
import { resolveModel } from "./lib/resolve-model.js";
|
|
19
20
|
import { createSessionContextExtension } from "./lib/session-context-extension.js";
|
|
20
21
|
import type {
|
|
@@ -123,11 +124,17 @@ export function createMind(options: {
|
|
|
123
124
|
cwd: options.cwd,
|
|
124
125
|
});
|
|
125
126
|
|
|
127
|
+
const replyInstructionsExtension = createReplyInstructionsExtension(session.messageChannels);
|
|
128
|
+
|
|
126
129
|
const resourceLoader = new DefaultResourceLoader({
|
|
127
130
|
cwd: options.cwd,
|
|
128
131
|
settingsManager,
|
|
129
132
|
systemPrompt: options.systemPrompt,
|
|
130
|
-
extensionFactories: [
|
|
133
|
+
extensionFactories: [
|
|
134
|
+
preCompactExtension,
|
|
135
|
+
sessionContextExtension,
|
|
136
|
+
replyInstructionsExtension,
|
|
137
|
+
],
|
|
131
138
|
});
|
|
132
139
|
await resourceLoader.reload();
|
|
133
140
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ExtensionFactory } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import type { MessageChannelInfo } from "./auto-reply.js";
|
|
3
|
+
|
|
4
|
+
export function createReplyInstructionsExtension(
|
|
5
|
+
messageChannels: Map<string, MessageChannelInfo>,
|
|
6
|
+
): ExtensionFactory {
|
|
7
|
+
return (pi) => {
|
|
8
|
+
let fired = false;
|
|
9
|
+
pi.on("before_agent_start", () => {
|
|
10
|
+
if (fired) return {};
|
|
11
|
+
|
|
12
|
+
const entry = messageChannels.values().next().value;
|
|
13
|
+
if (!entry?.channel) return {};
|
|
14
|
+
|
|
15
|
+
fired = true;
|
|
16
|
+
|
|
17
|
+
const content = entry.autoReply
|
|
18
|
+
? `Auto-reply is enabled for this session — your text output will automatically be sent back to ${entry.channel}. To send to a different channel: volute send <channel> "message"`
|
|
19
|
+
: `To reply to this message, use: volute send ${entry.channel} "your message"`;
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
message: {
|
|
23
|
+
customType: "reply-instructions",
|
|
24
|
+
content,
|
|
25
|
+
display: true,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|