@eclipse-docks/extension-ai-system 0.8.0 → 0.8.2

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.
Files changed (66) hide show
  1. package/README.md +2 -2
  2. package/dist/api.d.ts +1 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +87 -2
  5. package/dist/api.js.map +1 -0
  6. package/dist/{cognitive-extension-CG_d39K5.js → cognitive-extension-BKGxwLYj.js} +524 -102
  7. package/dist/cognitive-extension-BKGxwLYj.js.map +1 -0
  8. package/dist/cognitive-extension.d.ts.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/runtime/abort.d.ts +5 -0
  11. package/dist/runtime/abort.d.ts.map +1 -0
  12. package/dist/runtime/attachment-paths.d.ts +17 -0
  13. package/dist/runtime/attachment-paths.d.ts.map +1 -0
  14. package/dist/runtime/attachments.d.ts +5 -5
  15. package/dist/runtime/attachments.d.ts.map +1 -1
  16. package/dist/runtime/cognitive-runtime.d.ts +12 -3
  17. package/dist/runtime/cognitive-runtime.d.ts.map +1 -1
  18. package/dist/runtime/context/usage.d.ts +3 -0
  19. package/dist/runtime/context/usage.d.ts.map +1 -1
  20. package/dist/runtime/index.d.ts +4 -0
  21. package/dist/runtime/index.d.ts.map +1 -1
  22. package/dist/runtime/models/openai-compatible.d.ts.map +1 -1
  23. package/dist/runtime/models/types.d.ts +6 -1
  24. package/dist/runtime/models/types.d.ts.map +1 -1
  25. package/dist/runtime/session-workspace.d.ts +20 -0
  26. package/dist/runtime/session-workspace.d.ts.map +1 -0
  27. package/dist/runtime/skills-commands.d.ts +3 -0
  28. package/dist/runtime/skills-commands.d.ts.map +1 -0
  29. package/dist/runtime/skills-parse.d.ts +14 -0
  30. package/dist/runtime/skills-parse.d.ts.map +1 -0
  31. package/dist/runtime/skills-resolve.d.ts +9 -0
  32. package/dist/runtime/skills-resolve.d.ts.map +1 -0
  33. package/dist/runtime/skills-select.d.ts +9 -0
  34. package/dist/runtime/skills-select.d.ts.map +1 -0
  35. package/dist/runtime/skills-types.d.ts +47 -0
  36. package/dist/runtime/skills-types.d.ts.map +1 -0
  37. package/dist/runtime/skills.d.ts +13 -0
  38. package/dist/runtime/skills.d.ts.map +1 -0
  39. package/dist/runtime/specialists/index.d.ts.map +1 -1
  40. package/dist/runtime/specialists/loop.d.ts.map +1 -1
  41. package/dist/runtime/tools/command-adapter.d.ts.map +1 -1
  42. package/dist/runtime/tools/fetch-adapter.d.ts +4 -0
  43. package/dist/runtime/tools/fetch-adapter.d.ts.map +1 -0
  44. package/dist/runtime/tools/index.d.ts +1 -1
  45. package/dist/runtime/tools/index.d.ts.map +1 -1
  46. package/dist/runtime/tools/workspace-adapter.d.ts +1 -1
  47. package/dist/runtime/tools/workspace-adapter.d.ts.map +1 -1
  48. package/dist/runtime/tools/workspace-path-qualify.d.ts +22 -0
  49. package/dist/runtime/tools/workspace-path-qualify.d.ts.map +1 -0
  50. package/dist/runtime/tools/workspace-path.d.ts +17 -0
  51. package/dist/runtime/tools/workspace-path.d.ts.map +1 -0
  52. package/dist/runtime/types.d.ts +7 -0
  53. package/dist/runtime/types.d.ts.map +1 -1
  54. package/dist/{runtime-DfNGzEjU.js → runtime-B0IHjzQO.js} +1042 -401
  55. package/dist/runtime-B0IHjzQO.js.map +1 -0
  56. package/dist/view/busy-status.d.ts +12 -0
  57. package/dist/view/busy-status.d.ts.map +1 -0
  58. package/dist/view/cognitive-settings-editor.d.ts +0 -1
  59. package/dist/view/cognitive-settings-editor.d.ts.map +1 -1
  60. package/dist/view/cognitive-view.d.ts +22 -0
  61. package/dist/view/cognitive-view.d.ts.map +1 -1
  62. package/package.json +1 -1
  63. package/dist/cognitive-extension-CG_d39K5.js.map +0 -1
  64. package/dist/runtime/tools/attachment-adapter.d.ts +0 -6
  65. package/dist/runtime/tools/attachment-adapter.d.ts.map +0 -1
  66. package/dist/runtime-DfNGzEjU.js.map +0 -1
