iris-chatbot 5.0.1 → 5.0.2

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": "iris-chatbot",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "private": false,
5
5
  "description": "One-command installer for the Iris project template.",
6
6
  "bin": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "iris",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "iris",
9
- "version": "5.0.1",
9
+ "version": "5.0.2",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.72.1",
12
12
  "clsx": "^2.1.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iris",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "private": true,
5
5
  "description": "One-command installer for the Iris project template.",
6
6
  "engines": {
@@ -1101,7 +1101,53 @@ export default function ChatView({
1101
1101
  payloadMessages.push(
1102
1102
  ...history
1103
1103
  .filter((message) => message.role !== "system")
1104
- .map((message) => ({ role: message.role, content: message.content })),
1104
+ .map((message) => {
1105
+ let content = message.content;
1106
+
1107
+ // Enrich assistant messages with tool call summaries so the model
1108
+ // retains awareness of tools it successfully used earlier in the
1109
+ // conversation. Without this, the model "forgets" its own tool
1110
+ // capabilities and may deny being able to do things it already did.
1111
+ if (message.role === "assistant") {
1112
+ const events = toolEventsByMessage.get(message.id);
1113
+ if (events && events.length > 0) {
1114
+ const resultEvents = events.filter((e) => e.stage === "result");
1115
+ if (resultEvents.length > 0) {
1116
+ const summaries = resultEvents.map((e) => {
1117
+ const name = e.toolName || "Unknown Tool";
1118
+ // Try to extract a meaningful result summary from payloadJson
1119
+ let resultSummary = "";
1120
+ if (e.payloadJson) {
1121
+ try {
1122
+ const payload = JSON.parse(e.payloadJson);
1123
+ if (typeof payload === "object" && payload !== null) {
1124
+ // Look for common result fields
1125
+ resultSummary =
1126
+ payload.message || payload.summary || payload.result ||
1127
+ payload.status || payload.output || "";
1128
+ if (typeof resultSummary !== "string") {
1129
+ resultSummary = JSON.stringify(payload).slice(0, 120);
1130
+ }
1131
+ } else if (typeof payload === "string") {
1132
+ resultSummary = payload;
1133
+ }
1134
+ } catch {
1135
+ // payloadJson may not be valid JSON; ignore
1136
+ }
1137
+ }
1138
+ if (!resultSummary && e.message && e.message !== "success") {
1139
+ resultSummary = e.message;
1140
+ }
1141
+ return resultSummary ? `${name} → ${resultSummary}` : name;
1142
+ });
1143
+ const toolPrefix = `[Tools used: ${summaries.join("; ")}]`;
1144
+ content = content ? `${toolPrefix}\n\n${content}` : toolPrefix;
1145
+ }
1146
+ }
1147
+ }
1148
+
1149
+ return { role: message.role, content };
1150
+ }),
1105
1151
  );
1106
1152
 
1107
1153
  const controller = new AbortController();
@@ -1478,6 +1524,7 @@ export default function ChatView({
1478
1524
  stopMicMode,
1479
1525
  quotedContext,
1480
1526
  messageMap,
1527
+ toolEventsByMessage,
1481
1528
  ]);
1482
1529
 
1483
1530
  useEffect(() => {
@@ -900,11 +900,24 @@ async function runMusicSetVolume(input: unknown, context: ToolExecutionContext)
900
900
  return { dryRun: true, action: "music_set_volume", target, level };
901
901
  }
902
902
 
903
- const script =
904
- target === "music"
905
- ? `tell application "Music" to set sound volume to ${level}`
906
- : `set volume output volume ${level}`;
907
- await runAppleScript(script, [], context.signal);
903
+ // Always set the system output volume so the user hears an audible change.
904
+ // The Music app's internal sound volume is often already at 100%, so
905
+ // only setting that has no effect on actual output loudness.
906
+ await runAppleScript(`set volume output volume ${level}`, [], context.signal);
907
+
908
+ // If targeted at Music, also set the Music app's internal volume.
909
+ if (target === "music") {
910
+ try {
911
+ await runAppleScript(
912
+ `tell application "Music" to set sound volume to ${level}`,
913
+ [],
914
+ context.signal,
915
+ );
916
+ } catch {
917
+ // Music app may not be running; system volume is already set.
918
+ }
919
+ }
920
+
908
921
  return { target, level };
909
922
  }
910
923