clementine-agent 1.0.67 → 1.0.69

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 (53) hide show
  1. package/dist/agent/assistant.d.ts +42 -0
  2. package/dist/agent/assistant.js +330 -43
  3. package/dist/agent/session-store-adapter.d.ts +14 -0
  4. package/dist/agent/session-store-adapter.js +69 -0
  5. package/dist/brain/adapters/common.d.ts +12 -0
  6. package/dist/brain/adapters/common.js +29 -0
  7. package/dist/brain/adapters/csv.d.ts +10 -0
  8. package/dist/brain/adapters/csv.js +55 -0
  9. package/dist/brain/adapters/docx.d.ts +10 -0
  10. package/dist/brain/adapters/docx.js +35 -0
  11. package/dist/brain/adapters/email.d.ts +9 -0
  12. package/dist/brain/adapters/email.js +84 -0
  13. package/dist/brain/adapters/index.d.ts +9 -0
  14. package/dist/brain/adapters/index.js +24 -0
  15. package/dist/brain/adapters/json.d.ts +10 -0
  16. package/dist/brain/adapters/json.js +100 -0
  17. package/dist/brain/adapters/markdown.d.ts +10 -0
  18. package/dist/brain/adapters/markdown.js +49 -0
  19. package/dist/brain/adapters/pdf.d.ts +9 -0
  20. package/dist/brain/adapters/pdf.js +53 -0
  21. package/dist/brain/adapters/rest.d.ts +29 -0
  22. package/dist/brain/adapters/rest.js +139 -0
  23. package/dist/brain/batch-summary.d.ts +30 -0
  24. package/dist/brain/batch-summary.js +129 -0
  25. package/dist/brain/format-detector.d.ts +16 -0
  26. package/dist/brain/format-detector.js +153 -0
  27. package/dist/brain/graph-extractor.d.ts +15 -0
  28. package/dist/brain/graph-extractor.js +61 -0
  29. package/dist/brain/ingest-scheduler.d.ts +32 -0
  30. package/dist/brain/ingest-scheduler.js +123 -0
  31. package/dist/brain/ingestion-pipeline.d.ts +47 -0
  32. package/dist/brain/ingestion-pipeline.js +337 -0
  33. package/dist/brain/intelligence.d.ts +67 -0
  34. package/dist/brain/intelligence.js +291 -0
  35. package/dist/brain/llm-client.d.ts +38 -0
  36. package/dist/brain/llm-client.js +92 -0
  37. package/dist/brain/source-registry.d.ts +38 -0
  38. package/dist/brain/source-registry.js +121 -0
  39. package/dist/cli/dashboard.js +1204 -10
  40. package/dist/cli/index.js +23 -0
  41. package/dist/cli/ingest.d.ts +19 -0
  42. package/dist/cli/ingest.js +151 -0
  43. package/dist/config.d.ts +14 -0
  44. package/dist/config.js +80 -0
  45. package/dist/index.js +8 -0
  46. package/dist/memory/store.d.ts +190 -0
  47. package/dist/memory/store.js +674 -6
  48. package/dist/tools/artifact-tools.d.ts +11 -0
  49. package/dist/tools/artifact-tools.js +83 -0
  50. package/dist/tools/mcp-server.js +2 -0
  51. package/dist/tools/shared.d.ts +135 -0
  52. package/dist/types.d.ts +103 -0
  53. package/package.json +11 -3
@@ -40,6 +40,21 @@ export declare function getLinkedProjects(): ProjectMeta[];
40
40
  export declare function addProject(projectPath: string, description?: string, keywords?: string[]): void;
41
41
  /** Remove a project from the linked projects list. Returns true if removed. */
42
42
  export declare function removeProject(projectPath: string): boolean;
43
+ export interface ProactiveGoalInput {
44
+ goal: {
45
+ title: string;
46
+ priority?: string;
47
+ owner?: string;
48
+ nextActions?: string[];
49
+ };
50
+ }
51
+ /**
52
+ * Build the compact "active goals" block that gets injected when no goal
53
+ * keyword matches the user's prompt. Pure so it can be tested without the
54
+ * full Assistant/vault setup.
55
+ */
56
+ export declare function buildActiveGoalsBlock(goals: ProactiveGoalInput[], agentSlug?: string | null, maxEntries?: number): string;
57
+ export declare function chunkReferencedInResponse(chunkContent: string, responseLower: string): boolean;
43
58
  export declare class PersonalAssistant {
44
59
  static readonly MAX_SESSION_EXCHANGES = 40;
45
60
  private sessions;
@@ -69,6 +84,14 @@ export declare class PersonalAssistant {
69
84
  private _compactedSessions;
70
85
  /** Last auto-matched project per session — exposed for CLI display. */
71
86
  private _lastMatchedProject;
87
+ /**
88
+ * Chunks retrieved on the most recent turn per session, kept so the
89
+ * post-response outcome scorer can check which actually got referenced.
90
+ * Cleared after each scoring pass.
91
+ */
92
+ private _lastRetrievedChunks;
93
+ /** Lazy-built SessionStore adapter that mirrors SDK transcripts to SQLite. */
94
+ private _sessionStore;
72
95
  /** Hot correction buffer — explicit behavioral corrections applied before nightly SI. */
73
96
  private hotCorrections;
74
97
  constructor();
@@ -91,6 +114,12 @@ export declare class PersonalAssistant {
91
114
  /** Inject a background work result into the session so the next chat naturally references it. */
92
115
  injectPendingContext(sessionKey: string, userPrompt: string, result: string): void;
93
116
  private initMemoryStore;
117
+ /**
118
+ * Return the cached SessionStore adapter. Null until initMemoryStore
119
+ * completes, in which case the SDK falls back to local-only sessions —
120
+ * no crash on cold boot.
121
+ */
122
+ private getSessionStore;
94
123
  /**
95
124
  * Seed the in-memory hotCorrections ring buffer from persisted behavioral
96
125
  * patterns (corrections that recurred across ≥2 sessions in the last 30d).
@@ -123,6 +152,13 @@ export declare class PersonalAssistant {
123
152
  * or empty string if no goals match.
124
153
  */
125
154
  private matchGoals;
155
+ /**
156
+ * Compact always-on block of active goals. Used when no keyword match
157
+ * fires so the agent still sees what it's supposed to be working on.
158
+ * Scoped: for agent sessions, includes that agent's goals plus any
159
+ * clementine-owned goals it might contribute to.
160
+ */
161
+ private formatActiveGoalsBlock;
126
162
  chat(text: string, sessionKey?: string | null, options?: {
127
163
  onText?: OnTextCallback;
128
164
  onToolActivity?: OnToolActivityCallback;
@@ -134,6 +170,12 @@ export declare class PersonalAssistant {
134
170
  verboseLevel?: VerboseLevel;
135
171
  abortController?: AbortController;
136
172
  }): Promise<[string, string]>;
173
+ /**
174
+ * Compare retrieved chunks against the response text and record which
175
+ * were referenced. Uses a distinctive-token overlap heuristic — cheap,
176
+ * deterministic, no extra LLM calls. Called right after a turn completes.
177
+ */
178
+ private scoreRetrievalOutcomes;
137
179
  private static readonly RATE_LIMIT_MAX_RETRIES;
138
180
  private static readonly RATE_LIMIT_BACKOFF;
139
181
  private runQuery;