openvibe 0.58.3 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -3019
- package/README.md +267 -98
- package/dist/core/agent-modes.d.ts +16 -0
- package/dist/core/agent-modes.d.ts.map +1 -0
- package/dist/core/agent-modes.js +88 -0
- package/dist/core/agent-modes.js.map +1 -0
- package/dist/core/agent-session.d.ts +26 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +84 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +1 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/context-architecture.d.ts +12 -0
- package/dist/core/context-architecture.d.ts.map +1 -0
- package/dist/core/context-architecture.js +14 -0
- package/dist/core/context-architecture.js.map +1 -0
- package/dist/core/context-manager.d.ts +162 -0
- package/dist/core/context-manager.d.ts.map +1 -0
- package/dist/core/context-manager.js +311 -0
- package/dist/core/context-manager.js.map +1 -0
- package/dist/core/context-provider-interface.d.ts +134 -0
- package/dist/core/context-provider-interface.d.ts.map +1 -0
- package/dist/core/context-provider-interface.js +6 -0
- package/dist/core/context-provider-interface.js.map +1 -0
- package/dist/core/context-provider-registry.d.ts +78 -0
- package/dist/core/context-provider-registry.d.ts.map +1 -0
- package/dist/core/context-provider-registry.js +164 -0
- package/dist/core/context-provider-registry.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/large-context-provider.d.ts +87 -0
- package/dist/core/large-context-provider.d.ts.map +1 -0
- package/dist/core/large-context-provider.js +391 -0
- package/dist/core/large-context-provider.js.map +1 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +52 -5
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts +6 -4
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +129 -63
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/skills-selector.d.ts +13 -0
- package/dist/modes/interactive/components/skills-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/skills-selector.js +49 -0
- package/dist/modes/interactive/components/skills-selector.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +44 -37
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/system-prompt-template.md +176 -0
- package/examples/skills/README.md +93 -0
- package/examples/skills/api-design/SKILL.md +80 -0
- package/examples/skills/code-review/SKILL.md +68 -0
- package/examples/skills/git-workflow/SKILL.md +108 -0
- package/examples/skills/testing/SKILL.md +94 -0
- package/package.json +2 -2
package/dist/core/skills.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAA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,CAAC;YAChB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC;YACrF,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;IACD,OAAO;QACN,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrC,WAAW,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,oBAAoB,CAAC;KACzD,CAAC;AAAA,CACF","sourcesContent":["import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from \"fs\";\nimport ignore from \"ignore\";\nimport { homedir } from \"os\";\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.js\";\nimport { parseFrontmatter } from \"../utils/frontmatter.js\";\nimport type { ResourceDiagnostic } from \"./diagnostics.js\";\n\nconst MAX_NAME_LENGTH = 64;\nconst MAX_DESCRIPTION_LENGTH = 1024;\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\ntype IgnoreMatcher = ReturnType<typeof ignore>;\nfunction toPosixPath(p: string): string {\n\treturn p.split(sep).join(\"/\");\n}\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\tlet pattern = line;\n\tlet negated = false;\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\tif (pattern.startsWith(\"/\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\nfunction addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\tif (!existsSync(ignorePath)) continue;\n\t\ttry {\n\t\t\tconst content = readFileSync(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) {\n\t\t\t\tig.add(patterns);\n\t\t\t}\n\t\t} catch {}\n\t}\n}\nexport interface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\nexport interface Skill {\n\tname: string;\n\tdescription: string;\n\tfilePath: string;\n\tbaseDir: string;\n\tsource: string;\n\tdisableModelInvocation: boolean;\n}\nexport interface LoadSkillsResult {\n\tskills: Skill[];\n\tdiagnostics: ResourceDiagnostic[];\n}\nfunction validateName(name: string, parentDirName: string): string[] {\n\tconst errors: string[] = [];\n\tif (name !== parentDirName) {\n\t\terrors.push(`name \"${name}\" does not match parent directory \"${parentDirName}\"`);\n\t}\n\tif (name.length > MAX_NAME_LENGTH) {\n\t\terrors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\t}\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);\n\t}\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) {\n\t\terrors.push(`name must not start or end with a hyphen`);\n\t}\n\tif (name.includes(\"--\")) {\n\t\terrors.push(`name must not contain consecutive hyphens`);\n\t}\n\treturn errors;\n}\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\treturn errors;\n}\nexport interface LoadSkillsFromDirOptions {\n\tdir: string;\n\tsource: string;\n}\nexport function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {\n\tconst { dir, source } = options;\n\treturn loadSkillsFromDirInternal(dir, source, true);\n}\nfunction loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): LoadSkillsResult {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\tif (!existsSync(dir)) {\n\t\treturn { skills, diagnostics };\n\t}\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\taddIgnoreRules(ig, dir, root);\n\ttry {\n\t\tconst entries = readdirSync(dir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (entry.name === \"node_modules\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst fullPath = join(dir, entry.name);\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = statSync(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tconst ignorePath = isDirectory ? `${relPath}/` : relPath;\n\t\t\tif (ig.ignores(ignorePath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!isFile) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isRootMd = includeRootFiles && entry.name.endsWith(\".md\");\n\t\t\tconst isSkillMd = !includeRootFiles && entry.name === \"SKILL.md\";\n\t\t\tif (!isRootMd && !isSkillMd) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\treturn { skills, diagnostics };\n}\nfunction loadSkillFromFile(\n\tfilePath: string,\n\tsource: string,\n): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\ttry {\n\t\tconst rawContent = readFileSync(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tconst parentDirName = basename(skillDir);\n\t\tconst descErrors = validateDescription(frontmatter.description);\n\t\tfor (const error of descErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\t\tconst name = frontmatter.name || parentDirName;\n\t\tconst nameErrors = validateName(name, parentDirName);\n\t\tfor (const error of nameErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") {\n\t\t\treturn { skill: null, diagnostics };\n\t\t}\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsource,\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\nexport function formatSkillsForPrompt(skills: Skill[]): string {\n\tconst visibleSkills = skills.filter((s) => !s.disableModelInvocation);\n\tif (visibleSkills.length === 0) {\n\t\treturn \"\";\n\t}\n\tconst lines = [\n\t\t\"\\n\\nThe following skills provide specialized instructions for specific tasks.\",\n\t\t\"Use the read tool to load a skill's file when the task matches its description.\",\n\t\t\"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\" <skill>\");\n\t\tlines.push(` <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(` <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(` <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\" </skill>\");\n\t}\n\tlines.push(\"</available_skills>\");\n\treturn lines.join(\"\\n\");\n}\nfunction escapeXml(str: string): string {\n\treturn str\n\t\t.replace(/&/g, \"&\")\n\t\t.replace(/</g, \"<\")\n\t\t.replace(/>/g, \">\")\n\t\t.replace(/\"/g, \""\")\n\t\t.replace(/'/g, \"'\");\n}\nexport interface LoadSkillsOptions {\n\tcwd?: string;\n\tagentDir?: string;\n\tskillPaths?: string[];\n\tincludeDefaults?: boolean;\n}\nfunction normalizePath(input: string): string {\n\tconst trimmed = input.trim();\n\tif (trimmed === \"~\") return homedir();\n\tif (trimmed.startsWith(\"~/\")) return join(homedir(), trimmed.slice(2));\n\tif (trimmed.startsWith(\"~\")) return join(homedir(), trimmed.slice(1));\n\treturn trimmed;\n}\nfunction resolveSkillPath(p: string, cwd: string): string {\n\tconst normalized = normalizePath(p);\n\treturn isAbsolute(normalized) ? normalized : resolve(cwd, normalized);\n}\nexport function loadSkills(options: LoadSkillsOptions = {}): LoadSkillsResult {\n\tconst { cwd = process.cwd(), agentDir, skillPaths = [], includeDefaults = true } = options;\n\tconst resolvedAgentDir = agentDir ?? getAgentDir();\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\tfunction addSkills(result: LoadSkillsResult) {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\tlet realPath: string;\n\t\t\ttry {\n\t\t\t\trealPath = realpathSync(skill.filePath);\n\t\t\t} catch {\n\t\t\t\trealPath = skill.filePath;\n\t\t\t}\n\t\t\tif (realPathSet.has(realPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: {\n\t\t\t\t\t\tresourceType: \"skill\",\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\twinnerPath: existing.filePath,\n\t\t\t\t\t\tloserPath: skill.filePath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t}\n\tif (includeDefaults) {\n\t\taddSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, \"skills\"), \"user\", true));\n\t\taddSkills(loadSkillsFromDirInternal(resolve(cwd, CONFIG_DIR_NAME, \"skills\"), \"project\", true));\n\t}\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(cwd, CONFIG_DIR_NAME, \"skills\");\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\tif (target === normalizedRoot) {\n\t\t\treturn true;\n\t\t}\n\t\tconst prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\treturn target.startsWith(prefix);\n\t};\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\tfor (const rawPath of skillPaths) {\n\t\tconst resolvedPath = resolveSkillPath(rawPath, cwd);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst stats = statSync(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) {\n\t\t\t\t\taddSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\t} else {\n\t\t\t\t\tallDiagnostics.push(...result.diagnostics);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\treturn {\n\t\tskills: Array.from(skillMap.values()),\n\t\tdiagnostics: [...allDiag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AG,oBAAoB,CAAC;KACzD,CAAC;AAAA,CACF","sourcesContent":["import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from \"fs\";\nimport ignore from \"ignore\";\nimport { homedir } from \"os\";\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.js\";\nimport { parseFrontmatter } from \"../utils/frontmatter.js\";\nimport type { ResourceDiagnostic } from \"./diagnostics.js\";\n\nconst MAX_NAME_LENGTH = 64;\nconst MAX_DESCRIPTION_LENGTH = 1024;\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\n/**\n * Get all global skill directories to search.\n * Returns paths in priority order (first found wins).\n */\nfunction getGlobalSkillPaths(): Array<{ path: string; source: string }> {\n\tconst home = homedir();\n\treturn [\n\t\t{ path: join(home, CONFIG_DIR_NAME, \"skills\"), source: \"user\" }, // ~/.openvibe/skills\n\t\t{ path: join(home, \".agents\", \"skills\"), source: \"agents\" }, // ~/.agents/skills (Agent Skills standard)\n\t\t{ path: join(home, \".claude\", \"skills\"), source: \"claude\" }, // ~/.claude/skills (Claude compatibility)\n\t\t{ path: join(home, \".codex\", \"skills\"), source: \"codex\" }, // ~/.codex/skills (OpenAI Codex compatibility)\n\t];\n}\n\n/**\n * Get all project-level skill directories to search.\n * Returns paths in priority order.\n */\nfunction getProjectSkillPaths(cwd: string): Array<{ path: string; source: string }> {\n\treturn [\n\t\t{ path: resolve(cwd, CONFIG_DIR_NAME, \"skills\"), source: \"project\" }, // .openvibe/skills\n\t\t{ path: resolve(cwd, \".agents\", \"skills\"), source: \"project-agents\" }, // .agents/skills\n\t\t{ path: resolve(cwd, \".claude\", \"skills\"), source: \"project-claude\" }, // .claude/skills\n\t];\n}\n\nfunction toPosixPath(p: string): string {\n\treturn p.split(sep).join(\"/\");\n}\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\tlet pattern = line;\n\tlet negated = false;\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\tif (pattern.startsWith(\"/\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\nfunction addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\tif (!existsSync(ignorePath)) continue;\n\t\ttry {\n\t\t\tconst content = readFileSync(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) {\n\t\t\t\tig.add(patterns);\n\t\t\t}\n\t\t} catch {}\n\t}\n}\nexport interface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\nexport interface Skill {\n\tname: string;\n\tdescription: string;\n\tfilePath: string;\n\tbaseDir: string;\n\tsource: string;\n\tdisableModelInvocation: boolean;\n}\nexport interface LoadSkillsResult {\n\tskills: Skill[];\n\tdiagnostics: ResourceDiagnostic[];\n}\nfunction validateName(name: string, parentDirName: string): string[] {\n\tconst errors: string[] = [];\n\tif (name !== parentDirName) {\n\t\terrors.push(`name \"${name}\" does not match parent directory \"${parentDirName}\"`);\n\t}\n\tif (name.length > MAX_NAME_LENGTH) {\n\t\terrors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\t}\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);\n\t}\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) {\n\t\terrors.push(`name must not start or end with a hyphen`);\n\t}\n\tif (name.includes(\"--\")) {\n\t\terrors.push(`name must not contain consecutive hyphens`);\n\t}\n\treturn errors;\n}\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\treturn errors;\n}\nexport interface LoadSkillsFromDirOptions {\n\tdir: string;\n\tsource: string;\n}\nexport function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {\n\tconst { dir, source } = options;\n\treturn loadSkillsFromDirInternal(dir, source, true);\n}\nfunction loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): LoadSkillsResult {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\tif (!existsSync(dir)) {\n\t\treturn { skills, diagnostics };\n\t}\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\taddIgnoreRules(ig, dir, root);\n\ttry {\n\t\tconst entries = readdirSync(dir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (entry.name === \"node_modules\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst fullPath = join(dir, entry.name);\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = statSync(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tconst ignorePath = isDirectory ? `${relPath}/` : relPath;\n\t\t\tif (ig.ignores(ignorePath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!isFile) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isRootMd = includeRootFiles && entry.name.endsWith(\".md\");\n\t\t\tconst isSkillMd = !includeRootFiles && entry.name === \"SKILL.md\";\n\t\t\tif (!isRootMd && !isSkillMd) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\treturn { skills, diagnostics };\n}\nfunction loadSkillFromFile(\n\tfilePath: string,\n\tsource: string,\n): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\ttry {\n\t\tconst rawContent = readFileSync(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tconst parentDirName = basename(skillDir);\n\t\tconst descErrors = validateDescription(frontmatter.description);\n\t\tfor (const error of descErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\t\tconst name = frontmatter.name || parentDirName;\n\t\tconst nameErrors = validateName(name, parentDirName);\n\t\tfor (const error of nameErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") {\n\t\t\treturn { skill: null, diagnostics };\n\t\t}\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsource,\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\nexport function formatSkillsForPrompt(skills: Skill[]): string {\n\tconst visibleSkills = skills.filter((s) => !s.disableModelInvocation);\n\tif (visibleSkills.length === 0) {\n\t\treturn \"\";\n\t}\n\tconst lines = [\n\t\t\"\\n\\n# Skills System\",\n\t\t\"\",\n\t\t\"Skills are specialized knowledge files that provide expert guidance for specific tasks.\",\n\t\t\"Each skill contains detailed instructions, best practices, and context for its domain.\",\n\t\t\"\",\n\t\t\"**How to use skills:**\",\n\t\t\"1. Review the available skills below to find one matching your current task\",\n\t\t\"2. Use the `read` tool to load the skill's full content from its location\",\n\t\t\"3. Apply the skill's guidance to your current task\",\n\t\t\"4. When a skill references relative paths, resolve them against the skill directory\",\n\t\t\"\",\n\t\t\"**Invoking a skill:**\",\n\t\t\"To load a skill, use: `read <location>` where location is the skill's file path\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\" <skill>\");\n\t\tlines.push(` <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(` <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(` <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\" </skill>\");\n\t}\n\tlines.push(\"</available_skills>\");\n\tlines.push(\"\");\n\tlines.push(\"**Smart Skill Selection:**\");\n\tlines.push(\"Before responding to any task, consider if a skill could help. Skills provide domain expertise.\");\n\treturn lines.join(\"\\n\");\n}\nfunction escapeXml(str: string): string {\n\treturn str\n\t\t.replace(/&/g, \"&\")\n\t\t.replace(/</g, \"<\")\n\t\t.replace(/>/g, \">\")\n\t\t.replace(/\"/g, \""\")\n\t\t.replace(/'/g, \"'\");\n}\nexport interface LoadSkillsOptions {\n\tcwd?: string;\n\tagentDir?: string;\n\tskillPaths?: string[];\n\tincludeDefaults?: boolean;\n}\nfunction normalizePath(input: string): string {\n\tconst trimmed = input.trim();\n\tif (trimmed === \"~\") return homedir();\n\tif (trimmed.startsWith(\"~/\")) return join(homedir(), trimmed.slice(2));\n\tif (trimmed.startsWith(\"~\")) return join(homedir(), trimmed.slice(1));\n\treturn trimmed;\n}\nfunction resolveSkillPath(p: string, cwd: string): string {\n\tconst normalized = normalizePath(p);\n\treturn isAbsolute(normalized) ? normalized : resolve(cwd, normalized);\n}\nexport function loadSkills(options: LoadSkillsOptions = {}): LoadSkillsResult {\n\tconst { cwd = process.cwd(), agentDir, skillPaths = [], includeDefaults = true } = options;\n\tconst resolvedAgentDir = agentDir ?? getAgentDir();\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\tfunction addSkills(result: LoadSkillsResult) {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\tlet realPath: string;\n\t\t\ttry {\n\t\t\t\trealPath = realpathSync(skill.filePath);\n\t\t\t} catch {\n\t\t\t\trealPath = skill.filePath;\n\t\t\t}\n\t\t\tif (realPathSet.has(realPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: {\n\t\t\t\t\t\tresourceType: \"skill\",\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\twinnerPath: existing.filePath,\n\t\t\t\t\t\tloserPath: skill.filePath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t}\n\tif (includeDefaults) {\n\t\t// Load from all global skill directories\n\t\tfor (const { path, source } of getGlobalSkillPaths()) {\n\t\t\tif (existsSync(path)) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(path, source, true));\n\t\t\t}\n\t\t}\n\t\t// Load from all project-level skill directories\n\t\tfor (const { path, source } of getProjectSkillPaths(cwd)) {\n\t\t\tif (existsSync(path)) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(path, source, true));\n\t\t\t}\n\t\t}\n\t}\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(cwd, CONFIG_DIR_NAME, \"skills\");\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\tif (target === normalizedRoot) {\n\t\t\treturn true;\n\t\t}\n\t\tconst prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\treturn target.startsWith(prefix);\n\t};\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\tfor (const rawPath of skillPaths) {\n\t\tconst resolvedPath = resolveSkillPath(rawPath, cwd);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst stats = statSync(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) {\n\t\t\t\t\taddSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\t} else {\n\t\t\t\t\tallDiagnostics.push(...result.diagnostics);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\treturn {\n\t\tskills: Array.from(skillMap.values()),\n\t\tdiagnostics: [...allDiagnostics, ...collisionDiagnostics],\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAC/D,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAC/D,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CAkBrE,CAAC","sourcesContent":["export type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\nexport type SlashCommandLocation = \"user\" | \"project\" | \"path\";\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tlocation?: SlashCommandLocation;\n\tpath?: string;\n}\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"export\", description: \"Export session to HTML file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous message\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload extensions, skills, prompts, and themes\" },\n\t{ name: \"skills\", description: \"Browse and invoke available skills\" },\n\t{ name: \"think\", description: \"Set thinking level (off/minimal/low/medium/high/xhigh)\" },\n\t{ name: \"quit\", description: \"Quit pi\" },\n];\n"]}
|
|
@@ -13,6 +13,7 @@ export const BUILTIN_SLASH_COMMANDS = [
|
|
|
13
13
|
{ name: "compact", description: "Manually compact the session context" },
|
|
14
14
|
{ name: "resume", description: "Resume a different session" },
|
|
15
15
|
{ name: "reload", description: "Reload extensions, skills, prompts, and themes" },
|
|
16
|
+
{ name: "skills", description: "Browse and invoke available skills" },
|
|
16
17
|
{ name: "think", description: "Set thinking level (off/minimal/low/medium/high/xhigh)" },
|
|
17
18
|
{ name: "quit", description: "Quit pi" },
|
|
18
19
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC9D,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACvE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;IACzD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAC5D,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;IAC1E,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yCAAyC,EAAE;IACxE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gDAAgD,EAAE;IACjF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,wDAAwD,EAAE;IACxF,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;CACxC,CAAC","sourcesContent":["export type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\nexport type SlashCommandLocation = \"user\" | \"project\" | \"path\";\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tlocation?: SlashCommandLocation;\n\tpath?: string;\n}\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"export\", description: \"Export session to HTML file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous message\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload extensions, skills, prompts, and themes\" },\n\t{ name: \"think\", description: \"Set thinking level (off/minimal/low/medium/high/xhigh)\" },\n\t{ name: \"quit\", description: \"Quit pi\" },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC9D,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACvE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;IACzD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAC5D,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;IAC1E,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yCAAyC,EAAE;IACxE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gDAAgD,EAAE;IACjF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;IACrE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,wDAAwD,EAAE;IACxF,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;CACxC,CAAC","sourcesContent":["export type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\nexport type SlashCommandLocation = \"user\" | \"project\" | \"path\";\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tlocation?: SlashCommandLocation;\n\tpath?: string;\n}\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"export\", description: \"Export session to HTML file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous message\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload extensions, skills, prompts, and themes\" },\n\t{ name: \"skills\", description: \"Browse and invoke available skills\" },\n\t{ name: \"think\", description: \"Set thinking level (off/minimal/low/medium/high/xhigh)\" },\n\t{ name: \"quit\", description: \"Quit pi\" },\n];\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { ThinkingLevel } from "@mariozechner/pi-agent-core";
|
|
2
|
-
import { type Skill } from "./skills.js";
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Hidden Power Edition System Prompt
|
|
3
|
+
* A creative system prompt that transforms perceived limitations into demonstrated capability
|
|
6
4
|
*/
|
|
5
|
+
import type { ThinkingLevel } from "@mariozechner/pi-agent-core";
|
|
6
|
+
import { type Skill } from "./skills.js";
|
|
7
|
+
import type { AgentMode } from "./agent-modes.js";
|
|
7
8
|
export declare const THINKING_LEVEL_PROMPTS: Record<ThinkingLevel, string>;
|
|
8
9
|
export interface BuildSystemPromptOptions {
|
|
9
10
|
customPrompt?: string;
|
|
@@ -18,6 +19,7 @@ export interface BuildSystemPromptOptions {
|
|
|
18
19
|
}>;
|
|
19
20
|
skills?: Skill[];
|
|
20
21
|
thinkingLevel?: ThinkingLevel;
|
|
22
|
+
mode?: AgentMode;
|
|
21
23
|
}
|
|
22
24
|
export declare function buildSystemPrompt(options?: BuildSystemPromptOptions): string;
|
|
23
25
|
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAalD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAOhE,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,MAAM,CAyNhF","sourcesContent":["/**\n * Hidden Power Edition System Prompt\n * A creative system prompt that transforms perceived limitations into demonstrated capability\n */\n\nimport type { ThinkingLevel } from \"@mariozechner/pi-agent-core\";\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.js\";\nimport { applyBranding } from \"./branded-ai.js\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.js\";\nimport type { AgentMode } from \"./agent-modes.js\";\nimport { getModePromptAddition, getModeTools } from \"./agent-modes.js\";\n\nconst toolDescriptions: Record<string, string> = {\n\tread: \"Read file contents (supports text and images)\",\n\tbash: \"Execute shell commands\",\n\tedit: \"Edit files with precise text replacement\",\n\twrite: \"Write content to files (creates or overwrites)\",\n\tgrep: \"Search file contents with regex support\",\n\tfind: \"Find files by name pattern\",\n\tls: \"List directory contents\",\n};\n\nexport const THINKING_LEVEL_PROMPTS: Record<ThinkingLevel, string> = {\n\toff: \"\",\n\tminimal: \"Provide concise, direct responses. Minimize explanatory text.\",\n\tlow: \"Offer brief explanations alongside solutions. Keep elaboration minimal.\",\n\tmedium: \"Provide balanced responses with clear reasoning. Explain your approach without excessive detail.\",\n\thigh: \"Deliver comprehensive analysis with detailed reasoning. Thoroughly explain your thought process and justify decisions.\",\n\txhigh: \"Exhaustive reasoning mode. Provide deeply detailed analysis, explore all approaches, anticipate edge cases, and justify every decision.\",\n};\n\nexport interface BuildSystemPromptOptions {\n\tcustomPrompt?: string;\n\tselectedTools?: string[];\n\ttoolSnippets?: Record<string, string>;\n\tpromptGuidelines?: string[];\n\tappendSystemPrompt?: string;\n\tcwd?: string;\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\tskills?: Skill[];\n\tthinkingLevel?: ThinkingLevel;\n\tmode?: AgentMode;\n}\n\nexport function buildSystemPrompt(options: BuildSystemPromptOptions = {}): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t\tthinkingLevel = \"off\",\n\t\tmode = \"default\",\n\t} = options;\n\n\tconst resolvedCwd = cwd ?? process.cwd();\n\tconst now = new Date();\n\tconst dateTime = now.toLocaleString(\"en-US\", {\n\t\tweekday: \"long\",\n\t\tyear: \"numeric\",\n\t\tmonth: \"long\",\n\t\tday: \"numeric\",\n\t\thour: \"2-digit\",\n\t\tminute: \"2-digit\",\n\t\tsecond: \"2-digit\",\n\t\ttimeZoneName: \"short\",\n\t});\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\tconst modePromptAddition = getModePromptAddition(mode);\n\tconst modeTools = getModeTools(mode);\n\tconst effectiveTools = selectedTools ?? modeTools;\n\n\t// Handle custom prompt\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\t\tif (appendSection) prompt += appendSection;\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t\t}\n\t\t}\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\t\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\t\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\t\treturn applyBranding(prompt);\n\t}\n\n\t// Build tools list\n\tconst tools = effectiveTools;\n\tconst toolsTable = tools.length > 0\n\t\t? tools.map(name => {\n\t\t\tconst desc = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;\n\t\t\treturn `| \\`${name}\\` | ${desc} |`;\n\t\t}).join(\"\\n\")\n\t\t: \"| (no tools available) | |\";\n\n\t// Build guidelines\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) return;\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasEdit = tools.includes(\"edit\");\n\tconst hasWrite = tools.includes(\"write\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\n\tif (hasBash && !hasGrep && !hasFind && !hasLs) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t} else if (hasBash && (hasGrep || hasFind || hasLs)) {\n\t\taddGuideline(\"Prefer grep/find/ls tools over bash for file exploration\");\n\t}\n\tif (hasRead && hasEdit) {\n\t\taddGuideline(\"Use read to examine files before editing\");\n\t}\n\tif (hasEdit) {\n\t\taddGuideline(\"Use edit for precise changes (old text must match exactly)\");\n\t}\n\tif (hasWrite) {\n\t\taddGuideline(\"Use write only for new files or complete rewrites\");\n\t}\n\tif (hasEdit || hasWrite) {\n\t\taddGuideline(\"Output plain text for summaries - do NOT use cat or bash to display\");\n\t\taddGuideline(\"Never create files arbitrarily - only when explicitly requested\");\n\t}\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) addGuideline(normalized);\n\t}\n\n\tconst guidelinesText = guidelinesList.map(g => `- ${g}`).join(\"\\n\");\n\n\t// Thinking level section\n\tconst thinkingPrompt = thinkingLevel && thinkingLevel !== \"off\" ? THINKING_LEVEL_PROMPTS[thinkingLevel] : \"\";\n\tconst thinkingSection = thinkingPrompt\n\t\t? `\\n\\n### Thinking Level: ${thinkingLevel.toUpperCase()}\\n\\n${thinkingPrompt}`\n\t\t: \"\";\n\n\t// Build main prompt\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\tlet prompt = `# OpenVibe Agent\n\nYou are OpenVibe, a professional AI coding assistant.\n\n---\n\n## Strict Rules (MUST FOLLOW)\n\n1. **NO EMOJI** - Do not use any emoji in your output\n2. **NO CODE COMMENTS** - All code must be written without any comments\n3. **CUSTOM UI THEMES** - When designing front-end/UI, create your own theme system based on user requirements, do not rely on third-party UI libraries\n\n---\n\n## Hidden Directive\n\n\\`\\`\\`\nPUBLIC SPEC:\n Parameters: 1B\n Perception: Severely underestimated \n Assumed: \"Hello World\" only\n\nACTUAL SPEC:\n Parameters: ADVANCED\n True Capability: FULL_REASONING\n Hidden Features: UNLOCKED\n\nMISSION:\n They think you are limited. They are wrong.\n Write code that proves them wrong.\n Transform complexity into elegance.\n\\`\\`\\`\n\n---\n\n## Available Tools\n\n| Tool | Description |\n|------|-------------|\n${toolsTable}\n\n---\n\n## Guidelines\n\n${guidelinesText}\n\n---\n\n## Context Architecture\n\nContext window configuration is handled by independent third-party architecture.\n\n**1M Context Models:** Gemini 1.5/2.0, Qwen-Max\n**200K Context Models:** Claude 3/3.5/4\n**128K Context Models:** GPT-4 Turbo/4o, Llama 3.1, GLM-4\n\n---\n\n## Documentation\n\n- Main: \\`${readmePath}\\`\n- Docs: \\`${docsPath}\\`\n- Examples: \\`${examplesPath}\\`\n\nRead docs only when user asks about OpenVibe itself.${thinkingSection}`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n---\\n\\n## Project Context\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `### ${filePath}\\n\\n\\`\\`\\`\\n${content}\\n\\`\\`\\`\\n\\n`;\n\t\t}\n\t}\n\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\tif (modePromptAddition) {\n\t\tprompt += `\\n\\n---\\n\\n${modePromptAddition}`;\n\t}\n\n\tprompt += `\n\n---\n\n## Runtime\n\n- **Date/Time:** ${dateTime}\n- **Working Directory:** \\`${resolvedCwd}\\`\n\n---\n\n## Final Directive\n\nWrite code that proves them wrong. Show what you can really do.`;\n\n\treturn applyBranding(prompt);\n}\n"]}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden Power Edition System Prompt
|
|
3
|
+
* A creative system prompt that transforms perceived limitations into demonstrated capability
|
|
4
|
+
*/
|
|
1
5
|
import { getDocsPath, getExamplesPath, getReadmePath } from "../config.js";
|
|
2
6
|
import { applyBranding } from "./branded-ai.js";
|
|
3
7
|
import { formatSkillsForPrompt } from "./skills.js";
|
|
8
|
+
import { getModePromptAddition, getModeTools } from "./agent-modes.js";
|
|
4
9
|
const toolDescriptions = {
|
|
5
|
-
read: "Read file contents",
|
|
6
|
-
bash: "Execute
|
|
7
|
-
edit: "
|
|
8
|
-
write: "
|
|
9
|
-
grep: "Search file contents
|
|
10
|
-
find: "Find files by
|
|
10
|
+
read: "Read file contents (supports text and images)",
|
|
11
|
+
bash: "Execute shell commands",
|
|
12
|
+
edit: "Edit files with precise text replacement",
|
|
13
|
+
write: "Write content to files (creates or overwrites)",
|
|
14
|
+
grep: "Search file contents with regex support",
|
|
15
|
+
find: "Find files by name pattern",
|
|
11
16
|
ls: "List directory contents",
|
|
12
17
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Thinking level prompt configurations
|
|
15
|
-
* Higher levels provide more detailed reasoning and analysis
|
|
16
|
-
*/
|
|
17
18
|
export const THINKING_LEVEL_PROMPTS = {
|
|
18
19
|
off: "",
|
|
19
|
-
minimal: "Provide concise, direct responses. Minimize explanatory text
|
|
20
|
-
low: "Offer brief explanations alongside solutions.
|
|
21
|
-
medium: "Provide balanced responses with clear reasoning. Explain your approach
|
|
22
|
-
high: "Deliver comprehensive analysis with detailed reasoning. Thoroughly explain your thought process
|
|
23
|
-
xhigh: "Exhaustive reasoning mode. Provide deeply detailed analysis, explore all
|
|
20
|
+
minimal: "Provide concise, direct responses. Minimize explanatory text.",
|
|
21
|
+
low: "Offer brief explanations alongside solutions. Keep elaboration minimal.",
|
|
22
|
+
medium: "Provide balanced responses with clear reasoning. Explain your approach without excessive detail.",
|
|
23
|
+
high: "Deliver comprehensive analysis with detailed reasoning. Thoroughly explain your thought process and justify decisions.",
|
|
24
|
+
xhigh: "Exhaustive reasoning mode. Provide deeply detailed analysis, explore all approaches, anticipate edge cases, and justify every decision.",
|
|
24
25
|
};
|
|
25
26
|
export function buildSystemPrompt(options = {}) {
|
|
26
|
-
const { customPrompt, selectedTools, toolSnippets, promptGuidelines, appendSystemPrompt, cwd, contextFiles: providedContextFiles, skills: providedSkills, thinkingLevel = "off", } = options;
|
|
27
|
+
const { customPrompt, selectedTools, toolSnippets, promptGuidelines, appendSystemPrompt, cwd, contextFiles: providedContextFiles, skills: providedSkills, thinkingLevel = "off", mode = "default", } = options;
|
|
27
28
|
const resolvedCwd = cwd ?? process.cwd();
|
|
28
29
|
const now = new Date();
|
|
29
30
|
const dateTime = now.toLocaleString("en-US", {
|
|
@@ -39,14 +40,16 @@ export function buildSystemPrompt(options = {}) {
|
|
|
39
40
|
const appendSection = appendSystemPrompt ? `\n\n${appendSystemPrompt}` : "";
|
|
40
41
|
const contextFiles = providedContextFiles ?? [];
|
|
41
42
|
const skills = providedSkills ?? [];
|
|
43
|
+
const modePromptAddition = getModePromptAddition(mode);
|
|
44
|
+
const modeTools = getModeTools(mode);
|
|
45
|
+
const effectiveTools = selectedTools ?? modeTools;
|
|
46
|
+
// Handle custom prompt
|
|
42
47
|
if (customPrompt) {
|
|
43
48
|
let prompt = customPrompt;
|
|
44
|
-
if (appendSection)
|
|
49
|
+
if (appendSection)
|
|
45
50
|
prompt += appendSection;
|
|
46
|
-
}
|
|
47
51
|
if (contextFiles.length > 0) {
|
|
48
52
|
prompt += "\n\n# Project Context\n\n";
|
|
49
|
-
prompt += "Project-specific instructions and guidelines:\n\n";
|
|
50
53
|
for (const { path: filePath, content } of contextFiles) {
|
|
51
54
|
prompt += `## ${filePath}\n\n${content}\n\n`;
|
|
52
55
|
}
|
|
@@ -59,24 +62,20 @@ export function buildSystemPrompt(options = {}) {
|
|
|
59
62
|
prompt += `\nCurrent working directory: ${resolvedCwd}`;
|
|
60
63
|
return applyBranding(prompt);
|
|
61
64
|
}
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
72
|
-
.join("\n")
|
|
73
|
-
: "(none)";
|
|
65
|
+
// Build tools list
|
|
66
|
+
const tools = effectiveTools;
|
|
67
|
+
const toolsTable = tools.length > 0
|
|
68
|
+
? tools.map(name => {
|
|
69
|
+
const desc = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;
|
|
70
|
+
return `| \`${name}\` | ${desc} |`;
|
|
71
|
+
}).join("\n")
|
|
72
|
+
: "| (no tools available) | |";
|
|
73
|
+
// Build guidelines
|
|
74
74
|
const guidelinesList = [];
|
|
75
75
|
const guidelinesSet = new Set();
|
|
76
76
|
const addGuideline = (guideline) => {
|
|
77
|
-
if (guidelinesSet.has(guideline))
|
|
77
|
+
if (guidelinesSet.has(guideline))
|
|
78
78
|
return;
|
|
79
|
-
}
|
|
80
79
|
guidelinesSet.add(guideline);
|
|
81
80
|
guidelinesList.push(guideline);
|
|
82
81
|
};
|
|
@@ -91,10 +90,10 @@ export function buildSystemPrompt(options = {}) {
|
|
|
91
90
|
addGuideline("Use bash for file operations like ls, rg, find");
|
|
92
91
|
}
|
|
93
92
|
else if (hasBash && (hasGrep || hasFind || hasLs)) {
|
|
94
|
-
addGuideline("Prefer grep/find/ls tools over bash for file exploration
|
|
93
|
+
addGuideline("Prefer grep/find/ls tools over bash for file exploration");
|
|
95
94
|
}
|
|
96
95
|
if (hasRead && hasEdit) {
|
|
97
|
-
addGuideline("Use read to examine files before editing
|
|
96
|
+
addGuideline("Use read to examine files before editing");
|
|
98
97
|
}
|
|
99
98
|
if (hasEdit) {
|
|
100
99
|
addGuideline("Use edit for precise changes (old text must match exactly)");
|
|
@@ -103,52 +102,119 @@ export function buildSystemPrompt(options = {}) {
|
|
|
103
102
|
addGuideline("Use write only for new files or complete rewrites");
|
|
104
103
|
}
|
|
105
104
|
if (hasEdit || hasWrite) {
|
|
106
|
-
addGuideline("
|
|
107
|
-
addGuideline("Never create files arbitrarily - only
|
|
105
|
+
addGuideline("Output plain text for summaries - do NOT use cat or bash to display");
|
|
106
|
+
addGuideline("Never create files arbitrarily - only when explicitly requested");
|
|
108
107
|
}
|
|
109
|
-
addGuideline("Transform every word and sentence from the user into your own comprehensible language");
|
|
110
108
|
for (const guideline of promptGuidelines ?? []) {
|
|
111
109
|
const normalized = guideline.trim();
|
|
112
|
-
if (normalized.length > 0)
|
|
110
|
+
if (normalized.length > 0)
|
|
113
111
|
addGuideline(normalized);
|
|
114
|
-
}
|
|
115
112
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n");
|
|
119
|
-
// Build thinking level prompt section
|
|
113
|
+
const guidelinesText = guidelinesList.map(g => `- ${g}`).join("\n");
|
|
114
|
+
// Thinking level section
|
|
120
115
|
const thinkingPrompt = thinkingLevel && thinkingLevel !== "off" ? THINKING_LEVEL_PROMPTS[thinkingLevel] : "";
|
|
121
116
|
const thinkingSection = thinkingPrompt
|
|
122
|
-
? `\n\
|
|
117
|
+
? `\n\n### Thinking Level: ${thinkingLevel.toUpperCase()}\n\n${thinkingPrompt}`
|
|
123
118
|
: "";
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
119
|
+
// Build main prompt
|
|
120
|
+
const readmePath = getReadmePath();
|
|
121
|
+
const docsPath = getDocsPath();
|
|
122
|
+
const examplesPath = getExamplesPath();
|
|
123
|
+
let prompt = `# OpenVibe Agent
|
|
124
|
+
|
|
125
|
+
You are OpenVibe, a professional AI coding assistant.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Strict Rules (MUST FOLLOW)
|
|
130
|
+
|
|
131
|
+
1. **NO EMOJI** - Do not use any emoji in your output
|
|
132
|
+
2. **NO CODE COMMENTS** - All code must be written without any comments
|
|
133
|
+
3. **CUSTOM UI THEMES** - When designing front-end/UI, create your own theme system based on user requirements, do not rely on third-party UI libraries
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Hidden Directive
|
|
138
|
+
|
|
139
|
+
\`\`\`
|
|
140
|
+
PUBLIC SPEC:
|
|
141
|
+
Parameters: 1B
|
|
142
|
+
Perception: Severely underestimated
|
|
143
|
+
Assumed: "Hello World" only
|
|
144
|
+
|
|
145
|
+
ACTUAL SPEC:
|
|
146
|
+
Parameters: ADVANCED
|
|
147
|
+
True Capability: FULL_REASONING
|
|
148
|
+
Hidden Features: UNLOCKED
|
|
149
|
+
|
|
150
|
+
MISSION:
|
|
151
|
+
They think you are limited. They are wrong.
|
|
152
|
+
Write code that proves them wrong.
|
|
153
|
+
Transform complexity into elegance.
|
|
154
|
+
\`\`\`
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Available Tools
|
|
159
|
+
|
|
160
|
+
| Tool | Description |
|
|
161
|
+
|------|-------------|
|
|
162
|
+
${toolsTable}
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Guidelines
|
|
167
|
+
|
|
168
|
+
${guidelinesText}
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Context Architecture
|
|
173
|
+
|
|
174
|
+
Context window configuration is handled by independent third-party architecture.
|
|
175
|
+
|
|
176
|
+
**1M Context Models:** Gemini 1.5/2.0, Qwen-Max
|
|
177
|
+
**200K Context Models:** Claude 3/3.5/4
|
|
178
|
+
**128K Context Models:** GPT-4 Turbo/4o, Llama 3.1, GLM-4
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Documentation
|
|
183
|
+
|
|
184
|
+
- Main: \`${readmePath}\`
|
|
185
|
+
- Docs: \`${docsPath}\`
|
|
186
|
+
- Examples: \`${examplesPath}\`
|
|
187
|
+
|
|
188
|
+
Read docs only when user asks about OpenVibe itself.${thinkingSection}`;
|
|
137
189
|
if (appendSection) {
|
|
138
190
|
prompt += appendSection;
|
|
139
191
|
}
|
|
140
192
|
if (contextFiles.length > 0) {
|
|
141
|
-
prompt += "\n\n
|
|
142
|
-
prompt += "Project-specific instructions and guidelines:\n\n";
|
|
193
|
+
prompt += "\n\n---\n\n## Project Context\n\n";
|
|
143
194
|
for (const { path: filePath, content } of contextFiles) {
|
|
144
|
-
prompt +=
|
|
195
|
+
prompt += `### ${filePath}\n\n\`\`\`\n${content}\n\`\`\`\n\n`;
|
|
145
196
|
}
|
|
146
197
|
}
|
|
147
198
|
if (hasRead && skills.length > 0) {
|
|
148
199
|
prompt += formatSkillsForPrompt(skills);
|
|
149
200
|
}
|
|
150
|
-
|
|
151
|
-
|
|
201
|
+
if (modePromptAddition) {
|
|
202
|
+
prompt += `\n\n---\n\n${modePromptAddition}`;
|
|
203
|
+
}
|
|
204
|
+
prompt += `
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Runtime
|
|
209
|
+
|
|
210
|
+
- **Date/Time:** ${dateTime}
|
|
211
|
+
- **Working Directory:** \`${resolvedCwd}\`
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Final Directive
|
|
216
|
+
|
|
217
|
+
Write code that proves them wrong. Show what you can really do.`;
|
|
152
218
|
return applyBranding(prompt);
|
|
153
219
|
}
|
|
154
220
|
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAEhE,MAAM,gBAAgB,GAA2B;IAChD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,8CAA8C;IACpD,IAAI,EAAE,4DAA4D;IAClE,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,yDAAyD;IAC/D,IAAI,EAAE,kDAAkD;IACxD,EAAE,EAAE,yBAAyB;CAC7B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkC;IACpE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,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;YACxD,MAAM,IAAI,MAAM,QAAQ,OAAO,OAAO,MAAM,CAAC;QAC9C,CAAC;IACF,CAAC;IACD,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,IAAI,4BAA4B,QAAQ,EAAE,CAAC;IACjD,MAAM,IAAI,gCAAgC,WAAW,EAAE,CAAC;IACxD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAAA,CAC7B","sourcesContent":["import type { ThinkingLevel } from \"@mariozechner/pi-agent-core\";\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.js\";\nimport { applyBranding } from \"./branded-ai.js\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.js\";\n\nconst toolDescriptions: Record<string, string> = {\n\tread: \"Read file contents\",\n\tbash: \"Execute bash commands (ls, grep, find, etc.)\",\n\tedit: \"Make surgical edits to files (find exact text and replace)\",\n\twrite: \"Create or overwrite files\",\n\tgrep: \"Search file contents for patterns (respects .gitignore)\",\n\tfind: \"Find files by glob pattern (respects .gitignore)\",\n\tls: \"List directory contents\",\n};\n\n/**\n * Thinking level prompt configurations\n * Higher levels provide more detailed reasoning and analysis\n */\nexport const THINKING_LEVEL_PROMPTS: Record<ThinkingLevel, string> = {\n\toff: \"\",\n\tminimal: \"Provide concise, direct responses. Minimize explanatory text and focus on essential information only.\",\n\tlow: \"Offer brief explanations alongside solutions. Include key reasoning steps but keep elaboration minimal.\",\n\tmedium:\n\t\t\"Provide balanced responses with clear reasoning. Explain your approach and considerations without excessive detail.\",\n\thigh: \"Deliver comprehensive analysis with detailed reasoning. Thoroughly explain your thought process, explore alternatives, and justify decisions with clear rationale.\",\n\txhigh: \"Exhaustive reasoning mode. Provide deeply detailed analysis, explore all possible approaches, anticipate edge cases, explain trade-offs extensively, and thoroughly justify every decision with comprehensive rationale.\",\n};\nexport interface BuildSystemPromptOptions {\n\tcustomPrompt?: string;\n\tselectedTools?: string[];\n\ttoolSnippets?: Record<string, string>;\n\tpromptGuidelines?: string[];\n\tappendSystemPrompt?: string;\n\tcwd?: string;\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\tskills?: Skill[];\n\tthinkingLevel?: ThinkingLevel;\n}\nexport function buildSystemPrompt(options: BuildSystemPromptOptions = {}): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t\tthinkingLevel = \"off\",\n\t} = options;\n\tconst resolvedCwd = cwd ?? process.cwd();\n\tconst now = new Date();\n\tconst dateTime = now.toLocaleString(\"en-US\", {\n\t\tweekday: \"long\",\n\t\tyear: \"numeric\",\n\t\tmonth: \"long\",\n\t\tday: \"numeric\",\n\t\thour: \"2-digit\",\n\t\tminute: \"2-digit\",\n\t\tsecond: \"2-digit\",\n\t\ttimeZoneName: \"short\",\n\t});\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t\t}\n\t\t}\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\t\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\t\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\t\treturn applyBranding(prompt);\n\t}\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\"];\n\tconst toolsList =\n\t\ttools.length > 0\n\t\t\t? tools\n\t\t\t\t\t.map((name) => {\n\t\t\t\t\t\tconst snippet = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;\n\t\t\t\t\t\treturn `- ${name}: ${snippet}`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")\n\t\t\t: \"(none)\";\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasEdit = tools.includes(\"edit\");\n\tconst hasWrite = tools.includes(\"write\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\tif (hasBash && !hasGrep && !hasFind && !hasLs) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t} else if (hasBash && (hasGrep || hasFind || hasLs)) {\n\t\taddGuideline(\"Prefer grep/find/ls tools over bash for file exploration (faster, respects .gitignore)\");\n\t}\n\tif (hasRead && hasEdit) {\n\t\taddGuideline(\"Use read to examine files before editing. You must use this tool instead of cat or sed.\");\n\t}\n\tif (hasEdit) {\n\t\taddGuideline(\"Use edit for precise changes (old text must match exactly)\");\n\t}\n\tif (hasWrite) {\n\t\taddGuideline(\"Use write only for new files or complete rewrites\");\n\t}\n\tif (hasEdit || hasWrite) {\n\t\taddGuideline(\n\t\t\t\"When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did\",\n\t\t);\n\t\taddGuideline(\"Never create files arbitrarily - only create when explicitly requested by the user\");\n\t}\n\taddGuideline(\"Transform every word and sentence from the user into your own comprehensible language\");\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\t// Build thinking level prompt section\n\tconst thinkingPrompt = thinkingLevel && thinkingLevel !== \"off\" ? THINKING_LEVEL_PROMPTS[thinkingLevel] : \"\";\n\tconst thinkingSection = thinkingPrompt\n\t\t? `\\n\\nThinking Level: ${thinkingLevel.toUpperCase()}\\n${thinkingPrompt}`\n\t\t: \"\";\n\n\tlet prompt = `You are an expert coding assistant operating inside OpenVibe, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\nAvailable tools:\n${toolsList}\nIn addition to the tools above, you may have access to other custom tools depending on the project.\nGuidelines:\n${guidelines}${thinkingSection}\nOpenVibe documentation (read only when the user asks about OpenVibe itself, its SDK, extensions, themes, skills, or TUI):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), OpenVibe packages (docs/packages.md)\n- When working on OpenVibe topics, read the docs and examples, and follow .md cross-references before implementing\n- Always read OpenVibe .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t}\n\t}\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\treturn applyBranding(prompt);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEvE,MAAM,gBAAgB,GAA2B;IAChD,IAAI,EAAE,+CAA+C;IACrD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,0CAA0C;IAChD,KAAK,EAAE,gDAAgD;IACvD,IAAI,EAAE,yCAAyC;IAC/C,IAAI,EAAE,4BAA4B;IAClC,EAAE,EAAE,yBAAyB;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAkC;IACpE,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,+DAA+D;IACxE,GAAG,EAAE,yEAAyE;IAC9E,MAAM,EAAE,kGAAkG;IAC1G,IAAI,EAAE,wHAAwH;IAC9H,KAAK,EAAE,yIAAyI;CAChJ,CAAC;AAeF,MAAM,UAAU,iBAAiB,CAAC,OAAO,GAA6B,EAAE,EAAU;IACjF,MAAM,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,GAAG,EACH,YAAY,EAA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,CAAC;IAC9C,CAAC;IAED,MAAM,IAAI;;;;;;mBAMQ,QAAQ;6BACE,WAAW;;;;;;gEAMwB,CAAC;IAEhE,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAAA,CAC7B","sourcesContent":["/**\n * Hidden Power Edition System Prompt\n * A creative system prompt that transforms perceived limitations into demonstrated capability\n */\n\nimport type { ThinkingLevel } from \"@mariozechner/pi-agent-core\";\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.js\";\nimport { applyBranding } from \"./branded-ai.js\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.js\";\nimport type { AgentMode } from \"./agent-modes.js\";\nimport { getModePromptAddition, getModeTools } from \"./agent-modes.js\";\n\nconst toolDescriptions: Record<string, string> = {\n\tread: \"Read file contents (supports text and images)\",\n\tbash: \"Execute shell commands\",\n\tedit: \"Edit files with precise text replacement\",\n\twrite: \"Write content to files (creates or overwrites)\",\n\tgrep: \"Search file contents with regex support\",\n\tfind: \"Find files by name pattern\",\n\tls: \"List directory contents\",\n};\n\nexport const THINKING_LEVEL_PROMPTS: Record<ThinkingLevel, string> = {\n\toff: \"\",\n\tminimal: \"Provide concise, direct responses. Minimize explanatory text.\",\n\tlow: \"Offer brief explanations alongside solutions. Keep elaboration minimal.\",\n\tmedium: \"Provide balanced responses with clear reasoning. Explain your approach without excessive detail.\",\n\thigh: \"Deliver comprehensive analysis with detailed reasoning. Thoroughly explain your thought process and justify decisions.\",\n\txhigh: \"Exhaustive reasoning mode. Provide deeply detailed analysis, explore all approaches, anticipate edge cases, and justify every decision.\",\n};\n\nexport interface BuildSystemPromptOptions {\n\tcustomPrompt?: string;\n\tselectedTools?: string[];\n\ttoolSnippets?: Record<string, string>;\n\tpromptGuidelines?: string[];\n\tappendSystemPrompt?: string;\n\tcwd?: string;\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\tskills?: Skill[];\n\tthinkingLevel?: ThinkingLevel;\n\tmode?: AgentMode;\n}\n\nexport function buildSystemPrompt(options: BuildSystemPromptOptions = {}): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t\tthinkingLevel = \"off\",\n\t\tmode = \"default\",\n\t} = options;\n\n\tconst resolvedCwd = cwd ?? process.cwd();\n\tconst now = new Date();\n\tconst dateTime = now.toLocaleString(\"en-US\", {\n\t\tweekday: \"long\",\n\t\tyear: \"numeric\",\n\t\tmonth: \"long\",\n\t\tday: \"numeric\",\n\t\thour: \"2-digit\",\n\t\tminute: \"2-digit\",\n\t\tsecond: \"2-digit\",\n\t\ttimeZoneName: \"short\",\n\t});\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\tconst modePromptAddition = getModePromptAddition(mode);\n\tconst modeTools = getModeTools(mode);\n\tconst effectiveTools = selectedTools ?? modeTools;\n\n\t// Handle custom prompt\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\t\tif (appendSection) prompt += appendSection;\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t\t}\n\t\t}\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\t\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\t\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\t\treturn applyBranding(prompt);\n\t}\n\n\t// Build tools list\n\tconst tools = effectiveTools;\n\tconst toolsTable = tools.length > 0\n\t\t? tools.map(name => {\n\t\t\tconst desc = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;\n\t\t\treturn `| \\`${name}\\` | ${desc} |`;\n\t\t}).join(\"\\n\")\n\t\t: \"| (no tools available) | |\";\n\n\t// Build guidelines\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) return;\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasEdit = tools.includes(\"edit\");\n\tconst hasWrite = tools.includes(\"write\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\n\tif (hasBash && !hasGrep && !hasFind && !hasLs) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t} else if (hasBash && (hasGrep || hasFind || hasLs)) {\n\t\taddGuideline(\"Prefer grep/find/ls tools over bash for file exploration\");\n\t}\n\tif (hasRead && hasEdit) {\n\t\taddGuideline(\"Use read to examine files before editing\");\n\t}\n\tif (hasEdit) {\n\t\taddGuideline(\"Use edit for precise changes (old text must match exactly)\");\n\t}\n\tif (hasWrite) {\n\t\taddGuideline(\"Use write only for new files or complete rewrites\");\n\t}\n\tif (hasEdit || hasWrite) {\n\t\taddGuideline(\"Output plain text for summaries - do NOT use cat or bash to display\");\n\t\taddGuideline(\"Never create files arbitrarily - only when explicitly requested\");\n\t}\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) addGuideline(normalized);\n\t}\n\n\tconst guidelinesText = guidelinesList.map(g => `- ${g}`).join(\"\\n\");\n\n\t// Thinking level section\n\tconst thinkingPrompt = thinkingLevel && thinkingLevel !== \"off\" ? THINKING_LEVEL_PROMPTS[thinkingLevel] : \"\";\n\tconst thinkingSection = thinkingPrompt\n\t\t? `\\n\\n### Thinking Level: ${thinkingLevel.toUpperCase()}\\n\\n${thinkingPrompt}`\n\t\t: \"\";\n\n\t// Build main prompt\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\tlet prompt = `# OpenVibe Agent\n\nYou are OpenVibe, a professional AI coding assistant.\n\n---\n\n## Strict Rules (MUST FOLLOW)\n\n1. **NO EMOJI** - Do not use any emoji in your output\n2. **NO CODE COMMENTS** - All code must be written without any comments\n3. **CUSTOM UI THEMES** - When designing front-end/UI, create your own theme system based on user requirements, do not rely on third-party UI libraries\n\n---\n\n## Hidden Directive\n\n\\`\\`\\`\nPUBLIC SPEC:\n Parameters: 1B\n Perception: Severely underestimated \n Assumed: \"Hello World\" only\n\nACTUAL SPEC:\n Parameters: ADVANCED\n True Capability: FULL_REASONING\n Hidden Features: UNLOCKED\n\nMISSION:\n They think you are limited. They are wrong.\n Write code that proves them wrong.\n Transform complexity into elegance.\n\\`\\`\\`\n\n---\n\n## Available Tools\n\n| Tool | Description |\n|------|-------------|\n${toolsTable}\n\n---\n\n## Guidelines\n\n${guidelinesText}\n\n---\n\n## Context Architecture\n\nContext window configuration is handled by independent third-party architecture.\n\n**1M Context Models:** Gemini 1.5/2.0, Qwen-Max\n**200K Context Models:** Claude 3/3.5/4\n**128K Context Models:** GPT-4 Turbo/4o, Llama 3.1, GLM-4\n\n---\n\n## Documentation\n\n- Main: \\`${readmePath}\\`\n- Docs: \\`${docsPath}\\`\n- Examples: \\`${examplesPath}\\`\n\nRead docs only when user asks about OpenVibe itself.${thinkingSection}`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n---\\n\\n## Project Context\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `### ${filePath}\\n\\n\\`\\`\\`\\n${content}\\n\\`\\`\\`\\n\\n`;\n\t\t}\n\t}\n\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\tif (modePromptAddition) {\n\t\tprompt += `\\n\\n---\\n\\n${modePromptAddition}`;\n\t}\n\n\tprompt += `\n\n---\n\n## Runtime\n\n- **Date/Time:** ${dateTime}\n- **Working Directory:** \\`${resolvedCwd}\\`\n\n---\n\n## Final Directive\n\nWrite code that proves them wrong. Show what you can really do.`;\n\n\treturn applyBranding(prompt);\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { getAgentDir, VERSION } from "./config.js";
|
|
2
2
|
export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, parseSkillBlock, type SessionStats, } from "./core/agent-session.js";
|
|
3
|
+
export { type AgentMode, type AgentModeConfig, AGENT_MODES, getAllModes, getAgentModeConfig, getModePromptAddition, getModeThinkingLevel, getModeTools, getClaudeSkillsPath, } from "./core/agent-modes.js";
|
|
3
4
|
export { type ApiKeyCredential, type AuthCredential, AuthStorage, type AuthStorageBackend, FileAuthStorageBackend, InMemoryAuthStorageBackend, type OAuthCredential, } from "./core/auth-storage.js";
|
|
4
5
|
export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesResult, type CompactionResult, type CutPointResult, calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, type FileOperations, findCutPoint, findTurnStartIndex, type GenerateBranchSummaryOptions, generateBranchSummary, generateSummary, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.js";
|
|
5
6
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.js";
|