Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

docs(monitor): make stop/list first-class in the tool description

Akarshan Biswas881abfd2ae78
diff --git a/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/monitor.rs b/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/monitor.rs
index b2f347b12..306f5bdf0 100644
--- a/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/monitor.rs
+++ b/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/monitor.rs
@@ -550,7 +550,7 @@ pub fn monitor_tool_schema() -> serde_json::Value {
"type": "function",
"function": {
"name": MONITOR_TOOL_NAME,
- "description": "Wait for something in the background: poll a shell script on an interval until it exits 0, then get its stdout as a <SYSTEM> note while you keep working. Use it to wait on a backgrounded job, e.g. script \"grep -m1 'BUILD FAILED' build.log\" or \"test -f done.flag\". The script runs from the project root on every poll; a nonzero exit means not yet. The first match ends the monitor, as does its timeout. Start one monitor per thing you are waiting for.",
+ "description": "Wait in the background for a condition and be told when it happens. start polls a shell script from the project root every interval; the first poll that exits 0 ends the monitor and hands you its stdout as a <SYSTEM> note while you keep working (a nonzero exit means not yet), e.g. \"grep -m1 'BUILD FAILED' build.log\" or \"test -f done.flag\". A monitor also ends on its timeout. stop ends one early by its id once you no longer need it, and list shows active monitors and their ids. Start one monitor per thing you are waiting for.",
"parameters": {
"type": "object",
"properties": {
@@ -559,7 +559,7 @@ pub fn monitor_tool_schema() -> serde_json::Value {
"name": { "type": "string", "description": "For start: optional short label quoted back to you when it matches (defaults to the script)." },
"interval": { "type": "integer", "description": "For start: seconds between polls (default 5, min 1, max 300)." },
"timeout": { "type": "integer", "description": "For start: seconds before the monitor gives up (default 1800, max 7200)." },
- "monitor_id": { "type": "string", "description": "For stop: the id returned by start." }
+ "monitor_id": { "type": "string", "description": "The monitor's id, from start's result (or list); required for stop." }
},
"required": ["op"]
}
diff --git a/web-app/src/lib/coworkMonitor.ts b/web-app/src/lib/coworkMonitor.ts
index 81de4e1d6..5eecfa709 100644
--- a/web-app/src/lib/coworkMonitor.ts
+++ b/web-app/src/lib/coworkMonitor.ts
@@ -22,7 +22,7 @@ export const MONITOR_TOOL_NAME = 'monitor'
export function monitorTool(): Tool {
return {
description:
- 'Wait for something in the background: poll a shell script on an interval until it exits 0, then get its stdout as a <SYSTEM> note while you keep working. Use it to wait on a backgrounded job, e.g. script "grep -m1 \'BUILD FAILED\' build.log" or "test -f done.flag". The script runs from the project root on every poll; a nonzero exit means not yet. The first match ends the monitor, as does its timeout. Start one monitor per thing you are waiting for.',
+ 'Wait in the background for a condition and be told when it happens. start polls a shell script from the project root every interval; the first poll that exits 0 ends the monitor and hands you its stdout as a <SYSTEM> note while you keep working (a nonzero exit means not yet), e.g. "grep -m1 \'BUILD FAILED\' build.log" or "test -f done.flag". A monitor also ends on its timeout. stop ends one early by its id once you no longer need it, and list shows active monitors and their ids. Start one monitor per thing you are waiting for.',
inputSchema: jsonSchema({
type: 'object',
properties: {
@@ -49,7 +49,7 @@ export function monitorTool(): Tool {
},
monitor_id: {
type: 'string',
- description: 'For stop: the id returned by start.',
+ description: "The monitor's id, from start's result (or list); required for stop.",
},
},
required: ['op'],