@kl-c/matrixos 0.2.1 → 0.2.6
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/audit/self-audit.d.ts +53 -0
- package/dist/cli/index.js +1260 -346
- package/dist/cli/self-audit-command.d.ts +21 -0
- package/dist/cli-node/index.js +1260 -346
- package/dist/deployment/deploy-cli.d.ts +14 -0
- package/dist/deployment/deploy-static.d.ts +5 -0
- package/dist/deployment/deploy-vercel.d.ts +5 -0
- package/dist/deployment/deploy-vps.d.ts +5 -0
- package/dist/deployment/deployment-core.d.ts +38 -0
- package/dist/deployment/index.d.ts +10 -0
- package/dist/index.js +13 -2
- package/dist/project/project-context.d.ts +43 -0
- package/dist/project/project-memory.d.ts +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy-cli.ts
|
|
3
|
+
*
|
|
4
|
+
* Handles `matrixos deploy <target> [options]`.
|
|
5
|
+
*/
|
|
6
|
+
export interface DeployOptions {
|
|
7
|
+
target: string;
|
|
8
|
+
projectRoot?: string;
|
|
9
|
+
environment?: "staging" | "production" | "preview";
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
force?: boolean;
|
|
12
|
+
params?: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function runDeploy(options: DeployOptions): Promise<number>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A6 — Deployment skills core
|
|
3
|
+
*
|
|
4
|
+
* Shared types and helpers for MaTrixOS deployment skills.
|
|
5
|
+
* Each target implements the DeploymentTarget interface.
|
|
6
|
+
*/
|
|
7
|
+
export type DeploymentStage = "build" | "push" | "verify" | "rollback" | "done";
|
|
8
|
+
export interface DeploymentProgress {
|
|
9
|
+
stage: DeploymentStage;
|
|
10
|
+
message: string;
|
|
11
|
+
ok: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DeploymentContext {
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
/** Active project slug from `matrixos project switch`. */
|
|
16
|
+
projectSlug?: string;
|
|
17
|
+
/** Environment name: staging, production, preview... */
|
|
18
|
+
environment: "staging" | "production" | "preview";
|
|
19
|
+
/** If true, perform the deployment; if false, dry-run. */
|
|
20
|
+
execute: boolean;
|
|
21
|
+
/** If true, require explicit user validation before production deploy. */
|
|
22
|
+
requireValidation: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface DeploymentResult {
|
|
25
|
+
target: string;
|
|
26
|
+
ok: boolean;
|
|
27
|
+
url?: string;
|
|
28
|
+
stages: DeploymentProgress[];
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface DeploymentTarget {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
deploy(ctx: DeploymentContext, params: Record<string, string>): Promise<DeploymentResult>;
|
|
34
|
+
}
|
|
35
|
+
export declare const targets: Map<string, DeploymentTarget>;
|
|
36
|
+
export declare function registerTarget(target: DeploymentTarget): void;
|
|
37
|
+
export declare function getTarget(name: string): DeploymentTarget | undefined;
|
|
38
|
+
export declare function listTargets(): string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deployment skills index (A6).
|
|
3
|
+
*
|
|
4
|
+
* Registers all built-in deployment targets so the CLI can look them up.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./deployment-core";
|
|
7
|
+
export { deployStatic } from "./deploy-static";
|
|
8
|
+
export { deployVercel } from "./deploy-vercel";
|
|
9
|
+
export { deployVps } from "./deploy-vps";
|
|
10
|
+
export { runDeploy, type DeployOptions } from "./deploy-cli";
|
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.
|
|
368026
|
+
version: "0.2.6",
|
|
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
|
-
|
|
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