@kl-c/matrixos 0.3.52 → 0.3.53
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 +181 -19
- package/dist/cli/project-init.d.ts +7 -0
- package/dist/cli-node/index.js +181 -19
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2163,7 +2163,7 @@ var package_default;
|
|
|
2163
2163
|
var init_package = __esm(() => {
|
|
2164
2164
|
package_default = {
|
|
2165
2165
|
name: "@kl-c/matrixos",
|
|
2166
|
-
version: "0.3.
|
|
2166
|
+
version: "0.3.53",
|
|
2167
2167
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
2168
2168
|
main: "./dist/index.js",
|
|
2169
2169
|
types: "dist/index.d.ts",
|
|
@@ -168480,14 +168480,161 @@ function submitPr(options) {
|
|
|
168480
168480
|
}
|
|
168481
168481
|
var init_prepare = () => {};
|
|
168482
168482
|
|
|
168483
|
+
// packages/omo-opencode/src/cli/project-init.ts
|
|
168484
|
+
var exports_project_init = {};
|
|
168485
|
+
__export(exports_project_init, {
|
|
168486
|
+
projectInit: () => projectInit
|
|
168487
|
+
});
|
|
168488
|
+
import * as fs24 from "fs";
|
|
168489
|
+
import * as path29 from "path";
|
|
168490
|
+
function projectInit(options) {
|
|
168491
|
+
const target = path29.resolve(options.path ?? process.cwd(), options.name);
|
|
168492
|
+
const apply = options.apply ?? false;
|
|
168493
|
+
if (fs24.existsSync(target) && fs24.readdirSync(target).length > 0) {
|
|
168494
|
+
console.error(`[project] target exists and is not empty: ${target}`);
|
|
168495
|
+
return 1;
|
|
168496
|
+
}
|
|
168497
|
+
const files = Object.entries(TEMPLATES).map(([rel, fn]) => ({ rel, content: fn(options.name) }));
|
|
168498
|
+
if (!apply) {
|
|
168499
|
+
console.log(`[dry-run] would create project '${options.name}' at:
|
|
168500
|
+
${target}
|
|
168501
|
+
`);
|
|
168502
|
+
console.log("Files:");
|
|
168503
|
+
for (const f2 of files) {
|
|
168504
|
+
console.log(` ${f2.rel}`);
|
|
168505
|
+
}
|
|
168506
|
+
console.log(`
|
|
168507
|
+
[dry-run] re-run with --apply to write the files.`);
|
|
168508
|
+
return 0;
|
|
168509
|
+
}
|
|
168510
|
+
fs24.mkdirSync(path29.join(target, "src"), { recursive: true });
|
|
168511
|
+
for (const f2 of files) {
|
|
168512
|
+
const full = path29.join(target, f2.rel);
|
|
168513
|
+
fs24.mkdirSync(path29.dirname(full), { recursive: true });
|
|
168514
|
+
fs24.writeFileSync(full, f2.content);
|
|
168515
|
+
console.log(`[project] wrote ${f2.rel}`);
|
|
168516
|
+
}
|
|
168517
|
+
console.log(`
|
|
168518
|
+
[project] '${options.name}' initialized at ${target}`);
|
|
168519
|
+
console.log(`[project] Next: cd ${target} && matrixos run --agent Architect 'refine the plan.md'`);
|
|
168520
|
+
return 0;
|
|
168521
|
+
}
|
|
168522
|
+
var TEMPLATES;
|
|
168523
|
+
var init_project_init = __esm(() => {
|
|
168524
|
+
TEMPLATES = {
|
|
168525
|
+
"AGENTS.md": (name2) => `# ${name2}
|
|
168526
|
+
|
|
168527
|
+
> Project context for AI agents. Keep this file accurate \u2014 agents read it first.
|
|
168528
|
+
|
|
168529
|
+
## OVERVIEW
|
|
168530
|
+
|
|
168531
|
+
One-paragraph description of what this project is and who uses it.
|
|
168532
|
+
|
|
168533
|
+
## CONVENTIONS
|
|
168534
|
+
|
|
168535
|
+
- Code style: TBD
|
|
168536
|
+
- Tests: TBD
|
|
168537
|
+
- Commits: conventional commits
|
|
168538
|
+
|
|
168539
|
+
## STRUCTURE
|
|
168540
|
+
|
|
168541
|
+
\`\`\`
|
|
168542
|
+
${name2}/
|
|
168543
|
+
\u251C\u2500\u2500 README.md
|
|
168544
|
+
\u251C\u2500\u2500 PROJECT.md # project state / roadmap
|
|
168545
|
+
\u251C\u2500\u2500 plan.md # current plan
|
|
168546
|
+
\u2514\u2500\u2500 src/
|
|
168547
|
+
\`\`\`
|
|
168548
|
+
|
|
168549
|
+
## NOTES
|
|
168550
|
+
|
|
168551
|
+
- Link the relevant MaTrixOS Goal/Kanban board for tracking.
|
|
168552
|
+
`,
|
|
168553
|
+
"README.md": (name2) => `# ${name2}
|
|
168554
|
+
|
|
168555
|
+
## Install
|
|
168556
|
+
|
|
168557
|
+
\`\`\`bash
|
|
168558
|
+
# add your install steps
|
|
168559
|
+
\`\`\`
|
|
168560
|
+
|
|
168561
|
+
## Usage
|
|
168562
|
+
|
|
168563
|
+
\`\`\`bash
|
|
168564
|
+
# add your usage steps
|
|
168565
|
+
\`\`\`
|
|
168566
|
+
|
|
168567
|
+
## Development
|
|
168568
|
+
|
|
168569
|
+
See AGENTS.md for agent context.
|
|
168570
|
+
`,
|
|
168571
|
+
".gitignore": () => `# Dependencies
|
|
168572
|
+
node_modules/
|
|
168573
|
+
.venv/
|
|
168574
|
+
__pycache__/
|
|
168575
|
+
|
|
168576
|
+
# Build
|
|
168577
|
+
/dist/
|
|
168578
|
+
build/
|
|
168579
|
+
|
|
168580
|
+
# Env / secrets
|
|
168581
|
+
.env
|
|
168582
|
+
.env.local
|
|
168583
|
+
*.secret
|
|
168584
|
+
|
|
168585
|
+
# OS
|
|
168586
|
+
.DS_Store
|
|
168587
|
+
|
|
168588
|
+
# MaTrixOS
|
|
168589
|
+
.omo/
|
|
168590
|
+
`,
|
|
168591
|
+
"PROJECT.md": (name2) => `# ${name2} \u2014 Project State
|
|
168592
|
+
|
|
168593
|
+
## STATUS
|
|
168594
|
+
|
|
168595
|
+
| Item | State |
|
|
168596
|
+
|------|-------|
|
|
168597
|
+
| Scope | defined / wip / done |
|
|
168598
|
+
| Health | green / yellow / red |
|
|
168599
|
+
|
|
168600
|
+
## ROADMAP
|
|
168601
|
+
|
|
168602
|
+
- [ ] Milestone 1
|
|
168603
|
+
- [ ] Milestone 2
|
|
168604
|
+
|
|
168605
|
+
## LINKS
|
|
168606
|
+
|
|
168607
|
+
- MaTrixOS Goal: (create via dashboard)
|
|
168608
|
+
- Kanban: (link board)
|
|
168609
|
+
`,
|
|
168610
|
+
"plan.md": () => `# Plan
|
|
168611
|
+
|
|
168612
|
+
## Goal
|
|
168613
|
+
|
|
168614
|
+
What are we trying to achieve?
|
|
168615
|
+
|
|
168616
|
+
## Steps
|
|
168617
|
+
|
|
168618
|
+
1.
|
|
168619
|
+
2.
|
|
168620
|
+
3.
|
|
168621
|
+
|
|
168622
|
+
## Open Questions
|
|
168623
|
+
|
|
168624
|
+
-
|
|
168625
|
+
`,
|
|
168626
|
+
"src/.gitkeep": () => ""
|
|
168627
|
+
};
|
|
168628
|
+
});
|
|
168629
|
+
|
|
168483
168630
|
// packages/omo-opencode/src/cli/service.ts
|
|
168484
168631
|
var exports_service = {};
|
|
168485
168632
|
__export(exports_service, {
|
|
168486
168633
|
serviceInstallCommand: () => serviceInstallCommand
|
|
168487
168634
|
});
|
|
168488
168635
|
import * as os15 from "os";
|
|
168489
|
-
import * as
|
|
168490
|
-
import * as
|
|
168636
|
+
import * as fs25 from "fs";
|
|
168637
|
+
import * as path30 from "path";
|
|
168491
168638
|
import { execSync as execSync4 } from "child_process";
|
|
168492
168639
|
function resolveMatrixosBin2() {
|
|
168493
168640
|
try {
|
|
@@ -168495,8 +168642,8 @@ function resolveMatrixosBin2() {
|
|
|
168495
168642
|
if (p2)
|
|
168496
168643
|
return p2;
|
|
168497
168644
|
} catch {}
|
|
168498
|
-
for (const cand of ["/usr/local/bin/matrixos", "/usr/bin/matrixos",
|
|
168499
|
-
if (
|
|
168645
|
+
for (const cand of ["/usr/local/bin/matrixos", "/usr/bin/matrixos", path30.join(os15.homedir(), ".bun/bin/matrixos")]) {
|
|
168646
|
+
if (fs25.existsSync(cand))
|
|
168500
168647
|
return cand;
|
|
168501
168648
|
}
|
|
168502
168649
|
return "matrixos";
|
|
@@ -168510,16 +168657,16 @@ function resolveBunBin() {
|
|
|
168510
168657
|
return "/usr/bin/bun";
|
|
168511
168658
|
}
|
|
168512
168659
|
function writeFileEnsureDir(filePath, content) {
|
|
168513
|
-
|
|
168514
|
-
|
|
168660
|
+
fs25.mkdirSync(path30.dirname(filePath), { recursive: true });
|
|
168661
|
+
fs25.writeFileSync(filePath, content, "utf-8");
|
|
168515
168662
|
console.log(`[service] written: ${filePath}`);
|
|
168516
168663
|
}
|
|
168517
168664
|
function installSystemd(opts) {
|
|
168518
168665
|
const bin = resolveMatrixosBin2();
|
|
168519
168666
|
const bun = resolveBunBin();
|
|
168520
168667
|
const scope = opts.user ? "--user" : "";
|
|
168521
|
-
const unitDir = opts.user ?
|
|
168522
|
-
const envPath = `/usr/local/bin:/usr/bin:/bin:${
|
|
168668
|
+
const unitDir = opts.user ? path30.join(os15.homedir(), ".config", "systemd", "user") : "/etc/systemd/system";
|
|
168669
|
+
const envPath = `/usr/local/bin:/usr/bin:/bin:${path30.dirname(bun)}`;
|
|
168523
168670
|
if (opts.dashboard !== false) {
|
|
168524
168671
|
const unit = `[Unit]
|
|
168525
168672
|
Description=MaTrixOS Dashboard
|
|
@@ -168538,7 +168685,7 @@ RestartSec=5
|
|
|
168538
168685
|
[Install]
|
|
168539
168686
|
WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
168540
168687
|
`;
|
|
168541
|
-
writeFileEnsureDir(
|
|
168688
|
+
writeFileEnsureDir(path30.join(unitDir, "matrixos-dashboard.service"), unit);
|
|
168542
168689
|
}
|
|
168543
168690
|
if (opts.gateway !== false) {
|
|
168544
168691
|
const unit = `[Unit]
|
|
@@ -168558,7 +168705,7 @@ RestartSec=5
|
|
|
168558
168705
|
[Install]
|
|
168559
168706
|
WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
168560
168707
|
`;
|
|
168561
|
-
writeFileEnsureDir(
|
|
168708
|
+
writeFileEnsureDir(path30.join(unitDir, "matrixos-gateway.service"), unit);
|
|
168562
168709
|
}
|
|
168563
168710
|
if (opts.cron !== false) {
|
|
168564
168711
|
const unit = `[Unit]
|
|
@@ -168578,7 +168725,7 @@ RestartSec=5
|
|
|
168578
168725
|
[Install]
|
|
168579
168726
|
WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
168580
168727
|
`;
|
|
168581
|
-
writeFileEnsureDir(
|
|
168728
|
+
writeFileEnsureDir(path30.join(unitDir, "matrixos-cron.service"), unit);
|
|
168582
168729
|
}
|
|
168583
168730
|
console.log("[service] reloading systemd...");
|
|
168584
168731
|
if (scope) {
|
|
@@ -168615,8 +168762,8 @@ WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
|
168615
168762
|
function installLaunchd(opts) {
|
|
168616
168763
|
const bin = resolveMatrixosBin2();
|
|
168617
168764
|
const bun = resolveBunBin();
|
|
168618
|
-
const launchDir =
|
|
168619
|
-
const envPath = `/usr/local/bin:/usr/bin:/bin:${
|
|
168765
|
+
const launchDir = path30.join(os15.homedir(), "Library", "LaunchAgents");
|
|
168766
|
+
const envPath = `/usr/local/bin:/usr/bin:/bin:${path30.dirname(bun)}`;
|
|
168620
168767
|
if (opts.dashboard !== false) {
|
|
168621
168768
|
const label = "com.klc.matrixos.dashboard";
|
|
168622
168769
|
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -168653,8 +168800,8 @@ function installLaunchd(opts) {
|
|
|
168653
168800
|
</dict>
|
|
168654
168801
|
</plist>
|
|
168655
168802
|
`;
|
|
168656
|
-
writeFileEnsureDir(
|
|
168657
|
-
execSync4(`launchctl load ${
|
|
168803
|
+
writeFileEnsureDir(path30.join(launchDir, `${label}.plist`), plist);
|
|
168804
|
+
execSync4(`launchctl load ${path30.join(launchDir, `${label}.plist`)}`, { stdio: "inherit" });
|
|
168658
168805
|
}
|
|
168659
168806
|
if (opts.gateway !== false) {
|
|
168660
168807
|
const label = "com.klc.matrixos.gateway";
|
|
@@ -168692,8 +168839,8 @@ function installLaunchd(opts) {
|
|
|
168692
168839
|
</dict>
|
|
168693
168840
|
</plist>
|
|
168694
168841
|
`;
|
|
168695
|
-
writeFileEnsureDir(
|
|
168696
|
-
execSync4(`launchctl load ${
|
|
168842
|
+
writeFileEnsureDir(path30.join(launchDir, `${label}.plist`), plist);
|
|
168843
|
+
execSync4(`launchctl load ${path30.join(launchDir, `${label}.plist`)}`, { stdio: "inherit" });
|
|
168697
168844
|
}
|
|
168698
168845
|
console.log("[service] launchd agents installed and loaded.");
|
|
168699
168846
|
}
|
|
@@ -168707,7 +168854,7 @@ async function serviceInstallCommand(options) {
|
|
|
168707
168854
|
const platform2 = process.platform;
|
|
168708
168855
|
console.log(`[service] detected platform: ${platform2}`);
|
|
168709
168856
|
if (platform2 === "linux") {
|
|
168710
|
-
if (!
|
|
168857
|
+
if (!fs25.existsSync("/run/systemd/system") && !fs25.existsSync("/etc/systemd/system")) {
|
|
168711
168858
|
console.error("[service] systemd not detected \u2014 cannot install service automatically.");
|
|
168712
168859
|
console.error(" Start manually: matrixos dashboard --host 0.0.0.0 --daemon");
|
|
168713
168860
|
return 1;
|
|
@@ -190436,6 +190583,21 @@ prepare.command("submit <pr>").description("Mark a prepared PR as ready (human v
|
|
|
190436
190583
|
const code = submitPr2({ pr, json: options.json ?? false });
|
|
190437
190584
|
process.exit(code);
|
|
190438
190585
|
});
|
|
190586
|
+
var projectCmd = program2.command("project").description("Project lifecycle helpers (generic scaffolding)");
|
|
190587
|
+
projectCmd.command("init <name>").description("Scaffold a generic project (AGENTS.md, README, .gitignore, PROJECT.md, plan.md)").option("-p, --path <dir>", "Target directory (default: cwd)").option("--apply", "Actually write the files (default dry-run)").option("--json", "Output as JSON").addHelpText("after", `
|
|
190588
|
+
Examples:
|
|
190589
|
+
$ matrixos project init my-app # dry-run
|
|
190590
|
+
$ matrixos project init my-app --apply # write files
|
|
190591
|
+
`).action(async (name2, options) => {
|
|
190592
|
+
const { projectInit: projectInit2 } = await Promise.resolve().then(() => (init_project_init(), exports_project_init));
|
|
190593
|
+
const code = projectInit2({
|
|
190594
|
+
name: name2,
|
|
190595
|
+
path: options.path,
|
|
190596
|
+
apply: options.apply ?? false,
|
|
190597
|
+
json: options.json ?? false
|
|
190598
|
+
});
|
|
190599
|
+
process.exit(code);
|
|
190600
|
+
});
|
|
190439
190601
|
program2.command("service").description("Install MaTrixOS as a persistent OS service (dashboard + gateway)").argument("<action>", "install | uninstall").option("--no-dashboard", "Skip dashboard service").option("--no-gateway", "Skip gateway service").option("--no-cron", "Skip cron scheduler service").option("--user", "Install as current user (systemd --user / launchd user agent)").action(async (action, options) => {
|
|
190440
190602
|
if (action !== "install" && action !== "uninstall") {
|
|
190441
190603
|
console.error(`[service] unknown action: ${action}. Use 'install' or 'uninstall'.`);
|
package/dist/cli-node/index.js
CHANGED
|
@@ -2163,7 +2163,7 @@ var package_default;
|
|
|
2163
2163
|
var init_package = __esm(() => {
|
|
2164
2164
|
package_default = {
|
|
2165
2165
|
name: "@kl-c/matrixos",
|
|
2166
|
-
version: "0.3.
|
|
2166
|
+
version: "0.3.53",
|
|
2167
2167
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
2168
2168
|
main: "./dist/index.js",
|
|
2169
2169
|
types: "dist/index.d.ts",
|
|
@@ -168535,14 +168535,161 @@ function submitPr(options) {
|
|
|
168535
168535
|
}
|
|
168536
168536
|
var init_prepare = () => {};
|
|
168537
168537
|
|
|
168538
|
+
// packages/omo-opencode/src/cli/project-init.ts
|
|
168539
|
+
var exports_project_init = {};
|
|
168540
|
+
__export(exports_project_init, {
|
|
168541
|
+
projectInit: () => projectInit
|
|
168542
|
+
});
|
|
168543
|
+
import * as fs24 from "fs";
|
|
168544
|
+
import * as path29 from "path";
|
|
168545
|
+
function projectInit(options) {
|
|
168546
|
+
const target = path29.resolve(options.path ?? process.cwd(), options.name);
|
|
168547
|
+
const apply = options.apply ?? false;
|
|
168548
|
+
if (fs24.existsSync(target) && fs24.readdirSync(target).length > 0) {
|
|
168549
|
+
console.error(`[project] target exists and is not empty: ${target}`);
|
|
168550
|
+
return 1;
|
|
168551
|
+
}
|
|
168552
|
+
const files = Object.entries(TEMPLATES).map(([rel, fn]) => ({ rel, content: fn(options.name) }));
|
|
168553
|
+
if (!apply) {
|
|
168554
|
+
console.log(`[dry-run] would create project '${options.name}' at:
|
|
168555
|
+
${target}
|
|
168556
|
+
`);
|
|
168557
|
+
console.log("Files:");
|
|
168558
|
+
for (const f2 of files) {
|
|
168559
|
+
console.log(` ${f2.rel}`);
|
|
168560
|
+
}
|
|
168561
|
+
console.log(`
|
|
168562
|
+
[dry-run] re-run with --apply to write the files.`);
|
|
168563
|
+
return 0;
|
|
168564
|
+
}
|
|
168565
|
+
fs24.mkdirSync(path29.join(target, "src"), { recursive: true });
|
|
168566
|
+
for (const f2 of files) {
|
|
168567
|
+
const full = path29.join(target, f2.rel);
|
|
168568
|
+
fs24.mkdirSync(path29.dirname(full), { recursive: true });
|
|
168569
|
+
fs24.writeFileSync(full, f2.content);
|
|
168570
|
+
console.log(`[project] wrote ${f2.rel}`);
|
|
168571
|
+
}
|
|
168572
|
+
console.log(`
|
|
168573
|
+
[project] '${options.name}' initialized at ${target}`);
|
|
168574
|
+
console.log(`[project] Next: cd ${target} && matrixos run --agent Architect 'refine the plan.md'`);
|
|
168575
|
+
return 0;
|
|
168576
|
+
}
|
|
168577
|
+
var TEMPLATES;
|
|
168578
|
+
var init_project_init = __esm(() => {
|
|
168579
|
+
TEMPLATES = {
|
|
168580
|
+
"AGENTS.md": (name2) => `# ${name2}
|
|
168581
|
+
|
|
168582
|
+
> Project context for AI agents. Keep this file accurate \u2014 agents read it first.
|
|
168583
|
+
|
|
168584
|
+
## OVERVIEW
|
|
168585
|
+
|
|
168586
|
+
One-paragraph description of what this project is and who uses it.
|
|
168587
|
+
|
|
168588
|
+
## CONVENTIONS
|
|
168589
|
+
|
|
168590
|
+
- Code style: TBD
|
|
168591
|
+
- Tests: TBD
|
|
168592
|
+
- Commits: conventional commits
|
|
168593
|
+
|
|
168594
|
+
## STRUCTURE
|
|
168595
|
+
|
|
168596
|
+
\`\`\`
|
|
168597
|
+
${name2}/
|
|
168598
|
+
\u251C\u2500\u2500 README.md
|
|
168599
|
+
\u251C\u2500\u2500 PROJECT.md # project state / roadmap
|
|
168600
|
+
\u251C\u2500\u2500 plan.md # current plan
|
|
168601
|
+
\u2514\u2500\u2500 src/
|
|
168602
|
+
\`\`\`
|
|
168603
|
+
|
|
168604
|
+
## NOTES
|
|
168605
|
+
|
|
168606
|
+
- Link the relevant MaTrixOS Goal/Kanban board for tracking.
|
|
168607
|
+
`,
|
|
168608
|
+
"README.md": (name2) => `# ${name2}
|
|
168609
|
+
|
|
168610
|
+
## Install
|
|
168611
|
+
|
|
168612
|
+
\`\`\`bash
|
|
168613
|
+
# add your install steps
|
|
168614
|
+
\`\`\`
|
|
168615
|
+
|
|
168616
|
+
## Usage
|
|
168617
|
+
|
|
168618
|
+
\`\`\`bash
|
|
168619
|
+
# add your usage steps
|
|
168620
|
+
\`\`\`
|
|
168621
|
+
|
|
168622
|
+
## Development
|
|
168623
|
+
|
|
168624
|
+
See AGENTS.md for agent context.
|
|
168625
|
+
`,
|
|
168626
|
+
".gitignore": () => `# Dependencies
|
|
168627
|
+
node_modules/
|
|
168628
|
+
.venv/
|
|
168629
|
+
__pycache__/
|
|
168630
|
+
|
|
168631
|
+
# Build
|
|
168632
|
+
/dist/
|
|
168633
|
+
build/
|
|
168634
|
+
|
|
168635
|
+
# Env / secrets
|
|
168636
|
+
.env
|
|
168637
|
+
.env.local
|
|
168638
|
+
*.secret
|
|
168639
|
+
|
|
168640
|
+
# OS
|
|
168641
|
+
.DS_Store
|
|
168642
|
+
|
|
168643
|
+
# MaTrixOS
|
|
168644
|
+
.omo/
|
|
168645
|
+
`,
|
|
168646
|
+
"PROJECT.md": (name2) => `# ${name2} \u2014 Project State
|
|
168647
|
+
|
|
168648
|
+
## STATUS
|
|
168649
|
+
|
|
168650
|
+
| Item | State |
|
|
168651
|
+
|------|-------|
|
|
168652
|
+
| Scope | defined / wip / done |
|
|
168653
|
+
| Health | green / yellow / red |
|
|
168654
|
+
|
|
168655
|
+
## ROADMAP
|
|
168656
|
+
|
|
168657
|
+
- [ ] Milestone 1
|
|
168658
|
+
- [ ] Milestone 2
|
|
168659
|
+
|
|
168660
|
+
## LINKS
|
|
168661
|
+
|
|
168662
|
+
- MaTrixOS Goal: (create via dashboard)
|
|
168663
|
+
- Kanban: (link board)
|
|
168664
|
+
`,
|
|
168665
|
+
"plan.md": () => `# Plan
|
|
168666
|
+
|
|
168667
|
+
## Goal
|
|
168668
|
+
|
|
168669
|
+
What are we trying to achieve?
|
|
168670
|
+
|
|
168671
|
+
## Steps
|
|
168672
|
+
|
|
168673
|
+
1.
|
|
168674
|
+
2.
|
|
168675
|
+
3.
|
|
168676
|
+
|
|
168677
|
+
## Open Questions
|
|
168678
|
+
|
|
168679
|
+
-
|
|
168680
|
+
`,
|
|
168681
|
+
"src/.gitkeep": () => ""
|
|
168682
|
+
};
|
|
168683
|
+
});
|
|
168684
|
+
|
|
168538
168685
|
// packages/omo-opencode/src/cli/service.ts
|
|
168539
168686
|
var exports_service = {};
|
|
168540
168687
|
__export(exports_service, {
|
|
168541
168688
|
serviceInstallCommand: () => serviceInstallCommand
|
|
168542
168689
|
});
|
|
168543
168690
|
import * as os15 from "os";
|
|
168544
|
-
import * as
|
|
168545
|
-
import * as
|
|
168691
|
+
import * as fs25 from "fs";
|
|
168692
|
+
import * as path30 from "path";
|
|
168546
168693
|
import { execSync as execSync4 } from "child_process";
|
|
168547
168694
|
function resolveMatrixosBin2() {
|
|
168548
168695
|
try {
|
|
@@ -168550,8 +168697,8 @@ function resolveMatrixosBin2() {
|
|
|
168550
168697
|
if (p2)
|
|
168551
168698
|
return p2;
|
|
168552
168699
|
} catch {}
|
|
168553
|
-
for (const cand of ["/usr/local/bin/matrixos", "/usr/bin/matrixos",
|
|
168554
|
-
if (
|
|
168700
|
+
for (const cand of ["/usr/local/bin/matrixos", "/usr/bin/matrixos", path30.join(os15.homedir(), ".bun/bin/matrixos")]) {
|
|
168701
|
+
if (fs25.existsSync(cand))
|
|
168555
168702
|
return cand;
|
|
168556
168703
|
}
|
|
168557
168704
|
return "matrixos";
|
|
@@ -168565,16 +168712,16 @@ function resolveBunBin() {
|
|
|
168565
168712
|
return "/usr/bin/bun";
|
|
168566
168713
|
}
|
|
168567
168714
|
function writeFileEnsureDir(filePath, content) {
|
|
168568
|
-
|
|
168569
|
-
|
|
168715
|
+
fs25.mkdirSync(path30.dirname(filePath), { recursive: true });
|
|
168716
|
+
fs25.writeFileSync(filePath, content, "utf-8");
|
|
168570
168717
|
console.log(`[service] written: ${filePath}`);
|
|
168571
168718
|
}
|
|
168572
168719
|
function installSystemd(opts) {
|
|
168573
168720
|
const bin = resolveMatrixosBin2();
|
|
168574
168721
|
const bun = resolveBunBin();
|
|
168575
168722
|
const scope = opts.user ? "--user" : "";
|
|
168576
|
-
const unitDir = opts.user ?
|
|
168577
|
-
const envPath = `/usr/local/bin:/usr/bin:/bin:${
|
|
168723
|
+
const unitDir = opts.user ? path30.join(os15.homedir(), ".config", "systemd", "user") : "/etc/systemd/system";
|
|
168724
|
+
const envPath = `/usr/local/bin:/usr/bin:/bin:${path30.dirname(bun)}`;
|
|
168578
168725
|
if (opts.dashboard !== false) {
|
|
168579
168726
|
const unit = `[Unit]
|
|
168580
168727
|
Description=MaTrixOS Dashboard
|
|
@@ -168593,7 +168740,7 @@ RestartSec=5
|
|
|
168593
168740
|
[Install]
|
|
168594
168741
|
WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
168595
168742
|
`;
|
|
168596
|
-
writeFileEnsureDir(
|
|
168743
|
+
writeFileEnsureDir(path30.join(unitDir, "matrixos-dashboard.service"), unit);
|
|
168597
168744
|
}
|
|
168598
168745
|
if (opts.gateway !== false) {
|
|
168599
168746
|
const unit = `[Unit]
|
|
@@ -168613,7 +168760,7 @@ RestartSec=5
|
|
|
168613
168760
|
[Install]
|
|
168614
168761
|
WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
168615
168762
|
`;
|
|
168616
|
-
writeFileEnsureDir(
|
|
168763
|
+
writeFileEnsureDir(path30.join(unitDir, "matrixos-gateway.service"), unit);
|
|
168617
168764
|
}
|
|
168618
168765
|
if (opts.cron !== false) {
|
|
168619
168766
|
const unit = `[Unit]
|
|
@@ -168633,7 +168780,7 @@ RestartSec=5
|
|
|
168633
168780
|
[Install]
|
|
168634
168781
|
WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
168635
168782
|
`;
|
|
168636
|
-
writeFileEnsureDir(
|
|
168783
|
+
writeFileEnsureDir(path30.join(unitDir, "matrixos-cron.service"), unit);
|
|
168637
168784
|
}
|
|
168638
168785
|
console.log("[service] reloading systemd...");
|
|
168639
168786
|
if (scope) {
|
|
@@ -168670,8 +168817,8 @@ WantedBy=${opts.user ? "default.target" : "multi-user.target"}
|
|
|
168670
168817
|
function installLaunchd(opts) {
|
|
168671
168818
|
const bin = resolveMatrixosBin2();
|
|
168672
168819
|
const bun = resolveBunBin();
|
|
168673
|
-
const launchDir =
|
|
168674
|
-
const envPath = `/usr/local/bin:/usr/bin:/bin:${
|
|
168820
|
+
const launchDir = path30.join(os15.homedir(), "Library", "LaunchAgents");
|
|
168821
|
+
const envPath = `/usr/local/bin:/usr/bin:/bin:${path30.dirname(bun)}`;
|
|
168675
168822
|
if (opts.dashboard !== false) {
|
|
168676
168823
|
const label = "com.klc.matrixos.dashboard";
|
|
168677
168824
|
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -168708,8 +168855,8 @@ function installLaunchd(opts) {
|
|
|
168708
168855
|
</dict>
|
|
168709
168856
|
</plist>
|
|
168710
168857
|
`;
|
|
168711
|
-
writeFileEnsureDir(
|
|
168712
|
-
execSync4(`launchctl load ${
|
|
168858
|
+
writeFileEnsureDir(path30.join(launchDir, `${label}.plist`), plist);
|
|
168859
|
+
execSync4(`launchctl load ${path30.join(launchDir, `${label}.plist`)}`, { stdio: "inherit" });
|
|
168713
168860
|
}
|
|
168714
168861
|
if (opts.gateway !== false) {
|
|
168715
168862
|
const label = "com.klc.matrixos.gateway";
|
|
@@ -168747,8 +168894,8 @@ function installLaunchd(opts) {
|
|
|
168747
168894
|
</dict>
|
|
168748
168895
|
</plist>
|
|
168749
168896
|
`;
|
|
168750
|
-
writeFileEnsureDir(
|
|
168751
|
-
execSync4(`launchctl load ${
|
|
168897
|
+
writeFileEnsureDir(path30.join(launchDir, `${label}.plist`), plist);
|
|
168898
|
+
execSync4(`launchctl load ${path30.join(launchDir, `${label}.plist`)}`, { stdio: "inherit" });
|
|
168752
168899
|
}
|
|
168753
168900
|
console.log("[service] launchd agents installed and loaded.");
|
|
168754
168901
|
}
|
|
@@ -168762,7 +168909,7 @@ async function serviceInstallCommand(options) {
|
|
|
168762
168909
|
const platform2 = process.platform;
|
|
168763
168910
|
console.log(`[service] detected platform: ${platform2}`);
|
|
168764
168911
|
if (platform2 === "linux") {
|
|
168765
|
-
if (!
|
|
168912
|
+
if (!fs25.existsSync("/run/systemd/system") && !fs25.existsSync("/etc/systemd/system")) {
|
|
168766
168913
|
console.error("[service] systemd not detected \u2014 cannot install service automatically.");
|
|
168767
168914
|
console.error(" Start manually: matrixos dashboard --host 0.0.0.0 --daemon");
|
|
168768
168915
|
return 1;
|
|
@@ -190491,6 +190638,21 @@ prepare.command("submit <pr>").description("Mark a prepared PR as ready (human v
|
|
|
190491
190638
|
const code = submitPr2({ pr, json: options.json ?? false });
|
|
190492
190639
|
process.exit(code);
|
|
190493
190640
|
});
|
|
190641
|
+
var projectCmd = program2.command("project").description("Project lifecycle helpers (generic scaffolding)");
|
|
190642
|
+
projectCmd.command("init <name>").description("Scaffold a generic project (AGENTS.md, README, .gitignore, PROJECT.md, plan.md)").option("-p, --path <dir>", "Target directory (default: cwd)").option("--apply", "Actually write the files (default dry-run)").option("--json", "Output as JSON").addHelpText("after", `
|
|
190643
|
+
Examples:
|
|
190644
|
+
$ matrixos project init my-app # dry-run
|
|
190645
|
+
$ matrixos project init my-app --apply # write files
|
|
190646
|
+
`).action(async (name2, options) => {
|
|
190647
|
+
const { projectInit: projectInit2 } = await Promise.resolve().then(() => (init_project_init(), exports_project_init));
|
|
190648
|
+
const code = projectInit2({
|
|
190649
|
+
name: name2,
|
|
190650
|
+
path: options.path,
|
|
190651
|
+
apply: options.apply ?? false,
|
|
190652
|
+
json: options.json ?? false
|
|
190653
|
+
});
|
|
190654
|
+
process.exit(code);
|
|
190655
|
+
});
|
|
190494
190656
|
program2.command("service").description("Install MaTrixOS as a persistent OS service (dashboard + gateway)").argument("<action>", "install | uninstall").option("--no-dashboard", "Skip dashboard service").option("--no-gateway", "Skip gateway service").option("--no-cron", "Skip cron scheduler service").option("--user", "Install as current user (systemd --user / launchd user agent)").action(async (action, options) => {
|
|
190495
190657
|
if (action !== "install" && action !== "uninstall") {
|
|
190496
190658
|
console.error(`[service] unknown action: ${action}. Use 'install' or 'uninstall'.`);
|
package/dist/index.js
CHANGED
|
@@ -368086,7 +368086,7 @@ function getCachedVersion(options = {}) {
|
|
|
368086
368086
|
// package.json
|
|
368087
368087
|
var package_default = {
|
|
368088
368088
|
name: "@kl-c/matrixos",
|
|
368089
|
-
version: "0.3.
|
|
368089
|
+
version: "0.3.53",
|
|
368090
368090
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
368091
368091
|
main: "./dist/index.js",
|
|
368092
368092
|
types: "dist/index.d.ts",
|
package/package.json
CHANGED