@memtensor/memos-local-openclaw-plugin 1.0.9-beta.2 → 1.0.10-beta.1
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/index.ts +21 -4
- package/package.json +1 -1
- package/src/skill/generator.ts +18 -4
- package/src/viewer/html.ts +1 -0
package/index.ts
CHANGED
|
@@ -2386,10 +2386,27 @@ Groups: ${groupNames.length > 0 ? groupNames.join(", ") : "(none)"}`,
|
|
|
2386
2386
|
|
|
2387
2387
|
function isGatewayStartCommand(): boolean {
|
|
2388
2388
|
const args = process.argv.map(a => String(a || "").toLowerCase());
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2389
|
+
|
|
2390
|
+
// 1. Match dev environment scripts (pnpm dev / start / watch usually call these mjs files)
|
|
2391
|
+
if (args.some(a => a.includes("run-node.mjs") || a.includes("watch-node.mjs"))) {
|
|
2392
|
+
return true;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
// 2. Match formal CLI commands (gateway or daemon)
|
|
2396
|
+
const targetIdx = Math.max(args.lastIndexOf("gateway"), args.lastIndexOf("daemon"));
|
|
2397
|
+
if (targetIdx !== -1) {
|
|
2398
|
+
const next = args[targetIdx + 1];
|
|
2399
|
+
|
|
2400
|
+
// Match:
|
|
2401
|
+
// - No subcommand, only gateway config (e.g. openclaw gateway)
|
|
2402
|
+
// - Followed by parameter (e.g. openclaw gateway --port 8080)
|
|
2403
|
+
// - Specific start action (start, restart, run, install)
|
|
2404
|
+
if (!next || next.startsWith("-") || ["start", "restart", "run", "install"].includes(next)) {
|
|
2405
|
+
return true;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
return false;
|
|
2393
2410
|
}
|
|
2394
2411
|
|
|
2395
2412
|
const startServiceCore = async (isHostStart = false) => {
|
package/package.json
CHANGED
package/src/skill/generator.ts
CHANGED
|
@@ -24,17 +24,24 @@ This Skill is special: it comes from real execution experience — every step wa
|
|
|
24
24
|
|
|
25
25
|
## Core principles (follow strictly but do NOT include these in output)
|
|
26
26
|
|
|
27
|
+
### Assume the agent is smart
|
|
28
|
+
The agent consuming this skill is an LLM — it already knows how to use git, write code, read docs, and run commands.
|
|
29
|
+
- Only write what the agent CANNOT derive from the codebase or general knowledge: project-specific gotchas, non-obvious config, verified flags/versions, and real pitfalls encountered.
|
|
30
|
+
- Do NOT explain basic concepts, standard tool usage, or things any competent developer already knows.
|
|
31
|
+
|
|
27
32
|
### Progressive disclosure
|
|
28
33
|
- The frontmatter description (~100 words) is ALWAYS in the agent's context — it must be self-sufficient for deciding whether to use this skill.
|
|
29
34
|
- The SKILL.md body loads when triggered — keep it under 400 lines, focused, no fluff.
|
|
30
35
|
- If the task involved large configs/scripts, mention them but DON'T inline everything — just reference that scripts/ or references/ may contain them.
|
|
36
|
+
- If the skill covers multiple variants (e.g. different OS targets, different cloud providers), put variant-specific details in references/ files. The main SKILL.md should cover the common workflow only.
|
|
31
37
|
|
|
32
38
|
### Description as trigger mechanism
|
|
33
|
-
The description field
|
|
39
|
+
The description field is the SOLE input the agent uses to decide whether to activate this skill. If the description doesn't match, the body is never read — so put maximum effort here.
|
|
34
40
|
- Don't just say what it does — list the situations, keywords, and phrasings that should trigger it.
|
|
35
41
|
- Claude/agents tend to under-trigger skills. Counter this by being explicit about when to use it.
|
|
42
|
+
- Include indirect phrasings: users often describe the goal ("make it run anywhere") rather than the tool ("Docker").
|
|
36
43
|
- Bad: "How to deploy Node.js to Docker"
|
|
37
|
-
- Good: "How to containerize and deploy a Node.js application using Docker.
|
|
44
|
+
- Good: "How to containerize and deploy a Node.js application using Docker. TRIGGER when: user mentions Docker deployment, Dockerfile writing, container builds, multi-stage builds, port mapping, .dockerignore, image optimization, CI/CD container pipelines, or any task involving packaging a Node/JS backend into a container — even if they don't say 'Docker' explicitly but describe wanting to 'package the app for production' or 'run it anywhere'."
|
|
38
45
|
|
|
39
46
|
### Writing style
|
|
40
47
|
- Use imperative form
|
|
@@ -43,6 +50,9 @@ The description field decides whether the agent activates this skill. Write it "
|
|
|
43
50
|
- Generalize from the specific task so the skill works for similar future scenarios, don't over-fit to this exact project
|
|
44
51
|
- Keep real commands/code/config from the task record — these are verified to work
|
|
45
52
|
|
|
53
|
+
### No extra files
|
|
54
|
+
- Output ONLY the SKILL.md content. Do NOT create or reference README.md, CHANGELOG.md, INSTALLATION_GUIDE.md, CONTRIBUTING.md, or similar boilerplate files. All information belongs in SKILL.md, scripts/, or references/.
|
|
55
|
+
|
|
46
56
|
### Language matching (CRITICAL)
|
|
47
57
|
You MUST write the ENTIRE skill in the SAME language as the user's messages in the task record.
|
|
48
58
|
- If the user wrote in Chinese → the skill title, description, all prose sections MUST be in Chinese
|
|
@@ -57,12 +67,16 @@ DO NOT default to English. Look at the task record below and match its language.
|
|
|
57
67
|
|
|
58
68
|
Output ONLY the complete SKILL.md content. No extra text before or after.
|
|
59
69
|
|
|
70
|
+
The frontmatter contains ONLY name and description. Nothing else.
|
|
71
|
+
(OpenClaw metadata such as emoji is optional — if desired, add it as a \`<!-- metadata: {{"openclaw": {{"emoji": "..."}}}}} -->\` HTML comment at the very end of the file body, NOT in the frontmatter.)
|
|
72
|
+
|
|
60
73
|
---
|
|
61
74
|
name: "{NAME}"
|
|
62
|
-
description: "{A natural, proactive description. 60-120 words. Cover what it does + multiple phrasings/scenarios that should trigger it.
|
|
63
|
-
metadata: {{ "openclaw": {{ "emoji": "{emoji}" }} }}
|
|
75
|
+
description: "{A natural, proactive description. 60-120 words. Cover what it does + multiple phrasings/scenarios that should trigger it. Include a TRIGGER line listing keywords and indirect phrasings. Be pushy about triggering.}"
|
|
64
76
|
---
|
|
65
77
|
|
|
78
|
+
Name rules: 2-4 English words, kebab-case, lowercase (e.g. "docker-node-deploy", "aws-s3-backup"). This is a machine identifier.
|
|
79
|
+
|
|
66
80
|
# {Title — clear, action-oriented}
|
|
67
81
|
|
|
68
82
|
{One sentence: what this skill helps you do and why it's valuable}
|
package/src/viewer/html.ts
CHANGED
|
@@ -7205,6 +7205,7 @@ function onProviderChange(){}
|
|
|
7205
7205
|
async function loadConfig(){
|
|
7206
7206
|
try{
|
|
7207
7207
|
const r=await fetch('/api/config');
|
|
7208
|
+
if(r.status===401){toast(t('settings.session.expired'),'error');return;}
|
|
7208
7209
|
if(!r.ok) return;
|
|
7209
7210
|
const cfg=await r.json();
|
|
7210
7211
|
const emb=cfg.embedding||{};
|