-
Notifications
You must be signed in to change notification settings - Fork 46
feat(tasks): install and apply skill bundle artifacts in the sandbox #2924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: local-skill-02-bundler
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,18 @@ function transformMcpCommand(text: string): string { | |
| return text; | ||
| } | ||
|
|
||
| function isLocalSkillCommandChunk( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels kinda risky to me what if a the string is "hello please run /skill_name - thank you" could the tokens split the skill name?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chunk is an ACP prompt content block, not model tokens, and the matcher is anchored to a slash command at the start of the trimmed block so that ^ example would not fly It also can't reach this as a "skill" at all since |
||
| chunk: PromptRequest["prompt"][number], | ||
| skillName: string, | ||
| ): boolean { | ||
| if (chunk.type !== "text") { | ||
| return false; | ||
| } | ||
|
|
||
| const match = chunk.text.trim().match(/^\/([^\s]+)(?:\s+[\s\S]*)?$/); | ||
| return match?.[1] === skillName; | ||
| } | ||
|
|
||
| function processPromptChunk( | ||
| chunk: PromptRequest["prompt"][number], | ||
| content: ContentBlockParam[], | ||
|
|
@@ -168,8 +180,24 @@ export function promptToClaude(prompt: PromptRequest): SDKUserMessage { | |
| if (typeof prContext === "string") { | ||
| content.push(sdkText(prContext)); | ||
| } | ||
| const localSkillContext = meta?.localSkillContext; | ||
| if (typeof localSkillContext === "string") { | ||
| content.push(sdkText(localSkillContext)); | ||
| } | ||
| const localSkillName = | ||
| typeof meta?.localSkillName === "string" ? meta.localSkillName : null; | ||
| let skippedLocalSkillCommand = false; | ||
|
|
||
| for (const chunk of prompt.prompt) { | ||
| if ( | ||
| localSkillContext && | ||
| localSkillName && | ||
| !skippedLocalSkillCommand && | ||
| isLocalSkillCommandChunk(chunk, localSkillName) | ||
| ) { | ||
| skippedLocalSkillCommand = true; | ||
| continue; | ||
| } | ||
| processPromptChunk(chunk, content, context); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.