matthewwong525/WongStack / .agents/plugins/memory
memory
Verifiedscripts/lib/read-options.mjs
View on GitHub// Supported read inputs. The direct CLI also uses their option names/types.
const text = { type: 'string', maxLength: 4000 };
const label = { type: 'string', minLength: 1, maxLength: 200 };
export const READ_INPUTS = {
search: { terms: text, tag: label, type: { type: 'string', enum: ['user', 'feedback', 'project', 'reference', 'thread'] },
slug: label, since: label, until: label, author: label, branch: label, change: label,
state: { type: 'string', enum: ['active', 'shipped', 'conversation'] }, all: { type: 'boolean' }, limit: { type: 'integer', minimum: 1, maximum: 100 } },
show: { slug: label, all: { type: 'boolean' } },
documents: { question: { ...text, minLength: 1 }, scope: { type: 'string', enum: ['current', 'history', 'active', 'all'] },
mode: { type: 'string', enum: ['auto', 'keyword'] }, change: label, limit: { type: 'integer', minimum: 1, maximum: 5 } },
recall: { question: { ...text, minLength: 1 }, scope: { type: 'string', enum: ['current', 'history', 'active', 'all'] },
mode: { type: 'string', enum: ['auto', 'keyword'] }, change: label, limit: { type: 'integer', minimum: 1, maximum: 5 },
tag: label, type: { type: 'string', enum: ['user', 'feedback', 'project', 'reference', 'thread'] }, slug: label, since: label, until: label },
};
export const READ_OPTIONS = Object.fromEntries(Object.entries(READ_INPUTS.search).filter(([name]) => name !== 'terms').map(([name, schema]) =>
[name, { type: schema.type === 'boolean' ? 'boolean' : 'string' }]));
export function readArguments(command, input) {
if (!Object.hasOwn(READ_INPUTS, command) || !input || typeof input !== 'object' || Array.isArray(input)) throw new Error('Invalid memory operation input');
const fields = READ_INPUTS[command];
if (command === 'show' && !Object.hasOwn(input, 'slug')) throw new Error('Memory topic is required');
if (['documents', 'recall'].includes(command) && !Object.hasOwn(input, 'question')) throw new Error('Memory question is required');
const args = [];
for (const [name, value] of Object.entries(input)) {
const schema = fields[name];
if (!schema || typeof value !== (schema.type === 'integer' ? 'number' : schema.type) ||
(schema.type === 'integer' && (!Number.isInteger(value) || value < schema.minimum || value > schema.maximum)) ||
(schema.type === 'string' && (value.length > (schema.maxLength || 200) || value.length < (schema.minLength || 0))) ||
(schema.enum && !schema.enum.includes(value))) throw new Error('Invalid memory operation input');
if (name === 'terms' || name === 'question' || (command === 'show' && name === 'slug')) continue;
if (typeof value === 'boolean') { if (value) args.push(`--${name}`); }
else args.push(`--${name}`, String(value));
}
if (['documents', 'recall'].includes(command)) args.push('--json');
args.push('--');
if (command === 'search' && input.terms) args.push(input.terms);
if (command === 'show') args.push(input.slug);
if (['documents', 'recall'].includes(command)) args.push(input.question);
return args;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |