@eclipse-docks/extension-ai-system 0.8.3 → 0.8.5
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/dist/api.js +1 -86
- package/dist/{cognitive-extension-CvP05Bw_.js → cognitive-extension-DAP_yD5Y.js} +2 -2
- package/dist/{cognitive-extension-CvP05Bw_.js.map → cognitive-extension-DAP_yD5Y.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/cognitive-runtime.d.ts.map +1 -1
- package/dist/runtime/skills.d.ts +2 -0
- package/dist/runtime/skills.d.ts.map +1 -1
- package/dist/runtime/specialists/index.d.ts +1 -0
- package/dist/runtime/specialists/index.d.ts.map +1 -1
- package/dist/{runtime-DVzLyx8h.js → runtime-CI4JObpD.js} +124 -18
- package/dist/runtime-CI4JObpD.js.map +1 -0
- package/package.json +1 -1
- package/dist/api.js.map +0 -1
- package/dist/runtime-DVzLyx8h.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ extensionRegistry.registerExtension({
|
|
|
9
9
|
id: pkg.name,
|
|
10
10
|
name: t.EXT_COGNITIVE_NAME,
|
|
11
11
|
description: t.EXT_COGNITIVE_DESC,
|
|
12
|
-
loader: () => import("./cognitive-extension-
|
|
12
|
+
loader: () => import("./cognitive-extension-DAP_yD5Y.js"),
|
|
13
13
|
icon: "robot"
|
|
14
14
|
});
|
|
15
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cognitive-runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/cognitive-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EAGX,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,WAAW,EAEX,gBAAgB,EAQj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M,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO;IAYlE,0DAA0D;IAC1D,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IASzC;;;OAGG;IACG,cAAc,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,SAAqB,EAC9B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IAoC7B,MAAM,CAAC,KAAK,EAAE;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,6EAA6E;QAC7E,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;QACjC,6EAA6E;QAC7E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,IAAI,CAAC,EAAE,cAAc,CAAC;QACtB,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,WAAW,CAAC;IA2JxB,OAAO,CAAC,sBAAsB;IA2B9B,OAAO,CAAC,cAAc;YAgBR,iBAAiB;IAc/B,OAAO,CAAC,YAAY;IASpB,6EAA6E;IAC7E,OAAO,CAAC,iBAAiB;YAMX,UAAU;YAuBV,gBAAgB;YAUhB,gBAAgB;YAQhB,OAAO;YAwBP,OAAO;CAYtB;AA0DD,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
|
package/dist/runtime/skills.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { isSkillContribution } from './skills-types';
|
|
|
8
8
|
/** Contribution slot for AI agent skills (Cursor-compatible SKILL.md content). */
|
|
9
9
|
export declare const SYSTEM_SKILLS = "system.skills";
|
|
10
10
|
export declare function listSkillContributions(): SkillContribution[];
|
|
11
|
+
/** Descriptions for the specialist prompt. Full bodies stay behind skills.load. */
|
|
12
|
+
export declare function registeredSkillsPromptSection(): Promise<string>;
|
|
11
13
|
/** Register a SKILL.md document on {@link SYSTEM_SKILLS}. Returns an unregister function. */
|
|
12
14
|
export declare function registerSkillMarkdown(raw: string, opts?: Partial<SkillContribution>): () => void;
|
|
13
15
|
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/runtime/skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/runtime/skills.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAClF,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,kFAAkF;AAClF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,wBAAgB,sBAAsB,IAAI,iBAAiB,EAAE,CAI5D;AAED,mFAAmF;AACnF,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,MAAM,CAAC,CAMrE;AAaD,6FAA6F;AAC7F,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,MAAM,IAAI,CAgBhG"}
|
|
@@ -8,5 +8,6 @@ export type SystemPromptEnhancer = (prompt: string, ctx: {
|
|
|
8
8
|
}) => string | Promise<string>;
|
|
9
9
|
export declare function systemPromptFor(role: string, goal: string, opts?: {
|
|
10
10
|
hasAttachments?: boolean;
|
|
11
|
+
skillsSection?: string;
|
|
11
12
|
}): string;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/specialists/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAEhC,MAAM,MAAM,oBAAoB,GAAG,CACjC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAC3D,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9B,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/specialists/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAEhC,MAAM,MAAM,oBAAoB,GAAG,CACjC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAC3D,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9B,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9D,MAAM,CA8BR"}
|
|
@@ -2639,14 +2639,17 @@ function coalesceParts(parts) {
|
|
|
2639
2639
|
//#endregion
|
|
2640
2640
|
//#region src/runtime/specialists/index.ts
|
|
2641
2641
|
function systemPromptFor(role, goal, opts = {}) {
|
|
2642
|
-
const
|
|
2642
|
+
const base = "You are a specialist in the Eclipse Docks AI runtime. Prefer tools for file and command actions. Be concise.";
|
|
2643
|
+
const replyRule = "After tools finish, write a short human-friendly final reply (what you did and the outcome). Do not paste tool arguments, stdout, JSON, or command logs — those already appear in the UI details panel.";
|
|
2644
|
+
const attachmentRule = opts.hasAttachments ? [
|
|
2643
2645
|
"This turn publishes session attachments under the shared in-memory root (in-memory/<sessionId>/… or in-memory://<sessionId>/…).",
|
|
2644
2646
|
"Read them with workspace_read / workspace_list — in-memory paths work without mounting that root into the workspace tree.",
|
|
2645
|
-
"Do not call load_workspace / connect_opfs / connect_indexeddb to find attachments."
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2647
|
+
"Do not call load_workspace / connect_opfs / connect_indexeddb to find attachments."
|
|
2648
|
+
].join(" ") : "Session attachments live under the shared in-memory root and are readable via workspace_read / workspace_list.";
|
|
2649
|
+
const pathRule = "Workspace paths use a connected root prefix from workspace_list (never write bare names at the composite root unless a single durable folder can auto-qualify them).";
|
|
2650
|
+
const skillRule = "Before a complex task, call skills.list, then skills.load the matching skill and follow it.";
|
|
2651
|
+
const skillsSection = opts.skillsSection?.trim();
|
|
2652
|
+
const preamble = skillsSection ? `${base} ${replyRule} ${attachmentRule} ${pathRule} ${skillRule}\n${skillsSection}` : `${base} ${replyRule} ${attachmentRule} ${pathRule} ${skillRule}`;
|
|
2650
2653
|
switch (role) {
|
|
2651
2654
|
case "plan": return `${preamble}\nMode: PLAN (read-only). Analyze and propose a plan for: ${goal}`;
|
|
2652
2655
|
case "explore": return `${preamble}\nMode: EXPLORE (read-only). Search and report findings for: ${goal}`;
|
|
@@ -2894,15 +2897,6 @@ function readFrontmatterString(front, key) {
|
|
|
2894
2897
|
return front.match(new RegExp(`^${key}:\\s*(.+)$`, "m"))?.[1]?.trim() ?? "";
|
|
2895
2898
|
}
|
|
2896
2899
|
//#endregion
|
|
2897
|
-
//#region src/runtime/skills-types.ts
|
|
2898
|
-
function isSkillContribution(value) {
|
|
2899
|
-
if (!value || typeof value !== "object") return false;
|
|
2900
|
-
const skill = value;
|
|
2901
|
-
const hasBody = typeof skill.body === "string";
|
|
2902
|
-
const hasLoad = typeof skill.load === "function";
|
|
2903
|
-
return typeof skill.name === "string" && skill.name.length > 0 && typeof skill.label === "string" && (hasBody || hasLoad);
|
|
2904
|
-
}
|
|
2905
|
-
//#endregion
|
|
2906
2900
|
//#region src/runtime/skills-resolve.ts
|
|
2907
2901
|
function rawFromLoadResult(result) {
|
|
2908
2902
|
if (typeof result === "string") return result;
|
|
@@ -2936,12 +2930,121 @@ async function resolveSkillBody(skill) {
|
|
|
2936
2930
|
return (await resolveSkill(skill)).body;
|
|
2937
2931
|
}
|
|
2938
2932
|
//#endregion
|
|
2933
|
+
//#region src/runtime/skills-select.ts
|
|
2934
|
+
/**
|
|
2935
|
+
* Catalog-only prompt section. The model loads full skill bodies via skills.load.
|
|
2936
|
+
*/
|
|
2937
|
+
function formatSkillsPromptSection(skills) {
|
|
2938
|
+
if (!skills.length) return "";
|
|
2939
|
+
return ["Available skills (call skills.load with the skill name to load full instructions before relying on them):", skills.map((skill) => `- ${skill.name}: ${(skill.description ?? "").trim() || skill.label}`).join("\n")].join("\n");
|
|
2940
|
+
}
|
|
2941
|
+
/** @deprecated Prefer skills.load; kept for tests/helpers that still filter by goal. */
|
|
2942
|
+
function selectRelevantSkills(skills, ctx) {
|
|
2943
|
+
return skills.filter((skill) => {
|
|
2944
|
+
if (skill.relevant) return skill.relevant(ctx);
|
|
2945
|
+
return skillMatchesGoal(skill, ctx.goal);
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
var STOP_WORDS = /* @__PURE__ */ new Set([
|
|
2949
|
+
"that",
|
|
2950
|
+
"this",
|
|
2951
|
+
"with",
|
|
2952
|
+
"from",
|
|
2953
|
+
"your",
|
|
2954
|
+
"have",
|
|
2955
|
+
"when",
|
|
2956
|
+
"into",
|
|
2957
|
+
"call",
|
|
2958
|
+
"file",
|
|
2959
|
+
"files",
|
|
2960
|
+
"default",
|
|
2961
|
+
"export",
|
|
2962
|
+
"write",
|
|
2963
|
+
"using",
|
|
2964
|
+
"such",
|
|
2965
|
+
"does",
|
|
2966
|
+
"send",
|
|
2967
|
+
"open",
|
|
2968
|
+
"name",
|
|
2969
|
+
"they",
|
|
2970
|
+
"them",
|
|
2971
|
+
"then",
|
|
2972
|
+
"than",
|
|
2973
|
+
"also",
|
|
2974
|
+
"only",
|
|
2975
|
+
"over",
|
|
2976
|
+
"under",
|
|
2977
|
+
"about",
|
|
2978
|
+
"after",
|
|
2979
|
+
"before",
|
|
2980
|
+
"other",
|
|
2981
|
+
"which",
|
|
2982
|
+
"where",
|
|
2983
|
+
"whose",
|
|
2984
|
+
"their",
|
|
2985
|
+
"there",
|
|
2986
|
+
"these",
|
|
2987
|
+
"those",
|
|
2988
|
+
"and",
|
|
2989
|
+
"for",
|
|
2990
|
+
"the",
|
|
2991
|
+
"a",
|
|
2992
|
+
"an",
|
|
2993
|
+
"to",
|
|
2994
|
+
"of",
|
|
2995
|
+
"in",
|
|
2996
|
+
"on",
|
|
2997
|
+
"or",
|
|
2998
|
+
"by",
|
|
2999
|
+
"is",
|
|
3000
|
+
"are",
|
|
3001
|
+
"be",
|
|
3002
|
+
"as",
|
|
3003
|
+
"at",
|
|
3004
|
+
"it",
|
|
3005
|
+
"do",
|
|
3006
|
+
"not"
|
|
3007
|
+
]);
|
|
3008
|
+
function skillMatchesGoal(skill, goal) {
|
|
3009
|
+
const hay = goal.toLowerCase();
|
|
3010
|
+
if (!hay.trim()) return false;
|
|
3011
|
+
const tokens = `${skill.name} ${skill.label ?? ""} ${skill.description ?? ""}`.toLowerCase().split(/[^a-z0-9._-]+/).filter((token) => token.length >= 4 && !STOP_WORDS.has(token));
|
|
3012
|
+
if (!tokens.length) return false;
|
|
3013
|
+
return tokens.some((token) => hay.includes(token));
|
|
3014
|
+
}
|
|
3015
|
+
//#endregion
|
|
3016
|
+
//#region src/runtime/skills-types.ts
|
|
3017
|
+
function isSkillContribution(value) {
|
|
3018
|
+
if (!value || typeof value !== "object") return false;
|
|
3019
|
+
const skill = value;
|
|
3020
|
+
const hasBody = typeof skill.body === "string";
|
|
3021
|
+
const hasLoad = typeof skill.load === "function";
|
|
3022
|
+
return typeof skill.name === "string" && skill.name.length > 0 && typeof skill.label === "string" && (hasBody || hasLoad);
|
|
3023
|
+
}
|
|
3024
|
+
//#endregion
|
|
2939
3025
|
//#region src/runtime/skills.ts
|
|
2940
3026
|
/** Contribution slot for AI agent skills (Cursor-compatible SKILL.md content). */
|
|
2941
3027
|
var SYSTEM_SKILLS = "system.skills";
|
|
2942
3028
|
function listSkillContributions() {
|
|
2943
3029
|
return contributionRegistry.getContributions(SYSTEM_SKILLS).filter(isSkillContribution);
|
|
2944
3030
|
}
|
|
3031
|
+
/** Descriptions for the specialist prompt. Full bodies stay behind skills.load. */
|
|
3032
|
+
async function registeredSkillsPromptSection() {
|
|
3033
|
+
const skills = listSkillContributions().slice().sort((a, b) => (b.ranking ?? 0) - (a.ranking ?? 0));
|
|
3034
|
+
return formatSkillsPromptSection(await Promise.all(skills.map(describeSkill)));
|
|
3035
|
+
}
|
|
3036
|
+
async function describeSkill(skill) {
|
|
3037
|
+
try {
|
|
3038
|
+
const description = (await resolveSkill(skill)).description || skill.description;
|
|
3039
|
+
if (!description || description === skill.description) return skill;
|
|
3040
|
+
return {
|
|
3041
|
+
...skill,
|
|
3042
|
+
description
|
|
3043
|
+
};
|
|
3044
|
+
} catch {
|
|
3045
|
+
return skill;
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
2945
3048
|
/** Register a SKILL.md document on {@link SYSTEM_SKILLS}. Returns an unregister function. */
|
|
2946
3049
|
function registerSkillMarkdown(raw, opts) {
|
|
2947
3050
|
const parsed = parseSkillMarkdown(raw);
|
|
@@ -3312,7 +3415,10 @@ var CognitiveRuntime = class {
|
|
|
3312
3415
|
return err;
|
|
3313
3416
|
}
|
|
3314
3417
|
const goal = tick.intent?.summary ?? promptSummary;
|
|
3315
|
-
let systemPrompt = systemPromptFor(role, goal, {
|
|
3418
|
+
let systemPrompt = systemPromptFor(role, goal, {
|
|
3419
|
+
hasAttachments: published.length > 0 || (this.sessions.get(session.id)?.attachments?.length ?? 0) > 0,
|
|
3420
|
+
skillsSection: await registeredSkillsPromptSection()
|
|
3421
|
+
});
|
|
3316
3422
|
for (const enhance of this.promptEnhancers) systemPrompt = await enhance(systemPrompt, {
|
|
3317
3423
|
role,
|
|
3318
3424
|
goal,
|
|
@@ -3588,6 +3694,6 @@ function registerSkillCommands() {
|
|
|
3588
3694
|
});
|
|
3589
3695
|
}
|
|
3590
3696
|
//#endregion
|
|
3591
|
-
export {
|
|
3697
|
+
export { OPEN_AI_SETTINGS_COMMAND as A, listConfiguredModelIds as C, AI_SETTINGS_EDITOR_ID as D, loadModelsCatalog as E, AI_SETTINGS_KEY as O, defaultProvidersSettings as S, detectEffortCapability as T, formatTokenCount as _, listSkillContributions as a, OpenAICompatibleProvider as b, formatSkillsPromptSection as c, resolveSkillBody as d, formatSkillForPrompt as f, formatContextPercent as g, formatBucketDetail as h, SYSTEM_SKILLS as i, TOPIC as j, AI_VIEW_NAME as k, selectRelevantSkills as l, estimateSessionContextUsage as m, CognitiveRuntime as n, registerSkillMarkdown as o, parseSkillMarkdown as p, cognitiveRuntime as r, isSkillContribution as s, registerSkillCommands as t, resolveSkill as u, ATTACHMENT_FILE_ACCEPT as v, parseModelIds as w, fetchOpenAICompatibleModels as x, readPromptAttachmentFromFile as y };
|
|
3592
3698
|
|
|
3593
|
-
//# sourceMappingURL=runtime-
|
|
3699
|
+
//# sourceMappingURL=runtime-CI4JObpD.js.map
|