@kl-c/matrixos 0.3.2 → 0.3.3
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 +52 -47
- package/dist/cli-node/index.js +52 -47
- 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.3",
|
|
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",
|
|
@@ -186555,18 +186555,32 @@ import * as os12 from "os";
|
|
|
186555
186555
|
import * as fs21 from "fs";
|
|
186556
186556
|
import * as path24 from "path";
|
|
186557
186557
|
import { Database as Database5 } from "bun:sqlite";
|
|
186558
|
-
var
|
|
186558
|
+
var BUILTIN_AGENT_NAMES2 = BuiltinAgentNameSchema.options.map((v) => v);
|
|
186559
|
+
var AGENT_DISPLAY_NAMES2 = {
|
|
186560
|
+
morpheus: "Morpheus",
|
|
186561
|
+
tank: "Tank",
|
|
186562
|
+
"the-oracle": "The Oracle",
|
|
186563
|
+
oracle: "Oracle",
|
|
186564
|
+
link: "Link",
|
|
186565
|
+
ghost: "Ghost",
|
|
186566
|
+
"the-analyst": "The Analyst",
|
|
186567
|
+
"the-keymaker": "The Keymaker",
|
|
186568
|
+
"agent-smith": "Agent Smith",
|
|
186569
|
+
"the-operator": "The Operator",
|
|
186570
|
+
neo: "Neo"
|
|
186571
|
+
};
|
|
186559
186572
|
var AGENT_ROLES = {
|
|
186560
|
-
|
|
186561
|
-
|
|
186562
|
-
|
|
186563
|
-
|
|
186564
|
-
|
|
186565
|
-
|
|
186566
|
-
|
|
186567
|
-
|
|
186568
|
-
|
|
186569
|
-
|
|
186573
|
+
morpheus: "Orchestrator",
|
|
186574
|
+
tank: "Deep Work",
|
|
186575
|
+
"the-oracle": "Strategy",
|
|
186576
|
+
oracle: "Consultation",
|
|
186577
|
+
link: "Search",
|
|
186578
|
+
ghost: "Contextual Grep",
|
|
186579
|
+
"the-analyst": "Vision / PDF",
|
|
186580
|
+
"the-keymaker": "Pre-planning",
|
|
186581
|
+
"agent-smith": "Plan Review",
|
|
186582
|
+
"the-operator": "Todo Orchestrator",
|
|
186583
|
+
neo: "Executor"
|
|
186570
186584
|
};
|
|
186571
186585
|
var DEFAULT_MODEL = "opencode/deepseek-v4-flash-free";
|
|
186572
186586
|
var AVAILABLE_MODELS = [
|
|
@@ -186671,7 +186685,7 @@ function createDataProvider(config5) {
|
|
|
186671
186685
|
const mem = process.memoryUsage();
|
|
186672
186686
|
const totalMem = os12.totalmem();
|
|
186673
186687
|
const db = getDb();
|
|
186674
|
-
let agentsOnline =
|
|
186688
|
+
let agentsOnline = BUILTIN_AGENT_NAMES2.length;
|
|
186675
186689
|
let activeSessions = 0;
|
|
186676
186690
|
let tasksQueued = 0;
|
|
186677
186691
|
if (db) {
|
|
@@ -186692,7 +186706,7 @@ function createDataProvider(config5) {
|
|
|
186692
186706
|
}
|
|
186693
186707
|
return {
|
|
186694
186708
|
agentsOnline,
|
|
186695
|
-
totalAgents:
|
|
186709
|
+
totalAgents: BUILTIN_AGENT_NAMES2.length,
|
|
186696
186710
|
activeSessions,
|
|
186697
186711
|
tasksQueued,
|
|
186698
186712
|
uptime: process.uptime(),
|
|
@@ -186706,56 +186720,47 @@ function createDataProvider(config5) {
|
|
|
186706
186720
|
};
|
|
186707
186721
|
},
|
|
186708
186722
|
async getAgents() {
|
|
186723
|
+
const cfgAgents = readAgentModels();
|
|
186709
186724
|
const db = getDb();
|
|
186725
|
+
const cutoff = Date.now() - THIRTY_MIN_MS;
|
|
186726
|
+
const dbAgentMap = new Map;
|
|
186710
186727
|
if (db) {
|
|
186711
186728
|
try {
|
|
186712
|
-
const cutoff = Date.now() - THIRTY_MIN_MS;
|
|
186713
186729
|
const rows = db.query(`SELECT agent, COUNT(*) as sessions
|
|
186714
186730
|
FROM session
|
|
186715
186731
|
WHERE agent IS NOT NULL AND agent != ''
|
|
186716
186732
|
GROUP BY agent`).all();
|
|
186717
|
-
|
|
186718
|
-
const
|
|
186719
|
-
|
|
186720
|
-
|
|
186721
|
-
|
|
186722
|
-
|
|
186723
|
-
const status2 = onlineRows.length > 0 && onlineRows[0].count > 0 ? "online" : "idle";
|
|
186724
|
-
const model = cfgAgents2[name2];
|
|
186725
|
-
result.push({
|
|
186726
|
-
name: name2,
|
|
186727
|
-
role: AGENT_ROLES[name2] ?? "Agent",
|
|
186728
|
-
status: status2,
|
|
186729
|
-
sessions: row.sessions,
|
|
186730
|
-
uptime: 0,
|
|
186731
|
-
cpuPercent: 0,
|
|
186732
|
-
memoryPercent: 0,
|
|
186733
|
-
model: model ?? DEFAULT_MODEL,
|
|
186734
|
-
modelInherited: !model
|
|
186735
|
-
});
|
|
186736
|
-
}
|
|
186737
|
-
db.close();
|
|
186738
|
-
return result;
|
|
186733
|
+
for (const row of rows) {
|
|
186734
|
+
const onlineRows = db.query("SELECT COUNT(*) as count FROM session WHERE agent = ? AND time_updated > ?").all(row.agent, cutoff);
|
|
186735
|
+
dbAgentMap.set(row.agent, {
|
|
186736
|
+
sessions: row.sessions,
|
|
186737
|
+
online: onlineRows.length > 0 && onlineRows[0].count > 0
|
|
186738
|
+
});
|
|
186739
186739
|
}
|
|
186740
186740
|
} catch {} finally {
|
|
186741
186741
|
db.close();
|
|
186742
186742
|
}
|
|
186743
186743
|
}
|
|
186744
|
-
const
|
|
186745
|
-
|
|
186746
|
-
const
|
|
186747
|
-
|
|
186748
|
-
|
|
186749
|
-
|
|
186750
|
-
|
|
186751
|
-
|
|
186744
|
+
const result = [];
|
|
186745
|
+
for (const id of BUILTIN_AGENT_NAMES2) {
|
|
186746
|
+
const displayName = AGENT_DISPLAY_NAMES2[id] ?? id;
|
|
186747
|
+
const dbState = dbAgentMap.get(displayName) ?? dbAgentMap.get(id);
|
|
186748
|
+
const sessions = dbState?.sessions ?? 0;
|
|
186749
|
+
const status2 = dbState?.online ? "online" : sessions > 0 ? "idle" : "idle";
|
|
186750
|
+
const model = cfgAgents[id] ?? cfgAgents[displayName];
|
|
186751
|
+
result.push({
|
|
186752
|
+
name: displayName,
|
|
186753
|
+
role: AGENT_ROLES[id] ?? "Agent",
|
|
186754
|
+
status: status2,
|
|
186755
|
+
sessions,
|
|
186752
186756
|
uptime: 0,
|
|
186753
186757
|
cpuPercent: 0,
|
|
186754
186758
|
memoryPercent: 0,
|
|
186755
186759
|
model: model ?? DEFAULT_MODEL,
|
|
186756
186760
|
modelInherited: !model
|
|
186757
|
-
};
|
|
186758
|
-
}
|
|
186761
|
+
});
|
|
186762
|
+
}
|
|
186763
|
+
return result;
|
|
186759
186764
|
},
|
|
186760
186765
|
getModels() {
|
|
186761
186766
|
return AVAILABLE_MODELS;
|
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.3",
|
|
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",
|
|
@@ -186610,18 +186610,32 @@ import * as os12 from "os";
|
|
|
186610
186610
|
import * as fs21 from "fs";
|
|
186611
186611
|
import * as path24 from "path";
|
|
186612
186612
|
import { Database as Database5 } from "bun:sqlite";
|
|
186613
|
-
var
|
|
186613
|
+
var BUILTIN_AGENT_NAMES2 = BuiltinAgentNameSchema.options.map((v) => v);
|
|
186614
|
+
var AGENT_DISPLAY_NAMES2 = {
|
|
186615
|
+
morpheus: "Morpheus",
|
|
186616
|
+
tank: "Tank",
|
|
186617
|
+
"the-oracle": "The Oracle",
|
|
186618
|
+
oracle: "Oracle",
|
|
186619
|
+
link: "Link",
|
|
186620
|
+
ghost: "Ghost",
|
|
186621
|
+
"the-analyst": "The Analyst",
|
|
186622
|
+
"the-keymaker": "The Keymaker",
|
|
186623
|
+
"agent-smith": "Agent Smith",
|
|
186624
|
+
"the-operator": "The Operator",
|
|
186625
|
+
neo: "Neo"
|
|
186626
|
+
};
|
|
186614
186627
|
var AGENT_ROLES = {
|
|
186615
|
-
|
|
186616
|
-
|
|
186617
|
-
|
|
186618
|
-
|
|
186619
|
-
|
|
186620
|
-
|
|
186621
|
-
|
|
186622
|
-
|
|
186623
|
-
|
|
186624
|
-
|
|
186628
|
+
morpheus: "Orchestrator",
|
|
186629
|
+
tank: "Deep Work",
|
|
186630
|
+
"the-oracle": "Strategy",
|
|
186631
|
+
oracle: "Consultation",
|
|
186632
|
+
link: "Search",
|
|
186633
|
+
ghost: "Contextual Grep",
|
|
186634
|
+
"the-analyst": "Vision / PDF",
|
|
186635
|
+
"the-keymaker": "Pre-planning",
|
|
186636
|
+
"agent-smith": "Plan Review",
|
|
186637
|
+
"the-operator": "Todo Orchestrator",
|
|
186638
|
+
neo: "Executor"
|
|
186625
186639
|
};
|
|
186626
186640
|
var DEFAULT_MODEL = "opencode/deepseek-v4-flash-free";
|
|
186627
186641
|
var AVAILABLE_MODELS = [
|
|
@@ -186726,7 +186740,7 @@ function createDataProvider(config5) {
|
|
|
186726
186740
|
const mem = process.memoryUsage();
|
|
186727
186741
|
const totalMem = os12.totalmem();
|
|
186728
186742
|
const db = getDb();
|
|
186729
|
-
let agentsOnline =
|
|
186743
|
+
let agentsOnline = BUILTIN_AGENT_NAMES2.length;
|
|
186730
186744
|
let activeSessions = 0;
|
|
186731
186745
|
let tasksQueued = 0;
|
|
186732
186746
|
if (db) {
|
|
@@ -186747,7 +186761,7 @@ function createDataProvider(config5) {
|
|
|
186747
186761
|
}
|
|
186748
186762
|
return {
|
|
186749
186763
|
agentsOnline,
|
|
186750
|
-
totalAgents:
|
|
186764
|
+
totalAgents: BUILTIN_AGENT_NAMES2.length,
|
|
186751
186765
|
activeSessions,
|
|
186752
186766
|
tasksQueued,
|
|
186753
186767
|
uptime: process.uptime(),
|
|
@@ -186761,56 +186775,47 @@ function createDataProvider(config5) {
|
|
|
186761
186775
|
};
|
|
186762
186776
|
},
|
|
186763
186777
|
async getAgents() {
|
|
186778
|
+
const cfgAgents = readAgentModels();
|
|
186764
186779
|
const db = getDb();
|
|
186780
|
+
const cutoff = Date.now() - THIRTY_MIN_MS;
|
|
186781
|
+
const dbAgentMap = new Map;
|
|
186765
186782
|
if (db) {
|
|
186766
186783
|
try {
|
|
186767
|
-
const cutoff = Date.now() - THIRTY_MIN_MS;
|
|
186768
186784
|
const rows = db.query(`SELECT agent, COUNT(*) as sessions
|
|
186769
186785
|
FROM session
|
|
186770
186786
|
WHERE agent IS NOT NULL AND agent != ''
|
|
186771
186787
|
GROUP BY agent`).all();
|
|
186772
|
-
|
|
186773
|
-
const
|
|
186774
|
-
|
|
186775
|
-
|
|
186776
|
-
|
|
186777
|
-
|
|
186778
|
-
const status2 = onlineRows.length > 0 && onlineRows[0].count > 0 ? "online" : "idle";
|
|
186779
|
-
const model = cfgAgents2[name2];
|
|
186780
|
-
result.push({
|
|
186781
|
-
name: name2,
|
|
186782
|
-
role: AGENT_ROLES[name2] ?? "Agent",
|
|
186783
|
-
status: status2,
|
|
186784
|
-
sessions: row.sessions,
|
|
186785
|
-
uptime: 0,
|
|
186786
|
-
cpuPercent: 0,
|
|
186787
|
-
memoryPercent: 0,
|
|
186788
|
-
model: model ?? DEFAULT_MODEL,
|
|
186789
|
-
modelInherited: !model
|
|
186790
|
-
});
|
|
186791
|
-
}
|
|
186792
|
-
db.close();
|
|
186793
|
-
return result;
|
|
186788
|
+
for (const row of rows) {
|
|
186789
|
+
const onlineRows = db.query("SELECT COUNT(*) as count FROM session WHERE agent = ? AND time_updated > ?").all(row.agent, cutoff);
|
|
186790
|
+
dbAgentMap.set(row.agent, {
|
|
186791
|
+
sessions: row.sessions,
|
|
186792
|
+
online: onlineRows.length > 0 && onlineRows[0].count > 0
|
|
186793
|
+
});
|
|
186794
186794
|
}
|
|
186795
186795
|
} catch {} finally {
|
|
186796
186796
|
db.close();
|
|
186797
186797
|
}
|
|
186798
186798
|
}
|
|
186799
|
-
const
|
|
186800
|
-
|
|
186801
|
-
const
|
|
186802
|
-
|
|
186803
|
-
|
|
186804
|
-
|
|
186805
|
-
|
|
186806
|
-
|
|
186799
|
+
const result = [];
|
|
186800
|
+
for (const id of BUILTIN_AGENT_NAMES2) {
|
|
186801
|
+
const displayName = AGENT_DISPLAY_NAMES2[id] ?? id;
|
|
186802
|
+
const dbState = dbAgentMap.get(displayName) ?? dbAgentMap.get(id);
|
|
186803
|
+
const sessions = dbState?.sessions ?? 0;
|
|
186804
|
+
const status2 = dbState?.online ? "online" : sessions > 0 ? "idle" : "idle";
|
|
186805
|
+
const model = cfgAgents[id] ?? cfgAgents[displayName];
|
|
186806
|
+
result.push({
|
|
186807
|
+
name: displayName,
|
|
186808
|
+
role: AGENT_ROLES[id] ?? "Agent",
|
|
186809
|
+
status: status2,
|
|
186810
|
+
sessions,
|
|
186807
186811
|
uptime: 0,
|
|
186808
186812
|
cpuPercent: 0,
|
|
186809
186813
|
memoryPercent: 0,
|
|
186810
186814
|
model: model ?? DEFAULT_MODEL,
|
|
186811
186815
|
modelInherited: !model
|
|
186812
|
-
};
|
|
186813
|
-
}
|
|
186816
|
+
});
|
|
186817
|
+
}
|
|
186818
|
+
return result;
|
|
186814
186819
|
},
|
|
186815
186820
|
getModels() {
|
|
186816
186821
|
return AVAILABLE_MODELS;
|
package/dist/index.js
CHANGED
|
@@ -368019,7 +368019,7 @@ function getCachedVersion(options = {}) {
|
|
|
368019
368019
|
// package.json
|
|
368020
368020
|
var package_default = {
|
|
368021
368021
|
name: "@kl-c/matrixos",
|
|
368022
|
-
version: "0.3.
|
|
368022
|
+
version: "0.3.3",
|
|
368023
368023
|
description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
|
|
368024
368024
|
main: "./dist/index.js",
|
|
368025
368025
|
types: "dist/index.d.ts",
|
package/package.json
CHANGED