qlogicagent 2.0.0 → 2.1.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/README.md +8 -8
- package/dist/agent.js +8 -8
- package/dist/cli.js +238 -208
- package/dist/index.js +237 -207
- package/dist/types/cli/stdio-server.d.ts +9 -8
- package/dist/types/contracts/hooks.d.ts +3 -0
- package/dist/types/llm/transports/media-resolve.d.ts +25 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +2 -0
- package/dist/types/runtime/execution/dream-category-context.d.ts +47 -0
- package/dist/types/runtime/execution/dream-category-context.test.d.ts +1 -0
- package/dist/types/runtime/execution/index.d.ts +1 -0
- package/dist/types/runtime/execution/memory-decay.d.ts +57 -0
- package/dist/types/runtime/execution/memory-decay.test.d.ts +1 -0
- package/dist/types/runtime/hooks/index.d.ts +1 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +20 -0
- package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +36 -0
- package/dist/types/runtime/infra/agent-paths.d.ts +14 -2
- package/dist/types/runtime/infra/disk-storage.d.ts +0 -16
- package/dist/types/runtime/infra/index.d.ts +2 -2
- package/dist/types/runtime/session/session-persistence.d.ts +3 -1
- package/dist/types/skills/index.d.ts +5 -5
- package/dist/types/skills/memory/find-relevant-memories.d.ts +70 -0
- package/dist/types/skills/memory/memdir.d.ts +80 -0
- package/dist/types/skills/memory/memory-tool.d.ts +16 -44
- package/dist/types/skills/memory/memory-write-gate.d.ts +46 -0
- package/dist/types/skills/memory/memory-write-hook.d.ts +44 -0
- package/dist/types/skills/memory/qmemory-adapter.d.ts +12 -0
- package/dist/types/skills/memory/recall-category-filter.d.ts +54 -0
- package/dist/types/skills/tools/skill-tool.d.ts +16 -3
- package/package.json +1 -1
- package/dist/types/skills/memory/memory-store.d.ts +0 -86
- package/dist/types/skills/tools/skill-invoke-tool.d.ts +0 -46
- package/dist/types/skills/tools/skill-list-tool.d.ts +0 -33
- package/dist/types/skills/tools/skill-manage-tool.d.ts +0 -73
- package/dist/types/skills/tools/skill-view-tool.d.ts +0 -37
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { MemorySearchResult } from "qlogicagent-runtime-contracts";
|
|
2
|
+
/**
|
|
3
|
+
* Memory categories for QMemory writes.
|
|
4
|
+
* Each has different value thresholds and retention policies.
|
|
5
|
+
*/
|
|
6
|
+
export type QMemoryCategory = "lesson" | "preference" | "pattern" | "fact" | "decision" | "skill-learning";
|
|
7
|
+
/**
|
|
8
|
+
* A candidate memory extracted from a turn.
|
|
9
|
+
*/
|
|
10
|
+
export interface MemoryCandidate {
|
|
11
|
+
text: string;
|
|
12
|
+
category: QMemoryCategory;
|
|
13
|
+
importance: number;
|
|
14
|
+
tags: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract memory candidates from a completed turn.
|
|
18
|
+
*
|
|
19
|
+
* Strategy: scan assistant response for category signal patterns.
|
|
20
|
+
* This is a fast pattern-based approach (no LLM call needed).
|
|
21
|
+
* Only extracts segments that match high-value patterns.
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractCandidates(userPrompt: string, assistantResponse: string): MemoryCandidate[];
|
|
24
|
+
/**
|
|
25
|
+
* Quality gate: filter candidates by minimum importance threshold.
|
|
26
|
+
*/
|
|
27
|
+
export declare function applyQualityGate(candidates: MemoryCandidate[], minImportance?: number): MemoryCandidate[];
|
|
28
|
+
/**
|
|
29
|
+
* Result of supersedes check for a single candidate.
|
|
30
|
+
*/
|
|
31
|
+
export interface SupersedesCheckResult {
|
|
32
|
+
candidate: MemoryCandidate;
|
|
33
|
+
supersedes: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if candidates supersede existing memories.
|
|
37
|
+
*
|
|
38
|
+
* Strategy: for each candidate, search QMemory for semantically similar
|
|
39
|
+
* existing entries. If similarity is high (>0.80) and the candidate is
|
|
40
|
+
* newer/more specific, mark the old one for supersede.
|
|
41
|
+
*
|
|
42
|
+
* @param candidates - Memory candidates to check
|
|
43
|
+
* @param existingSearch - Function to search existing memories
|
|
44
|
+
* @returns Candidates with supersedes info
|
|
45
|
+
*/
|
|
46
|
+
export declare function checkSupersedes(candidates: MemoryCandidate[], existingSearch: (query: string) => Promise<MemorySearchResult[]>): Promise<SupersedesCheckResult[]>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MemorySearchResult } from "qlogicagent-runtime-contracts";
|
|
2
|
+
import type { ExtractedMemoryItem } from "./qmemory-adapter.js";
|
|
3
|
+
export declare const WRITE_HOOK_CONFIG: {
|
|
4
|
+
/** Minimum importance to pass the quality gate. */
|
|
5
|
+
readonly MIN_IMPORTANCE: 0.4;
|
|
6
|
+
/** Max candidates to write per turn (prevent flood). */
|
|
7
|
+
readonly MAX_PER_TURN: 3;
|
|
8
|
+
/** Cooldown between writes (ms) — prevents rapid duplicate writes. */
|
|
9
|
+
readonly COOLDOWN_MS: 5000;
|
|
10
|
+
};
|
|
11
|
+
export interface MemoryWriteHookDeps {
|
|
12
|
+
/** Write extracted items to QMemory. */
|
|
13
|
+
ingestExtracted: (items: ExtractedMemoryItem[], userId: string) => Promise<{
|
|
14
|
+
memoriesAdded: number;
|
|
15
|
+
}>;
|
|
16
|
+
/** Search existing memories (for supersedes check). */
|
|
17
|
+
searchMemories: (query: string, userId: string) => Promise<MemorySearchResult[]>;
|
|
18
|
+
/** Remove a superseded memory by ID. */
|
|
19
|
+
removeMemory?: (memoryId: string) => Promise<boolean>;
|
|
20
|
+
/** User ID for QMemory writes. */
|
|
21
|
+
userId: string;
|
|
22
|
+
/** Logger. */
|
|
23
|
+
log: {
|
|
24
|
+
debug(msg: string): void;
|
|
25
|
+
warn(msg: string): void;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** Per-session state for the write hook. */
|
|
29
|
+
export interface MemoryWriteState {
|
|
30
|
+
/** Timestamp of last write (for cooldown). */
|
|
31
|
+
lastWriteAt: number;
|
|
32
|
+
/** Total memories written this session (for budget). */
|
|
33
|
+
sessionWrites: number;
|
|
34
|
+
/** Recent write texts (for intra-session dedup). */
|
|
35
|
+
recentTexts: Set<string>;
|
|
36
|
+
}
|
|
37
|
+
export declare function createMemoryWriteState(): MemoryWriteState;
|
|
38
|
+
/**
|
|
39
|
+
* Process a completed turn for memory-worthy content.
|
|
40
|
+
* Called directly from stdio-server after turn.end (fire-and-forget).
|
|
41
|
+
*
|
|
42
|
+
* Pipeline: extract → gate → dedup → supersedes check → write.
|
|
43
|
+
*/
|
|
44
|
+
export declare function processMemoryWriteGate(userPrompt: string, assistantResponse: string, deps: MemoryWriteHookDeps, state: MemoryWriteState): Promise<void>;
|
|
@@ -19,6 +19,17 @@ export interface QMemoryAdapterConfig {
|
|
|
19
19
|
/** Prefix prepended to userId for multi-tenant isolation. */
|
|
20
20
|
userIdPrefix?: string;
|
|
21
21
|
}
|
|
22
|
+
/** Options for triggering a decay cycle. */
|
|
23
|
+
export interface DecayOptions {
|
|
24
|
+
temporalExpiry?: boolean;
|
|
25
|
+
stalenessDecay?: boolean;
|
|
26
|
+
noiseArchival?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Result of a decay cycle. */
|
|
29
|
+
export interface DecayResult {
|
|
30
|
+
decayed: number;
|
|
31
|
+
archived: number;
|
|
32
|
+
}
|
|
22
33
|
/** Health status returned by qmemory `/v1/health/`. */
|
|
23
34
|
export interface QMemoryHealthStatus {
|
|
24
35
|
status: string;
|
|
@@ -40,4 +51,5 @@ export declare function createQMemoryAdapter(config: QMemoryAdapterConfig): Memo
|
|
|
40
51
|
memoriesAdded: number;
|
|
41
52
|
}>;
|
|
42
53
|
feedback(memoryIds: string[], signal: string, sessionId?: string): Promise<void>;
|
|
54
|
+
triggerDecay(userId: string, options?: DecayOptions): Promise<DecayResult>;
|
|
43
55
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { QMemoryCategory } from "../../skills/memory/memory-write-gate.js";
|
|
2
|
+
/** Detected query scenario with preferred categories. */
|
|
3
|
+
export interface RecallCategoryHint {
|
|
4
|
+
/** Detected scenario label. */
|
|
5
|
+
scenario: QueryScenario;
|
|
6
|
+
/** Preferred categories for this scenario (ordered by priority). */
|
|
7
|
+
preferred: QMemoryCategory[];
|
|
8
|
+
/** Categories to deprioritize (still recalled but scored lower). */
|
|
9
|
+
deprioritized: QMemoryCategory[];
|
|
10
|
+
/** Confidence of scenario detection (0.0-1.0). */
|
|
11
|
+
confidence: number;
|
|
12
|
+
}
|
|
13
|
+
/** Known query scenarios. */
|
|
14
|
+
export type QueryScenario = "coding" | "config" | "conversation" | "learning" | "decision" | "general";
|
|
15
|
+
/**
|
|
16
|
+
* Detect the query scenario and return category preferences.
|
|
17
|
+
*
|
|
18
|
+
* Uses pattern matching on the user query to infer intent.
|
|
19
|
+
* Returns "general" (no filtering) when confidence is below threshold.
|
|
20
|
+
*
|
|
21
|
+
* @param query - User query text
|
|
22
|
+
* @returns Category hint with preferred/deprioritized categories
|
|
23
|
+
*/
|
|
24
|
+
export declare function detectRecallCategories(query: string): RecallCategoryHint;
|
|
25
|
+
/**
|
|
26
|
+
* Apply category boost/penalty to a recall score.
|
|
27
|
+
*
|
|
28
|
+
* Used by recall hooks to adjust memory scores based on category alignment.
|
|
29
|
+
*
|
|
30
|
+
* @param baseScore - Original relevance score (0.0-1.0)
|
|
31
|
+
* @param memoryCategory - Category of the memory entry (if known)
|
|
32
|
+
* @param hint - Category hint from detectRecallCategories()
|
|
33
|
+
* @returns Adjusted score
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyCategoryBoost(baseScore: number, memoryCategory: string | undefined | null, hint: RecallCategoryHint): number;
|
|
36
|
+
/**
|
|
37
|
+
* Filter and re-rank a list of recalled memories based on category preferences.
|
|
38
|
+
*
|
|
39
|
+
* @param memories - Raw recalled memories with optional category
|
|
40
|
+
* @param hint - Category hint from detectRecallCategories()
|
|
41
|
+
* @param minScore - Minimum adjusted score to keep (default: 0)
|
|
42
|
+
* @returns Re-ranked memories (highest adjusted score first)
|
|
43
|
+
*/
|
|
44
|
+
export declare function filterByCategory<T extends {
|
|
45
|
+
score?: number;
|
|
46
|
+
category?: string | null;
|
|
47
|
+
}>(memories: T[], hint: RecallCategoryHint, minScore?: number): T[];
|
|
48
|
+
/**
|
|
49
|
+
* Infer memory category from filename prefix convention.
|
|
50
|
+
* E.g. "lesson-docker.md" → "lesson", "fact-ports.md" → "fact"
|
|
51
|
+
*
|
|
52
|
+
* Exported for use by recall hooks.
|
|
53
|
+
*/
|
|
54
|
+
export declare function inferCategoryFromFilename(filename: string): QMemoryCategory | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
2
|
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
|
|
3
3
|
export declare const SKILL_TOOL_NAME: "skill";
|
|
4
|
-
export type SkillAction = "invoke" | "list" | "view" | "create" | "edit" | "patch" | "delete";
|
|
4
|
+
export type SkillAction = "invoke" | "list" | "view" | "create" | "edit" | "patch" | "delete" | "promote" | "install";
|
|
5
5
|
export interface SkillToolParams {
|
|
6
6
|
action: SkillAction;
|
|
7
7
|
name?: string;
|
|
@@ -12,18 +12,20 @@ export interface SkillToolParams {
|
|
|
12
12
|
fileContent?: string;
|
|
13
13
|
oldString?: string;
|
|
14
14
|
newString?: string;
|
|
15
|
+
/** URL to download skill from (for 'install' action). */
|
|
16
|
+
url?: string;
|
|
15
17
|
}
|
|
16
18
|
export declare const SKILL_TOOL_SCHEMA: {
|
|
17
19
|
readonly type: "object";
|
|
18
20
|
readonly properties: {
|
|
19
21
|
readonly action: {
|
|
20
22
|
readonly type: "string";
|
|
21
|
-
readonly enum: readonly ["invoke", "list", "view", "create", "edit", "patch", "delete"];
|
|
23
|
+
readonly enum: readonly ["invoke", "list", "view", "create", "edit", "patch", "delete", "promote", "install"];
|
|
22
24
|
readonly description: string;
|
|
23
25
|
};
|
|
24
26
|
readonly name: {
|
|
25
27
|
readonly type: "string";
|
|
26
|
-
readonly description: "Skill name (required for invoke/view/create/edit/patch/delete).";
|
|
28
|
+
readonly description: "Skill name (required for invoke/view/create/edit/patch/delete/promote).";
|
|
27
29
|
};
|
|
28
30
|
readonly args: {
|
|
29
31
|
readonly type: "string";
|
|
@@ -53,6 +55,10 @@ export declare const SKILL_TOOL_SCHEMA: {
|
|
|
53
55
|
readonly type: "string";
|
|
54
56
|
readonly description: "Replacement text for patch action.";
|
|
55
57
|
};
|
|
58
|
+
readonly url: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly description: "URL to download a skill from (for 'install' action). Supports skill stores (skillhub.cn, skill.io, GitHub raw links, etc.) and any direct .md URL.";
|
|
61
|
+
};
|
|
56
62
|
};
|
|
57
63
|
readonly required: readonly ["action"];
|
|
58
64
|
};
|
|
@@ -61,6 +67,8 @@ export interface SkillListItem {
|
|
|
61
67
|
description: string;
|
|
62
68
|
version?: string;
|
|
63
69
|
category?: string;
|
|
70
|
+
/** Where the skill lives: "global" (user-level) or "project" (cwd-level). */
|
|
71
|
+
scope?: "global" | "project" | "plugin" | "config";
|
|
64
72
|
}
|
|
65
73
|
export interface SkillListOutput {
|
|
66
74
|
skills: SkillListItem[];
|
|
@@ -91,11 +99,16 @@ export interface SkillToolDeps {
|
|
|
91
99
|
manageSkill(params: {
|
|
92
100
|
action: string;
|
|
93
101
|
name: string;
|
|
102
|
+
category?: string;
|
|
94
103
|
content?: string;
|
|
95
104
|
filePath?: string;
|
|
96
105
|
fileContent?: string;
|
|
97
106
|
oldString?: string;
|
|
98
107
|
newString?: string;
|
|
99
108
|
}): Promise<SkillManageResult>;
|
|
109
|
+
/** Promote a project-level skill to user/global level. Returns success message. */
|
|
110
|
+
promoteSkill?(name: string): Promise<SkillManageResult>;
|
|
111
|
+
/** Install a skill from a URL. Downloads .md content and saves it. */
|
|
112
|
+
installSkill?(url: string, name?: string): Promise<SkillManageResult>;
|
|
100
113
|
}
|
|
101
114
|
export declare function createSkillMetaTool(deps: SkillToolDeps): PortableTool<SkillToolParams>;
|
package/package.json
CHANGED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export declare const MEMORY_ENTRY_DELIMITER = "\n\u00A7\n";
|
|
2
|
-
export declare const DEFAULT_MEMORY_CHAR_LIMIT = 2200;
|
|
3
|
-
export declare const DEFAULT_USER_CHAR_LIMIT = 1375;
|
|
4
|
-
export type MemoryStoreTarget = "memory" | "user";
|
|
5
|
-
export interface MemoryStoreResult {
|
|
6
|
-
ok: boolean;
|
|
7
|
-
message: string;
|
|
8
|
-
target: MemoryStoreTarget;
|
|
9
|
-
entries: readonly string[];
|
|
10
|
-
entryCount: number;
|
|
11
|
-
usage: string;
|
|
12
|
-
errorCode?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface MemoryStoreOptions {
|
|
15
|
-
memoryCharLimit?: number;
|
|
16
|
-
userCharLimit?: number;
|
|
17
|
-
/** When true, mutations automatically persist to ~/.qlogicagent/memory.json */
|
|
18
|
-
persistToDisk?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface MemoryStoreSerialized {
|
|
21
|
-
memory: string;
|
|
22
|
-
user: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class MemoryStore {
|
|
25
|
-
private memoryEntries;
|
|
26
|
-
private userEntries;
|
|
27
|
-
private frozenSnapshot;
|
|
28
|
-
private snapshotFrozen;
|
|
29
|
-
private saveTimer;
|
|
30
|
-
private readonly memoryCharLimit;
|
|
31
|
-
private readonly userCharLimit;
|
|
32
|
-
private readonly persistToDisk;
|
|
33
|
-
constructor(options?: MemoryStoreOptions);
|
|
34
|
-
/**
|
|
35
|
-
* Load from serialized form (e.g. from PG or filesystem).
|
|
36
|
-
* Deduplicates entries on load.
|
|
37
|
-
*/
|
|
38
|
-
loadFromSerialized(data: Partial<MemoryStoreSerialized>): void;
|
|
39
|
-
/**
|
|
40
|
-
* Serialize current live state for persistence.
|
|
41
|
-
*/
|
|
42
|
-
serialize(): MemoryStoreSerialized;
|
|
43
|
-
/**
|
|
44
|
-
* Load from disk (~/.qlogicagent/memory.json). No-op if file doesn't exist.
|
|
45
|
-
* Call this at startup when persistToDisk is enabled.
|
|
46
|
-
*/
|
|
47
|
-
loadFromDisk(): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Synchronous variant for use in sync constructors / init paths.
|
|
50
|
-
*/
|
|
51
|
-
loadFromDiskSync(): void;
|
|
52
|
-
/**
|
|
53
|
-
* Schedule a debounced save to disk (500ms). Multiple rapid mutations
|
|
54
|
-
* coalesce into a single disk write.
|
|
55
|
-
*/
|
|
56
|
-
private scheduleSave;
|
|
57
|
-
/** Flush any pending save immediately. Call before shutdown. */
|
|
58
|
-
flush(): Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Freeze current entries for system prompt injection.
|
|
61
|
-
* Call once at session start. After freezing, mutations update
|
|
62
|
-
* live state but NOT the system prompt block.
|
|
63
|
-
*/
|
|
64
|
-
freezeSnapshot(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Get frozen system prompt block for the given target.
|
|
67
|
-
* Returns empty string if no entries or not yet frozen.
|
|
68
|
-
*/
|
|
69
|
-
getSystemPromptBlock(target: MemoryStoreTarget): string;
|
|
70
|
-
add(target: MemoryStoreTarget, content: string): MemoryStoreResult;
|
|
71
|
-
replace(target: MemoryStoreTarget, oldText: string, newContent: string): MemoryStoreResult;
|
|
72
|
-
remove(target: MemoryStoreTarget, oldText: string): MemoryStoreResult;
|
|
73
|
-
getEntries(target: MemoryStoreTarget): readonly string[];
|
|
74
|
-
getUsage(target: MemoryStoreTarget): {
|
|
75
|
-
used: number;
|
|
76
|
-
limit: number;
|
|
77
|
-
percent: number;
|
|
78
|
-
};
|
|
79
|
-
isEmpty(): boolean;
|
|
80
|
-
private entriesFor;
|
|
81
|
-
private charLimitFor;
|
|
82
|
-
private formatUsage;
|
|
83
|
-
private renderBlock;
|
|
84
|
-
private successResult;
|
|
85
|
-
private errorResult;
|
|
86
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
|
|
3
|
-
export declare const SKILL_TOOL_NAME: "skill_invoke";
|
|
4
|
-
export interface SkillInvokeParams {
|
|
5
|
-
skill: string;
|
|
6
|
-
args?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const SKILL_INVOKE_SCHEMA: {
|
|
9
|
-
readonly type: "object";
|
|
10
|
-
readonly properties: {
|
|
11
|
-
readonly skill: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly description: "Name of the skill to invoke. Use skill_list to see available skills.";
|
|
14
|
-
};
|
|
15
|
-
readonly args: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly description: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
readonly required: readonly ["skill"];
|
|
21
|
-
};
|
|
22
|
-
export interface SkillToolDeps {
|
|
23
|
-
/**
|
|
24
|
-
* Get all available skills (Layer 0 metadata).
|
|
25
|
-
* Returns name + description pairs for tool manifest enrichment.
|
|
26
|
-
*/
|
|
27
|
-
listSkills(): WorkspaceSkill[];
|
|
28
|
-
/**
|
|
29
|
-
* Read skill content (Layer 1 instructions).
|
|
30
|
-
* Returns the full SKILL.md content for the named skill.
|
|
31
|
-
* Returns null if skill not found.
|
|
32
|
-
*/
|
|
33
|
-
readSkillContent(name: string): Promise<string | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Execute the skill instructions as a sub-turn.
|
|
36
|
-
* The implementation should:
|
|
37
|
-
* 1. Build system prompt from SKILL.md content
|
|
38
|
-
* 2. Run a sub-turn (fork) with skill instructions
|
|
39
|
-
* 3. Return the sub-turn's final response
|
|
40
|
-
*
|
|
41
|
-
* If not provided, the skill content is returned directly
|
|
42
|
-
* (the LLM can then follow the instructions in context).
|
|
43
|
-
*/
|
|
44
|
-
executeSkillSubturn?(skillName: string, skillContent: string, userArgs: string | undefined, signal?: AbortSignal): Promise<string>;
|
|
45
|
-
}
|
|
46
|
-
export declare function createSkillTool(deps: SkillToolDeps): PortableTool<SkillInvokeParams>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const SKILL_LIST_TOOL_NAME: "skill_list";
|
|
3
|
-
export interface SkillListToolParams {
|
|
4
|
-
category?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const SKILL_LIST_TOOL_SCHEMA: {
|
|
7
|
-
readonly type: "object";
|
|
8
|
-
readonly properties: {
|
|
9
|
-
readonly category: {
|
|
10
|
-
readonly type: "string";
|
|
11
|
-
readonly description: "Filter skills by category (e.g. 'devops', 'mlops'). Omit to list all.";
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
readonly required: readonly [];
|
|
15
|
-
};
|
|
16
|
-
export interface SkillListItem {
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
version?: string;
|
|
20
|
-
category?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface SkillListOutput {
|
|
23
|
-
skills: SkillListItem[];
|
|
24
|
-
categories: string[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Host-provided skill registry for listing.
|
|
28
|
-
*/
|
|
29
|
-
export interface SkillListToolDeps {
|
|
30
|
-
/** List all available skills, optionally filtered by category. */
|
|
31
|
-
listSkills(category?: string): Promise<SkillListOutput>;
|
|
32
|
-
}
|
|
33
|
-
export declare function createSkillListTool(deps: SkillListToolDeps): PortableTool<SkillListToolParams>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const SKILL_MANAGE_TOOL_NAME: "skill_manage";
|
|
3
|
-
export type SkillManageAction = "create" | "edit" | "patch" | "delete" | "write_file" | "remove_file";
|
|
4
|
-
export interface SkillManageToolParams {
|
|
5
|
-
action: SkillManageAction;
|
|
6
|
-
name: string;
|
|
7
|
-
content?: string;
|
|
8
|
-
category?: string;
|
|
9
|
-
filePath?: string;
|
|
10
|
-
fileContent?: string;
|
|
11
|
-
oldString?: string;
|
|
12
|
-
newString?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const SKILL_MANAGE_TOOL_SCHEMA: {
|
|
15
|
-
readonly type: "object";
|
|
16
|
-
readonly properties: {
|
|
17
|
-
readonly action: {
|
|
18
|
-
readonly type: "string";
|
|
19
|
-
readonly enum: readonly ["create", "edit", "patch", "delete", "write_file", "remove_file"];
|
|
20
|
-
readonly description: string;
|
|
21
|
-
};
|
|
22
|
-
readonly name: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "Skill name (lowercase, max 64 chars, kebab-case: letters, digits, hyphens).";
|
|
25
|
-
};
|
|
26
|
-
readonly content: {
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly description: string;
|
|
29
|
-
};
|
|
30
|
-
readonly category: {
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
readonly description: "Category/domain (e.g. 'devops', 'mlops'). Used by create to organize skills.";
|
|
33
|
-
};
|
|
34
|
-
readonly filePath: {
|
|
35
|
-
readonly type: "string";
|
|
36
|
-
readonly description: string;
|
|
37
|
-
};
|
|
38
|
-
readonly fileContent: {
|
|
39
|
-
readonly type: "string";
|
|
40
|
-
readonly description: "Content for write_file action. Max 1 MiB.";
|
|
41
|
-
};
|
|
42
|
-
readonly oldString: {
|
|
43
|
-
readonly type: "string";
|
|
44
|
-
readonly description: "Text to find for patch action (must match uniquely in SKILL.md).";
|
|
45
|
-
};
|
|
46
|
-
readonly newString: {
|
|
47
|
-
readonly type: "string";
|
|
48
|
-
readonly description: "Replacement text for patch action (can be empty to delete).";
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
readonly required: readonly ["action", "name"];
|
|
52
|
-
};
|
|
53
|
-
export interface SkillManageResult {
|
|
54
|
-
success: boolean;
|
|
55
|
-
message: string;
|
|
56
|
-
path?: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Host-provided skill management backend.
|
|
60
|
-
*/
|
|
61
|
-
export interface SkillManageToolDeps {
|
|
62
|
-
/**
|
|
63
|
-
* Execute a skill management action.
|
|
64
|
-
* The host handles file system operations, validation, and security scanning.
|
|
65
|
-
*/
|
|
66
|
-
manageSkill(params: SkillManageToolParams): Promise<SkillManageResult>;
|
|
67
|
-
/**
|
|
68
|
-
* Validate skill name format.
|
|
69
|
-
* If not provided, tool uses built-in validation.
|
|
70
|
-
*/
|
|
71
|
-
validateName?(name: string): string | null;
|
|
72
|
-
}
|
|
73
|
-
export declare function createSkillManageTool(deps: SkillManageToolDeps): PortableTool<SkillManageToolParams>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const SKILL_VIEW_TOOL_NAME: "skill_view";
|
|
3
|
-
export interface SkillViewToolParams {
|
|
4
|
-
name: string;
|
|
5
|
-
filePath?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const SKILL_VIEW_TOOL_SCHEMA: {
|
|
8
|
-
readonly type: "object";
|
|
9
|
-
readonly properties: {
|
|
10
|
-
readonly name: {
|
|
11
|
-
readonly type: "string";
|
|
12
|
-
readonly description: "Skill name to view (e.g. 'code-review', 'deploy-ecs').";
|
|
13
|
-
};
|
|
14
|
-
readonly filePath: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
readonly required: readonly ["name"];
|
|
20
|
-
};
|
|
21
|
-
export interface SkillViewOutput {
|
|
22
|
-
name: string;
|
|
23
|
-
content: string;
|
|
24
|
-
referenceFiles?: string[];
|
|
25
|
-
tags?: string[];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Host-provided skill viewer.
|
|
29
|
-
*/
|
|
30
|
-
export interface SkillViewToolDeps {
|
|
31
|
-
/**
|
|
32
|
-
* Read skill content. Returns the main SKILL.md or a specific file.
|
|
33
|
-
* Returns null if skill not found.
|
|
34
|
-
*/
|
|
35
|
-
viewSkill(name: string, filePath?: string): Promise<SkillViewOutput | null>;
|
|
36
|
-
}
|
|
37
|
-
export declare function createSkillViewTool(deps: SkillViewToolDeps): PortableTool<SkillViewToolParams>;
|