feat(server): add builtin past-conversations skill#796
Open
caoergou wants to merge 6 commits intodifferent-ai:devfrom
Open
feat(server): add builtin past-conversations skill#796caoergou wants to merge 6 commits intodifferent-ai:devfrom
caoergou wants to merge 6 commits intodifferent-ai:devfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@caoergou is attempting to deploy a commit to the 0 Finance Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
6868c86 to
4cc94ef
Compare
Add a default skill for recalling previous conversations from the OpenCode SQLite database. - Add builtin-skills directory with past-conversations/SKILL.md - Modify listSkills() to include builtin skills with fallback mechanism - Add getSkillContent() for reading skill content from filesystem or embedded module (handles builtin:// protocol paths) - Update server.ts to use getSkillContent() for skill content retrieval The implementation supports two build modes: - Normal build: reads SKILL.md files from filesystem - Single-file executable: uses generated module with embedded content Closes different-ai#792
Add scripts to support both build modes: - copy-builtin-skills.ts: copies SKILL.md files to dist/ for npm package - generate-builtin-skills.ts: generates TypeScript module for single-file executable with embedded skill content Both scripts handle edge cases gracefully (missing directories, empty skill lists). Update build scripts in package.json: - build: runs copy script after tsc - build:bin: runs generate script before compile - build:bin:all: runs generate script before multi-platform build
Add tests for: - listSkills returns builtin skills - past-conversations skill exists with correct properties - Trigger phrases are present in description - Skill path points to builtin directory - getSkillContent returns content for builtin skill
The generated-builtin-skills.ts is auto-generated by the build script and should not be version controlled.
f63e722 to
1686b12
Compare
- Add `builtin: boolean` field to SkillItem type for clear identification - Unify path format to `builtin://<name>` for all builtin skills - Improve getSkillContent error handling with explicit error message - Add filesystem fallback in getSkillContent for better robustness
- Add check in deleteSkill to reject deletion of builtin skills - Return specific error code "cannot_delete_builtin_skill" - Add tests for: - Attempting to delete builtin skill throws appropriate error - Project skills can override builtin skills (project takes precedence)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a builtin
past-conversationsskill that allows the AI to recall previous conversations from the OpenCode SQLite database.Changes
packages/server/src/builtin-skills/past-conversations/SKILL.mdlistSkills()to include builtin skills with fallback mechanismgetSkillContent()for reading skill content from filesystem or embedded modulescript/generate-builtin-skills.tsfor single-file executable supportscript/copy-builtin-skills.tsfor npm package distributionTechnical Details
Build Process
Two build modes are supported:
bun run build): Usestsc+ copy script to include SKILL.md files in dist/bun run build:bin): Generates TypeScript module with embedded skill contentSingle Source of Truth
All skill content lives in
SKILL.mdfiles. The generated TypeScript module is created during build and should not be committed to git.Test Plan
Closes #792