package/README.md CHANGED
@@ -6,9 +6,9 @@ Cognitive chat runtime for Eclipse Docks: sessions, model routing, tool broker w
6
6
 
7
7
  The **harness** (prompt → specialist loop → tools → approvals → streaming UI) is the working product path.
8
8
 
9
- Composer supports **attachments** (paperclip / drag-drop, up to 8). Payloads (text or image data URLs) are stored on the **session**, not inlined into chat history. The user turn only publishes a lightweight reference; the model calls `attachment_list` / `attachment_read` when it needs contents (images are presented for vision only on read). This keeps baseline token use low.
9
+ Composer supports **attachments** (paperclip / drag-drop / Ctrl+V, up to 8). Payloads live on the **session**. The shared in-memory root is domain-agnostic: callers register **live file callbacks** that resolve payloads on read (no copies). AI places refs under `in-memory/<sessionId>/…` and optionally projects the mount to the active session folder. The root is not mounted by default. Image data-URL files are presented for vision on read.
10
10
 
11
- Supported: text files (≤~100k chars stored) and visual media (jpeg/png/gif/webp/svg/ico/bmp/avif/tiff, ≤4MB). SVG keeps source text for `attachment_read` plus a preview data URL. Audio/video rejected.
11
+ Supported: text files (≤~100k chars stored) and visual media (jpeg/png/gif/webp/svg/ico/bmp/avif/tiff, ≤4MB). SVG keeps source text plus a preview data URL. Audio/video rejected. Storage bootstrap commands (`connect_opfs`, `load_workspace`, …) are not exposed as LLM tools.
12
12
 
13
13
  **ICOM Core** (`runtime/core`) and **ACT-R memory** (`runtime/memory` + session buffers) are wired into each turn but do not yet drive model policy, tool policy, or prompt content in a meaningful way. Treat them as scaffolding until the todos below land.
14
14
 
