@elizaos/plugin-directives 2.0.0-alpha.5 → 2.0.0-alpha.6
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/cjs/index.cjs +8 -7
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/index.js +8 -7
- package/dist/index.js.map +4 -4
- package/package.json +89 -89
package/dist/cjs/index.cjs
CHANGED
|
@@ -226,8 +226,9 @@ function extractThinkDirective(body) {
|
|
|
226
226
|
if (!body)
|
|
227
227
|
return { cleaned: "", hasDirective: false };
|
|
228
228
|
const extracted = extractLevelDirective(body, ["thinking", "think", "t"], normalizeThinkLevel);
|
|
229
|
+
const cleaned = extracted.hasDirective && !extracted.level && extracted.rawLevel ? `${extracted.rawLevel} ${extracted.cleaned}`.trim() : extracted.cleaned;
|
|
229
230
|
return {
|
|
230
|
-
cleaned
|
|
231
|
+
cleaned,
|
|
231
232
|
thinkLevel: extracted.level,
|
|
232
233
|
rawLevel: extracted.rawLevel,
|
|
233
234
|
hasDirective: extracted.hasDirective
|
|
@@ -312,7 +313,7 @@ function extractExecDirective(body) {
|
|
|
312
313
|
hasDirective: false
|
|
313
314
|
};
|
|
314
315
|
}
|
|
315
|
-
const execMatch = body.match(/(?:^|\s)\/exec(?:\s+([
|
|
316
|
+
const execMatch = body.match(/(?:^|\s)\/exec(?:\s+([^/\n]+))?(?=$|\s|\/)/i);
|
|
316
317
|
if (!execMatch) {
|
|
317
318
|
return {
|
|
318
319
|
cleaned: body.trim(),
|
|
@@ -331,8 +332,7 @@ function extractExecDirective(body) {
|
|
|
331
332
|
let rawExecAsk;
|
|
332
333
|
let rawExecNode;
|
|
333
334
|
const kvPattern = /(\w+)\s*=\s*([^\s]+)/g;
|
|
334
|
-
|
|
335
|
-
while ((match = kvPattern.exec(args)) !== null) {
|
|
335
|
+
for (const match of args.matchAll(kvPattern)) {
|
|
336
336
|
const key = match[1].toLowerCase();
|
|
337
337
|
const value = match[2];
|
|
338
338
|
if (key === "host")
|
|
@@ -560,7 +560,8 @@ function formatDirectiveAcknowledgment(directives) {
|
|
|
560
560
|
var directiveStateProvider = {
|
|
561
561
|
name: "DIRECTIVE_STATE",
|
|
562
562
|
description: "Current directive levels (thinking, verbose, model, etc.)",
|
|
563
|
-
|
|
563
|
+
dynamic: true,
|
|
564
|
+
async get(_runtime, message, _state) {
|
|
564
565
|
const roomId = message.roomId;
|
|
565
566
|
const directives = getDirectiveState(roomId);
|
|
566
567
|
return {
|
|
@@ -687,10 +688,10 @@ var directivesPlugin = {
|
|
|
687
688
|
]
|
|
688
689
|
}
|
|
689
690
|
],
|
|
690
|
-
async init(_config,
|
|
691
|
+
async init(_config, _runtime) {
|
|
691
692
|
import_core.logger.log("[plugin-directives] Initializing directive parser");
|
|
692
693
|
}
|
|
693
694
|
};
|
|
694
695
|
var src_default = directivesPlugin;
|
|
695
696
|
|
|
696
|
-
//# debugId=
|
|
697
|
+
//# debugId=21873DD0528C6F7A64756E2164756E21
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../src/parsers.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * Plugin Directives - Inline directive parsing for Eliza agents\n *\n * Parses and applies inline directives from message text:\n * - /think or /t - Thinking level control\n * - /verbose or /v - Verbose output control\n * - /reasoning - Reasoning visibility\n * - /elevated - Elevated permissions\n * - /exec - Execution environment settings\n * - /model - Model selection\n * - /status - Status request\n */\n\nimport {\n type IAgentRuntime,\n type Plugin,\n type Provider,\n type ProviderResult,\n logger,\n} from \"@elizaos/core\";\n\nimport {\n extractElevatedDirective,\n extractExecDirective,\n extractModelDirective,\n extractReasoningDirective,\n extractStatusDirective,\n extractThinkDirective,\n extractVerboseDirective,\n normalizeElevatedLevel,\n normalizeReasoningLevel,\n normalizeThinkLevel,\n normalizeVerboseLevel,\n} from \"./parsers\";\n\nimport type {\n DirectiveState,\n ElevatedLevel,\n ParsedDirectives,\n ParseOptions,\n ReasoningLevel,\n ThinkLevel,\n VerboseLevel,\n} from \"./types\";\n\n// Re-export types\nexport * from \"./types\";\nexport * from \"./parsers\";\n\n// ============================================================================\n// Session State Management\n// ============================================================================\n\nconst sessionStates = new Map<string, DirectiveState>();\n\nfunction getDefaultState(): DirectiveState {\n return {\n thinking: \"low\",\n verbose: \"off\",\n reasoning: \"off\",\n elevated: \"off\",\n exec: {},\n model: {},\n };\n}\n\n/**\n * Get directive state for a room\n */\nexport function getDirectiveState(roomId: string): DirectiveState {\n return sessionStates.get(roomId) ?? getDefaultState();\n}\n\n/**\n * Set directive state for a room\n */\nexport function setDirectiveState(roomId: string, state: DirectiveState): void {\n sessionStates.set(roomId, state);\n}\n\n/**\n * Clear directive state for a room\n */\nexport function clearDirectiveState(roomId: string): void {\n sessionStates.delete(roomId);\n}\n\n// ============================================================================\n// Main Parse Function\n// ============================================================================\n\n/**\n * Parse all inline directives from message text\n */\nexport function parseDirectives(\n body: string,\n options?: ParseOptions,\n): ParsedDirectives {\n const {\n cleaned: thinkCleaned,\n thinkLevel,\n rawLevel: rawThinkLevel,\n hasDirective: hasThinkDirective,\n } = extractThinkDirective(body);\n\n const {\n cleaned: verboseCleaned,\n verboseLevel,\n rawLevel: rawVerboseLevel,\n hasDirective: hasVerboseDirective,\n } = extractVerboseDirective(thinkCleaned);\n\n const {\n cleaned: reasoningCleaned,\n reasoningLevel,\n rawLevel: rawReasoningLevel,\n hasDirective: hasReasoningDirective,\n } = extractReasoningDirective(verboseCleaned);\n\n const {\n cleaned: elevatedCleaned,\n elevatedLevel,\n rawLevel: rawElevatedLevel,\n hasDirective: hasElevatedDirective,\n } = options?.disableElevated\n ? {\n cleaned: reasoningCleaned,\n elevatedLevel: undefined,\n rawLevel: undefined,\n hasDirective: false,\n }\n : extractElevatedDirective(reasoningCleaned);\n\n const {\n cleaned: execCleaned,\n execHost,\n execSecurity,\n execAsk,\n execNode,\n rawExecHost,\n rawExecSecurity,\n rawExecAsk,\n rawExecNode,\n hasExecOptions,\n invalidHost: invalidExecHost,\n invalidSecurity: invalidExecSecurity,\n invalidAsk: invalidExecAsk,\n invalidNode: invalidExecNode,\n hasDirective: hasExecDirective,\n } = extractExecDirective(elevatedCleaned);\n\n const allowStatusDirective = options?.allowStatusDirective !== false;\n const { cleaned: statusCleaned, hasDirective: hasStatusDirective } =\n allowStatusDirective\n ? extractStatusDirective(execCleaned)\n : { cleaned: execCleaned, hasDirective: false };\n\n const {\n cleaned: modelCleaned,\n rawModel,\n rawProfile,\n hasDirective: hasModelDirective,\n } = extractModelDirective(statusCleaned, {\n aliases: options?.modelAliases,\n });\n\n // Determine if message contains only directives\n const hasAnyDirective =\n hasThinkDirective ||\n hasVerboseDirective ||\n hasReasoningDirective ||\n hasElevatedDirective ||\n hasExecDirective ||\n hasModelDirective;\n const directivesOnly = hasAnyDirective && modelCleaned.trim().length === 0;\n\n return {\n cleanedText: modelCleaned,\n directivesOnly,\n hasThinkDirective,\n thinkLevel,\n rawThinkLevel,\n hasVerboseDirective,\n verboseLevel,\n rawVerboseLevel,\n hasReasoningDirective,\n reasoningLevel,\n rawReasoningLevel,\n hasElevatedDirective,\n elevatedLevel,\n rawElevatedLevel,\n hasExecDirective,\n execHost,\n execSecurity,\n execAsk,\n execNode,\n rawExecHost,\n rawExecSecurity,\n rawExecAsk,\n rawExecNode,\n hasExecOptions,\n invalidExecHost,\n invalidExecSecurity,\n invalidExecAsk,\n invalidExecNode,\n hasStatusDirective,\n hasModelDirective,\n rawModelDirective: rawModel,\n rawModelProfile: rawProfile,\n };\n}\n\n/**\n * Apply parsed directives to session state\n */\nexport function applyDirectives(\n roomId: string,\n directives: ParsedDirectives,\n persist = true,\n): DirectiveState {\n const current = getDirectiveState(roomId);\n const updated = { ...current };\n\n if (directives.hasThinkDirective && directives.thinkLevel) {\n updated.thinking = directives.thinkLevel;\n }\n if (directives.hasVerboseDirective && directives.verboseLevel) {\n updated.verbose = directives.verboseLevel;\n }\n if (directives.hasReasoningDirective && directives.reasoningLevel) {\n updated.reasoning = directives.reasoningLevel;\n }\n if (directives.hasElevatedDirective && directives.elevatedLevel) {\n updated.elevated = directives.elevatedLevel;\n }\n if (directives.hasExecDirective) {\n updated.exec = {\n ...updated.exec,\n ...(directives.execHost && { host: directives.execHost }),\n ...(directives.execSecurity && { security: directives.execSecurity }),\n ...(directives.execAsk && { ask: directives.execAsk }),\n ...(directives.execNode && { node: directives.execNode }),\n };\n }\n if (directives.hasModelDirective && directives.rawModelDirective) {\n const parts = directives.rawModelDirective.split(\"/\");\n if (parts.length === 2) {\n updated.model = {\n provider: parts[0],\n model: parts[1],\n authProfile: directives.rawModelProfile,\n };\n } else {\n updated.model = {\n model: directives.rawModelDirective,\n authProfile: directives.rawModelProfile,\n };\n }\n }\n\n if (persist) {\n setDirectiveState(roomId, updated);\n }\n\n return updated;\n}\n\n/**\n * Format directive state for display\n */\nexport function formatDirectiveState(state: DirectiveState): string {\n const lines: string[] = [];\n lines.push(`Thinking: ${state.thinking}`);\n lines.push(`Verbose: ${state.verbose}`);\n lines.push(`Reasoning: ${state.reasoning}`);\n lines.push(`Elevated: ${state.elevated}`);\n if (state.model.provider || state.model.model) {\n const modelStr = state.model.provider\n ? `${state.model.provider}/${state.model.model}`\n : state.model.model;\n lines.push(\n `Model: ${modelStr}${state.model.authProfile ? ` @${state.model.authProfile}` : \"\"}`,\n );\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Format acknowledgment for directive-only messages\n */\nexport function formatDirectiveAcknowledgment(\n directives: ParsedDirectives,\n): string {\n const changes: string[] = [];\n\n if (directives.hasThinkDirective) {\n changes.push(`Thinking: ${directives.thinkLevel ?? \"status\"}`);\n }\n if (directives.hasVerboseDirective) {\n changes.push(`Verbose: ${directives.verboseLevel ?? \"status\"}`);\n }\n if (directives.hasReasoningDirective) {\n changes.push(`Reasoning: ${directives.reasoningLevel ?? \"status\"}`);\n }\n if (directives.hasElevatedDirective) {\n changes.push(`Elevated: ${directives.elevatedLevel ?? \"status\"}`);\n }\n if (directives.hasModelDirective) {\n changes.push(`Model: ${directives.rawModelDirective ?? \"status\"}`);\n }\n\n return changes.length > 0 ? `✓ ${changes.join(\", \")}` : \"No changes applied\";\n}\n\n// ============================================================================\n// Provider\n// ============================================================================\n\n/**\n * Provider that exposes current directive state to the agent\n */\nexport const directiveStateProvider: Provider = {\n name: \"DIRECTIVE_STATE\",\n description: \"Current directive levels (thinking, verbose, model, etc.)\",\n\n async get(runtime, message, _state): Promise<ProviderResult> {\n const roomId = message.roomId;\n const directives = getDirectiveState(roomId);\n\n return {\n text: formatDirectiveState(directives),\n values: {\n thinkingLevel: directives.thinking,\n verboseLevel: directives.verbose,\n reasoningLevel: directives.reasoning,\n elevatedLevel: directives.elevated,\n modelProvider: directives.model.provider ?? \"\",\n modelName: directives.model.model ?? \"\",\n isElevated: directives.elevated !== \"off\",\n },\n data: { directives },\n };\n },\n};\n\n// ============================================================================\n// Plugin Export\n// ============================================================================\n\n/**\n * Plugin Directives\n *\n * Provides inline directive parsing for Eliza agents, allowing users to\n * control thinking levels, verbosity, model selection, and more through\n * inline commands in their messages.\n */\nexport const directivesPlugin: Plugin = {\n name: \"directives\",\n description:\n \"Inline directive parsing (@think, @model, @verbose, etc.) for controlling agent behavior\",\n\n providers: [directiveStateProvider],\n\n config: {\n DEFAULT_THINKING: \"low\",\n DEFAULT_VERBOSE: \"off\",\n ALLOW_ELEVATED: \"true\",\n ALLOW_EXEC: \"false\",\n },\n\n tests: [\n {\n name: \"directive-parsing\",\n tests: [\n {\n name: \"Parse think directive\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\"/think:high hello world\");\n if (!result.hasThinkDirective) {\n throw new Error(\"Should detect think directive\");\n }\n if (result.thinkLevel !== \"high\") {\n throw new Error(`Expected 'high', got '${result.thinkLevel}'`);\n }\n if (result.cleanedText !== \"hello world\") {\n throw new Error(\n `Expected 'hello world', got '${result.cleanedText}'`,\n );\n }\n logger.success(\"Think directive parsed correctly\");\n },\n },\n {\n name: \"Parse verbose directive\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\"/v on test message\");\n if (!result.hasVerboseDirective) {\n throw new Error(\"Should detect verbose directive\");\n }\n if (result.verboseLevel !== \"on\") {\n throw new Error(`Expected 'on', got '${result.verboseLevel}'`);\n }\n logger.success(\"Verbose directive parsed correctly\");\n },\n },\n {\n name: \"Parse model directive\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\n \"/model anthropic/claude-3-opus what is 2+2\",\n );\n if (!result.hasModelDirective) {\n throw new Error(\"Should detect model directive\");\n }\n if (result.rawModelDirective !== \"anthropic/claude-3-opus\") {\n throw new Error(\n `Expected 'anthropic/claude-3-opus', got '${result.rawModelDirective}'`,\n );\n }\n logger.success(\"Model directive parsed correctly\");\n },\n },\n {\n name: \"Detect directive-only message\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\"/think:high /verbose on\");\n if (!result.directivesOnly) {\n throw new Error(\"Should detect directive-only message\");\n }\n logger.success(\"Directive-only detection works correctly\");\n },\n },\n {\n name: \"Parse multiple directives\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\n \"/think:medium /v full /elevated on hello\",\n );\n if (\n !result.hasThinkDirective ||\n !result.hasVerboseDirective ||\n !result.hasElevatedDirective\n ) {\n throw new Error(\"Should detect all directives\");\n }\n if (result.thinkLevel !== \"medium\") {\n throw new Error(`Expected 'medium', got '${result.thinkLevel}'`);\n }\n if (result.verboseLevel !== \"full\") {\n throw new Error(`Expected 'full', got '${result.verboseLevel}'`);\n }\n if (result.elevatedLevel !== \"on\") {\n throw new Error(`Expected 'on', got '${result.elevatedLevel}'`);\n }\n if (result.cleanedText !== \"hello\") {\n throw new Error(`Expected 'hello', got '${result.cleanedText}'`);\n }\n logger.success(\"Multiple directives parsed correctly\");\n },\n },\n {\n name: \"Session state management\",\n fn: async (_runtime: IAgentRuntime) => {\n const roomId = \"test-room-123\";\n clearDirectiveState(roomId);\n\n const directives = parseDirectives(\"/think:high /verbose on\");\n applyDirectives(roomId, directives);\n\n const state = getDirectiveState(roomId);\n if (state.thinking !== \"high\") {\n throw new Error(\n `Expected thinking 'high', got '${state.thinking}'`,\n );\n }\n if (state.verbose !== \"on\") {\n throw new Error(`Expected verbose 'on', got '${state.verbose}'`);\n }\n\n clearDirectiveState(roomId);\n logger.success(\"Session state management works correctly\");\n },\n },\n ],\n },\n ],\n\n async init(_config, runtime) {\n logger.log(\"[plugin-directives] Initializing directive parser\");\n },\n};\n\nexport default directivesPlugin;\n",
|
|
6
|
-
"/**\n * Directive parsers for extracting inline directives from message text\n */\n\nimport type {\n DirectiveExtractResult,\n ElevatedLevel,\n ExecAsk,\n ExecHost,\n ExecSecurity,\n ReasoningLevel,\n ThinkLevel,\n VerboseLevel,\n} from \"./types\";\n\nconst escapeRegExp = (value: string) =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Match a level-based directive (e.g., /think:high)\n */\nfunction matchLevelDirective(\n body: string,\n names: string[],\n): { start: number; end: number; rawLevel?: string } | null {\n const namePattern = names.map(escapeRegExp).join(\"|\");\n const match = body.match(\n new RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)`, \"i\"),\n );\n if (!match || match.index === undefined) {\n return null;\n }\n const start = match.index;\n let end = match.index + match[0].length;\n let i = end;\n while (i < body.length && /\\s/.test(body[i])) {\n i += 1;\n }\n if (body[i] === \":\") {\n i += 1;\n while (i < body.length && /\\s/.test(body[i])) {\n i += 1;\n }\n }\n const argStart = i;\n while (i < body.length && /[A-Za-z0-9-]/.test(body[i])) {\n i += 1;\n }\n const rawLevel = i > argStart ? body.slice(argStart, i) : undefined;\n end = i;\n return { start, end, rawLevel };\n}\n\n/**\n * Extract a level-based directive from text\n */\nfunction extractLevelDirective<T>(\n body: string,\n names: string[],\n normalize: (raw?: string) => T | undefined,\n): DirectiveExtractResult<T> {\n const match = matchLevelDirective(body, names);\n if (!match) {\n return { cleaned: body.trim(), hasDirective: false };\n }\n const rawLevel = match.rawLevel;\n const level = normalize(rawLevel);\n const cleaned = body\n .slice(0, match.start)\n .concat(\" \")\n .concat(body.slice(match.end))\n .replace(/\\s+/g, \" \")\n .trim();\n return {\n cleaned,\n level,\n rawLevel,\n hasDirective: true,\n };\n}\n\n/**\n * Extract a simple directive (no value)\n */\nfunction extractSimpleDirective(\n body: string,\n names: string[],\n): { cleaned: string; hasDirective: boolean } {\n const namePattern = names.map(escapeRegExp).join(\"|\");\n const match = body.match(\n new RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)(?:\\\\s*:\\\\s*)?`, \"i\"),\n );\n const cleaned = match\n ? body.replace(match[0], \" \").replace(/\\s+/g, \" \").trim()\n : body.trim();\n return {\n cleaned,\n hasDirective: Boolean(match),\n };\n}\n\n// ============================================================================\n// Normalizers\n// ============================================================================\n\nexport function normalizeThinkLevel(\n raw?: string | null,\n): ThinkLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\"].includes(key)) return \"off\";\n if ([\"on\", \"enable\", \"enabled\"].includes(key)) return \"low\";\n if ([\"min\", \"minimal\"].includes(key)) return \"minimal\";\n if ([\"low\", \"thinkhard\", \"think-hard\", \"think_hard\"].includes(key))\n return \"low\";\n if (\n [\"mid\", \"med\", \"medium\", \"thinkharder\", \"think-harder\", \"harder\"].includes(\n key,\n )\n )\n return \"medium\";\n if (\n [\n \"high\",\n \"ultra\",\n \"ultrathink\",\n \"think-hard\",\n \"thinkhardest\",\n \"highest\",\n \"max\",\n ].includes(key)\n )\n return \"high\";\n if ([\"xhigh\", \"x-high\", \"x_high\"].includes(key)) return \"xhigh\";\n if ([\"think\"].includes(key)) return \"minimal\";\n return undefined;\n}\n\nexport function normalizeVerboseLevel(\n raw?: string | null,\n): VerboseLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n if ([\"full\", \"all\", \"everything\"].includes(key)) return \"full\";\n if ([\"on\", \"minimal\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n return undefined;\n}\n\nexport function normalizeReasoningLevel(\n raw?: string | null,\n): ReasoningLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if (\n [\n \"off\",\n \"false\",\n \"no\",\n \"0\",\n \"hide\",\n \"hidden\",\n \"disable\",\n \"disabled\",\n ].includes(key)\n )\n return \"off\";\n if (\n [\"on\", \"true\", \"yes\", \"1\", \"show\", \"visible\", \"enable\", \"enabled\"].includes(\n key,\n )\n )\n return \"on\";\n if ([\"stream\", \"streaming\", \"draft\", \"live\"].includes(key)) return \"stream\";\n return undefined;\n}\n\nexport function normalizeElevatedLevel(\n raw?: string | null,\n): ElevatedLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n if ([\"full\", \"auto\", \"auto-approve\", \"autoapprove\"].includes(key))\n return \"full\";\n if ([\"ask\", \"prompt\", \"approval\", \"approve\"].includes(key)) return \"ask\";\n if ([\"on\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n return undefined;\n}\n\nexport function normalizeExecHost(raw?: string | null): ExecHost | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"sandbox\", \"sb\"].includes(key)) return \"sandbox\";\n if ([\"gateway\", \"gw\", \"local\"].includes(key)) return \"gateway\";\n if ([\"node\", \"remote\"].includes(key)) return \"node\";\n return undefined;\n}\n\nexport function normalizeExecSecurity(\n raw?: string | null,\n): ExecSecurity | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"deny\", \"none\", \"off\"].includes(key)) return \"deny\";\n if ([\"allowlist\", \"allow\", \"list\"].includes(key)) return \"allowlist\";\n if ([\"full\", \"all\", \"any\"].includes(key)) return \"full\";\n return undefined;\n}\n\nexport function normalizeExecAsk(raw?: string | null): ExecAsk | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\", \"never\", \"no\"].includes(key)) return \"off\";\n if ([\"on-miss\", \"miss\", \"fallback\"].includes(key)) return \"on-miss\";\n if ([\"always\", \"on\", \"yes\"].includes(key)) return \"always\";\n return undefined;\n}\n\n// ============================================================================\n// Directive Extractors\n// ============================================================================\n\nexport function extractThinkDirective(body?: string): {\n cleaned: string;\n thinkLevel?: ThinkLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"thinking\", \"think\", \"t\"],\n normalizeThinkLevel,\n );\n return {\n cleaned: extracted.cleaned,\n thinkLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractVerboseDirective(body?: string): {\n cleaned: string;\n verboseLevel?: VerboseLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"verbose\", \"v\"],\n normalizeVerboseLevel,\n );\n return {\n cleaned: extracted.cleaned,\n verboseLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractReasoningDirective(body?: string): {\n cleaned: string;\n reasoningLevel?: ReasoningLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"reasoning\", \"reason\"],\n normalizeReasoningLevel,\n );\n return {\n cleaned: extracted.cleaned,\n reasoningLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractElevatedDirective(body?: string): {\n cleaned: string;\n elevatedLevel?: ElevatedLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"elevated\", \"elev\"],\n normalizeElevatedLevel,\n );\n return {\n cleaned: extracted.cleaned,\n elevatedLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractStatusDirective(body?: string): {\n cleaned: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n return extractSimpleDirective(body, [\"status\"]);\n}\n\nexport function extractModelDirective(\n body: string,\n options?: { aliases?: string[] },\n): {\n cleaned: string;\n rawModel?: string;\n rawProfile?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n\n // Match /model:provider/model@profile or /model provider/model@profile\n const modelMatch = body.match(\n /(?:^|\\s)\\/model(?:\\s*:\\s*|\\s+)([a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9._-]+)?(?:@[a-zA-Z0-9_-]+)?)/i,\n );\n\n if (modelMatch) {\n const fullMatch = modelMatch[1];\n const atIndex = fullMatch.indexOf(\"@\");\n const rawModel = atIndex >= 0 ? fullMatch.slice(0, atIndex) : fullMatch;\n const rawProfile = atIndex >= 0 ? fullMatch.slice(atIndex + 1) : undefined;\n const cleaned = body\n .replace(modelMatch[0], \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return { cleaned, rawModel, rawProfile, hasDirective: true };\n }\n\n // Check for simple /model directive without value\n const simpleMatch = body.match(/(?:^|\\s)\\/model(?=$|\\s|:)/i);\n if (simpleMatch) {\n const cleaned = body\n .replace(simpleMatch[0], \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return { cleaned, hasDirective: true };\n }\n\n // Check for model aliases\n if (options?.aliases?.length) {\n for (const alias of options.aliases) {\n const aliasPattern = new RegExp(\n `(?:^|\\\\s)/${escapeRegExp(alias)}(?=$|\\\\s)`,\n \"i\",\n );\n const aliasMatch = body.match(aliasPattern);\n if (aliasMatch) {\n const cleaned = body\n .replace(aliasMatch[0], \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return { cleaned, rawModel: alias, hasDirective: true };\n }\n }\n }\n\n return { cleaned: body.trim(), hasDirective: false };\n}\n\nexport function extractExecDirective(body?: string): {\n cleaned: string;\n execHost?: ExecHost;\n execSecurity?: ExecSecurity;\n execAsk?: ExecAsk;\n execNode?: string;\n rawExecHost?: string;\n rawExecSecurity?: string;\n rawExecAsk?: string;\n rawExecNode?: string;\n hasExecOptions: boolean;\n invalidHost: boolean;\n invalidSecurity: boolean;\n invalidAsk: boolean;\n invalidNode: boolean;\n hasDirective: boolean;\n} {\n if (!body) {\n return {\n cleaned: \"\",\n hasExecOptions: false,\n invalidHost: false,\n invalidSecurity: false,\n invalidAsk: false,\n invalidNode: false,\n hasDirective: false,\n };\n }\n\n // Match /exec with optional key=value pairs\n const execMatch = body.match(/(?:^|\\s)\\/exec(?:\\s+([^\\/\\n]+))?(?=$|\\s|\\/)/i);\n if (!execMatch) {\n return {\n cleaned: body.trim(),\n hasExecOptions: false,\n invalidHost: false,\n invalidSecurity: false,\n invalidAsk: false,\n invalidNode: false,\n hasDirective: false,\n };\n }\n\n const args = execMatch[1]?.trim() ?? \"\";\n const cleaned = body.replace(execMatch[0], \" \").replace(/\\s+/g, \" \").trim();\n\n let rawExecHost: string | undefined;\n let rawExecSecurity: string | undefined;\n let rawExecAsk: string | undefined;\n let rawExecNode: string | undefined;\n\n // Parse key=value pairs\n const kvPattern = /(\\w+)\\s*=\\s*([^\\s]+)/g;\n let match;\n while ((match = kvPattern.exec(args)) !== null) {\n const key = match[1].toLowerCase();\n const value = match[2];\n if (key === \"host\") rawExecHost = value;\n else if (key === \"security\") rawExecSecurity = value;\n else if (key === \"ask\") rawExecAsk = value;\n else if (key === \"node\") rawExecNode = value;\n }\n\n const execHost = normalizeExecHost(rawExecHost);\n const execSecurity = normalizeExecSecurity(rawExecSecurity);\n const execAsk = normalizeExecAsk(rawExecAsk);\n\n return {\n cleaned,\n execHost,\n execSecurity,\n execAsk,\n execNode: rawExecNode,\n rawExecHost,\n rawExecSecurity,\n rawExecAsk,\n rawExecNode,\n hasExecOptions: Boolean(\n rawExecHost || rawExecSecurity || rawExecAsk || rawExecNode,\n ),\n invalidHost: Boolean(rawExecHost && !execHost),\n invalidSecurity: Boolean(rawExecSecurity && !execSecurity),\n invalidAsk: Boolean(rawExecAsk && !execAsk),\n invalidNode: false, // Node validation is context-dependent\n hasDirective: true,\n };\n}\n"
|
|
5
|
+
"/**\n * Plugin Directives - Inline directive parsing for Eliza agents\n *\n * Parses and applies inline directives from message text:\n * - /think or /t - Thinking level control\n * - /verbose or /v - Verbose output control\n * - /reasoning - Reasoning visibility\n * - /elevated - Elevated permissions\n * - /exec - Execution environment settings\n * - /model - Model selection\n * - /status - Status request\n */\n\nimport {\n\ttype IAgentRuntime,\n\tlogger,\n\ttype Plugin,\n\ttype Provider,\n\ttype ProviderResult,\n} from \"@elizaos/core\";\n\nimport {\n\textractElevatedDirective,\n\textractExecDirective,\n\textractModelDirective,\n\textractReasoningDirective,\n\textractStatusDirective,\n\textractThinkDirective,\n\textractVerboseDirective,\n} from \"./parsers\";\n\nimport type { DirectiveState, ParsedDirectives, ParseOptions } from \"./types\";\n\nexport * from \"./parsers\";\n// Re-export types\nexport * from \"./types\";\n\n// ============================================================================\n// Session State Management\n// ============================================================================\n\nconst sessionStates = new Map<string, DirectiveState>();\n\nfunction getDefaultState(): DirectiveState {\n\treturn {\n\t\tthinking: \"low\",\n\t\tverbose: \"off\",\n\t\treasoning: \"off\",\n\t\televated: \"off\",\n\t\texec: {},\n\t\tmodel: {},\n\t};\n}\n\n/**\n * Get directive state for a room\n */\nexport function getDirectiveState(roomId: string): DirectiveState {\n\treturn sessionStates.get(roomId) ?? getDefaultState();\n}\n\n/**\n * Set directive state for a room\n */\nexport function setDirectiveState(roomId: string, state: DirectiveState): void {\n\tsessionStates.set(roomId, state);\n}\n\n/**\n * Clear directive state for a room\n */\nexport function clearDirectiveState(roomId: string): void {\n\tsessionStates.delete(roomId);\n}\n\n// ============================================================================\n// Main Parse Function\n// ============================================================================\n\n/**\n * Parse all inline directives from message text\n */\nexport function parseDirectives(\n\tbody: string,\n\toptions?: ParseOptions,\n): ParsedDirectives {\n\tconst {\n\t\tcleaned: thinkCleaned,\n\t\tthinkLevel,\n\t\trawLevel: rawThinkLevel,\n\t\thasDirective: hasThinkDirective,\n\t} = extractThinkDirective(body);\n\n\tconst {\n\t\tcleaned: verboseCleaned,\n\t\tverboseLevel,\n\t\trawLevel: rawVerboseLevel,\n\t\thasDirective: hasVerboseDirective,\n\t} = extractVerboseDirective(thinkCleaned);\n\n\tconst {\n\t\tcleaned: reasoningCleaned,\n\t\treasoningLevel,\n\t\trawLevel: rawReasoningLevel,\n\t\thasDirective: hasReasoningDirective,\n\t} = extractReasoningDirective(verboseCleaned);\n\n\tconst {\n\t\tcleaned: elevatedCleaned,\n\t\televatedLevel,\n\t\trawLevel: rawElevatedLevel,\n\t\thasDirective: hasElevatedDirective,\n\t} = options?.disableElevated\n\t\t? {\n\t\t\t\tcleaned: reasoningCleaned,\n\t\t\t\televatedLevel: undefined,\n\t\t\t\trawLevel: undefined,\n\t\t\t\thasDirective: false,\n\t\t\t}\n\t\t: extractElevatedDirective(reasoningCleaned);\n\n\tconst {\n\t\tcleaned: execCleaned,\n\t\texecHost,\n\t\texecSecurity,\n\t\texecAsk,\n\t\texecNode,\n\t\trawExecHost,\n\t\trawExecSecurity,\n\t\trawExecAsk,\n\t\trawExecNode,\n\t\thasExecOptions,\n\t\tinvalidHost: invalidExecHost,\n\t\tinvalidSecurity: invalidExecSecurity,\n\t\tinvalidAsk: invalidExecAsk,\n\t\tinvalidNode: invalidExecNode,\n\t\thasDirective: hasExecDirective,\n\t} = extractExecDirective(elevatedCleaned);\n\n\tconst allowStatusDirective = options?.allowStatusDirective !== false;\n\tconst { cleaned: statusCleaned, hasDirective: hasStatusDirective } =\n\t\tallowStatusDirective\n\t\t\t? extractStatusDirective(execCleaned)\n\t\t\t: { cleaned: execCleaned, hasDirective: false };\n\n\tconst {\n\t\tcleaned: modelCleaned,\n\t\trawModel,\n\t\trawProfile,\n\t\thasDirective: hasModelDirective,\n\t} = extractModelDirective(statusCleaned, {\n\t\taliases: options?.modelAliases,\n\t});\n\n\t// Determine if message contains only directives\n\tconst hasAnyDirective =\n\t\thasThinkDirective ||\n\t\thasVerboseDirective ||\n\t\thasReasoningDirective ||\n\t\thasElevatedDirective ||\n\t\thasExecDirective ||\n\t\thasModelDirective;\n\tconst directivesOnly = hasAnyDirective && modelCleaned.trim().length === 0;\n\n\treturn {\n\t\tcleanedText: modelCleaned,\n\t\tdirectivesOnly,\n\t\thasThinkDirective,\n\t\tthinkLevel,\n\t\trawThinkLevel,\n\t\thasVerboseDirective,\n\t\tverboseLevel,\n\t\trawVerboseLevel,\n\t\thasReasoningDirective,\n\t\treasoningLevel,\n\t\trawReasoningLevel,\n\t\thasElevatedDirective,\n\t\televatedLevel,\n\t\trawElevatedLevel,\n\t\thasExecDirective,\n\t\texecHost,\n\t\texecSecurity,\n\t\texecAsk,\n\t\texecNode,\n\t\trawExecHost,\n\t\trawExecSecurity,\n\t\trawExecAsk,\n\t\trawExecNode,\n\t\thasExecOptions,\n\t\tinvalidExecHost,\n\t\tinvalidExecSecurity,\n\t\tinvalidExecAsk,\n\t\tinvalidExecNode,\n\t\thasStatusDirective,\n\t\thasModelDirective,\n\t\trawModelDirective: rawModel,\n\t\trawModelProfile: rawProfile,\n\t};\n}\n\n/**\n * Apply parsed directives to session state\n */\nexport function applyDirectives(\n\troomId: string,\n\tdirectives: ParsedDirectives,\n\tpersist = true,\n): DirectiveState {\n\tconst current = getDirectiveState(roomId);\n\tconst updated = { ...current };\n\n\tif (directives.hasThinkDirective && directives.thinkLevel) {\n\t\tupdated.thinking = directives.thinkLevel;\n\t}\n\tif (directives.hasVerboseDirective && directives.verboseLevel) {\n\t\tupdated.verbose = directives.verboseLevel;\n\t}\n\tif (directives.hasReasoningDirective && directives.reasoningLevel) {\n\t\tupdated.reasoning = directives.reasoningLevel;\n\t}\n\tif (directives.hasElevatedDirective && directives.elevatedLevel) {\n\t\tupdated.elevated = directives.elevatedLevel;\n\t}\n\tif (directives.hasExecDirective) {\n\t\tupdated.exec = {\n\t\t\t...updated.exec,\n\t\t\t...(directives.execHost && { host: directives.execHost }),\n\t\t\t...(directives.execSecurity && { security: directives.execSecurity }),\n\t\t\t...(directives.execAsk && { ask: directives.execAsk }),\n\t\t\t...(directives.execNode && { node: directives.execNode }),\n\t\t};\n\t}\n\tif (directives.hasModelDirective && directives.rawModelDirective) {\n\t\tconst parts = directives.rawModelDirective.split(\"/\");\n\t\tif (parts.length === 2) {\n\t\t\tupdated.model = {\n\t\t\t\tprovider: parts[0],\n\t\t\t\tmodel: parts[1],\n\t\t\t\tauthProfile: directives.rawModelProfile,\n\t\t\t};\n\t\t} else {\n\t\t\tupdated.model = {\n\t\t\t\tmodel: directives.rawModelDirective,\n\t\t\t\tauthProfile: directives.rawModelProfile,\n\t\t\t};\n\t\t}\n\t}\n\n\tif (persist) {\n\t\tsetDirectiveState(roomId, updated);\n\t}\n\n\treturn updated;\n}\n\n/**\n * Format directive state for display\n */\nexport function formatDirectiveState(state: DirectiveState): string {\n\tconst lines: string[] = [];\n\tlines.push(`Thinking: ${state.thinking}`);\n\tlines.push(`Verbose: ${state.verbose}`);\n\tlines.push(`Reasoning: ${state.reasoning}`);\n\tlines.push(`Elevated: ${state.elevated}`);\n\tif (state.model.provider || state.model.model) {\n\t\tconst modelStr = state.model.provider\n\t\t\t? `${state.model.provider}/${state.model.model}`\n\t\t\t: state.model.model;\n\t\tlines.push(\n\t\t\t`Model: ${modelStr}${state.model.authProfile ? ` @${state.model.authProfile}` : \"\"}`,\n\t\t);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Format acknowledgment for directive-only messages\n */\nexport function formatDirectiveAcknowledgment(\n\tdirectives: ParsedDirectives,\n): string {\n\tconst changes: string[] = [];\n\n\tif (directives.hasThinkDirective) {\n\t\tchanges.push(`Thinking: ${directives.thinkLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasVerboseDirective) {\n\t\tchanges.push(`Verbose: ${directives.verboseLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasReasoningDirective) {\n\t\tchanges.push(`Reasoning: ${directives.reasoningLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasElevatedDirective) {\n\t\tchanges.push(`Elevated: ${directives.elevatedLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasModelDirective) {\n\t\tchanges.push(`Model: ${directives.rawModelDirective ?? \"status\"}`);\n\t}\n\n\treturn changes.length > 0 ? `✓ ${changes.join(\", \")}` : \"No changes applied\";\n}\n\n// ============================================================================\n// Provider\n// ============================================================================\n\n/**\n * Provider that exposes current directive state to the agent\n */\nexport const directiveStateProvider: Provider = {\n\tname: \"DIRECTIVE_STATE\",\n\tdescription: \"Current directive levels (thinking, verbose, model, etc.)\",\n\tdynamic: true,\n\tasync get(_runtime, message, _state): Promise<ProviderResult> {\n\t\tconst roomId = message.roomId;\n\t\tconst directives = getDirectiveState(roomId);\n\n\t\treturn {\n\t\t\ttext: formatDirectiveState(directives),\n\t\t\tvalues: {\n\t\t\t\tthinkingLevel: directives.thinking,\n\t\t\t\tverboseLevel: directives.verbose,\n\t\t\t\treasoningLevel: directives.reasoning,\n\t\t\t\televatedLevel: directives.elevated,\n\t\t\t\tmodelProvider: directives.model.provider ?? \"\",\n\t\t\t\tmodelName: directives.model.model ?? \"\",\n\t\t\t\tisElevated: directives.elevated !== \"off\",\n\t\t\t},\n\t\t\tdata: { directives },\n\t\t};\n\t},\n};\n\n// ============================================================================\n// Plugin Export\n// ============================================================================\n\n/**\n * Plugin Directives\n *\n * Provides inline directive parsing for Eliza agents, allowing users to\n * control thinking levels, verbosity, model selection, and more through\n * inline commands in their messages.\n */\nexport const directivesPlugin: Plugin = {\n\tname: \"directives\",\n\tdescription:\n\t\t\"Inline directive parsing (@think, @model, @verbose, etc.) for controlling agent behavior\",\n\n\tproviders: [directiveStateProvider],\n\n\tconfig: {\n\t\tDEFAULT_THINKING: \"low\",\n\t\tDEFAULT_VERBOSE: \"off\",\n\t\tALLOW_ELEVATED: \"true\",\n\t\tALLOW_EXEC: \"false\",\n\t},\n\n\ttests: [\n\t\t{\n\t\t\tname: \"directive-parsing\",\n\t\t\ttests: [\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse think directive\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\"/think:high hello world\");\n\t\t\t\t\t\tif (!result.hasThinkDirective) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect think directive\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.thinkLevel !== \"high\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'high', got '${result.thinkLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.cleanedText !== \"hello world\") {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Expected 'hello world', got '${result.cleanedText}'`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Think directive parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse verbose directive\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\"/v on test message\");\n\t\t\t\t\t\tif (!result.hasVerboseDirective) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect verbose directive\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.verboseLevel !== \"on\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'on', got '${result.verboseLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Verbose directive parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse model directive\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\n\t\t\t\t\t\t\t\"/model anthropic/claude-3-opus what is 2+2\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!result.hasModelDirective) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect model directive\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.rawModelDirective !== \"anthropic/claude-3-opus\") {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Expected 'anthropic/claude-3-opus', got '${result.rawModelDirective}'`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Model directive parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Detect directive-only message\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\"/think:high /verbose on\");\n\t\t\t\t\t\tif (!result.directivesOnly) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect directive-only message\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Directive-only detection works correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse multiple directives\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\n\t\t\t\t\t\t\t\"/think:medium /v full /elevated on hello\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!result.hasThinkDirective ||\n\t\t\t\t\t\t\t!result.hasVerboseDirective ||\n\t\t\t\t\t\t\t!result.hasElevatedDirective\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect all directives\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.thinkLevel !== \"medium\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'medium', got '${result.thinkLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.verboseLevel !== \"full\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'full', got '${result.verboseLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.elevatedLevel !== \"on\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'on', got '${result.elevatedLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.cleanedText !== \"hello\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'hello', got '${result.cleanedText}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Multiple directives parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Session state management\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst roomId = \"test-room-123\";\n\t\t\t\t\t\tclearDirectiveState(roomId);\n\n\t\t\t\t\t\tconst directives = parseDirectives(\"/think:high /verbose on\");\n\t\t\t\t\t\tapplyDirectives(roomId, directives);\n\n\t\t\t\t\t\tconst state = getDirectiveState(roomId);\n\t\t\t\t\t\tif (state.thinking !== \"high\") {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Expected thinking 'high', got '${state.thinking}'`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state.verbose !== \"on\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected verbose 'on', got '${state.verbose}'`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearDirectiveState(roomId);\n\t\t\t\t\t\tlogger.success(\"Session state management works correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n\n\tasync init(_config, _runtime) {\n\t\tlogger.log(\"[plugin-directives] Initializing directive parser\");\n\t},\n};\n\nexport default directivesPlugin;\n",
|
|
6
|
+
"/**\n * Directive parsers for extracting inline directives from message text\n */\n\nimport type {\n\tDirectiveExtractResult,\n\tElevatedLevel,\n\tExecAsk,\n\tExecHost,\n\tExecSecurity,\n\tReasoningLevel,\n\tThinkLevel,\n\tVerboseLevel,\n} from \"./types\";\n\nconst escapeRegExp = (value: string) =>\n\tvalue.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Match a level-based directive (e.g., /think:high)\n */\nfunction matchLevelDirective(\n\tbody: string,\n\tnames: string[],\n): { start: number; end: number; rawLevel?: string } | null {\n\tconst namePattern = names.map(escapeRegExp).join(\"|\");\n\tconst match = body.match(\n\t\tnew RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)`, \"i\"),\n\t);\n\tif (!match || match.index === undefined) {\n\t\treturn null;\n\t}\n\tconst start = match.index;\n\tlet end = match.index + match[0].length;\n\tlet i = end;\n\twhile (i < body.length && /\\s/.test(body[i])) {\n\t\ti += 1;\n\t}\n\tif (body[i] === \":\") {\n\t\ti += 1;\n\t\twhile (i < body.length && /\\s/.test(body[i])) {\n\t\t\ti += 1;\n\t\t}\n\t}\n\tconst argStart = i;\n\twhile (i < body.length && /[A-Za-z0-9-]/.test(body[i])) {\n\t\ti += 1;\n\t}\n\tconst rawLevel = i > argStart ? body.slice(argStart, i) : undefined;\n\tend = i;\n\treturn { start, end, rawLevel };\n}\n\n/**\n * Extract a level-based directive from text\n */\nfunction extractLevelDirective<T>(\n\tbody: string,\n\tnames: string[],\n\tnormalize: (raw?: string) => T | undefined,\n): DirectiveExtractResult<T> {\n\tconst match = matchLevelDirective(body, names);\n\tif (!match) {\n\t\treturn { cleaned: body.trim(), hasDirective: false };\n\t}\n\tconst rawLevel = match.rawLevel;\n\tconst level = normalize(rawLevel);\n\tconst cleaned = body\n\t\t.slice(0, match.start)\n\t\t.concat(\" \")\n\t\t.concat(body.slice(match.end))\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n\treturn {\n\t\tcleaned,\n\t\tlevel,\n\t\trawLevel,\n\t\thasDirective: true,\n\t};\n}\n\n/**\n * Extract a simple directive (no value)\n */\nfunction extractSimpleDirective(\n\tbody: string,\n\tnames: string[],\n): { cleaned: string; hasDirective: boolean } {\n\tconst namePattern = names.map(escapeRegExp).join(\"|\");\n\tconst match = body.match(\n\t\tnew RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)(?:\\\\s*:\\\\s*)?`, \"i\"),\n\t);\n\tconst cleaned = match\n\t\t? body.replace(match[0], \" \").replace(/\\s+/g, \" \").trim()\n\t\t: body.trim();\n\treturn {\n\t\tcleaned,\n\t\thasDirective: Boolean(match),\n\t};\n}\n\n// ============================================================================\n// Normalizers\n// ============================================================================\n\nexport function normalizeThinkLevel(\n\traw?: string | null,\n): ThinkLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\"].includes(key)) return \"off\";\n\tif ([\"on\", \"enable\", \"enabled\"].includes(key)) return \"low\";\n\tif ([\"min\", \"minimal\"].includes(key)) return \"minimal\";\n\tif ([\"low\", \"thinkhard\", \"think-hard\", \"think_hard\"].includes(key))\n\t\treturn \"low\";\n\tif (\n\t\t[\"mid\", \"med\", \"medium\", \"thinkharder\", \"think-harder\", \"harder\"].includes(\n\t\t\tkey,\n\t\t)\n\t)\n\t\treturn \"medium\";\n\tif (\n\t\t[\n\t\t\t\"high\",\n\t\t\t\"ultra\",\n\t\t\t\"ultrathink\",\n\t\t\t\"think-hard\",\n\t\t\t\"thinkhardest\",\n\t\t\t\"highest\",\n\t\t\t\"max\",\n\t\t].includes(key)\n\t)\n\t\treturn \"high\";\n\tif ([\"xhigh\", \"x-high\", \"x_high\"].includes(key)) return \"xhigh\";\n\tif ([\"think\"].includes(key)) return \"minimal\";\n\treturn undefined;\n}\n\nexport function normalizeVerboseLevel(\n\traw?: string | null,\n): VerboseLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n\tif ([\"full\", \"all\", \"everything\"].includes(key)) return \"full\";\n\tif ([\"on\", \"minimal\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n\treturn undefined;\n}\n\nexport function normalizeReasoningLevel(\n\traw?: string | null,\n): ReasoningLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif (\n\t\t[\n\t\t\t\"off\",\n\t\t\t\"false\",\n\t\t\t\"no\",\n\t\t\t\"0\",\n\t\t\t\"hide\",\n\t\t\t\"hidden\",\n\t\t\t\"disable\",\n\t\t\t\"disabled\",\n\t\t].includes(key)\n\t)\n\t\treturn \"off\";\n\tif (\n\t\t[\"on\", \"true\", \"yes\", \"1\", \"show\", \"visible\", \"enable\", \"enabled\"].includes(\n\t\t\tkey,\n\t\t)\n\t)\n\t\treturn \"on\";\n\tif ([\"stream\", \"streaming\", \"draft\", \"live\"].includes(key)) return \"stream\";\n\treturn undefined;\n}\n\nexport function normalizeElevatedLevel(\n\traw?: string | null,\n): ElevatedLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n\tif ([\"full\", \"auto\", \"auto-approve\", \"autoapprove\"].includes(key))\n\t\treturn \"full\";\n\tif ([\"ask\", \"prompt\", \"approval\", \"approve\"].includes(key)) return \"ask\";\n\tif ([\"on\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n\treturn undefined;\n}\n\nexport function normalizeExecHost(raw?: string | null): ExecHost | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"sandbox\", \"sb\"].includes(key)) return \"sandbox\";\n\tif ([\"gateway\", \"gw\", \"local\"].includes(key)) return \"gateway\";\n\tif ([\"node\", \"remote\"].includes(key)) return \"node\";\n\treturn undefined;\n}\n\nexport function normalizeExecSecurity(\n\traw?: string | null,\n): ExecSecurity | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"deny\", \"none\", \"off\"].includes(key)) return \"deny\";\n\tif ([\"allowlist\", \"allow\", \"list\"].includes(key)) return \"allowlist\";\n\tif ([\"full\", \"all\", \"any\"].includes(key)) return \"full\";\n\treturn undefined;\n}\n\nexport function normalizeExecAsk(raw?: string | null): ExecAsk | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\", \"never\", \"no\"].includes(key)) return \"off\";\n\tif ([\"on-miss\", \"miss\", \"fallback\"].includes(key)) return \"on-miss\";\n\tif ([\"always\", \"on\", \"yes\"].includes(key)) return \"always\";\n\treturn undefined;\n}\n\n// ============================================================================\n// Directive Extractors\n// ============================================================================\n\nexport function extractThinkDirective(body?: string): {\n\tcleaned: string;\n\tthinkLevel?: ThinkLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"thinking\", \"think\", \"t\"],\n\t\tnormalizeThinkLevel,\n\t);\n\tconst cleaned =\n\t\textracted.hasDirective && !extracted.level && extracted.rawLevel\n\t\t\t? `${extracted.rawLevel} ${extracted.cleaned}`.trim()\n\t\t\t: extracted.cleaned;\n\treturn {\n\t\tcleaned,\n\t\tthinkLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractVerboseDirective(body?: string): {\n\tcleaned: string;\n\tverboseLevel?: VerboseLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"verbose\", \"v\"],\n\t\tnormalizeVerboseLevel,\n\t);\n\treturn {\n\t\tcleaned: extracted.cleaned,\n\t\tverboseLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractReasoningDirective(body?: string): {\n\tcleaned: string;\n\treasoningLevel?: ReasoningLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"reasoning\", \"reason\"],\n\t\tnormalizeReasoningLevel,\n\t);\n\treturn {\n\t\tcleaned: extracted.cleaned,\n\t\treasoningLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractElevatedDirective(body?: string): {\n\tcleaned: string;\n\televatedLevel?: ElevatedLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"elevated\", \"elev\"],\n\t\tnormalizeElevatedLevel,\n\t);\n\treturn {\n\t\tcleaned: extracted.cleaned,\n\t\televatedLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractStatusDirective(body?: string): {\n\tcleaned: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\treturn extractSimpleDirective(body, [\"status\"]);\n}\n\nexport function extractModelDirective(\n\tbody: string,\n\toptions?: { aliases?: string[] },\n): {\n\tcleaned: string;\n\trawModel?: string;\n\trawProfile?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\n\t// Match /model:provider/model@profile or /model provider/model@profile\n\tconst modelMatch = body.match(\n\t\t/(?:^|\\s)\\/model(?:\\s*:\\s*|\\s+)([a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9._-]+)?(?:@[a-zA-Z0-9_-]+)?)/i,\n\t);\n\n\tif (modelMatch) {\n\t\tconst fullMatch = modelMatch[1];\n\t\tconst atIndex = fullMatch.indexOf(\"@\");\n\t\tconst rawModel = atIndex >= 0 ? fullMatch.slice(0, atIndex) : fullMatch;\n\t\tconst rawProfile = atIndex >= 0 ? fullMatch.slice(atIndex + 1) : undefined;\n\t\tconst cleaned = body\n\t\t\t.replace(modelMatch[0], \" \")\n\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t.trim();\n\t\treturn { cleaned, rawModel, rawProfile, hasDirective: true };\n\t}\n\n\t// Check for simple /model directive without value\n\tconst simpleMatch = body.match(/(?:^|\\s)\\/model(?=$|\\s|:)/i);\n\tif (simpleMatch) {\n\t\tconst cleaned = body\n\t\t\t.replace(simpleMatch[0], \" \")\n\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t.trim();\n\t\treturn { cleaned, hasDirective: true };\n\t}\n\n\t// Check for model aliases\n\tif (options?.aliases?.length) {\n\t\tfor (const alias of options.aliases) {\n\t\t\tconst aliasPattern = new RegExp(\n\t\t\t\t`(?:^|\\\\s)/${escapeRegExp(alias)}(?=$|\\\\s)`,\n\t\t\t\t\"i\",\n\t\t\t);\n\t\t\tconst aliasMatch = body.match(aliasPattern);\n\t\t\tif (aliasMatch) {\n\t\t\t\tconst cleaned = body\n\t\t\t\t\t.replace(aliasMatch[0], \" \")\n\t\t\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t\t\t.trim();\n\t\t\t\treturn { cleaned, rawModel: alias, hasDirective: true };\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { cleaned: body.trim(), hasDirective: false };\n}\n\nexport function extractExecDirective(body?: string): {\n\tcleaned: string;\n\texecHost?: ExecHost;\n\texecSecurity?: ExecSecurity;\n\texecAsk?: ExecAsk;\n\texecNode?: string;\n\trawExecHost?: string;\n\trawExecSecurity?: string;\n\trawExecAsk?: string;\n\trawExecNode?: string;\n\thasExecOptions: boolean;\n\tinvalidHost: boolean;\n\tinvalidSecurity: boolean;\n\tinvalidAsk: boolean;\n\tinvalidNode: boolean;\n\thasDirective: boolean;\n} {\n\tif (!body) {\n\t\treturn {\n\t\t\tcleaned: \"\",\n\t\t\thasExecOptions: false,\n\t\t\tinvalidHost: false,\n\t\t\tinvalidSecurity: false,\n\t\t\tinvalidAsk: false,\n\t\t\tinvalidNode: false,\n\t\t\thasDirective: false,\n\t\t};\n\t}\n\n\t// Match /exec with optional key=value pairs\n\tconst execMatch = body.match(/(?:^|\\s)\\/exec(?:\\s+([^/\\n]+))?(?=$|\\s|\\/)/i);\n\tif (!execMatch) {\n\t\treturn {\n\t\t\tcleaned: body.trim(),\n\t\t\thasExecOptions: false,\n\t\t\tinvalidHost: false,\n\t\t\tinvalidSecurity: false,\n\t\t\tinvalidAsk: false,\n\t\t\tinvalidNode: false,\n\t\t\thasDirective: false,\n\t\t};\n\t}\n\n\tconst args = execMatch[1]?.trim() ?? \"\";\n\tconst cleaned = body.replace(execMatch[0], \" \").replace(/\\s+/g, \" \").trim();\n\n\tlet rawExecHost: string | undefined;\n\tlet rawExecSecurity: string | undefined;\n\tlet rawExecAsk: string | undefined;\n\tlet rawExecNode: string | undefined;\n\n\t// Parse key=value pairs\n\tconst kvPattern = /(\\w+)\\s*=\\s*([^\\s]+)/g;\n\tfor (const match of args.matchAll(kvPattern)) {\n\t\tconst key = match[1].toLowerCase();\n\t\tconst value = match[2];\n\t\tif (key === \"host\") rawExecHost = value;\n\t\telse if (key === \"security\") rawExecSecurity = value;\n\t\telse if (key === \"ask\") rawExecAsk = value;\n\t\telse if (key === \"node\") rawExecNode = value;\n\t}\n\n\tconst execHost = normalizeExecHost(rawExecHost);\n\tconst execSecurity = normalizeExecSecurity(rawExecSecurity);\n\tconst execAsk = normalizeExecAsk(rawExecAsk);\n\n\treturn {\n\t\tcleaned,\n\t\texecHost,\n\t\texecSecurity,\n\t\texecAsk,\n\t\texecNode: rawExecNode,\n\t\trawExecHost,\n\t\trawExecSecurity,\n\t\trawExecAsk,\n\t\trawExecNode,\n\t\thasExecOptions: Boolean(\n\t\t\trawExecHost || rawExecSecurity || rawExecAsk || rawExecNode,\n\t\t),\n\t\tinvalidHost: Boolean(rawExecHost && !execHost),\n\t\tinvalidSecurity: Boolean(rawExecSecurity && !execSecurity),\n\t\tinvalidAsk: Boolean(rawExecAsk && !execAsk),\n\t\tinvalidNode: false, // Node validation is context-dependent\n\t\thasDirective: true,\n\t};\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IANP;;;ACEA,IAAM,eAAe,CAAC,UACpB,MAAM,QAAQ,uBAAuB,MAAM;AAK7C,SAAS,mBAAmB,CAC1B,MACA,OAC0D;AAAA,EAC1D,MAAM,cAAc,MAAM,IAAI,YAAY,EAAE,KAAK,GAAG;AAAA,EACpD,MAAM,QAAQ,KAAK,MACjB,IAAI,OAAO,kBAAkB,2BAA2B,GAAG,CAC7D;AAAA,EACA,IAAI,CAAC,SAAS,MAAM,UAAU,WAAW;AAAA,IACvC,OAAO;AAAA,EACT;AAAA,EACA,MAAM,QAAQ,MAAM;AAAA,EACpB,IAAI,MAAM,MAAM,QAAQ,MAAM,GAAG;AAAA,EACjC,IAAI,IAAI;AAAA,EACR,OAAO,IAAI,KAAK,UAAU,KAAK,KAAK,KAAK,EAAE,GAAG;AAAA,IAC5C,KAAK;AAAA,EACP;AAAA,EACA,IAAI,KAAK,OAAO,KAAK;AAAA,IACnB,KAAK;AAAA,IACL,OAAO,IAAI,KAAK,UAAU,KAAK,KAAK,KAAK,EAAE,GAAG;AAAA,MAC5C,KAAK;AAAA,IACP;AAAA,EACF;AAAA,EACA,MAAM,WAAW;AAAA,EACjB,OAAO,IAAI,KAAK,UAAU,eAAe,KAAK,KAAK,EAAE,GAAG;AAAA,IACtD,KAAK;AAAA,EACP;AAAA,EACA,MAAM,WAAW,IAAI,WAAW,KAAK,MAAM,UAAU,CAAC,IAAI;AAAA,EAC1D,MAAM;AAAA,EACN,OAAO,EAAE,OAAO,KAAK,SAAS;AAAA;AAMhC,SAAS,qBAAwB,CAC/B,MACA,OACA,WAC2B;AAA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@@ -172,8 +172,9 @@ function extractThinkDirective(body) {
|
|
|
172
172
|
if (!body)
|
|
173
173
|
return { cleaned: "", hasDirective: false };
|
|
174
174
|
const extracted = extractLevelDirective(body, ["thinking", "think", "t"], normalizeThinkLevel);
|
|
175
|
+
const cleaned = extracted.hasDirective && !extracted.level && extracted.rawLevel ? `${extracted.rawLevel} ${extracted.cleaned}`.trim() : extracted.cleaned;
|
|
175
176
|
return {
|
|
176
|
-
cleaned
|
|
177
|
+
cleaned,
|
|
177
178
|
thinkLevel: extracted.level,
|
|
178
179
|
rawLevel: extracted.rawLevel,
|
|
179
180
|
hasDirective: extracted.hasDirective
|
|
@@ -258,7 +259,7 @@ function extractExecDirective(body) {
|
|
|
258
259
|
hasDirective: false
|
|
259
260
|
};
|
|
260
261
|
}
|
|
261
|
-
const execMatch = body.match(/(?:^|\s)\/exec(?:\s+([
|
|
262
|
+
const execMatch = body.match(/(?:^|\s)\/exec(?:\s+([^/\n]+))?(?=$|\s|\/)/i);
|
|
262
263
|
if (!execMatch) {
|
|
263
264
|
return {
|
|
264
265
|
cleaned: body.trim(),
|
|
@@ -277,8 +278,7 @@ function extractExecDirective(body) {
|
|
|
277
278
|
let rawExecAsk;
|
|
278
279
|
let rawExecNode;
|
|
279
280
|
const kvPattern = /(\w+)\s*=\s*([^\s]+)/g;
|
|
280
|
-
|
|
281
|
-
while ((match = kvPattern.exec(args)) !== null) {
|
|
281
|
+
for (const match of args.matchAll(kvPattern)) {
|
|
282
282
|
const key = match[1].toLowerCase();
|
|
283
283
|
const value = match[2];
|
|
284
284
|
if (key === "host")
|
|
@@ -506,7 +506,8 @@ function formatDirectiveAcknowledgment(directives) {
|
|
|
506
506
|
var directiveStateProvider = {
|
|
507
507
|
name: "DIRECTIVE_STATE",
|
|
508
508
|
description: "Current directive levels (thinking, verbose, model, etc.)",
|
|
509
|
-
|
|
509
|
+
dynamic: true,
|
|
510
|
+
async get(_runtime, message, _state) {
|
|
510
511
|
const roomId = message.roomId;
|
|
511
512
|
const directives = getDirectiveState(roomId);
|
|
512
513
|
return {
|
|
@@ -633,7 +634,7 @@ var directivesPlugin = {
|
|
|
633
634
|
]
|
|
634
635
|
}
|
|
635
636
|
],
|
|
636
|
-
async init(_config,
|
|
637
|
+
async init(_config, _runtime) {
|
|
637
638
|
logger.log("[plugin-directives] Initializing directive parser");
|
|
638
639
|
}
|
|
639
640
|
};
|
|
@@ -665,4 +666,4 @@ export {
|
|
|
665
666
|
applyDirectives
|
|
666
667
|
};
|
|
667
668
|
|
|
668
|
-
//# debugId=
|
|
669
|
+
//# debugId=1664D5D4B9BED94F64756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/parsers.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * Plugin Directives - Inline directive parsing for Eliza agents\n *\n * Parses and applies inline directives from message text:\n * - /think or /t - Thinking level control\n * - /verbose or /v - Verbose output control\n * - /reasoning - Reasoning visibility\n * - /elevated - Elevated permissions\n * - /exec - Execution environment settings\n * - /model - Model selection\n * - /status - Status request\n */\n\nimport {\n type IAgentRuntime,\n type Plugin,\n type Provider,\n type ProviderResult,\n logger,\n} from \"@elizaos/core\";\n\nimport {\n extractElevatedDirective,\n extractExecDirective,\n extractModelDirective,\n extractReasoningDirective,\n extractStatusDirective,\n extractThinkDirective,\n extractVerboseDirective,\n normalizeElevatedLevel,\n normalizeReasoningLevel,\n normalizeThinkLevel,\n normalizeVerboseLevel,\n} from \"./parsers\";\n\nimport type {\n DirectiveState,\n ElevatedLevel,\n ParsedDirectives,\n ParseOptions,\n ReasoningLevel,\n ThinkLevel,\n VerboseLevel,\n} from \"./types\";\n\n// Re-export types\nexport * from \"./types\";\nexport * from \"./parsers\";\n\n// ============================================================================\n// Session State Management\n// ============================================================================\n\nconst sessionStates = new Map<string, DirectiveState>();\n\nfunction getDefaultState(): DirectiveState {\n return {\n thinking: \"low\",\n verbose: \"off\",\n reasoning: \"off\",\n elevated: \"off\",\n exec: {},\n model: {},\n };\n}\n\n/**\n * Get directive state for a room\n */\nexport function getDirectiveState(roomId: string): DirectiveState {\n return sessionStates.get(roomId) ?? getDefaultState();\n}\n\n/**\n * Set directive state for a room\n */\nexport function setDirectiveState(roomId: string, state: DirectiveState): void {\n sessionStates.set(roomId, state);\n}\n\n/**\n * Clear directive state for a room\n */\nexport function clearDirectiveState(roomId: string): void {\n sessionStates.delete(roomId);\n}\n\n// ============================================================================\n// Main Parse Function\n// ============================================================================\n\n/**\n * Parse all inline directives from message text\n */\nexport function parseDirectives(\n body: string,\n options?: ParseOptions,\n): ParsedDirectives {\n const {\n cleaned: thinkCleaned,\n thinkLevel,\n rawLevel: rawThinkLevel,\n hasDirective: hasThinkDirective,\n } = extractThinkDirective(body);\n\n const {\n cleaned: verboseCleaned,\n verboseLevel,\n rawLevel: rawVerboseLevel,\n hasDirective: hasVerboseDirective,\n } = extractVerboseDirective(thinkCleaned);\n\n const {\n cleaned: reasoningCleaned,\n reasoningLevel,\n rawLevel: rawReasoningLevel,\n hasDirective: hasReasoningDirective,\n } = extractReasoningDirective(verboseCleaned);\n\n const {\n cleaned: elevatedCleaned,\n elevatedLevel,\n rawLevel: rawElevatedLevel,\n hasDirective: hasElevatedDirective,\n } = options?.disableElevated\n ? {\n cleaned: reasoningCleaned,\n elevatedLevel: undefined,\n rawLevel: undefined,\n hasDirective: false,\n }\n : extractElevatedDirective(reasoningCleaned);\n\n const {\n cleaned: execCleaned,\n execHost,\n execSecurity,\n execAsk,\n execNode,\n rawExecHost,\n rawExecSecurity,\n rawExecAsk,\n rawExecNode,\n hasExecOptions,\n invalidHost: invalidExecHost,\n invalidSecurity: invalidExecSecurity,\n invalidAsk: invalidExecAsk,\n invalidNode: invalidExecNode,\n hasDirective: hasExecDirective,\n } = extractExecDirective(elevatedCleaned);\n\n const allowStatusDirective = options?.allowStatusDirective !== false;\n const { cleaned: statusCleaned, hasDirective: hasStatusDirective } =\n allowStatusDirective\n ? extractStatusDirective(execCleaned)\n : { cleaned: execCleaned, hasDirective: false };\n\n const {\n cleaned: modelCleaned,\n rawModel,\n rawProfile,\n hasDirective: hasModelDirective,\n } = extractModelDirective(statusCleaned, {\n aliases: options?.modelAliases,\n });\n\n // Determine if message contains only directives\n const hasAnyDirective =\n hasThinkDirective ||\n hasVerboseDirective ||\n hasReasoningDirective ||\n hasElevatedDirective ||\n hasExecDirective ||\n hasModelDirective;\n const directivesOnly = hasAnyDirective && modelCleaned.trim().length === 0;\n\n return {\n cleanedText: modelCleaned,\n directivesOnly,\n hasThinkDirective,\n thinkLevel,\n rawThinkLevel,\n hasVerboseDirective,\n verboseLevel,\n rawVerboseLevel,\n hasReasoningDirective,\n reasoningLevel,\n rawReasoningLevel,\n hasElevatedDirective,\n elevatedLevel,\n rawElevatedLevel,\n hasExecDirective,\n execHost,\n execSecurity,\n execAsk,\n execNode,\n rawExecHost,\n rawExecSecurity,\n rawExecAsk,\n rawExecNode,\n hasExecOptions,\n invalidExecHost,\n invalidExecSecurity,\n invalidExecAsk,\n invalidExecNode,\n hasStatusDirective,\n hasModelDirective,\n rawModelDirective: rawModel,\n rawModelProfile: rawProfile,\n };\n}\n\n/**\n * Apply parsed directives to session state\n */\nexport function applyDirectives(\n roomId: string,\n directives: ParsedDirectives,\n persist = true,\n): DirectiveState {\n const current = getDirectiveState(roomId);\n const updated = { ...current };\n\n if (directives.hasThinkDirective && directives.thinkLevel) {\n updated.thinking = directives.thinkLevel;\n }\n if (directives.hasVerboseDirective && directives.verboseLevel) {\n updated.verbose = directives.verboseLevel;\n }\n if (directives.hasReasoningDirective && directives.reasoningLevel) {\n updated.reasoning = directives.reasoningLevel;\n }\n if (directives.hasElevatedDirective && directives.elevatedLevel) {\n updated.elevated = directives.elevatedLevel;\n }\n if (directives.hasExecDirective) {\n updated.exec = {\n ...updated.exec,\n ...(directives.execHost && { host: directives.execHost }),\n ...(directives.execSecurity && { security: directives.execSecurity }),\n ...(directives.execAsk && { ask: directives.execAsk }),\n ...(directives.execNode && { node: directives.execNode }),\n };\n }\n if (directives.hasModelDirective && directives.rawModelDirective) {\n const parts = directives.rawModelDirective.split(\"/\");\n if (parts.length === 2) {\n updated.model = {\n provider: parts[0],\n model: parts[1],\n authProfile: directives.rawModelProfile,\n };\n } else {\n updated.model = {\n model: directives.rawModelDirective,\n authProfile: directives.rawModelProfile,\n };\n }\n }\n\n if (persist) {\n setDirectiveState(roomId, updated);\n }\n\n return updated;\n}\n\n/**\n * Format directive state for display\n */\nexport function formatDirectiveState(state: DirectiveState): string {\n const lines: string[] = [];\n lines.push(`Thinking: ${state.thinking}`);\n lines.push(`Verbose: ${state.verbose}`);\n lines.push(`Reasoning: ${state.reasoning}`);\n lines.push(`Elevated: ${state.elevated}`);\n if (state.model.provider || state.model.model) {\n const modelStr = state.model.provider\n ? `${state.model.provider}/${state.model.model}`\n : state.model.model;\n lines.push(\n `Model: ${modelStr}${state.model.authProfile ? ` @${state.model.authProfile}` : \"\"}`,\n );\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Format acknowledgment for directive-only messages\n */\nexport function formatDirectiveAcknowledgment(\n directives: ParsedDirectives,\n): string {\n const changes: string[] = [];\n\n if (directives.hasThinkDirective) {\n changes.push(`Thinking: ${directives.thinkLevel ?? \"status\"}`);\n }\n if (directives.hasVerboseDirective) {\n changes.push(`Verbose: ${directives.verboseLevel ?? \"status\"}`);\n }\n if (directives.hasReasoningDirective) {\n changes.push(`Reasoning: ${directives.reasoningLevel ?? \"status\"}`);\n }\n if (directives.hasElevatedDirective) {\n changes.push(`Elevated: ${directives.elevatedLevel ?? \"status\"}`);\n }\n if (directives.hasModelDirective) {\n changes.push(`Model: ${directives.rawModelDirective ?? \"status\"}`);\n }\n\n return changes.length > 0 ? `✓ ${changes.join(\", \")}` : \"No changes applied\";\n}\n\n// ============================================================================\n// Provider\n// ============================================================================\n\n/**\n * Provider that exposes current directive state to the agent\n */\nexport const directiveStateProvider: Provider = {\n name: \"DIRECTIVE_STATE\",\n description: \"Current directive levels (thinking, verbose, model, etc.)\",\n\n async get(runtime, message, _state): Promise<ProviderResult> {\n const roomId = message.roomId;\n const directives = getDirectiveState(roomId);\n\n return {\n text: formatDirectiveState(directives),\n values: {\n thinkingLevel: directives.thinking,\n verboseLevel: directives.verbose,\n reasoningLevel: directives.reasoning,\n elevatedLevel: directives.elevated,\n modelProvider: directives.model.provider ?? \"\",\n modelName: directives.model.model ?? \"\",\n isElevated: directives.elevated !== \"off\",\n },\n data: { directives },\n };\n },\n};\n\n// ============================================================================\n// Plugin Export\n// ============================================================================\n\n/**\n * Plugin Directives\n *\n * Provides inline directive parsing for Eliza agents, allowing users to\n * control thinking levels, verbosity, model selection, and more through\n * inline commands in their messages.\n */\nexport const directivesPlugin: Plugin = {\n name: \"directives\",\n description:\n \"Inline directive parsing (@think, @model, @verbose, etc.) for controlling agent behavior\",\n\n providers: [directiveStateProvider],\n\n config: {\n DEFAULT_THINKING: \"low\",\n DEFAULT_VERBOSE: \"off\",\n ALLOW_ELEVATED: \"true\",\n ALLOW_EXEC: \"false\",\n },\n\n tests: [\n {\n name: \"directive-parsing\",\n tests: [\n {\n name: \"Parse think directive\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\"/think:high hello world\");\n if (!result.hasThinkDirective) {\n throw new Error(\"Should detect think directive\");\n }\n if (result.thinkLevel !== \"high\") {\n throw new Error(`Expected 'high', got '${result.thinkLevel}'`);\n }\n if (result.cleanedText !== \"hello world\") {\n throw new Error(\n `Expected 'hello world', got '${result.cleanedText}'`,\n );\n }\n logger.success(\"Think directive parsed correctly\");\n },\n },\n {\n name: \"Parse verbose directive\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\"/v on test message\");\n if (!result.hasVerboseDirective) {\n throw new Error(\"Should detect verbose directive\");\n }\n if (result.verboseLevel !== \"on\") {\n throw new Error(`Expected 'on', got '${result.verboseLevel}'`);\n }\n logger.success(\"Verbose directive parsed correctly\");\n },\n },\n {\n name: \"Parse model directive\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\n \"/model anthropic/claude-3-opus what is 2+2\",\n );\n if (!result.hasModelDirective) {\n throw new Error(\"Should detect model directive\");\n }\n if (result.rawModelDirective !== \"anthropic/claude-3-opus\") {\n throw new Error(\n `Expected 'anthropic/claude-3-opus', got '${result.rawModelDirective}'`,\n );\n }\n logger.success(\"Model directive parsed correctly\");\n },\n },\n {\n name: \"Detect directive-only message\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\"/think:high /verbose on\");\n if (!result.directivesOnly) {\n throw new Error(\"Should detect directive-only message\");\n }\n logger.success(\"Directive-only detection works correctly\");\n },\n },\n {\n name: \"Parse multiple directives\",\n fn: async (_runtime: IAgentRuntime) => {\n const result = parseDirectives(\n \"/think:medium /v full /elevated on hello\",\n );\n if (\n !result.hasThinkDirective ||\n !result.hasVerboseDirective ||\n !result.hasElevatedDirective\n ) {\n throw new Error(\"Should detect all directives\");\n }\n if (result.thinkLevel !== \"medium\") {\n throw new Error(`Expected 'medium', got '${result.thinkLevel}'`);\n }\n if (result.verboseLevel !== \"full\") {\n throw new Error(`Expected 'full', got '${result.verboseLevel}'`);\n }\n if (result.elevatedLevel !== \"on\") {\n throw new Error(`Expected 'on', got '${result.elevatedLevel}'`);\n }\n if (result.cleanedText !== \"hello\") {\n throw new Error(`Expected 'hello', got '${result.cleanedText}'`);\n }\n logger.success(\"Multiple directives parsed correctly\");\n },\n },\n {\n name: \"Session state management\",\n fn: async (_runtime: IAgentRuntime) => {\n const roomId = \"test-room-123\";\n clearDirectiveState(roomId);\n\n const directives = parseDirectives(\"/think:high /verbose on\");\n applyDirectives(roomId, directives);\n\n const state = getDirectiveState(roomId);\n if (state.thinking !== \"high\") {\n throw new Error(\n `Expected thinking 'high', got '${state.thinking}'`,\n );\n }\n if (state.verbose !== \"on\") {\n throw new Error(`Expected verbose 'on', got '${state.verbose}'`);\n }\n\n clearDirectiveState(roomId);\n logger.success(\"Session state management works correctly\");\n },\n },\n ],\n },\n ],\n\n async init(_config, runtime) {\n logger.log(\"[plugin-directives] Initializing directive parser\");\n },\n};\n\nexport default directivesPlugin;\n",
|
|
6
|
-
"/**\n * Directive parsers for extracting inline directives from message text\n */\n\nimport type {\n DirectiveExtractResult,\n ElevatedLevel,\n ExecAsk,\n ExecHost,\n ExecSecurity,\n ReasoningLevel,\n ThinkLevel,\n VerboseLevel,\n} from \"./types\";\n\nconst escapeRegExp = (value: string) =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Match a level-based directive (e.g., /think:high)\n */\nfunction matchLevelDirective(\n body: string,\n names: string[],\n): { start: number; end: number; rawLevel?: string } | null {\n const namePattern = names.map(escapeRegExp).join(\"|\");\n const match = body.match(\n new RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)`, \"i\"),\n );\n if (!match || match.index === undefined) {\n return null;\n }\n const start = match.index;\n let end = match.index + match[0].length;\n let i = end;\n while (i < body.length && /\\s/.test(body[i])) {\n i += 1;\n }\n if (body[i] === \":\") {\n i += 1;\n while (i < body.length && /\\s/.test(body[i])) {\n i += 1;\n }\n }\n const argStart = i;\n while (i < body.length && /[A-Za-z0-9-]/.test(body[i])) {\n i += 1;\n }\n const rawLevel = i > argStart ? body.slice(argStart, i) : undefined;\n end = i;\n return { start, end, rawLevel };\n}\n\n/**\n * Extract a level-based directive from text\n */\nfunction extractLevelDirective<T>(\n body: string,\n names: string[],\n normalize: (raw?: string) => T | undefined,\n): DirectiveExtractResult<T> {\n const match = matchLevelDirective(body, names);\n if (!match) {\n return { cleaned: body.trim(), hasDirective: false };\n }\n const rawLevel = match.rawLevel;\n const level = normalize(rawLevel);\n const cleaned = body\n .slice(0, match.start)\n .concat(\" \")\n .concat(body.slice(match.end))\n .replace(/\\s+/g, \" \")\n .trim();\n return {\n cleaned,\n level,\n rawLevel,\n hasDirective: true,\n };\n}\n\n/**\n * Extract a simple directive (no value)\n */\nfunction extractSimpleDirective(\n body: string,\n names: string[],\n): { cleaned: string; hasDirective: boolean } {\n const namePattern = names.map(escapeRegExp).join(\"|\");\n const match = body.match(\n new RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)(?:\\\\s*:\\\\s*)?`, \"i\"),\n );\n const cleaned = match\n ? body.replace(match[0], \" \").replace(/\\s+/g, \" \").trim()\n : body.trim();\n return {\n cleaned,\n hasDirective: Boolean(match),\n };\n}\n\n// ============================================================================\n// Normalizers\n// ============================================================================\n\nexport function normalizeThinkLevel(\n raw?: string | null,\n): ThinkLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\"].includes(key)) return \"off\";\n if ([\"on\", \"enable\", \"enabled\"].includes(key)) return \"low\";\n if ([\"min\", \"minimal\"].includes(key)) return \"minimal\";\n if ([\"low\", \"thinkhard\", \"think-hard\", \"think_hard\"].includes(key))\n return \"low\";\n if (\n [\"mid\", \"med\", \"medium\", \"thinkharder\", \"think-harder\", \"harder\"].includes(\n key,\n )\n )\n return \"medium\";\n if (\n [\n \"high\",\n \"ultra\",\n \"ultrathink\",\n \"think-hard\",\n \"thinkhardest\",\n \"highest\",\n \"max\",\n ].includes(key)\n )\n return \"high\";\n if ([\"xhigh\", \"x-high\", \"x_high\"].includes(key)) return \"xhigh\";\n if ([\"think\"].includes(key)) return \"minimal\";\n return undefined;\n}\n\nexport function normalizeVerboseLevel(\n raw?: string | null,\n): VerboseLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n if ([\"full\", \"all\", \"everything\"].includes(key)) return \"full\";\n if ([\"on\", \"minimal\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n return undefined;\n}\n\nexport function normalizeReasoningLevel(\n raw?: string | null,\n): ReasoningLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if (\n [\n \"off\",\n \"false\",\n \"no\",\n \"0\",\n \"hide\",\n \"hidden\",\n \"disable\",\n \"disabled\",\n ].includes(key)\n )\n return \"off\";\n if (\n [\"on\", \"true\", \"yes\", \"1\", \"show\", \"visible\", \"enable\", \"enabled\"].includes(\n key,\n )\n )\n return \"on\";\n if ([\"stream\", \"streaming\", \"draft\", \"live\"].includes(key)) return \"stream\";\n return undefined;\n}\n\nexport function normalizeElevatedLevel(\n raw?: string | null,\n): ElevatedLevel | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n if ([\"full\", \"auto\", \"auto-approve\", \"autoapprove\"].includes(key))\n return \"full\";\n if ([\"ask\", \"prompt\", \"approval\", \"approve\"].includes(key)) return \"ask\";\n if ([\"on\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n return undefined;\n}\n\nexport function normalizeExecHost(raw?: string | null): ExecHost | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"sandbox\", \"sb\"].includes(key)) return \"sandbox\";\n if ([\"gateway\", \"gw\", \"local\"].includes(key)) return \"gateway\";\n if ([\"node\", \"remote\"].includes(key)) return \"node\";\n return undefined;\n}\n\nexport function normalizeExecSecurity(\n raw?: string | null,\n): ExecSecurity | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"deny\", \"none\", \"off\"].includes(key)) return \"deny\";\n if ([\"allowlist\", \"allow\", \"list\"].includes(key)) return \"allowlist\";\n if ([\"full\", \"all\", \"any\"].includes(key)) return \"full\";\n return undefined;\n}\n\nexport function normalizeExecAsk(raw?: string | null): ExecAsk | undefined {\n if (!raw) return undefined;\n const key = raw.toLowerCase();\n if ([\"off\", \"never\", \"no\"].includes(key)) return \"off\";\n if ([\"on-miss\", \"miss\", \"fallback\"].includes(key)) return \"on-miss\";\n if ([\"always\", \"on\", \"yes\"].includes(key)) return \"always\";\n return undefined;\n}\n\n// ============================================================================\n// Directive Extractors\n// ============================================================================\n\nexport function extractThinkDirective(body?: string): {\n cleaned: string;\n thinkLevel?: ThinkLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"thinking\", \"think\", \"t\"],\n normalizeThinkLevel,\n );\n return {\n cleaned: extracted.cleaned,\n thinkLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractVerboseDirective(body?: string): {\n cleaned: string;\n verboseLevel?: VerboseLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"verbose\", \"v\"],\n normalizeVerboseLevel,\n );\n return {\n cleaned: extracted.cleaned,\n verboseLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractReasoningDirective(body?: string): {\n cleaned: string;\n reasoningLevel?: ReasoningLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"reasoning\", \"reason\"],\n normalizeReasoningLevel,\n );\n return {\n cleaned: extracted.cleaned,\n reasoningLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractElevatedDirective(body?: string): {\n cleaned: string;\n elevatedLevel?: ElevatedLevel;\n rawLevel?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n const extracted = extractLevelDirective(\n body,\n [\"elevated\", \"elev\"],\n normalizeElevatedLevel,\n );\n return {\n cleaned: extracted.cleaned,\n elevatedLevel: extracted.level,\n rawLevel: extracted.rawLevel,\n hasDirective: extracted.hasDirective,\n };\n}\n\nexport function extractStatusDirective(body?: string): {\n cleaned: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n return extractSimpleDirective(body, [\"status\"]);\n}\n\nexport function extractModelDirective(\n body: string,\n options?: { aliases?: string[] },\n): {\n cleaned: string;\n rawModel?: string;\n rawProfile?: string;\n hasDirective: boolean;\n} {\n if (!body) return { cleaned: \"\", hasDirective: false };\n\n // Match /model:provider/model@profile or /model provider/model@profile\n const modelMatch = body.match(\n /(?:^|\\s)\\/model(?:\\s*:\\s*|\\s+)([a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9._-]+)?(?:@[a-zA-Z0-9_-]+)?)/i,\n );\n\n if (modelMatch) {\n const fullMatch = modelMatch[1];\n const atIndex = fullMatch.indexOf(\"@\");\n const rawModel = atIndex >= 0 ? fullMatch.slice(0, atIndex) : fullMatch;\n const rawProfile = atIndex >= 0 ? fullMatch.slice(atIndex + 1) : undefined;\n const cleaned = body\n .replace(modelMatch[0], \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return { cleaned, rawModel, rawProfile, hasDirective: true };\n }\n\n // Check for simple /model directive without value\n const simpleMatch = body.match(/(?:^|\\s)\\/model(?=$|\\s|:)/i);\n if (simpleMatch) {\n const cleaned = body\n .replace(simpleMatch[0], \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return { cleaned, hasDirective: true };\n }\n\n // Check for model aliases\n if (options?.aliases?.length) {\n for (const alias of options.aliases) {\n const aliasPattern = new RegExp(\n `(?:^|\\\\s)/${escapeRegExp(alias)}(?=$|\\\\s)`,\n \"i\",\n );\n const aliasMatch = body.match(aliasPattern);\n if (aliasMatch) {\n const cleaned = body\n .replace(aliasMatch[0], \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return { cleaned, rawModel: alias, hasDirective: true };\n }\n }\n }\n\n return { cleaned: body.trim(), hasDirective: false };\n}\n\nexport function extractExecDirective(body?: string): {\n cleaned: string;\n execHost?: ExecHost;\n execSecurity?: ExecSecurity;\n execAsk?: ExecAsk;\n execNode?: string;\n rawExecHost?: string;\n rawExecSecurity?: string;\n rawExecAsk?: string;\n rawExecNode?: string;\n hasExecOptions: boolean;\n invalidHost: boolean;\n invalidSecurity: boolean;\n invalidAsk: boolean;\n invalidNode: boolean;\n hasDirective: boolean;\n} {\n if (!body) {\n return {\n cleaned: \"\",\n hasExecOptions: false,\n invalidHost: false,\n invalidSecurity: false,\n invalidAsk: false,\n invalidNode: false,\n hasDirective: false,\n };\n }\n\n // Match /exec with optional key=value pairs\n const execMatch = body.match(/(?:^|\\s)\\/exec(?:\\s+([^\\/\\n]+))?(?=$|\\s|\\/)/i);\n if (!execMatch) {\n return {\n cleaned: body.trim(),\n hasExecOptions: false,\n invalidHost: false,\n invalidSecurity: false,\n invalidAsk: false,\n invalidNode: false,\n hasDirective: false,\n };\n }\n\n const args = execMatch[1]?.trim() ?? \"\";\n const cleaned = body.replace(execMatch[0], \" \").replace(/\\s+/g, \" \").trim();\n\n let rawExecHost: string | undefined;\n let rawExecSecurity: string | undefined;\n let rawExecAsk: string | undefined;\n let rawExecNode: string | undefined;\n\n // Parse key=value pairs\n const kvPattern = /(\\w+)\\s*=\\s*([^\\s]+)/g;\n let match;\n while ((match = kvPattern.exec(args)) !== null) {\n const key = match[1].toLowerCase();\n const value = match[2];\n if (key === \"host\") rawExecHost = value;\n else if (key === \"security\") rawExecSecurity = value;\n else if (key === \"ask\") rawExecAsk = value;\n else if (key === \"node\") rawExecNode = value;\n }\n\n const execHost = normalizeExecHost(rawExecHost);\n const execSecurity = normalizeExecSecurity(rawExecSecurity);\n const execAsk = normalizeExecAsk(rawExecAsk);\n\n return {\n cleaned,\n execHost,\n execSecurity,\n execAsk,\n execNode: rawExecNode,\n rawExecHost,\n rawExecSecurity,\n rawExecAsk,\n rawExecNode,\n hasExecOptions: Boolean(\n rawExecHost || rawExecSecurity || rawExecAsk || rawExecNode,\n ),\n invalidHost: Boolean(rawExecHost && !execHost),\n invalidSecurity: Boolean(rawExecSecurity && !execSecurity),\n invalidAsk: Boolean(rawExecAsk && !execAsk),\n invalidNode: false, // Node validation is context-dependent\n hasDirective: true,\n };\n}\n"
|
|
5
|
+
"/**\n * Plugin Directives - Inline directive parsing for Eliza agents\n *\n * Parses and applies inline directives from message text:\n * - /think or /t - Thinking level control\n * - /verbose or /v - Verbose output control\n * - /reasoning - Reasoning visibility\n * - /elevated - Elevated permissions\n * - /exec - Execution environment settings\n * - /model - Model selection\n * - /status - Status request\n */\n\nimport {\n\ttype IAgentRuntime,\n\tlogger,\n\ttype Plugin,\n\ttype Provider,\n\ttype ProviderResult,\n} from \"@elizaos/core\";\n\nimport {\n\textractElevatedDirective,\n\textractExecDirective,\n\textractModelDirective,\n\textractReasoningDirective,\n\textractStatusDirective,\n\textractThinkDirective,\n\textractVerboseDirective,\n} from \"./parsers\";\n\nimport type { DirectiveState, ParsedDirectives, ParseOptions } from \"./types\";\n\nexport * from \"./parsers\";\n// Re-export types\nexport * from \"./types\";\n\n// ============================================================================\n// Session State Management\n// ============================================================================\n\nconst sessionStates = new Map<string, DirectiveState>();\n\nfunction getDefaultState(): DirectiveState {\n\treturn {\n\t\tthinking: \"low\",\n\t\tverbose: \"off\",\n\t\treasoning: \"off\",\n\t\televated: \"off\",\n\t\texec: {},\n\t\tmodel: {},\n\t};\n}\n\n/**\n * Get directive state for a room\n */\nexport function getDirectiveState(roomId: string): DirectiveState {\n\treturn sessionStates.get(roomId) ?? getDefaultState();\n}\n\n/**\n * Set directive state for a room\n */\nexport function setDirectiveState(roomId: string, state: DirectiveState): void {\n\tsessionStates.set(roomId, state);\n}\n\n/**\n * Clear directive state for a room\n */\nexport function clearDirectiveState(roomId: string): void {\n\tsessionStates.delete(roomId);\n}\n\n// ============================================================================\n// Main Parse Function\n// ============================================================================\n\n/**\n * Parse all inline directives from message text\n */\nexport function parseDirectives(\n\tbody: string,\n\toptions?: ParseOptions,\n): ParsedDirectives {\n\tconst {\n\t\tcleaned: thinkCleaned,\n\t\tthinkLevel,\n\t\trawLevel: rawThinkLevel,\n\t\thasDirective: hasThinkDirective,\n\t} = extractThinkDirective(body);\n\n\tconst {\n\t\tcleaned: verboseCleaned,\n\t\tverboseLevel,\n\t\trawLevel: rawVerboseLevel,\n\t\thasDirective: hasVerboseDirective,\n\t} = extractVerboseDirective(thinkCleaned);\n\n\tconst {\n\t\tcleaned: reasoningCleaned,\n\t\treasoningLevel,\n\t\trawLevel: rawReasoningLevel,\n\t\thasDirective: hasReasoningDirective,\n\t} = extractReasoningDirective(verboseCleaned);\n\n\tconst {\n\t\tcleaned: elevatedCleaned,\n\t\televatedLevel,\n\t\trawLevel: rawElevatedLevel,\n\t\thasDirective: hasElevatedDirective,\n\t} = options?.disableElevated\n\t\t? {\n\t\t\t\tcleaned: reasoningCleaned,\n\t\t\t\televatedLevel: undefined,\n\t\t\t\trawLevel: undefined,\n\t\t\t\thasDirective: false,\n\t\t\t}\n\t\t: extractElevatedDirective(reasoningCleaned);\n\n\tconst {\n\t\tcleaned: execCleaned,\n\t\texecHost,\n\t\texecSecurity,\n\t\texecAsk,\n\t\texecNode,\n\t\trawExecHost,\n\t\trawExecSecurity,\n\t\trawExecAsk,\n\t\trawExecNode,\n\t\thasExecOptions,\n\t\tinvalidHost: invalidExecHost,\n\t\tinvalidSecurity: invalidExecSecurity,\n\t\tinvalidAsk: invalidExecAsk,\n\t\tinvalidNode: invalidExecNode,\n\t\thasDirective: hasExecDirective,\n\t} = extractExecDirective(elevatedCleaned);\n\n\tconst allowStatusDirective = options?.allowStatusDirective !== false;\n\tconst { cleaned: statusCleaned, hasDirective: hasStatusDirective } =\n\t\tallowStatusDirective\n\t\t\t? extractStatusDirective(execCleaned)\n\t\t\t: { cleaned: execCleaned, hasDirective: false };\n\n\tconst {\n\t\tcleaned: modelCleaned,\n\t\trawModel,\n\t\trawProfile,\n\t\thasDirective: hasModelDirective,\n\t} = extractModelDirective(statusCleaned, {\n\t\taliases: options?.modelAliases,\n\t});\n\n\t// Determine if message contains only directives\n\tconst hasAnyDirective =\n\t\thasThinkDirective ||\n\t\thasVerboseDirective ||\n\t\thasReasoningDirective ||\n\t\thasElevatedDirective ||\n\t\thasExecDirective ||\n\t\thasModelDirective;\n\tconst directivesOnly = hasAnyDirective && modelCleaned.trim().length === 0;\n\n\treturn {\n\t\tcleanedText: modelCleaned,\n\t\tdirectivesOnly,\n\t\thasThinkDirective,\n\t\tthinkLevel,\n\t\trawThinkLevel,\n\t\thasVerboseDirective,\n\t\tverboseLevel,\n\t\trawVerboseLevel,\n\t\thasReasoningDirective,\n\t\treasoningLevel,\n\t\trawReasoningLevel,\n\t\thasElevatedDirective,\n\t\televatedLevel,\n\t\trawElevatedLevel,\n\t\thasExecDirective,\n\t\texecHost,\n\t\texecSecurity,\n\t\texecAsk,\n\t\texecNode,\n\t\trawExecHost,\n\t\trawExecSecurity,\n\t\trawExecAsk,\n\t\trawExecNode,\n\t\thasExecOptions,\n\t\tinvalidExecHost,\n\t\tinvalidExecSecurity,\n\t\tinvalidExecAsk,\n\t\tinvalidExecNode,\n\t\thasStatusDirective,\n\t\thasModelDirective,\n\t\trawModelDirective: rawModel,\n\t\trawModelProfile: rawProfile,\n\t};\n}\n\n/**\n * Apply parsed directives to session state\n */\nexport function applyDirectives(\n\troomId: string,\n\tdirectives: ParsedDirectives,\n\tpersist = true,\n): DirectiveState {\n\tconst current = getDirectiveState(roomId);\n\tconst updated = { ...current };\n\n\tif (directives.hasThinkDirective && directives.thinkLevel) {\n\t\tupdated.thinking = directives.thinkLevel;\n\t}\n\tif (directives.hasVerboseDirective && directives.verboseLevel) {\n\t\tupdated.verbose = directives.verboseLevel;\n\t}\n\tif (directives.hasReasoningDirective && directives.reasoningLevel) {\n\t\tupdated.reasoning = directives.reasoningLevel;\n\t}\n\tif (directives.hasElevatedDirective && directives.elevatedLevel) {\n\t\tupdated.elevated = directives.elevatedLevel;\n\t}\n\tif (directives.hasExecDirective) {\n\t\tupdated.exec = {\n\t\t\t...updated.exec,\n\t\t\t...(directives.execHost && { host: directives.execHost }),\n\t\t\t...(directives.execSecurity && { security: directives.execSecurity }),\n\t\t\t...(directives.execAsk && { ask: directives.execAsk }),\n\t\t\t...(directives.execNode && { node: directives.execNode }),\n\t\t};\n\t}\n\tif (directives.hasModelDirective && directives.rawModelDirective) {\n\t\tconst parts = directives.rawModelDirective.split(\"/\");\n\t\tif (parts.length === 2) {\n\t\t\tupdated.model = {\n\t\t\t\tprovider: parts[0],\n\t\t\t\tmodel: parts[1],\n\t\t\t\tauthProfile: directives.rawModelProfile,\n\t\t\t};\n\t\t} else {\n\t\t\tupdated.model = {\n\t\t\t\tmodel: directives.rawModelDirective,\n\t\t\t\tauthProfile: directives.rawModelProfile,\n\t\t\t};\n\t\t}\n\t}\n\n\tif (persist) {\n\t\tsetDirectiveState(roomId, updated);\n\t}\n\n\treturn updated;\n}\n\n/**\n * Format directive state for display\n */\nexport function formatDirectiveState(state: DirectiveState): string {\n\tconst lines: string[] = [];\n\tlines.push(`Thinking: ${state.thinking}`);\n\tlines.push(`Verbose: ${state.verbose}`);\n\tlines.push(`Reasoning: ${state.reasoning}`);\n\tlines.push(`Elevated: ${state.elevated}`);\n\tif (state.model.provider || state.model.model) {\n\t\tconst modelStr = state.model.provider\n\t\t\t? `${state.model.provider}/${state.model.model}`\n\t\t\t: state.model.model;\n\t\tlines.push(\n\t\t\t`Model: ${modelStr}${state.model.authProfile ? ` @${state.model.authProfile}` : \"\"}`,\n\t\t);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Format acknowledgment for directive-only messages\n */\nexport function formatDirectiveAcknowledgment(\n\tdirectives: ParsedDirectives,\n): string {\n\tconst changes: string[] = [];\n\n\tif (directives.hasThinkDirective) {\n\t\tchanges.push(`Thinking: ${directives.thinkLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasVerboseDirective) {\n\t\tchanges.push(`Verbose: ${directives.verboseLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasReasoningDirective) {\n\t\tchanges.push(`Reasoning: ${directives.reasoningLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasElevatedDirective) {\n\t\tchanges.push(`Elevated: ${directives.elevatedLevel ?? \"status\"}`);\n\t}\n\tif (directives.hasModelDirective) {\n\t\tchanges.push(`Model: ${directives.rawModelDirective ?? \"status\"}`);\n\t}\n\n\treturn changes.length > 0 ? `✓ ${changes.join(\", \")}` : \"No changes applied\";\n}\n\n// ============================================================================\n// Provider\n// ============================================================================\n\n/**\n * Provider that exposes current directive state to the agent\n */\nexport const directiveStateProvider: Provider = {\n\tname: \"DIRECTIVE_STATE\",\n\tdescription: \"Current directive levels (thinking, verbose, model, etc.)\",\n\tdynamic: true,\n\tasync get(_runtime, message, _state): Promise<ProviderResult> {\n\t\tconst roomId = message.roomId;\n\t\tconst directives = getDirectiveState(roomId);\n\n\t\treturn {\n\t\t\ttext: formatDirectiveState(directives),\n\t\t\tvalues: {\n\t\t\t\tthinkingLevel: directives.thinking,\n\t\t\t\tverboseLevel: directives.verbose,\n\t\t\t\treasoningLevel: directives.reasoning,\n\t\t\t\televatedLevel: directives.elevated,\n\t\t\t\tmodelProvider: directives.model.provider ?? \"\",\n\t\t\t\tmodelName: directives.model.model ?? \"\",\n\t\t\t\tisElevated: directives.elevated !== \"off\",\n\t\t\t},\n\t\t\tdata: { directives },\n\t\t};\n\t},\n};\n\n// ============================================================================\n// Plugin Export\n// ============================================================================\n\n/**\n * Plugin Directives\n *\n * Provides inline directive parsing for Eliza agents, allowing users to\n * control thinking levels, verbosity, model selection, and more through\n * inline commands in their messages.\n */\nexport const directivesPlugin: Plugin = {\n\tname: \"directives\",\n\tdescription:\n\t\t\"Inline directive parsing (@think, @model, @verbose, etc.) for controlling agent behavior\",\n\n\tproviders: [directiveStateProvider],\n\n\tconfig: {\n\t\tDEFAULT_THINKING: \"low\",\n\t\tDEFAULT_VERBOSE: \"off\",\n\t\tALLOW_ELEVATED: \"true\",\n\t\tALLOW_EXEC: \"false\",\n\t},\n\n\ttests: [\n\t\t{\n\t\t\tname: \"directive-parsing\",\n\t\t\ttests: [\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse think directive\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\"/think:high hello world\");\n\t\t\t\t\t\tif (!result.hasThinkDirective) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect think directive\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.thinkLevel !== \"high\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'high', got '${result.thinkLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.cleanedText !== \"hello world\") {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Expected 'hello world', got '${result.cleanedText}'`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Think directive parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse verbose directive\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\"/v on test message\");\n\t\t\t\t\t\tif (!result.hasVerboseDirective) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect verbose directive\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.verboseLevel !== \"on\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'on', got '${result.verboseLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Verbose directive parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse model directive\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\n\t\t\t\t\t\t\t\"/model anthropic/claude-3-opus what is 2+2\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!result.hasModelDirective) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect model directive\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.rawModelDirective !== \"anthropic/claude-3-opus\") {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Expected 'anthropic/claude-3-opus', got '${result.rawModelDirective}'`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Model directive parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Detect directive-only message\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\"/think:high /verbose on\");\n\t\t\t\t\t\tif (!result.directivesOnly) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect directive-only message\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Directive-only detection works correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Parse multiple directives\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst result = parseDirectives(\n\t\t\t\t\t\t\t\"/think:medium /v full /elevated on hello\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!result.hasThinkDirective ||\n\t\t\t\t\t\t\t!result.hasVerboseDirective ||\n\t\t\t\t\t\t\t!result.hasElevatedDirective\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error(\"Should detect all directives\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.thinkLevel !== \"medium\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'medium', got '${result.thinkLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.verboseLevel !== \"full\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'full', got '${result.verboseLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.elevatedLevel !== \"on\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'on', got '${result.elevatedLevel}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.cleanedText !== \"hello\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected 'hello', got '${result.cleanedText}'`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.success(\"Multiple directives parsed correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Session state management\",\n\t\t\t\t\tfn: async (_runtime: IAgentRuntime) => {\n\t\t\t\t\t\tconst roomId = \"test-room-123\";\n\t\t\t\t\t\tclearDirectiveState(roomId);\n\n\t\t\t\t\t\tconst directives = parseDirectives(\"/think:high /verbose on\");\n\t\t\t\t\t\tapplyDirectives(roomId, directives);\n\n\t\t\t\t\t\tconst state = getDirectiveState(roomId);\n\t\t\t\t\t\tif (state.thinking !== \"high\") {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Expected thinking 'high', got '${state.thinking}'`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state.verbose !== \"on\") {\n\t\t\t\t\t\t\tthrow new Error(`Expected verbose 'on', got '${state.verbose}'`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tclearDirectiveState(roomId);\n\t\t\t\t\t\tlogger.success(\"Session state management works correctly\");\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n\n\tasync init(_config, _runtime) {\n\t\tlogger.log(\"[plugin-directives] Initializing directive parser\");\n\t},\n};\n\nexport default directivesPlugin;\n",
|
|
6
|
+
"/**\n * Directive parsers for extracting inline directives from message text\n */\n\nimport type {\n\tDirectiveExtractResult,\n\tElevatedLevel,\n\tExecAsk,\n\tExecHost,\n\tExecSecurity,\n\tReasoningLevel,\n\tThinkLevel,\n\tVerboseLevel,\n} from \"./types\";\n\nconst escapeRegExp = (value: string) =>\n\tvalue.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Match a level-based directive (e.g., /think:high)\n */\nfunction matchLevelDirective(\n\tbody: string,\n\tnames: string[],\n): { start: number; end: number; rawLevel?: string } | null {\n\tconst namePattern = names.map(escapeRegExp).join(\"|\");\n\tconst match = body.match(\n\t\tnew RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)`, \"i\"),\n\t);\n\tif (!match || match.index === undefined) {\n\t\treturn null;\n\t}\n\tconst start = match.index;\n\tlet end = match.index + match[0].length;\n\tlet i = end;\n\twhile (i < body.length && /\\s/.test(body[i])) {\n\t\ti += 1;\n\t}\n\tif (body[i] === \":\") {\n\t\ti += 1;\n\t\twhile (i < body.length && /\\s/.test(body[i])) {\n\t\t\ti += 1;\n\t\t}\n\t}\n\tconst argStart = i;\n\twhile (i < body.length && /[A-Za-z0-9-]/.test(body[i])) {\n\t\ti += 1;\n\t}\n\tconst rawLevel = i > argStart ? body.slice(argStart, i) : undefined;\n\tend = i;\n\treturn { start, end, rawLevel };\n}\n\n/**\n * Extract a level-based directive from text\n */\nfunction extractLevelDirective<T>(\n\tbody: string,\n\tnames: string[],\n\tnormalize: (raw?: string) => T | undefined,\n): DirectiveExtractResult<T> {\n\tconst match = matchLevelDirective(body, names);\n\tif (!match) {\n\t\treturn { cleaned: body.trim(), hasDirective: false };\n\t}\n\tconst rawLevel = match.rawLevel;\n\tconst level = normalize(rawLevel);\n\tconst cleaned = body\n\t\t.slice(0, match.start)\n\t\t.concat(\" \")\n\t\t.concat(body.slice(match.end))\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n\treturn {\n\t\tcleaned,\n\t\tlevel,\n\t\trawLevel,\n\t\thasDirective: true,\n\t};\n}\n\n/**\n * Extract a simple directive (no value)\n */\nfunction extractSimpleDirective(\n\tbody: string,\n\tnames: string[],\n): { cleaned: string; hasDirective: boolean } {\n\tconst namePattern = names.map(escapeRegExp).join(\"|\");\n\tconst match = body.match(\n\t\tnew RegExp(`(?:^|\\\\s)\\\\/(?:${namePattern})(?=$|\\\\s|:)(?:\\\\s*:\\\\s*)?`, \"i\"),\n\t);\n\tconst cleaned = match\n\t\t? body.replace(match[0], \" \").replace(/\\s+/g, \" \").trim()\n\t\t: body.trim();\n\treturn {\n\t\tcleaned,\n\t\thasDirective: Boolean(match),\n\t};\n}\n\n// ============================================================================\n// Normalizers\n// ============================================================================\n\nexport function normalizeThinkLevel(\n\traw?: string | null,\n): ThinkLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\"].includes(key)) return \"off\";\n\tif ([\"on\", \"enable\", \"enabled\"].includes(key)) return \"low\";\n\tif ([\"min\", \"minimal\"].includes(key)) return \"minimal\";\n\tif ([\"low\", \"thinkhard\", \"think-hard\", \"think_hard\"].includes(key))\n\t\treturn \"low\";\n\tif (\n\t\t[\"mid\", \"med\", \"medium\", \"thinkharder\", \"think-harder\", \"harder\"].includes(\n\t\t\tkey,\n\t\t)\n\t)\n\t\treturn \"medium\";\n\tif (\n\t\t[\n\t\t\t\"high\",\n\t\t\t\"ultra\",\n\t\t\t\"ultrathink\",\n\t\t\t\"think-hard\",\n\t\t\t\"thinkhardest\",\n\t\t\t\"highest\",\n\t\t\t\"max\",\n\t\t].includes(key)\n\t)\n\t\treturn \"high\";\n\tif ([\"xhigh\", \"x-high\", \"x_high\"].includes(key)) return \"xhigh\";\n\tif ([\"think\"].includes(key)) return \"minimal\";\n\treturn undefined;\n}\n\nexport function normalizeVerboseLevel(\n\traw?: string | null,\n): VerboseLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n\tif ([\"full\", \"all\", \"everything\"].includes(key)) return \"full\";\n\tif ([\"on\", \"minimal\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n\treturn undefined;\n}\n\nexport function normalizeReasoningLevel(\n\traw?: string | null,\n): ReasoningLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif (\n\t\t[\n\t\t\t\"off\",\n\t\t\t\"false\",\n\t\t\t\"no\",\n\t\t\t\"0\",\n\t\t\t\"hide\",\n\t\t\t\"hidden\",\n\t\t\t\"disable\",\n\t\t\t\"disabled\",\n\t\t].includes(key)\n\t)\n\t\treturn \"off\";\n\tif (\n\t\t[\"on\", \"true\", \"yes\", \"1\", \"show\", \"visible\", \"enable\", \"enabled\"].includes(\n\t\t\tkey,\n\t\t)\n\t)\n\t\treturn \"on\";\n\tif ([\"stream\", \"streaming\", \"draft\", \"live\"].includes(key)) return \"stream\";\n\treturn undefined;\n}\n\nexport function normalizeElevatedLevel(\n\traw?: string | null,\n): ElevatedLevel | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\", \"false\", \"no\", \"0\"].includes(key)) return \"off\";\n\tif ([\"full\", \"auto\", \"auto-approve\", \"autoapprove\"].includes(key))\n\t\treturn \"full\";\n\tif ([\"ask\", \"prompt\", \"approval\", \"approve\"].includes(key)) return \"ask\";\n\tif ([\"on\", \"true\", \"yes\", \"1\"].includes(key)) return \"on\";\n\treturn undefined;\n}\n\nexport function normalizeExecHost(raw?: string | null): ExecHost | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"sandbox\", \"sb\"].includes(key)) return \"sandbox\";\n\tif ([\"gateway\", \"gw\", \"local\"].includes(key)) return \"gateway\";\n\tif ([\"node\", \"remote\"].includes(key)) return \"node\";\n\treturn undefined;\n}\n\nexport function normalizeExecSecurity(\n\traw?: string | null,\n): ExecSecurity | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"deny\", \"none\", \"off\"].includes(key)) return \"deny\";\n\tif ([\"allowlist\", \"allow\", \"list\"].includes(key)) return \"allowlist\";\n\tif ([\"full\", \"all\", \"any\"].includes(key)) return \"full\";\n\treturn undefined;\n}\n\nexport function normalizeExecAsk(raw?: string | null): ExecAsk | undefined {\n\tif (!raw) return undefined;\n\tconst key = raw.toLowerCase();\n\tif ([\"off\", \"never\", \"no\"].includes(key)) return \"off\";\n\tif ([\"on-miss\", \"miss\", \"fallback\"].includes(key)) return \"on-miss\";\n\tif ([\"always\", \"on\", \"yes\"].includes(key)) return \"always\";\n\treturn undefined;\n}\n\n// ============================================================================\n// Directive Extractors\n// ============================================================================\n\nexport function extractThinkDirective(body?: string): {\n\tcleaned: string;\n\tthinkLevel?: ThinkLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"thinking\", \"think\", \"t\"],\n\t\tnormalizeThinkLevel,\n\t);\n\tconst cleaned =\n\t\textracted.hasDirective && !extracted.level && extracted.rawLevel\n\t\t\t? `${extracted.rawLevel} ${extracted.cleaned}`.trim()\n\t\t\t: extracted.cleaned;\n\treturn {\n\t\tcleaned,\n\t\tthinkLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractVerboseDirective(body?: string): {\n\tcleaned: string;\n\tverboseLevel?: VerboseLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"verbose\", \"v\"],\n\t\tnormalizeVerboseLevel,\n\t);\n\treturn {\n\t\tcleaned: extracted.cleaned,\n\t\tverboseLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractReasoningDirective(body?: string): {\n\tcleaned: string;\n\treasoningLevel?: ReasoningLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"reasoning\", \"reason\"],\n\t\tnormalizeReasoningLevel,\n\t);\n\treturn {\n\t\tcleaned: extracted.cleaned,\n\t\treasoningLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractElevatedDirective(body?: string): {\n\tcleaned: string;\n\televatedLevel?: ElevatedLevel;\n\trawLevel?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\tconst extracted = extractLevelDirective(\n\t\tbody,\n\t\t[\"elevated\", \"elev\"],\n\t\tnormalizeElevatedLevel,\n\t);\n\treturn {\n\t\tcleaned: extracted.cleaned,\n\t\televatedLevel: extracted.level,\n\t\trawLevel: extracted.rawLevel,\n\t\thasDirective: extracted.hasDirective,\n\t};\n}\n\nexport function extractStatusDirective(body?: string): {\n\tcleaned: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\treturn extractSimpleDirective(body, [\"status\"]);\n}\n\nexport function extractModelDirective(\n\tbody: string,\n\toptions?: { aliases?: string[] },\n): {\n\tcleaned: string;\n\trawModel?: string;\n\trawProfile?: string;\n\thasDirective: boolean;\n} {\n\tif (!body) return { cleaned: \"\", hasDirective: false };\n\n\t// Match /model:provider/model@profile or /model provider/model@profile\n\tconst modelMatch = body.match(\n\t\t/(?:^|\\s)\\/model(?:\\s*:\\s*|\\s+)([a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9._-]+)?(?:@[a-zA-Z0-9_-]+)?)/i,\n\t);\n\n\tif (modelMatch) {\n\t\tconst fullMatch = modelMatch[1];\n\t\tconst atIndex = fullMatch.indexOf(\"@\");\n\t\tconst rawModel = atIndex >= 0 ? fullMatch.slice(0, atIndex) : fullMatch;\n\t\tconst rawProfile = atIndex >= 0 ? fullMatch.slice(atIndex + 1) : undefined;\n\t\tconst cleaned = body\n\t\t\t.replace(modelMatch[0], \" \")\n\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t.trim();\n\t\treturn { cleaned, rawModel, rawProfile, hasDirective: true };\n\t}\n\n\t// Check for simple /model directive without value\n\tconst simpleMatch = body.match(/(?:^|\\s)\\/model(?=$|\\s|:)/i);\n\tif (simpleMatch) {\n\t\tconst cleaned = body\n\t\t\t.replace(simpleMatch[0], \" \")\n\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t.trim();\n\t\treturn { cleaned, hasDirective: true };\n\t}\n\n\t// Check for model aliases\n\tif (options?.aliases?.length) {\n\t\tfor (const alias of options.aliases) {\n\t\t\tconst aliasPattern = new RegExp(\n\t\t\t\t`(?:^|\\\\s)/${escapeRegExp(alias)}(?=$|\\\\s)`,\n\t\t\t\t\"i\",\n\t\t\t);\n\t\t\tconst aliasMatch = body.match(aliasPattern);\n\t\t\tif (aliasMatch) {\n\t\t\t\tconst cleaned = body\n\t\t\t\t\t.replace(aliasMatch[0], \" \")\n\t\t\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t\t\t.trim();\n\t\t\t\treturn { cleaned, rawModel: alias, hasDirective: true };\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { cleaned: body.trim(), hasDirective: false };\n}\n\nexport function extractExecDirective(body?: string): {\n\tcleaned: string;\n\texecHost?: ExecHost;\n\texecSecurity?: ExecSecurity;\n\texecAsk?: ExecAsk;\n\texecNode?: string;\n\trawExecHost?: string;\n\trawExecSecurity?: string;\n\trawExecAsk?: string;\n\trawExecNode?: string;\n\thasExecOptions: boolean;\n\tinvalidHost: boolean;\n\tinvalidSecurity: boolean;\n\tinvalidAsk: boolean;\n\tinvalidNode: boolean;\n\thasDirective: boolean;\n} {\n\tif (!body) {\n\t\treturn {\n\t\t\tcleaned: \"\",\n\t\t\thasExecOptions: false,\n\t\t\tinvalidHost: false,\n\t\t\tinvalidSecurity: false,\n\t\t\tinvalidAsk: false,\n\t\t\tinvalidNode: false,\n\t\t\thasDirective: false,\n\t\t};\n\t}\n\n\t// Match /exec with optional key=value pairs\n\tconst execMatch = body.match(/(?:^|\\s)\\/exec(?:\\s+([^/\\n]+))?(?=$|\\s|\\/)/i);\n\tif (!execMatch) {\n\t\treturn {\n\t\t\tcleaned: body.trim(),\n\t\t\thasExecOptions: false,\n\t\t\tinvalidHost: false,\n\t\t\tinvalidSecurity: false,\n\t\t\tinvalidAsk: false,\n\t\t\tinvalidNode: false,\n\t\t\thasDirective: false,\n\t\t};\n\t}\n\n\tconst args = execMatch[1]?.trim() ?? \"\";\n\tconst cleaned = body.replace(execMatch[0], \" \").replace(/\\s+/g, \" \").trim();\n\n\tlet rawExecHost: string | undefined;\n\tlet rawExecSecurity: string | undefined;\n\tlet rawExecAsk: string | undefined;\n\tlet rawExecNode: string | undefined;\n\n\t// Parse key=value pairs\n\tconst kvPattern = /(\\w+)\\s*=\\s*([^\\s]+)/g;\n\tfor (const match of args.matchAll(kvPattern)) {\n\t\tconst key = match[1].toLowerCase();\n\t\tconst value = match[2];\n\t\tif (key === \"host\") rawExecHost = value;\n\t\telse if (key === \"security\") rawExecSecurity = value;\n\t\telse if (key === \"ask\") rawExecAsk = value;\n\t\telse if (key === \"node\") rawExecNode = value;\n\t}\n\n\tconst execHost = normalizeExecHost(rawExecHost);\n\tconst execSecurity = normalizeExecSecurity(rawExecSecurity);\n\tconst execAsk = normalizeExecAsk(rawExecAsk);\n\n\treturn {\n\t\tcleaned,\n\t\texecHost,\n\t\texecSecurity,\n\t\texecAsk,\n\t\texecNode: rawExecNode,\n\t\trawExecHost,\n\t\trawExecSecurity,\n\t\trawExecAsk,\n\t\trawExecNode,\n\t\thasExecOptions: Boolean(\n\t\t\trawExecHost || rawExecSecurity || rawExecAsk || rawExecNode,\n\t\t),\n\t\tinvalidHost: Boolean(rawExecHost && !execHost),\n\t\tinvalidSecurity: Boolean(rawExecSecurity && !execSecurity),\n\t\tinvalidAsk: Boolean(rawExecAsk && !execAsk),\n\t\tinvalidNode: false, // Node validation is context-dependent\n\t\thasDirective: true,\n\t};\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";AAaA;AAAA;AAAA;;;ACEA,IAAM,eAAe,CAAC,UACpB,MAAM,QAAQ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-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
2
|
+
"name": "@elizaos/plugin-directives",
|
|
3
|
+
"version": "2.0.0-alpha.6",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/cjs/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"description": "Inline directive parsing for Eliza agents (@think, @model, @verbose, etc.)",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/elizaos/eliza.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/cjs/index.cjs",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@elizaos/core": "2.0.0-alpha.3"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/bun": "^1.2.22",
|
|
31
|
+
"@types/node": "^24.5.2",
|
|
32
|
+
"typescript": "^5.9.2",
|
|
33
|
+
"@biomejs/biome": "^2.3.11"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "bun run build.ts",
|
|
37
|
+
"dev": "bun --hot build.ts",
|
|
38
|
+
"test": "npx -y vitest@4.0.18 run --passWithNoTests",
|
|
39
|
+
"clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
|
|
40
|
+
"format": "bunx @biomejs/biome@2.4.2 format --write .",
|
|
41
|
+
"format:check": "bunx @biomejs/biome@2.4.2 format .",
|
|
42
|
+
"lint": "bunx @biomejs/biome@2.4.2 check --write --unsafe .",
|
|
43
|
+
"lint:check": "bunx @biomejs/biome@2.4.2 check .",
|
|
44
|
+
"typecheck": "tsc --noEmit"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"agentConfig": {
|
|
50
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
51
|
+
"pluginParameters": {
|
|
52
|
+
"DEFAULT_THINKING": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Default thinking level (off, minimal, low, medium, high)",
|
|
55
|
+
"required": false,
|
|
56
|
+
"default": "low",
|
|
57
|
+
"sensitive": false
|
|
58
|
+
},
|
|
59
|
+
"DEFAULT_VERBOSE": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Default verbose level (off, on, full)",
|
|
62
|
+
"required": false,
|
|
63
|
+
"default": "off",
|
|
64
|
+
"sensitive": false
|
|
65
|
+
},
|
|
66
|
+
"ALLOW_ELEVATED": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "Allow elevated permission directives",
|
|
69
|
+
"required": false,
|
|
70
|
+
"default": "true",
|
|
71
|
+
"sensitive": false
|
|
72
|
+
},
|
|
73
|
+
"ALLOW_EXEC": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"description": "Allow exec directive for shell configuration",
|
|
76
|
+
"required": false,
|
|
77
|
+
"default": "false",
|
|
78
|
+
"sensitive": false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"milady": {
|
|
83
|
+
"platforms": [
|
|
84
|
+
"node"
|
|
85
|
+
],
|
|
86
|
+
"runtime": "node",
|
|
87
|
+
"platformDetails": {
|
|
88
|
+
"node": "Default export (Node.js)"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
91
|
}
|