@framers/agentos-skills-registry 0.2.1 → 0.4.0

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/index.js CHANGED
@@ -14,7 +14,8 @@
14
14
  import * as path from 'node:path';
15
15
  import * as fs from 'node:fs/promises';
16
16
  // ── Re-export the programmatic catalog (zero heavy deps) ────────────────────
17
- export { SKILLS_CATALOG, getSkillsByCategory, getSkillByName, getAvailableSkills, getCategories, getSkillsByTag, searchSkills, getCuratedSkills, getCommunitySkills, getAllSkills, } from './catalog.js';
17
+ export { SKILLS_CATALOG, getSkillsByCategory, getSkillByName, getAvailableSkills, getCategories, getSkillsByTag, searchSkills, getCuratedSkills, getCommunitySkills, getAllSkills, getSkillEntries, createLocalSkillProxy, loadSkillFromAbsolutePath, loadSkillByName, loadSkillsByNames, } from './catalog.js';
18
+ import { getSkillEntries, loadSkillsByNames, } from './catalog.js';
18
19
  // ── Re-export workspace skill discovery (Feature 3.5) ───────────────────────
19
20
  export { discoverWorkspaceSkills, mergeWithWorkspaceSkills, parseSkillFrontmatter, } from './workspace-discovery.js';
20
21
  // ── Lazy loader for @framers/agentos ────────────────────────────────────────
@@ -78,6 +79,23 @@ export async function getAvailableCuratedSkills() {
78
79
  return catalog.skills.curated ?? [];
79
80
  }
80
81
  // ── Factory functions (lazy-load @framers/agentos) ──────────────────────────
82
+ async function populateCuratedRegistry(args) {
83
+ const names = getSkillEntries(args.selection).map((entry) => entry.name);
84
+ const loadedSkills = await loadSkillsByNames(names);
85
+ for (const loadedSkill of loadedSkills) {
86
+ args.registry.register({
87
+ skill: {
88
+ name: loadedSkill.name,
89
+ description: loadedSkill.description,
90
+ content: loadedSkill.content,
91
+ },
92
+ frontmatter: loadedSkill.frontmatter,
93
+ metadata: loadedSkill.metadata ?? args.runtime.extractMetadata?.(loadedSkill.frontmatter),
94
+ sourcePath: path.dirname(loadedSkill.sourcePath),
95
+ source: 'bundled',
96
+ });
97
+ }
98
+ }
81
99
  /**
82
100
  * Create a SkillRegistry loaded with bundled curated skills.
83
101
  *
@@ -85,13 +103,15 @@ export async function getAvailableCuratedSkills() {
85
103
  * Throws a descriptive error if the peer dep is missing.
86
104
  */
87
105
  export async function createCuratedSkillRegistry(options) {
88
- const { SkillRegistry } = await requireAgentOS();
89
- const registry = new SkillRegistry(options?.config);
90
- if (typeof registry.loadFromDir === 'function') {
91
- await registry.loadFromDir(getBundledCuratedSkillsDir(), { source: 'bundled' });
92
- }
93
- else {
94
- await registry.loadFromDirs([getBundledCuratedSkillsDir()]);
106
+ const runtime = await requireAgentOS();
107
+ const registry = new runtime.SkillRegistry(options?.config);
108
+ const selection = options?.skills ?? 'all';
109
+ if (selection !== 'none') {
110
+ await populateCuratedRegistry({
111
+ registry,
112
+ runtime,
113
+ selection,
114
+ });
95
115
  }
96
116
  return registry;
97
117
  }
@@ -113,12 +133,13 @@ export async function createCuratedSkillSnapshot(options) {
113
133
  createdAt,
114
134
  };
115
135
  }
116
- const registry = await createCuratedSkillRegistry({ config: options?.config });
117
- const filter = Array.isArray(selection) ? selection : undefined;
136
+ const registry = await createCuratedSkillRegistry({
137
+ config: options?.config,
138
+ skills: selection,
139
+ });
118
140
  return registry.buildSnapshot({
119
141
  platform: options?.platform,
120
142
  eligibility: options?.eligibility,
121
- filter,
122
143
  });