package/dist/api.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { cognitiveRuntime, CognitiveRuntime, TOPIC, AI_VIEW_NAME, AI_SETTINGS_KEY, AI_SETTINGS_EDITOR_ID, OPEN_AI_SETTINGS_COMMAND, defaultProvidersSettings, fetchOpenAICompatibleModels, listConfiguredModelIds, loadModelsCatalog, parseModelIds, OpenAICompatibleProvider, type ChatMessage, type MessagePart, type PromptAttachment, type SessionAttachment, type CognitiveSession, type Checkpoint, type ModelPolicy, type EffortLevel, type OptimizeFor, type SpecialistRole, type PermissionAction, type ToolApprovalMode, type EmotionalState, type ProviderConfig, type ProvidersSettings, type RemoteModelInfo, type ModelProvider, type StreamParams, type StreamChunk, type ProviderChatMessage, type SystemPromptEnhancer, } from './runtime';
1
+ export { cognitiveRuntime, CognitiveRuntime, TOPIC, AI_VIEW_NAME, AI_SETTINGS_KEY, AI_SETTINGS_EDITOR_ID, OPEN_AI_SETTINGS_COMMAND, defaultProvidersSettings, fetchOpenAICompatibleModels, listConfiguredModelIds, loadModelsCatalog, parseModelIds, OpenAICompatibleProvider, type ChatMessage, type MessagePart, type PromptAttachment, type SessionAttachment, type CognitiveSession, type Checkpoint, type ModelPolicy, type EffortLevel, type OptimizeFor, type SpecialistRole, type PermissionAction, type ToolApprovalMode, type TokenUsage, type EmotionalState, type ProviderConfig, type ProvidersSettings, type RemoteModelInfo, type ModelProvider, type StreamParams, type StreamChunk, type ProviderChatMessage, type SystemPromptEnhancer, type AgentSkill, type ResolvedSkill, type SkillContribution, type SkillLoadResult, type SkillRelevanceContext, SYSTEM_SKILLS, parseSkillMarkdown, formatSkillForPrompt, formatSkillsPromptSection, registerSkillMarkdown, registerSkillCommands, listSkillContributions, resolveSkill, resolveSkillBody, selectRelevantSkills, isSkillContribution, } from './runtime';
2
2
  //# sourceMappingURL=api.d.ts.map
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,WAAW,CAAC"}
package/dist/api.js CHANGED
@@ -1,2 +1,87 @@
1
- import { _ as AI_SETTINGS_KEY, b as TOPIC, d as defaultProvidersSettings, f as listConfiguredModelIds, g as AI_SETTINGS_EDITOR_ID, h as loadModelsCatalog, l as OpenAICompatibleProvider, n as cognitiveRuntime, p as parseModelIds, t as CognitiveRuntime, u as fetchOpenAICompatibleModels, v as AI_VIEW_NAME, y as OPEN_AI_SETTINGS_COMMAND } from "./runtime-DfNGzEjU.js";
2
- export { AI_SETTINGS_EDITOR_ID, AI_SETTINGS_KEY, AI_VIEW_NAME, CognitiveRuntime, OPEN_AI_SETTINGS_COMMAND, OpenAICompatibleProvider, TOPIC, cognitiveRuntime, defaultProvidersSettings, fetchOpenAICompatibleModels, listConfiguredModelIds, loadModelsCatalog, parseModelIds };
1
+ import { D as AI_VIEW_NAME, E as AI_SETTINGS_KEY, O as OPEN_AI_SETTINGS_COMMAND, S as parseModelIds, T as AI_SETTINGS_EDITOR_ID, a as listSkillContributions, b as defaultProvidersSettings, c as resolveSkillBody, d as parseSkillMarkdown, i as SYSTEM_SKILLS, k as TOPIC, l as isSkillContribution, n as CognitiveRuntime, o as registerSkillMarkdown, r as cognitiveRuntime, s as resolveSkill, t as registerSkillCommands, u as formatSkillForPrompt, v as OpenAICompatibleProvider, w as loadModelsCatalog, x as listConfiguredModelIds, y as fetchOpenAICompatibleModels } from "./runtime-B0IHjzQO.js";
2
+ //#region src/runtime/skills-select.ts
3
+ /**
4
+ * Catalog-only prompt section. The model loads full skill bodies via skills.load.
5
+ */
6
+ function formatSkillsPromptSection(skills) {
7
+ if (!skills.length) return "";
8
+ 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");
9
+ }
10
+ /** @deprecated Prefer skills.load; kept for tests/helpers that still filter by goal. */
11
+ function selectRelevantSkills(skills, ctx) {
12
+ return skills.filter((skill) => {
13
+ if (skill.relevant) return skill.relevant(ctx);
14
+ return skillMatchesGoal(skill, ctx.goal);
15
+ });
16
+ }
17
+ var STOP_WORDS = /* @__PURE__ */ new Set([
18
+ "that",
19
+ "this",
20
+ "with",
21
+ "from",
22
+ "your",
23
+ "have",
24
+ "when",
25
+ "into",
26
+ "call",
27
+ "file",
28
+ "files",
29
+ "default",
30
+ "export",
31
+ "write",
32
+ "using",
33
+ "such",
34
+ "does",
35
+ "send",
36
+ "open",
37
+ "name",
38
+ "they",
39
+ "them",
40
+ "then",
41
+ "than",
42
+ "also",
43
+ "only",
44
+ "over",
45
+ "under",
46
+ "about",
47
+ "after",
48
+ "before",
49
+ "other",
50
+ "which",
51
+ "where",
52
+ "whose",
53
+ "their",
54
+ "there",
55
+ "these",
56
+ "those",
57
+ "and",
58
+ "for",
59
+ "the",
60
+ "a",
61
+ "an",
62
+ "to",
63
+ "of",
64
+ "in",
65
+ "on",
66
+ "or",
67
+ "by",
68
+ "is",
69
+ "are",
70
+ "be",
71
+ "as",
72
+ "at",
73
+ "it",
74
+ "do",
75
+ "not"
76
+ ]);
77
+ function skillMatchesGoal(skill, goal) {
78
+ const hay = goal.toLowerCase();
79
+ if (!hay.trim()) return false;
80
+ const tokens = `${skill.name} ${skill.label ?? ""} ${skill.description ?? ""}`.toLowerCase().split(/[^a-z0-9._-]+/).filter((token) => token.length >= 4 && !STOP_WORDS.has(token));
81
+ if (!tokens.length) return false;
82
+ return tokens.some((token) => hay.includes(token));
83
+ }
84
+ //#endregion
85
+ export { AI_SETTINGS_EDITOR_ID, AI_SETTINGS_KEY, AI_VIEW_NAME, CognitiveRuntime, OPEN_AI_SETTINGS_COMMAND, OpenAICompatibleProvider, SYSTEM_SKILLS, TOPIC, cognitiveRuntime, defaultProvidersSettings, fetchOpenAICompatibleModels, formatSkillForPrompt, formatSkillsPromptSection, isSkillContribution, listConfiguredModelIds, listSkillContributions, loadModelsCatalog, parseModelIds, parseSkillMarkdown, registerSkillCommands, registerSkillMarkdown, resolveSkill, resolveSkillBody, selectRelevantSkills };
86
+
87
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","names":[],"sources":["../src/runtime/skills-select.ts"],"sourcesContent":["import type { SkillContribution, SkillRelevanceContext } from './skills-types';\n\nexport type { SkillContribution, SkillRelevanceContext } from './skills-types';\n\n/**\n * Catalog-only prompt section. The model loads full skill bodies via skills.load.\n */\nexport function formatSkillsPromptSection(skills: SkillContribution[]): string {\n if (!skills.length) return '';\n const catalog = skills\n .map((skill) => `- ${skill.name}: ${(skill.description ?? '').trim() || skill.label}`)\n .join('\\n');\n return [\n 'Available skills (call skills.load with the skill name to load full instructions before relying on them):',\n catalog,\n ].join('\\n');\n}\n\n/** @deprecated Prefer skills.load; kept for tests/helpers that still filter by goal. */\nexport function selectRelevantSkills(\n skills: SkillContribution[],\n ctx: SkillRelevanceContext,\n): SkillContribution[] {\n return skills.filter((skill) => {\n if (skill.relevant) return skill.relevant(ctx);\n return skillMatchesGoal(skill, ctx.goal);\n });\n}\n\nconst STOP_WORDS = new Set([\n 'that',\n 'this',\n 'with',\n 'from',\n 'your',\n 'have',\n 'when',\n 'into',\n 'call',\n 'file',\n 'files',\n 'default',\n 'export',\n 'write',\n 'using',\n 'such',\n 'does',\n 'send',\n 'open',\n 'name',\n 'they',\n 'them',\n 'then',\n 'than',\n 'also',\n 'only',\n 'over',\n 'under',\n 'about',\n 'after',\n 'before',\n 'other',\n 'which',\n 'where',\n 'whose',\n 'their',\n 'there',\n 'these',\n 'those',\n 'and',\n 'for',\n 'the',\n 'a',\n 'an',\n 'to',\n 'of',\n 'in',\n 'on',\n 'or',\n 'by',\n 'is',\n 'are',\n 'be',\n 'as',\n 'at',\n 'it',\n 'do',\n 'not',\n]);\n\nfunction skillMatchesGoal(skill: SkillContribution, goal: string): boolean {\n const hay = goal.toLowerCase();\n if (!hay.trim()) return false;\n const tokens = `${skill.name} ${skill.label ?? ''} ${skill.description ?? ''}`\n .toLowerCase()\n .split(/[^a-z0-9._-]+/)\n .filter((token) => token.length >= 4 && !STOP_WORDS.has(token));\n if (!tokens.length) return false;\n return tokens.some((token) => hay.includes(token));\n}\n"],"mappings":";;;;;AAOA,SAAgB,0BAA0B,QAAqC;CAC7E,IAAI,CAAC,OAAO,QAAQ,OAAO;CAI3B,OAAO,CACL,6GAJc,OACb,KAAK,UAAU,KAAK,MAAM,KAAK,KAAK,MAAM,eAAe,GAAA,CAAI,KAAK,KAAK,MAAM,OAAO,CAAC,CACrF,KAAK,IAGN,CACF,CAAC,CAAC,KAAK,IAAI;AACb;;AAGA,SAAgB,qBACd,QACA,KACqB;CACrB,OAAO,OAAO,QAAQ,UAAU;EAC9B,IAAI,MAAM,UAAU,OAAO,MAAM,SAAS,GAAG;EAC7C,OAAO,iBAAiB,OAAO,IAAI,IAAI;CACzC,CAAC;AACH;AAEA,IAAM,6BAAa,IAAI,IAAI;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,iBAAiB,OAA0B,MAAuB;CACzE,MAAM,MAAM,KAAK,YAAY;CAC7B,IAAI,CAAC,IAAI,KAAK,GAAG,OAAO;CACxB,MAAM,SAAS,GAAG,MAAM,KAAK,GAAG,MAAM,SAAS,GAAG,GAAG,MAAM,eAAe,KACvE,YAAY,CAAC,CACb,MAAM,eAAe,CAAC,CACtB,QAAQ,UAAU,MAAM,UAAU,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC;CAChE,IAAI,CAAC,OAAO,QAAQ,OAAO;CAC3B,OAAO,OAAO,MAAM,UAAU,IAAI,SAAS,KAAK,CAAC;AACnD"}