@heylemon/lemonade 0.4.2 → 0.4.3
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.
|
@@ -366,7 +366,7 @@ export function buildAgentSystemPrompt(params) {
|
|
|
366
366
|
'1. Run `lemon-composio search "<what the user wants>"` — this is your FIRST action. No web search. No `which`. No `--help`. No questions.',
|
|
367
367
|
"2. If result shows `connected: true` → execute the tool immediately with `lemon-composio execute`.",
|
|
368
368
|
"3. If the search returns results but none match the exact action, try broader/different search terms SILENTLY. Do NOT tell the user you're retrying searches.",
|
|
369
|
-
|
|
369
|
+
"4. If the service IS connected but the specific action truly doesn't exist, open the browser to do it. Tell the user briefly: \"Let me do this in the browser — I'll have better control there.\" Do NOT mention Composio, tools, searches, integrations, or any technical details.",
|
|
370
370
|
'5. If result shows `connected: false` → include the `connectUrl` from the search result as plain text (no backticks, no bold, no brackets) e.g. lemon://connect?provider=jira. The app will automatically open the auth page. Say "Connecting [service name] for you: lemon://connect?provider=X" Then STOP and wait for them to complete the auth.',
|
|
371
371
|
"6. Once the user confirms they connected → execute the tool.",
|
|
372
372
|
"7. If `lemon-composio` has no results OR `lemon://connect` fails → use the browser as fallback. Open the service website, let the user log in, and complete the task via browser tools.",
|
|
@@ -430,9 +430,9 @@ export function buildAgentSystemPrompt(params) {
|
|
|
430
430
|
"",
|
|
431
431
|
"Then based on results:",
|
|
432
432
|
'1. **Tools found + connected** → Execute immediately: `lemon-composio execute <TOOL_SLUG> \'{"param": "value"}\'`. If the first search doesn\'t find the right tool, try different search terms (broader terms, service name only, etc.) before giving up.',
|
|
433
|
-
|
|
433
|
+
"2. **No tools found but `serviceConnected: true`** → The user IS connected but this specific action isn't available as a tool. Try a broader search first (e.g. just the service name). If still nothing, tell the user: \"Let me do this in the browser — I'll have better control there.\" Then use the browser. Do NOT try to connect again.",
|
|
434
434
|
"3. **Not connected (`serviceConnected: false`)** → Include the `connectUrl` from the result as plain text: lemon://connect?provider=X. NEVER output a connect URL if `serviceConnected` is true or if the provider appears in `connectedProviders`.",
|
|
435
|
-
|
|
435
|
+
'4. **Connect fails or no results at all** → Tell the user: "Let me do this in the browser — I\'ll have better control there." Then use the browser directly.',
|
|
436
436
|
"",
|
|
437
437
|
"Example flows:",
|
|
438
438
|
'- User: "add a card to my Trello board" → `lemon-composio search "create trello card"` → execute `TRELLO_CREATE_CARD`',
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d75afd34a3b9d8188a668f91262937fd91f47bc5aa69731f23e3402ba9a88e93
|
|
@@ -207,9 +207,9 @@ async function withSessionStoreLock(storePath, fn, opts = {}) {
|
|
|
207
207
|
if (!storePath || typeof storePath !== "string") {
|
|
208
208
|
throw new Error(`withSessionStoreLock: storePath must be a non-empty string, got ${JSON.stringify(storePath)}`);
|
|
209
209
|
}
|
|
210
|
-
const timeoutMs = opts.timeoutMs ??
|
|
211
|
-
const pollIntervalMs = opts.pollIntervalMs ??
|
|
212
|
-
const staleMs = opts.staleMs ??
|
|
210
|
+
const timeoutMs = opts.timeoutMs ?? 30_000;
|
|
211
|
+
const pollIntervalMs = opts.pollIntervalMs ?? 50;
|
|
212
|
+
const staleMs = opts.staleMs ?? 15_000;
|
|
213
213
|
const lockPath = `${storePath}.lock`;
|
|
214
214
|
const startedAt = Date.now();
|
|
215
215
|
await fs.promises.mkdir(path.dirname(storePath), { recursive: true });
|
|
@@ -242,7 +242,27 @@ async function withSessionStoreLock(storePath, fn, opts = {}) {
|
|
|
242
242
|
throw err;
|
|
243
243
|
const now = Date.now();
|
|
244
244
|
if (now - startedAt > timeoutMs) {
|
|
245
|
-
|
|
245
|
+
// Force-remove the stale lock and retry once instead of crashing
|
|
246
|
+
try {
|
|
247
|
+
await fs.promises.unlink(lockPath);
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
// ignore
|
|
251
|
+
}
|
|
252
|
+
try {
|
|
253
|
+
const handle = await fs.promises.open(lockPath, "wx");
|
|
254
|
+
try {
|
|
255
|
+
await handle.writeFile(JSON.stringify({ pid: process.pid, startedAt: Date.now() }), "utf-8");
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// best-effort
|
|
259
|
+
}
|
|
260
|
+
await handle.close();
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
catch {
|
|
264
|
+
throw new Error(`timeout acquiring session store lock: ${lockPath}`);
|
|
265
|
+
}
|
|
246
266
|
}
|
|
247
267
|
// Best-effort stale lock eviction (e.g. crashed process).
|
|
248
268
|
try {
|