@kl-c/matrixos 0.2.1 → 0.2.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/index.js CHANGED
@@ -368023,7 +368023,7 @@ function getCachedVersion(options = {}) {
368023
368023
  // package.json
368024
368024
  var package_default = {
368025
368025
  name: "@kl-c/matrixos",
368026
- version: "0.2.1",
368026
+ version: "0.2.5",
368027
368027
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
368028
368028
  main: "./dist/index.js",
368029
368029
  types: "dist/index.d.ts",
@@ -443547,11 +443547,22 @@ class TelegramAdapter {
443547
443547
  }
443548
443548
  const text = envelope.content.text ?? "";
443549
443549
  const result = await this.bot.api.sendMessage(chatId, text);
443550
- return String(result.message_id);
443550
+ const messageId = String(result.message_id);
443551
+ if (envelope.metadata?.onMessageId && typeof envelope.metadata.onMessageId === "function") {
443552
+ envelope.metadata.onMessageId(messageId);
443553
+ }
443554
+ return messageId;
443551
443555
  } catch (err) {
443552
443556
  throw new TelegramSendError(`Failed to send Telegram message: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
443553
443557
  }
443554
443558
  }
443559
+ async editMessage(recipientId, messageId, text) {
443560
+ try {
443561
+ await this.bot.api.editMessageText(recipientId, Number(messageId), text);
443562
+ } catch (err) {
443563
+ console.warn(`[telegram] editMessage failed: ${err instanceof Error ? err.message : String(err)}`);
443564
+ }
443565
+ }
443555
443566
  onMessage(handler) {
443556
443567
  this.messageHandler = handler;
443557
443568
  }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A5 — Active Project Context
3
+ *
4
+ * Lightweight project manager for MaTrixOS. Each project is a directory
5
+ * under .matrixos/projects/<slug>/ containing meta.json, kanban.json and a
6
+ * kb/ folder. The active project is stored in .matrixos/state.json.
7
+ */
8
+ export interface ProjectMeta {
9
+ readonly slug: string;
10
+ readonly name: string;
11
+ readonly description?: string;
12
+ readonly createdAt: string;
13
+ readonly archived?: boolean;
14
+ readonly archivedAt?: string;
15
+ }
16
+ export interface ProjectState {
17
+ readonly activeProject?: string;
18
+ }
19
+ export interface ProjectInfo {
20
+ readonly slug: string;
21
+ readonly meta: ProjectMeta;
22
+ readonly active: boolean;
23
+ }
24
+ export declare function getMatrixOsDir(cwd?: string): string;
25
+ export declare function getProjectsDir(cwd?: string): string;
26
+ export declare function getProjectDir(slug: string, cwd?: string): string;
27
+ export declare function getStatePath(cwd?: string): string;
28
+ export declare function loadState(cwd?: string): ProjectState;
29
+ export declare function saveState(state: ProjectState, cwd?: string): void;
30
+ export declare function loadProjectMeta(slug: string, cwd?: string): ProjectMeta | null;
31
+ export declare function saveProjectMeta(slug: string, meta: ProjectMeta, cwd?: string): void;
32
+ export declare function initProjectFiles(slug: string, cwd?: string): void;
33
+ export declare function createProject(slug: string, options?: {
34
+ name?: string;
35
+ description?: string;
36
+ cwd?: string;
37
+ }): ProjectInfo;
38
+ export declare function listProjects(cwd?: string): ProjectInfo[];
39
+ export declare function switchProject(slug: string, cwd?: string): ProjectInfo;
40
+ export declare function archiveProject(slug: string, cwd?: string): ProjectInfo;
41
+ export declare function unarchiveProject(slug: string, cwd?: string): ProjectInfo;
42
+ export declare function deleteProject(slug: string, cwd?: string): void;
43
+ export declare function getActiveProject(cwd?: string): ProjectInfo | null;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A1 — Project-scoped memory and search
3
+ *
4
+ * Builds on top of the learning-loop memory store. Adds a project tag to
5
+ * every episode recorded while a project is active, and filters search by
6
+ * project. Also provides a simple KB text search over .matrixos/projects/
7
+ * <slug>/kb/.
8
+ */
9
+ export interface ProjectMemoryOptions {
10
+ cwd?: string;
11
+ }
12
+ export interface KbDocument {
13
+ readonly path: string;
14
+ readonly content: string;
15
+ }
16
+ export interface ProjectSearchResult {
17
+ readonly project: string;
18
+ readonly source: "kb" | "episode";
19
+ readonly path?: string;
20
+ readonly summary?: string;
21
+ readonly content?: string;
22
+ readonly score: number;
23
+ }
24
+ export declare function tagWithProject(metadata?: Record<string, unknown>, projectSlug?: string, cwd?: string): Record<string, unknown>;
25
+ export declare function isProjectEpisode(ep: {
26
+ metadata?: Record<string, unknown> | null;
27
+ }, projectSlug?: string, cwd?: string): boolean;
28
+ export declare function listKbDocuments(projectSlug: string, cwd?: string): KbDocument[];
29
+ export declare function searchKb(projectSlug: string, query: string, cwd?: string): ProjectSearchResult[];
30
+ export declare function searchProject(query: string, options?: {
31
+ projectSlug?: string;
32
+ cwd?: string;
33
+ memoryStore?: any;
34
+ }): Promise<ProjectSearchResult[]>;
35
+ export declare function addKbDocument(projectSlug: string, filename: string, content: string, cwd?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kl-c/matrixos",
3
- "version": "0.2.1",
3
+ "version": "0.2.5",
4
4
  "description": "MaTrixOS — Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "dist/index.d.ts",