@cerebriline/core 4.100.240 → 4.100.241

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 (59) hide show
  1. package/assets/skills/README.md +14 -0
  2. package/assets/skills/build-project/SKILL.md +103 -0
  3. package/assets/skills/docker-compose-deploy/SKILL.md +239 -0
  4. package/assets/skills/librarian/SKILL.md +177 -0
  5. package/assets/skills/mandatory-qa-prompt-and-issue-resolution/SKILL.md +58 -0
  6. package/assets/skills/run-project/SKILL.md +103 -0
  7. package/assets/skills/sdd-discuss/SKILL.md +129 -0
  8. package/assets/skills/sdd-execute/SKILL.md +146 -0
  9. package/assets/skills/sdd-plan/SKILL.md +140 -0
  10. package/assets/skills/sdd-quick/SKILL.md +40 -0
  11. package/assets/skills/sdd-status/SKILL.md +75 -0
  12. package/assets/skills/sdd-verify/SKILL.md +122 -0
  13. package/assets/skills/sdd-wizard/SKILL.md +105 -0
  14. package/assets/skills/tdd-coverage/SKILL.md +88 -0
  15. package/assets/skills/tdd-gen/SKILL.md +82 -0
  16. package/assets/skills/tdd-test/SKILL.md +61 -0
  17. package/assets/skills/tdd-wizard/SKILL.md +162 -0
  18. package/dist/extensions/config/bundled-skills.d.ts +24 -0
  19. package/dist/extensions/config/index.d.ts +2 -1
  20. package/dist/extensions/config/unified-config-file-watcher.d.ts +15 -0
  21. package/dist/extensions/config/user-instruction-config-loader.d.ts +15 -0
  22. package/dist/extensions/tools/executors/document/ebook.d.ts +10 -0
  23. package/dist/extensions/tools/executors/document/formats.d.ts +25 -0
  24. package/dist/extensions/tools/executors/document/ocr.d.ts +3 -0
  25. package/dist/extensions/tools/executors/document/recognition.d.ts +16 -0
  26. package/dist/extensions/tools/executors/document-extract.d.ts +91 -0
  27. package/dist/extensions/tools/librarian-tools.d.ts +35 -0
  28. package/dist/extensions/tools/library-import-run.d.ts +79 -0
  29. package/dist/extensions/tools/library-tools.d.ts +88 -0
  30. package/dist/extensions/tools/memory-tools.d.ts +41 -0
  31. package/dist/extensions/tools/sdd-tool.d.ts +215 -0
  32. package/dist/extensions/tools/team/create-agent-tool.d.ts +5 -4
  33. package/dist/hub/daemon/entry.js +547 -545
  34. package/dist/hub/index.js +531 -529
  35. package/dist/index.d.ts +17 -1
  36. package/dist/index.js +1070 -689
  37. package/dist/services/global-settings.d.ts +9 -0
  38. package/dist/services/llms/provider-settings.d.ts +15 -15
  39. package/dist/services/retrieval/catalogue.d.ts +370 -0
  40. package/dist/services/retrieval/chunker.d.ts +44 -0
  41. package/dist/services/retrieval/embedding-client.d.ts +78 -0
  42. package/dist/services/retrieval/fingerprint.d.ts +21 -0
  43. package/dist/services/retrieval/firecrawl.d.ts +77 -0
  44. package/dist/services/retrieval/lancedb-runtime.d.ts +84 -0
  45. package/dist/services/retrieval/lancedb-runtime.manifest.d.ts +17 -0
  46. package/dist/services/retrieval/library-store.d.ts +148 -0
  47. package/dist/services/retrieval/library.d.ts +139 -0
  48. package/dist/services/retrieval/memory-recall.d.ts +97 -0
  49. package/dist/services/retrieval/memory.d.ts +184 -0
  50. package/dist/services/retrieval/retrieve.d.ts +85 -0
  51. package/dist/services/retrieval/tar-extract.d.ts +14 -0
  52. package/dist/services/retrieval/tar-write.d.ts +20 -0
  53. package/dist/services/retrieval/vector-index.d.ts +82 -0
  54. package/dist/services/sdd/sdd-engine.d.ts +248 -0
  55. package/dist/services/telemetry/index.js +1 -1
  56. package/dist/types/config.d.ts +7 -0
  57. package/dist/types/session.d.ts +2 -0
  58. package/package.json +4 -4
  59. package/dist/extensions/tools/code-intel.d.ts +0 -131
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The Library's tools: what the model sees of it.
3
+ *
4
+ * `search_library` finds passages in the books the user has collected and
5
+ * `list_library` says what is there, shelf by shelf. Both are offered
6
+ * whenever the Library is on. Everything that changes the Library is the
7
+ * librarian's (`librarian-tools.ts`), and offered only with that skill.
8
+ *
9
+ * They work on keywords alone; an embedding model and a reranker, when the
10
+ * user has configured them, make the search better and change nothing else.
11
+ */
12
+ import { type AgentTool, type LibrarySettings } from "@cerebriline/shared";
13
+ import type { Catalogue, LibraryBook, LibraryShelf } from "../../services/retrieval/catalogue";
14
+ import type { RetrievalEndpoint } from "../../services/retrieval/embedding-client";
15
+ import type { ScrapeEndpoint } from "../../services/retrieval/firecrawl";
16
+ import { type Library } from "../../services/retrieval/library";
17
+ import type { RetrieveResult } from "../../services/retrieval/retrieve";
18
+ import type { DocumentReaderSettings } from "./executors/document/ocr";
19
+ import type { DescribeImages } from "./executors/document/recognition";
20
+ export declare const LIBRARY_TOOL_NAMES: readonly ["search_library", "list_library"];
21
+ export type LibraryToolName = (typeof LIBRARY_TOOL_NAMES)[number];
22
+ /** The built-in skill that brings the librarian's tools with it. */
23
+ export declare const LIBRARIAN_SKILL_NAME = "librarian";
24
+ export interface LibraryScrapeConfig extends ScrapeEndpoint {
25
+ /** Pages one crawl reads, at most. */
26
+ maxPages: number;
27
+ /** How many links deep a crawl follows. */
28
+ maxDepth: number;
29
+ }
30
+ export interface LibraryToolsConfig {
31
+ settings: LibrarySettings;
32
+ /** The embedding model, when the user has set one. */
33
+ embedding?: RetrievalEndpoint;
34
+ /** The reranking model, when the user has set one. */
35
+ reranker?: RetrievalEndpoint;
36
+ documentReader?: DocumentReaderSettings;
37
+ /**
38
+ * The scraping endpoint, when it is set up under Features and the
39
+ * session's profile allows it. Without it the librarian has no web tools.
40
+ */
41
+ scrape?: LibraryScrapeConfig;
42
+ }
43
+ export interface CreateLibraryToolsOptions {
44
+ cwd: string;
45
+ /**
46
+ * Read on every call: the settings can change mid-session. Undefined, or
47
+ * settings with `enabled` off, means the Library is off.
48
+ */
49
+ getConfig: () => LibraryToolsConfig | undefined;
50
+ /** @default the shared Library of the data folder */
51
+ library?: Library;
52
+ /**
53
+ * The model that describes a book's pictures, read when a book is added.
54
+ * May take a moment: a host can ask a server whether a model reads images.
55
+ */
56
+ getDescribeImages?: () => DescribeImages | undefined | Promise<DescribeImages | undefined>;
57
+ /** Whether the librarian's tools are offered. @default the librarian skill is on */
58
+ librarian?: boolean;
59
+ onError?: (message: string, error: unknown) => void;
60
+ log?: (message: string) => void;
61
+ }
62
+ export declare const LIBRARY_OFF = "The Library is turned off. The user turns it on under Settings > Library; do not call this again in this task.";
63
+ export declare function errorText(error: unknown): string;
64
+ export declare function strings(value: unknown): string[];
65
+ export declare function text(value: unknown): string;
66
+ export declare function activeConfig(options: CreateLibraryToolsOptions): LibraryToolsConfig | undefined;
67
+ export declare function plural(count: number, one: string, many?: string): string;
68
+ /** What is on the shelves, as the model is shown it. */
69
+ export declare function describeShelves(catalogue: Catalogue): string;
70
+ /**
71
+ * A shelf as the model names it: "Section / Shelf", or the shelf's name
72
+ * alone when only one shelf has it.
73
+ */
74
+ export declare function resolveShelf(catalogue: Catalogue, reference: string, section?: string): (LibraryShelf & {
75
+ section: string;
76
+ }) | undefined;
77
+ export declare function describeBookLine(book: LibraryBook): string;
78
+ export declare function describeSearch(query: string, result: RetrieveResult, collectionName: (id: number) => string): string;
79
+ /** One book in full: what it is, what it was made from, its pictures. */
80
+ export declare function describeBook(catalogue: Catalogue, book: LibraryBook): string;
81
+ /** Whether the user has the librarian skill turned on. */
82
+ export declare function isLibrarianEnabled(): boolean;
83
+ /**
84
+ * The Library's tools, when the Library is on at session start. Whether it
85
+ * is on is read again on every call, so turning it off mid-session stops the
86
+ * tools answering without a restart.
87
+ */
88
+ export declare function createLibraryTools(options: CreateLibraryToolsOptions): AgentTool[];
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Memory's tools: `remember`, `recall` and `forget`.
3
+ *
4
+ * What the model keeps from one task to the next. The store works on
5
+ * keywords alone; the embedding and reranking models of the Embedding tab,
6
+ * when set, make a recall find a note by what it means.
7
+ *
8
+ * Which memories a session uses is the user's choice per workspace, made in
9
+ * the Memory panel: one memory new notes are kept in, and the memories that
10
+ * are searched. The tools take no memory name: a model cannot store to, or
11
+ * read from, a memory the user did not allow this workspace.
12
+ */
13
+ import { type AgentTool, type MemorySettings } from "@cerebriline/shared";
14
+ import { type Memory, type MemoryEndpoints } from "../../services/retrieval/memory";
15
+ export declare const MEMORY_TOOL_NAMES: readonly ["remember", "recall", "forget"];
16
+ export type MemoryToolName = (typeof MEMORY_TOOL_NAMES)[number];
17
+ export interface MemoryToolsConfig extends MemoryEndpoints {
18
+ settings: MemorySettings;
19
+ }
20
+ export interface CreateMemoryToolsOptions {
21
+ /** The workspace, which is what the user's choice of memories is filed under. */
22
+ cwd: string;
23
+ /** Read on every call. Undefined, or `enabled` off, means Memory is off. */
24
+ getConfig: () => MemoryToolsConfig | undefined;
25
+ /** @default the shared Memory of the data folder */
26
+ memory?: Memory;
27
+ onError?: (message: string, error: unknown) => void;
28
+ log?: (message: string) => void;
29
+ }
30
+ /**
31
+ * The memories this workspace uses, held to the ones that exist: a memory
32
+ * deleted after it was picked is left out of the search, and notes go to
33
+ * the main memory rather than nowhere.
34
+ */
35
+ export declare function resolveMemoryAccess(memory: Memory, settings: MemorySettings, cwd: string): {
36
+ store: string;
37
+ recall: string[];
38
+ storeFellBack?: string;
39
+ };
40
+ /** Memory's tools, when Memory is on at session start. */
41
+ export declare function createMemoryTools(options: CreateMemoryToolsOptions): AgentTool[];
@@ -0,0 +1,215 @@
1
+ /**
2
+ * The `sdd` tool: the spec-driven engine, as the model sees it.
3
+ *
4
+ * One tool with an `action`, not twenty tools: every tool's schema is paid
5
+ * for in every request, and these are used one at a time. Every answer ends
6
+ * with the step that is due, so the model never has to work out its place.
7
+ */
8
+ import { type AgentTool } from "@cerebriline/shared";
9
+ import { SddEngine } from "../../services/sdd/sdd-engine";
10
+ export declare const SDD_TOOL_NAME = "sdd";
11
+ export declare const SDD_ACTIONS: readonly ["next", "status", "set_project", "add_requirement", "update_requirement", "add_decision", "add_knowledge", "capture", "add_milestone", "update_milestone", "approve", "plan_milestone", "add_slices", "remove_slice", "plan_slice", "replan_slice", "start_task", "complete_task", "block_task", "complete_slice", "validate_milestone", "complete_milestone", "quick"];
12
+ export type SddAction = (typeof SDD_ACTIONS)[number];
13
+ export declare const SDD_TOOL_DESCRIPTION = "Spec-driven development: the project's plan and where the work stands, kept in a database in the project (.sdd/). Use it for every step of a planned build; do not keep the plan in your head or in files of your own.\n\nCall with action \"next\" whenever you are unsure what to do: it answers with the one step that is due and everything that step needs. Every other action ends by telling you the next step too. A step out of turn is refused with the reason.\n\nActions:\n- next, status: where things stand. Change nothing.\n- set_project {name, description, agreements}\n- add_requirement {title, description}; update_requirement {id, status: active | validated | deferred | out_of_scope}\n- add_decision {title, choice, why}; add_knowledge {text}; capture {text} (a thought for later)\n- add_milestone {title, context}; update_milestone {title, context}\n- approve {what: \"requirements\" | \"roadmap\"}: only after the user has said yes to them.\n- plan_milestone {slices: [{title, goal, demo, depends: [\"S01\"], requirements: [\"R001\"]}]}\n- add_slices {slices}: more slices on an approved roadmap, when the user agreed to more scope. remove_slice {slice, reason}: take off one that has no work in it.\n- plan_slice {research, tasks: [{title, steps, files: [], verify, expect}]}\n- replan_slice {reason, tasks}: after a blocker; done tasks are kept.\n- start_task; complete_task {summary, evidence}; block_task {reason}\n- complete_slice {summary, uat: [{check, result: \"pass\" | \"fail\" | \"needs_human\", note}]}\n- validate_milestone {verdict: \"pass\" | \"needs_remediation\", findings, remediation: [slices]}\n- complete_milestone {summary}\n- quick {title, summary}: record a small change made outside the plan.\n\nevidence is the real output of the task's verify command, run in the workspace. Never write it from memory.";
14
+ export declare const SDD_TOOL_INPUT_SCHEMA: {
15
+ readonly type: "object";
16
+ readonly properties: {
17
+ readonly action: {
18
+ readonly type: "string";
19
+ readonly enum: readonly ["next", "status", "set_project", "add_requirement", "update_requirement", "add_decision", "add_knowledge", "capture", "add_milestone", "update_milestone", "approve", "plan_milestone", "add_slices", "remove_slice", "plan_slice", "replan_slice", "start_task", "complete_task", "block_task", "complete_slice", "validate_milestone", "complete_milestone", "quick"];
20
+ };
21
+ readonly name: {
22
+ readonly type: "string";
23
+ };
24
+ readonly title: {
25
+ readonly type: "string";
26
+ };
27
+ readonly description: {
28
+ readonly type: "string";
29
+ };
30
+ readonly agreements: {
31
+ readonly type: "string";
32
+ };
33
+ readonly context: {
34
+ readonly type: "string";
35
+ };
36
+ readonly text: {
37
+ readonly type: "string";
38
+ };
39
+ readonly id: {
40
+ readonly type: "string";
41
+ readonly description: "A requirement id, e.g. R003.";
42
+ };
43
+ readonly status: {
44
+ readonly type: "string";
45
+ readonly enum: readonly ["active", "validated", "deferred", "out_of_scope"];
46
+ };
47
+ readonly choice: {
48
+ readonly type: "string";
49
+ };
50
+ readonly why: {
51
+ readonly type: "string";
52
+ };
53
+ readonly what: {
54
+ readonly type: "string";
55
+ readonly enum: readonly ["requirements", "roadmap"];
56
+ };
57
+ readonly slice: {
58
+ readonly type: "string";
59
+ readonly description: "A slice, e.g. S02. Leave out for the one that is due.";
60
+ };
61
+ readonly task: {
62
+ readonly type: "string";
63
+ readonly description: "A task, e.g. T03. Leave out for the one that is due.";
64
+ };
65
+ readonly slices: {
66
+ readonly type: "array";
67
+ readonly items: {
68
+ readonly type: "object";
69
+ readonly properties: {
70
+ readonly title: {
71
+ readonly type: "string";
72
+ };
73
+ readonly goal: {
74
+ readonly type: "string";
75
+ };
76
+ readonly demo: {
77
+ readonly type: "string";
78
+ readonly description: "What shows that the slice works.";
79
+ };
80
+ readonly depends: {
81
+ readonly type: "array";
82
+ readonly items: {
83
+ readonly type: "string";
84
+ };
85
+ };
86
+ readonly requirements: {
87
+ readonly type: "array";
88
+ readonly items: {
89
+ readonly type: "string";
90
+ };
91
+ };
92
+ };
93
+ readonly required: readonly ["title"];
94
+ };
95
+ };
96
+ readonly remediation: {
97
+ readonly type: "array";
98
+ readonly items: {
99
+ readonly type: "object";
100
+ readonly properties: {
101
+ readonly title: {
102
+ readonly type: "string";
103
+ };
104
+ readonly goal: {
105
+ readonly type: "string";
106
+ };
107
+ readonly demo: {
108
+ readonly type: "string";
109
+ readonly description: "What shows that the slice works.";
110
+ };
111
+ readonly depends: {
112
+ readonly type: "array";
113
+ readonly items: {
114
+ readonly type: "string";
115
+ };
116
+ };
117
+ readonly requirements: {
118
+ readonly type: "array";
119
+ readonly items: {
120
+ readonly type: "string";
121
+ };
122
+ };
123
+ };
124
+ readonly required: readonly ["title"];
125
+ };
126
+ };
127
+ readonly research: {
128
+ readonly type: "string";
129
+ };
130
+ readonly tasks: {
131
+ readonly type: "array";
132
+ readonly items: {
133
+ readonly type: "object";
134
+ readonly properties: {
135
+ readonly title: {
136
+ readonly type: "string";
137
+ };
138
+ readonly steps: {
139
+ readonly type: "string";
140
+ };
141
+ readonly files: {
142
+ readonly type: "array";
143
+ readonly items: {
144
+ readonly type: "string";
145
+ };
146
+ };
147
+ readonly verify: {
148
+ readonly type: "string";
149
+ readonly description: "The one command whose output proves the task.";
150
+ };
151
+ readonly expect: {
152
+ readonly type: "string";
153
+ };
154
+ };
155
+ readonly required: readonly ["title", "steps", "verify"];
156
+ };
157
+ };
158
+ readonly reason: {
159
+ readonly type: "string";
160
+ };
161
+ readonly summary: {
162
+ readonly type: "string";
163
+ };
164
+ readonly evidence: {
165
+ readonly type: "string";
166
+ };
167
+ readonly uat: {
168
+ readonly type: "array";
169
+ readonly items: {
170
+ readonly type: "object";
171
+ readonly properties: {
172
+ readonly check: {
173
+ readonly type: "string";
174
+ };
175
+ readonly result: {
176
+ readonly type: "string";
177
+ readonly enum: readonly ["pass", "fail", "needs_human"];
178
+ };
179
+ readonly note: {
180
+ readonly type: "string";
181
+ };
182
+ };
183
+ readonly required: readonly ["check", "result"];
184
+ };
185
+ };
186
+ readonly verdict: {
187
+ readonly type: "string";
188
+ readonly enum: readonly ["pass", "needs_remediation"];
189
+ };
190
+ readonly findings: {
191
+ readonly type: "string";
192
+ };
193
+ };
194
+ readonly required: readonly ["action"];
195
+ };
196
+ export interface SddToolOptions {
197
+ /** The project the plan belongs to. */
198
+ cwd: string;
199
+ onError?: (message: string, error: unknown) => void;
200
+ }
201
+ /** Run one action. Returns what happened, without the next step. */
202
+ export declare function runSddAction(engine: SddEngine, input: Record<string, unknown>): string;
203
+ export declare function createSddTool(options: SddToolOptions): AgentTool;
204
+ /** The spec-driven skills, any one of which brings the tool with it. */
205
+ export declare const SDD_SKILL_NAMES: readonly ["sdd-wizard", "sdd-discuss", "sdd-plan", "sdd-execute", "sdd-verify", "sdd-quick", "sdd-status"];
206
+ /** Whether the user has any of the spec-driven skills turned on. */
207
+ export declare function isSddEnabled(): boolean;
208
+ /**
209
+ * The tool, when a spec-driven skill is on. The skills are what tell the
210
+ * model how to work this way; without one the tool would be a cost in every
211
+ * request and no use.
212
+ */
213
+ export declare function createSddTools(options: SddToolOptions & {
214
+ log?: (message: string) => void;
215
+ }): AgentTool[];
@@ -7,10 +7,11 @@
7
7
  * directory is not somewhere it would guess, and the VS Code editor that knows
8
8
  * both is reachable only by a human with a mouse.
9
9
  *
10
- * A tool rather than a skill because skills have to be installed by hand --
11
- * `resolveSkillsConfigSearchPaths` looks only in the workspace and the Cline
12
- * data directory -- so a skill that teaches this would need the user to already
13
- * know the thing it was going to tell them.
10
+ * A tool rather than a skill because, when this was written, skills had to be
11
+ * installed by hand, so a skill that taught this would have needed the user to
12
+ * already know the thing it was going to tell them. Skills can ship with the
13
+ * product now (`bundled-skills.ts`); the tool stays, since it also writes the
14
+ * file.
14
15
  */
15
16
  import { type AgentTool } from "@cerebriline/shared";
16
17
  import { z } from "zod";