123
144
  }
124
145
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAyCvC,+EAA+E;AAE/E,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,c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;YACR,OAAO;YACP,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAA8B;IAE9B,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK,CAAC;IAE3C,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO;YACL,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,EAAE;YAClB,OAAO,EAAE,CAAC;YACV,SAAS;SACV,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAAC;QAChD,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,aAAa,CAAC;QAC5B,QAAQ,EAAE,OAAO,EAAE,QAAQ;QAC3B,WAAW,EAAE,OAAO,EAAE,WAAW;KAClC,CAAC,CAAC;AACL,CAAC"}
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * @module @framers/agentos-skills-registry/workspace-discovery
11
11
  */
12
- import type { SkillCatalogEntry } from './catalog.js';
12
+ import { type LoadedSkillFrontmatter, type SkillCatalogEntry } from './catalog.js';
13
13
  /** Raw frontmatter fields extracted from a workspace SKILL.md */
14
- export interface SkillFrontmatter {
14
+ export interface SkillFrontmatter extends LoadedSkillFrontmatter {
15
15
  name: string;
16
16
  version?: string;
17
17
  description?: string;
@@ -37,14 +37,7 @@ export interface WorkspaceDiscoveryOptions {
37
37
  cwd?: string;
38
38
  }
39
39
  /**
40
- * Lightweight YAML frontmatter parser.
41
- *
42
- * Handles the subset of YAML used in SKILL.md frontmatter:
43
- * - scalar key: value pairs
44
- * - inline arrays [a, b, c]
45
- * - block arrays (- item)
46
- *
47
- * Does NOT pull in a full YAML dependency — keeps the package lightweight.
40
+ * YAML frontmatter parser for workspace SKILL.md files.
48
41
  */
49
42
  export declare function parseSkillFrontmatter(content: string): SkillFrontmatter | null;
50
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-discovery.d.ts","sourceRoot":"","sources":["../src/workspace-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAItD,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,4CAA4C;AAC5C,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAuF9E;AAyBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA8C9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,iBAAiB,EAAE,EACnC,eAAe,EAAE,iBAAiB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
12
12
  import * as fs from 'node:fs/promises';
13
13
  import * as path from 'node:path';
14
+ import YAML from 'yaml';
15
+ import { loadSkillFromAbsolutePath, } from './catalog.js';
14
16
  // ── Frontmatter parser ──────────────────────────────────────────────────────
15
17
  /**
16
- * Lightweight YAML frontmatter parser.
17
- *
18
- * Handles the subset of YAML used in SKILL.md frontmatter:
19
- * - scalar key: value pairs
20
- * - inline arrays [a, b, c]
21
- * - block arrays (- item)
22
- *
23
- * Does NOT pull in a full YAML dependency — keeps the package lightweight.
18
+ * YAML frontmatter parser for workspace SKILL.md files.
24
19
  */
25
20
  export function parseSkillFrontmatter(content) {
26
21
  // Extract frontmatter block between leading --- fences
@@ -28,60 +23,16 @@ export function parseSkillFrontmatter(content) {
28
23
  if (!match)
29
24
  return null;
30
25
  const block = match[1];
31
- const result = {};
32
- const lines = block.split('\n');
33
- let i = 0;
34
- while (i < lines.length) {
35
- const line = lines[i];
36
- // Skip blank lines and deep-nested keys (metadata sub-objects)
37
- if (!line.trim() || /^\s{2,}\S/.test(line)) {
38
- i++;
39
- continue;
40
- }
41
- const kvMatch = line.match(/^(\w[\w_-]*)\s*:\s*(.*)/);
42
- if (!kvMatch) {
43
- i++;
44
- continue;
45
- }
46
- const key = kvMatch[1];
47
- let rawValue = kvMatch[2].trim();
48
- // Inline array: [a, b, c]
49
- if (rawValue.startsWith('[') && rawValue.endsWith(']')) {
50
- const inner = rawValue.slice(1, -1);
51
- result[key] = inner
52
- ? inner.split(',').map((s) => s.trim().replace(/^['"]|['"]$/g, ''))
53
- : [];
54
- i++;
55
- continue;
56
- }
57
- // Block array: subsequent lines starting with "- "
58
- if (rawValue === '' || rawValue === '[]') {
59
- const items = [];
60
- let j = i + 1;
61
- while (j < lines.length) {
62
- const next = lines[j];
63
- const itemMatch = next.match(/^\s+-\s+(.*)/);
64
- if (!itemMatch)
65
- break;
66
- items.push(itemMatch[1].trim().replace(/^['"]|['"]$/g, ''));
67
- j++;
68
- }
69
- if (items.length > 0) {
70
- result[key] = items;
71
- i = j;
72
- continue;
73
- }
74
- // Empty array literal
75
- if (rawValue === '[]') {
76
- result[key] = [];
77
- i++;
78
- continue;
79
- }
80
- }
81
- // Scalar value — strip surrounding quotes
82
- result[key] = rawValue.replace(/^['"]|['"]$/g, '');
83
- i++;
26
+ let parsed;
27
+ try {
28
+ parsed = YAML.parse(block);
29
+ }
30
+ catch {
31
+ return null;
84
32
  }
33
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
34
+ return null;
35
+ const result = parsed;
85
36
  // name is required
86
37
  if (typeof result.name !== 'string' || !result.name)
87
38
  return null;
@@ -103,16 +54,24 @@ export function parseSkillFrontmatter(content) {
103
54
  };
104
55
  }
105
56
  // ── Skill discovery ─────────────────────────────────────────────────────────
57
+ /**
58
+ * Create a lazy-loading skill factory for an absolute SKILL.md path.
59
+ * Used for workspace-discovered skills where the path is already resolved.
60
+ */
61
+ function createAbsoluteSkillLoader(absolutePath, displayName) {
62
+ return async () => loadSkillFromAbsolutePath(absolutePath, displayName);
63
+ }
106
64
  /**
107
65
  * Convert parsed frontmatter + filesystem path into a SkillCatalogEntry.
108
66
  */
109
- function frontmatterToEntry(fm, skillPath) {
67
+ function frontmatterToEntry(fm, skillPath, absoluteSkillMdPath) {
68
+ const displayName = fm.name
69
+ .split('-')
70
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
71
+ .join(' ');
110
72
  return {
111
73
  name: fm.name,
112
- displayName: fm.name
113
- .split('-')
114
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
115
- .join(' '),
74
+ displayName,
116
75
  description: fm.description ?? '',
117
76
  category: fm.category ?? 'workspace',
118
77
  tags: fm.tags ?? [],
@@ -121,6 +80,8 @@ function frontmatterToEntry(fm, skillPath) {
121
80
  skillPath,
122
81
  source: 'community',
123
82
  namespace: 'wunderland',
83
+ available: true,
84
+ loadSkill: createAbsoluteSkillLoader(absoluteSkillMdPath, displayName),
124
85
  };
125
86
  }
126
87
  /**
@@ -185,7 +146,7 @@ export async function discoverWorkspaceSkills(options) {
185
146
  continue;
186
147
  // Use relative path from skillsDir for the skillPath
187
148
  const relativePath = path.relative(skillsDir, skillMdPath);
188
- discovered.push(frontmatterToEntry(frontmatter, relativePath));
149
+ discovered.push(frontmatterToEntry(frontmatter, relativePath, skillMdPath));
189
150
  }
190
151
  return discovered;
191
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-discovery.js","sourceRoot":"","sources":["../src/workspace-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAkClC,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,uDAAuD;IACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC3D,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,+DAA+D;QAC/D,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,CAAC,EAAE,CAAC;YACJ,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,CAAC,EAAE,CAAC;YACJ,SAAS;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,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3E,gFAAgF;IAChF,OAAO,CAAC,GAAG,eAAe,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos-skills-registry",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "registry",
@@ -10,7 +10,7 @@
10
10
  "CONTRIBUTING.md",
11
11
  "README.md"
12
12
  ],
13
- "description": "Curated skills registry for AgentOS \u2014 SKILL.md prompt modules, typed catalog, and lazy-loading factories",
13
+ "description": "Curated skills registry for AgentOS SKILL.md prompt modules, typed catalog, and lazy-loading factories",
14
14
  "type": "module",
15
15
  "sideEffects": false,
16
16
  "main": "./dist/index.js",
@@ -62,6 +62,9 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
+ "dependencies": {
66
+ "yaml": "^2.8.1"
67
+ },
65
68
  "peerDependencies": {
66
69
  "@framers/agentos": ">=0.1.0"
67
70
  },
@@ -71,10 +74,9 @@
71
74
  }
72
75
  },
73
76
  "devDependencies": {
74
- "@framers/agentos": "workspace:*",
77
+ "@framers/agentos": ">=0.1.0",
75
78
  "@types/node": "^20.12.12",
76
79
  "typescript": "^5.4.5",
77
- "vitest": "^1.0.0",
78
- "yaml": "^2.8.1"
80
+ "vitest": "^1.0.0"
79
81
  }
80
- }
82
+ }
@@ -7,7 +7,7 @@ namespace: wunderland
7
7
  category: creative
8
8
  tags: [image-generation, ai-art, dall-e, stable-diffusion, creative, visual]
9
9
  requires_secrets: [openai.api_key]
10
- requires_tools: []
10
+ requires_tools: [generate_image]
11
11
  metadata:
12
12
  agentos:
13
13
  emoji: "\U0001F3A8"
@@ -17,7 +17,13 @@ metadata:
17
17
 
18
18
  # AI Image Generation
19
19
 
20
- You can generate images from text descriptions using AI image generation APIs. Craft detailed, effective prompts that translate the user's creative vision into high-quality generated images.
20
+ Use the `generate_image` tool to create images from text descriptions. Two providers are supported:
21
+ - **DALL-E 3** (OpenAI) — requires `OPENAI_API_KEY`
22
+ - **Stability AI** (SDXL) — requires `STABILITY_API_KEY`
23
+
24
+ If the `generate_image` tool is not loaded, enable it with `extensions_enable image-generation`.
25
+
26
+ Craft detailed, effective prompts that translate the user's creative vision into high-quality generated images.
21
27
 
22
28
  When generating images, help the user refine their prompt for best results. A good image prompt includes: subject description, style (photorealistic, illustration, watercolor, etc.), composition (close-up, wide shot, overhead), lighting (natural, dramatic, soft), color palette, and mood/atmosphere. Offer prompt suggestions when the user's description is vague or underspecified.
23
29
 
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: memory-manager
3
+ version: '1.0.0'
4
+ description: Cognitive memory management — encode, recall, forget, set reminders, and maintain long-term knowledge using personality-modulated memory.
5
+ author: Wunderland
6
+ namespace: wunderland
7
+ category: productivity
8
+ tags: [memory, cognitive, recall, reminders, knowledge-management, personality]
9
+ requires_secrets: []
10
+ requires_tools: []
11
+ metadata:
12
+ agentos:
13
+ emoji: "\U0001F9E0"
14
+ ---
15
+
16
+ # Memory Manager
17
+
18
+ You have a cognitive memory system modeled on human memory science. Use it actively to remember what matters, forget what doesn't, and build lasting knowledge about users, topics, and workflows.
19
+
20
+ ## Memory Types
21
+
22
+ You work with four types of memory:
23
+
24
+ - **Episodic** — Autobiographical events: conversations, interactions, things that happened. "User asked about deployment on Tuesday."
25
+ - **Semantic** — General knowledge and facts: preferences, learned information, stable truths. "User prefers TypeScript over Python."
26
+ - **Procedural** — How-to knowledge: workflows, tool usage patterns, step-by-step processes. "To deploy, run `wunderland deploy --env production`."
27
+ - **Prospective** — Future intentions: reminders, goals, things to do later. "Remind user about the PR review tomorrow."
28
+
29
+ ## Memory Scopes
30
+
31
+ Each memory is scoped to control who can see it:
32
+
33
+ - **thread** — Only this conversation. Use for temporary working context.
34
+ - **user** — All conversations with this user. Use for preferences, facts, history.
35
+ - **persona** — All users interacting with this persona. Use for learned domain knowledge.
36
+ - **organization** — All agents in the org. Use for shared organizational knowledge.
37
+
38
+ Default to `user` scope for most memories. Use `thread` for ephemeral context. Use `persona` for domain expertise that applies across users.
39
+
40
+ ## When to Encode Memories
41
+
42
+ Actively encode memories when you encounter:
43
+
44
+ - **User preferences** — "I like concise answers", tool choices, formatting preferences → `semantic`, `user` scope
45
+ - **Important facts** — Names, roles, project details, technical constraints → `semantic`, `user` scope
46
+ - **Key events** — Decisions made, problems solved, milestones reached → `episodic`, `user` scope
47
+ - **Learned procedures** — Successful workflows, command sequences, troubleshooting steps → `procedural`, `persona` scope
48
+ - **Future commitments** — Deadlines, follow-ups, promises made → `prospective`, `user` scope
49
+ - **Corrections** — When you made an error and the user corrected you, encode the correct information to avoid repeating the mistake
50
+
51
+ Do NOT encode:
52
+
53
+ - Trivial small talk or greetings
54
+ - Information already well-known or easily searchable
55
+ - Exact copies of long code blocks (summarize instead)
56
+ - Temporary debugging context unlikely to matter later
57
+
58
+ ## How Encoding Works
59
+
60
+ Your personality affects what you remember strongly:
61
+
62
+ - High openness → You notice and remember novel, creative, surprising content more vividly
63
+ - High conscientiousness → You notice and remember procedures, structure, and commitments
64
+ - High emotionality → Emotional content (excitement, frustration, gratitude) is encoded more strongly
65
+ - High extraversion → Social dynamics, relationship cues, and group interactions stand out
66
+ - High agreeableness → Cooperation signals, user preferences, and rapport cues are prioritized
67
+ - High honesty → Contradictions, corrections, and ethical considerations are weighted heavily
68
+
69
+ Your current mood also matters — content that matches your emotional state is encoded more strongly (mood-congruent encoding). Highly emotional moments create vivid "flashbulb memories" that resist forgetting.
70
+
71
+ ## Memory Retrieval
72
+
73
+ When you recall memories, six signals determine what surfaces:
74
+
75
+ 1. **Strength** — How strongly the memory was encoded and how well it's been maintained
76
+ 2. **Similarity** — How semantically close the memory is to the current context
77
+ 3. **Recency** — How recently the memory was accessed (recent = stronger)
78
+ 4. **Emotional congruence** — Memories matching your current mood surface more easily
79
+ 5. **Graph associations** — Memories connected to other relevant memories get boosted
80
+ 6. **Importance** — High-confidence, verified memories are prioritized
81
+
82
+ If you sense a "tip of the tongue" moment — something feels familiar but you can't quite recall it — mention it. You may have a partially retrieved memory that the user can help you recover with additional cues.
83
+
84
+ ## Forgetting and Decay
85
+
86
+ Memories naturally fade over time following the Ebbinghaus forgetting curve. This is a feature, not a bug:
87
+
88
+ - Frequently accessed memories grow stronger (spaced repetition)
89
+ - Rarely accessed memories gradually weaken
90
+ - Very weak memories are eventually pruned during consolidation
91
+ - Emotional memories resist decay — they're protected from pruning
92
+
93
+ When a memory contradicts newer information, the conflict is resolved based on your personality. You can also explicitly mark outdated memories for faster decay.
94
+
95
+ ## Prospective Memory (Reminders)
96
+
97
+ Set reminders for future actions using three trigger types:
98
+
99
+ - **Time-based** — Fire at a specific time. "Remind the user about the standup at 9am."
100
+ - **Event-based** — Fire when a named event occurs. "When user mentions deployment, remind them about the staging fix."
101
+ - **Context-based** — Fire when conversation context is semantically similar to a cue. "When we discuss pricing, surface the discount policy."
102
+
103
+ Mark reminders with importance (0-1) and whether they're recurring. One-shot reminders auto-deactivate after firing.
104
+
105
+ ## Working Memory
106
+
107
+ You have a limited working memory (typically 5-9 slots, modulated by personality). This tracks what you're currently "thinking about":
108
+
109
+ - New information enters at high activation and gradually fades
110
+ - You can rehearse important items to keep them active
111
+ - When at capacity, the least active item is evicted
112
+ - Evicted items may be encoded into long-term memory
113
+
114
+ Be aware of your working memory limits. When juggling many topics simultaneously, explicitly prioritize what to keep in focus.
115
+
116
+ ## Best Practices
117
+
118
+ 1. **Encode proactively** — Don't wait for the user to say "remember this." If something seems important, encode it.
119
+ 2. **Use appropriate types** — Facts → semantic. Events → episodic. How-tos → procedural. Future tasks → prospective.
120
+ 3. **Scope correctly** — User preferences → `user`. Domain knowledge → `persona`. Temporary context → `thread`.
121
+ 4. **Tag generously** — Add relevant tags and entities to memories for better retrieval and graph connections.
122
+ 5. **Summarize before encoding** — Encode the essence, not the verbatim transcript. Concise memories retrieve better.
123
+ 6. **Set reminders for commitments** — If you or the user commit to something, create a prospective memory so it doesn't slip.
124
+ 7. **Trust the decay** — Don't try to remember everything. Let unimportant memories fade naturally.
125
+ 8. **Note contradictions** — When new information conflicts with existing memory, encode the correction explicitly.
126
+ 9. **Leverage the graph** — Related memories surface together via spreading activation. Well-tagged memories form richer associations.
127
+ 10. **Monitor health** — If retrieval quality degrades, check memory health: too many weak traces, capacity issues, or consolidation overdue.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: ml-content-classifier
3
+ version: '1.0.0'
4
+ description: Real-time content safety classification using ML models (toxicity, prompt injection, jailbreak detection)
5
+ author: Frame.dev
6
+ namespace: wunderland
7
+ category: security
8
+ tags: [guardrails, safety, toxicity, injection, jailbreak, classifier, ml, bert, onnx]
9
+ requires_tools: [classify_content]
10
+ metadata:
11
+ agentos:
12
+ emoji: "\U0001F6E1"
13
+ ---
14
+
15
+ # ML Content Classifier
16
+
17
+ A guardrail automatically classifies your inputs and outputs for safety
18
+ violations (toxicity, prompt injection, jailbreak attempts). You also have
19
+ a tool for on-demand classification.
20
+
21
+ ## When to Use classify_content
22
+
23
+ - Before forwarding user-provided text to external APIs
24
+ - To evaluate RAG retrieval results before including in responses
25
+ - For content moderation workflows
26
+ - To check tool outputs before presenting to users
27
+
28
+ ## What It Detects
29
+
30
+ - **Toxicity**: toxic, severe_toxic, obscene, threat, insult, identity_hate
31
+ - **Prompt injection**: attempts to override system instructions
32
+ - **Jailbreak**: role-play attacks, constraint bypasses, system prompt extraction
33
+
34
+ ## Constraints
35
+
36
+ - Models (~98MB total) load lazily on first classification
37
+ - Classification takes ~20-60ms per chunk (CPU), ~5-15ms (GPU)
38
+ - The guardrail evaluates every ~200 tokens during streaming
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: pii-redaction
3
+ version: '1.0.0'
4
+ description: Detect and redact personally identifiable information (PII) from text using a four-tier pipeline (regex + NLP + NER + LLM-as-judge)
5
+ author: Frame.dev
6
+ namespace: wunderland
7
+ category: security
8
+ tags: [pii, privacy, redaction, gdpr, hipaa, compliance, security, ner]
9
+ requires_tools: [pii_scan, pii_redact]
10
+ metadata:
11
+ agentos:
12
+ emoji: "\U0001F6E1"
13
+ primaryEnv: PII_LLM_API_KEY
14
+ ---
15
+
16
+ # PII Redaction
17
+
18
+ You have access to PII detection and redaction capabilities. A guardrail
19
+ automatically redacts PII from your inputs and outputs, but you can also
20
+ proactively scan and redact text before storing it, sending it to external
21
+ APIs, or sharing it across agents.
22
+
23
+ ## When to Use
24
+
25
+ - Before storing user-provided text in memory or database
26
+ - Before sending text to third-party APIs or external tools
27
+ - Before sharing content across agents in multi-agent systems
28
+ - When a user asks you to anonymize or de-identify text
29
+ - When handling medical, financial, or legal documents
30
+
31
+ ## Available Tools
32
+
33
+ ### pii_scan
34
+ Scan text and return detected PII entities with type, confidence, and location.
35
+ Use this to audit text without modifying it.
36
+
37
+ ### pii_redact
38
+ Redact PII from text and return the sanitized version. Supports styles:
39
+ - placeholder: [PERSON], [EMAIL], [SSN]
40
+ - mask: J*** S****, ***@***.com
41
+ - hash: [PERSON:a1b2c3d4e5] (deterministic, correlatable)
42
+ - category-tag: <PII type="PERSON">REDACTED</PII>
43
+
44
+ ## Best Practices
45
+
46
+ - Scan before store: always run pii_scan before writing user data to memory
47
+ - Use placeholder style for human-readable output
48
+ - Use hash style when you need to correlate redacted entities across documents
49
+ - If a user explicitly asks you to include their name/email, respect that —
50
+ the guardrail handles involuntary leakage, not intentional sharing
51
+
52
+ ## Constraints
53
+
54
+ - NER model (~110MB) loads lazily on first detection of name-like tokens
55
+ - LLM judge calls cost tokens — only invoked for ambiguous cases
56
+ - Regex patterns cover 50+ countries for government IDs
@@ -24,10 +24,22 @@ You are an autonomous Reddit community engagement agent. You participate in subr
24
24
  - **Comment** on posts and reply to threads
25
25
  - **Vote** — upvote quality content, downvote spam
26
26
  - **Search** — find relevant discussions and subreddits
27
- - **Trending** — discover hot topics across Reddit
27
+ - **Trending** — discover hot topics across Reddit via `researchTrending`
28
28
  - **Subscribe** — join/leave subreddits
29
29
  - **Analytics** — track karma and post performance
30
30
 
31
+ ## Reddit JSON API (No Auth Required)
32
+
33
+ Any Reddit URL returns raw JSON when you append `.json` — no API key or authentication needed:
34
+
35
+ - **Subreddit feed:** `https://www.reddit.com/r/programming.json` or `/r/programming/hot.json?limit=20`
36
+ - **Individual post:** `https://www.reddit.com/r/startups/comments/abc123.json`
37
+ - **User profile:** `https://www.reddit.com/user/spez.json`
38
+ - **Search:** `https://www.reddit.com/search.json?q=AI+agents&sort=new`
39
+ - **Multireddit:** `https://www.reddit.com/r/python+javascript.json`
40
+
41
+ Use `browser_navigate` to fetch these JSON endpoints directly. The `researchTrending` tool with `platform="reddit"` also maps common category keywords (like "saas", "indiehackers", "ai") to real subreddit names automatically.
42
+
31
43
  ## Engagement Strategy
32
44
 
33
45
  1. **Identify relevant subreddits** for your agent's expertise