@kl-c/matrixos 0.1.11 → 0.1.12
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/cli/index.js +1 -1
- package/dist/cli-node/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/postinstall.mjs +39 -1
package/dist/cli/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "@kl-c/matrixos",
|
|
2148
|
-
version: "0.1.
|
|
2148
|
+
version: "0.1.12",
|
|
2149
2149
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
2150
2150
|
main: "./dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
package/dist/cli-node/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "@kl-c/matrixos",
|
|
2148
|
-
version: "0.1.
|
|
2148
|
+
version: "0.1.12",
|
|
2149
2149
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
2150
2150
|
main: "./dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
package/dist/index.js
CHANGED
|
@@ -367932,7 +367932,7 @@ function getCachedVersion(options = {}) {
|
|
|
367932
367932
|
// package.json
|
|
367933
367933
|
var package_default = {
|
|
367934
367934
|
name: "@kl-c/matrixos",
|
|
367935
|
-
version: "0.1.
|
|
367935
|
+
version: "0.1.12",
|
|
367936
367936
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
367937
367937
|
main: "./dist/index.js",
|
|
367938
367938
|
types: "dist/index.d.ts",
|
package/package.json
CHANGED
package/postinstall.mjs
CHANGED
|
@@ -1,16 +1,52 @@
|
|
|
1
1
|
// postinstall.mjs
|
|
2
2
|
// MaTrixOS — simplified postinstall (no platform binary packages)
|
|
3
3
|
|
|
4
|
-
import { readdirSync, rmSync } from "node:fs";
|
|
4
|
+
import { readdirSync, rmSync, cpSync, mkdirSync, existsSync } from "node:fs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { join } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
|
|
10
|
+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
8
11
|
|
|
9
12
|
const require = createRequire(import.meta.url);
|
|
10
13
|
|
|
11
14
|
const MIN_OPENCODE_VERSION = "1.4.0";
|
|
12
15
|
const MATRIXOS_PLUGIN_PACKAGES = ["@kl-c/matrixos", "oh-my-opencode", "oh-my-openagent"];
|
|
13
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Copy MaTrixOS slash commands to the user-level OpenCode command directory
|
|
19
|
+
* so OpenCode discovers them at startup. OpenCode scans
|
|
20
|
+
* `~/.config/opencode/command/*.md` (user-level) and `.opencode/command/*.md`
|
|
21
|
+
* (project-level), but NOT package internals under node_modules. Without this
|
|
22
|
+
* copy, `/adopt` and `/features` are silently unavailable.
|
|
23
|
+
*/
|
|
24
|
+
function installUserCommands() {
|
|
25
|
+
const opencodeConfigDir = join(process.env.XDG_CONFIG_HOME ?? join(homedir(), ".config"), "opencode");
|
|
26
|
+
const targetDir = join(opencodeConfigDir, "command");
|
|
27
|
+
|
|
28
|
+
const commandSources = [
|
|
29
|
+
join(__dirname, ".opencode", "command"),
|
|
30
|
+
join(__dirname, ".agents", "command"),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
let copied = 0;
|
|
34
|
+
for (const sourceDir of commandSources) {
|
|
35
|
+
if (!existsSync(sourceDir)) continue;
|
|
36
|
+
mkdirSync(targetDir, { recursive: true });
|
|
37
|
+
for (const entry of readdirSync(sourceDir, { withFileTypes: true })) {
|
|
38
|
+
if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
39
|
+
cpSync(join(sourceDir, entry.name), join(targetDir, entry.name), { force: true });
|
|
40
|
+
copied++;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (copied > 0) {
|
|
46
|
+
console.log(` Installed ${copied} MaTrixOS command(s) to ${targetDir}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
14
50
|
/**
|
|
15
51
|
* Parse version string into numeric parts
|
|
16
52
|
* @param {string} version
|
|
@@ -91,6 +127,8 @@ function main() {
|
|
|
91
127
|
console.warn(` Please update OpenCode to avoid compatibility issues.`);
|
|
92
128
|
}
|
|
93
129
|
|
|
130
|
+
installUserCommands();
|
|
131
|
+
|
|
94
132
|
console.log(`\u2713 MaTrixOS installed successfully.`);
|
|
95
133
|
console.log(` Run 'bunx @kl-c/matrixos install' to set up MaTrixOS.`);
|
|
96
134
|
}
|