tuna-agent 0.1.63 → 0.1.65
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/daemon/index.js +2 -1
- package/dist/mcp/setup.js +4 -4
- package/package.json +1 -1
package/dist/daemon/index.js
CHANGED
|
@@ -355,10 +355,11 @@ export async function startDaemon(config) {
|
|
|
355
355
|
const analyzePrompt = `You are analyzing a Claude Code skill file (markdown prompt template). Extract the following structured information from the content below:
|
|
356
356
|
|
|
357
357
|
1. **description**: A short summary of what this skill does in under 80 characters. Be very concise — like a subtitle, not a full sentence.
|
|
358
|
-
2. **actions**:
|
|
358
|
+
2. **actions**: Distinct sub-commands or operations the user can choose from. An action represents a SEPARATE task the skill can perform — not just a flag, option, or variation of the same task. Each action has:
|
|
359
359
|
- "name" (short, lowercase, no spaces — use hyphens)
|
|
360
360
|
- "description" (what it does, max 100 chars)
|
|
361
361
|
- "params" (array of parameter KEY strings that are relevant to THIS specific action — only include params that this action actually uses)
|
|
362
|
+
IMPORTANT: Flags like --all, --verbose, --dry-run are PARAMETERS, not actions. A mode that simply runs the same task with different scope (e.g. "browse one platform" vs "browse all platforms") is ONE action with a parameter, not two separate actions. Only create multiple actions when the skill does fundamentally different things (e.g. "create" vs "delete" vs "list").
|
|
362
363
|
3. **parameters**: ALL input parameters the skill accepts (the full definitions). Look for {{param_name}} placeholders, $ARGUMENTS references, or documented inputs. Each parameter has "key", "label", "type" (text/number/select/multiline), "required" (boolean), "default_value", "options" (for select type), "placeholder".
|
|
363
364
|
- IMPORTANT: If a parameter has a finite set of known values (e.g. listed in config files, enums, documented choices), use type "select" and populate the "options" array with ALL known values. Only use type "text" when the input is truly free-form.
|
|
364
365
|
|
package/dist/mcp/setup.js
CHANGED
|
@@ -68,7 +68,7 @@ export async function fetchMem0Count(agentName) {
|
|
|
68
68
|
export async function callMem0AddMemory(text, agentName) {
|
|
69
69
|
if (!MEM0_SSH_HOST && !MEM0_HTTP_BASE)
|
|
70
70
|
throw new Error('Mem0 not configured');
|
|
71
|
-
const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
71
|
+
const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
72
72
|
// Try HTTP API first (OpenMemory) — stores in SQLite+Qdrant, shows up in counts
|
|
73
73
|
// Falls through to SSH+curl if HTTP is not reachable (e.g. port not exposed externally)
|
|
74
74
|
if (MEM0_HTTP_BASE && !MEM0_SSH_HOST) {
|
|
@@ -145,7 +145,7 @@ export async function callMem0SearchMemory(query, agentName, limit = 5) {
|
|
|
145
145
|
if (!MEM0_SSH_HOST)
|
|
146
146
|
return [];
|
|
147
147
|
const { execFile } = await import('child_process');
|
|
148
|
-
const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
148
|
+
const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
149
149
|
return new Promise((resolve) => {
|
|
150
150
|
let cmd;
|
|
151
151
|
let args;
|
|
@@ -194,7 +194,7 @@ export async function callMem0Patterns(agentName, minCluster = 3) {
|
|
|
194
194
|
if (!MEM0_SSH_HOST)
|
|
195
195
|
return [];
|
|
196
196
|
const { execFile } = await import('child_process');
|
|
197
|
-
const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
197
|
+
const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
198
198
|
const input = JSON.stringify({ user_id: safeAgentName, min_cluster: minCluster });
|
|
199
199
|
return new Promise((resolve) => {
|
|
200
200
|
let cmd;
|
|
@@ -318,7 +318,7 @@ function buildMem0McpConfig(agentName) {
|
|
|
318
318
|
if (!MEM0_SSH_HOST)
|
|
319
319
|
return null;
|
|
320
320
|
// Sanitize agent name for shell safety (replace non-alphanumeric with hyphens)
|
|
321
|
-
const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
321
|
+
const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
|
|
322
322
|
const envWithUser = { ...MEM0_ENV_VARS, MEM0_USER_ID: safeAgentName };
|
|
323
323
|
if (MEM0_SSH_HOST === 'local') {
|
|
324
324
|
return {
|