mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(claude): separate skills from slash commands (#1293)
* fix(claude): separate skills from slash commands * fix(claude): make native skills ready before use * fix(claude): keep skill commands before attachments * fix(claude): align skill catalog with launch args * fix(claude): include launch plugin skills * fix(claude): use native loaded skill list * refactor(claude): remove obsolete metadata callback * fix(claude): wait for skill catalog before draining messages * fix(claude): cancel deferred startup messages * fix(claude): bound skill catalog startup probe
This commit is contained in:
@@ -23,6 +23,7 @@ export class Session extends AgentSessionBase<EnhancedMode> {
|
||||
readonly startedBy: 'runner' | 'terminal';
|
||||
readonly startingMode: 'local' | 'remote';
|
||||
localLaunchFailure: LocalLaunchFailure | null = null;
|
||||
private nativeSkillNames = new Set<string>();
|
||||
|
||||
constructor(opts: {
|
||||
api: ApiClient;
|
||||
@@ -97,6 +98,17 @@ export class Session extends AgentSessionBase<EnhancedMode> {
|
||||
this.effort = effort;
|
||||
};
|
||||
|
||||
setNativeSkillNames = (names: readonly string[]): void => {
|
||||
this.nativeSkillNames = new Set(names);
|
||||
};
|
||||
|
||||
expandSkillReference = (message: string, trailingContext = ''): string => {
|
||||
const match = /^\s*\$([^\s]+)(?=\s|$)/.exec(message);
|
||||
if (!match || !this.nativeSkillNames.has(match[1])) return message;
|
||||
const expanded = `/${match[1]}${message.slice(match[0].length)}`;
|
||||
return trailingContext ? `${expanded}\n\n${trailingContext}` : expanded;
|
||||
};
|
||||
|
||||
recordLocalLaunchFailure = (message: string, exitReason: LocalLaunchExitReason): void => {
|
||||
this.localLaunchFailure = { message, exitReason };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user