@kl-c/matrixos 0.3.47 → 0.3.48

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 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.47",
2166
+ version: "0.3.48",
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",
@@ -187742,6 +187742,26 @@ ${row.description ? `Description: ${row.description}
187742
187742
  db.close();
187743
187743
  }
187744
187744
  },
187745
+ async createSkill(input) {
187746
+ try {
187747
+ const { spawnSync: spawnSync4 } = await import("child_process");
187748
+ const args = ["skill-create", input.name];
187749
+ if (input.description)
187750
+ args.push("--description", input.description);
187751
+ if (input.scope === "project")
187752
+ args.push("--scope", "project");
187753
+ args.push("--apply");
187754
+ const res = spawnSync4("matrixos", args, { encoding: "utf-8" });
187755
+ if (res.status !== 0) {
187756
+ return { ok: false, error: (res.stderr || res.stdout || "skill-create failed").trim() };
187757
+ }
187758
+ const out = res.stdout.trim();
187759
+ const pathMatch = out.match(/created: (.+)/);
187760
+ return { ok: true, path: pathMatch ? pathMatch[1] : out };
187761
+ } catch (e) {
187762
+ return { ok: false, error: e instanceof Error ? e.message : String(e) };
187763
+ }
187764
+ },
187745
187765
  async getIncidents(limit = 50) {
187746
187766
  const lines = readJsonl("anti-loop.jsonl");
187747
187767
  if (lines.length === 0) {
@@ -188151,6 +188171,17 @@ function createDashboardServer(dataProvider, config5) {
188151
188171
  return Response.json(dataProvider.getMemory(), { headers: jsonHeaders });
188152
188172
  case "/api/skills":
188153
188173
  return Response.json(dataProvider.getSkills(), { headers: jsonHeaders });
188174
+ case "/api/skills/create": {
188175
+ if (req.method !== "POST") {
188176
+ return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
188177
+ }
188178
+ const body = await req.json();
188179
+ if (!body.name || !body.name.trim()) {
188180
+ return Response.json({ ok: false, error: "name required" }, { status: 400, headers: jsonHeaders });
188181
+ }
188182
+ const result = await dataProvider.createSkill(body);
188183
+ return Response.json(result, { status: result.ok ? 201 : 500, headers: jsonHeaders });
188184
+ }
188154
188185
  case "/api/gateway/token": {
188155
188186
  if (req.method !== "POST") {
188156
188187
  return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
@@ -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.47",
2166
+ version: "0.3.48",
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",
@@ -187797,6 +187797,26 @@ ${row.description ? `Description: ${row.description}
187797
187797
  db.close();
187798
187798
  }
187799
187799
  },
187800
+ async createSkill(input) {
187801
+ try {
187802
+ const { spawnSync: spawnSync4 } = await import("child_process");
187803
+ const args = ["skill-create", input.name];
187804
+ if (input.description)
187805
+ args.push("--description", input.description);
187806
+ if (input.scope === "project")
187807
+ args.push("--scope", "project");
187808
+ args.push("--apply");
187809
+ const res = spawnSync4("matrixos", args, { encoding: "utf-8" });
187810
+ if (res.status !== 0) {
187811
+ return { ok: false, error: (res.stderr || res.stdout || "skill-create failed").trim() };
187812
+ }
187813
+ const out = res.stdout.trim();
187814
+ const pathMatch = out.match(/created: (.+)/);
187815
+ return { ok: true, path: pathMatch ? pathMatch[1] : out };
187816
+ } catch (e) {
187817
+ return { ok: false, error: e instanceof Error ? e.message : String(e) };
187818
+ }
187819
+ },
187800
187820
  async getIncidents(limit = 50) {
187801
187821
  const lines = readJsonl("anti-loop.jsonl");
187802
187822
  if (lines.length === 0) {
@@ -188206,6 +188226,17 @@ function createDashboardServer(dataProvider, config5) {
188206
188226
  return Response.json(dataProvider.getMemory(), { headers: jsonHeaders });
188207
188227
  case "/api/skills":
188208
188228
  return Response.json(dataProvider.getSkills(), { headers: jsonHeaders });
188229
+ case "/api/skills/create": {
188230
+ if (req.method !== "POST") {
188231
+ return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
188232
+ }
188233
+ const body = await req.json();
188234
+ if (!body.name || !body.name.trim()) {
188235
+ return Response.json({ ok: false, error: "name required" }, { status: 400, headers: jsonHeaders });
188236
+ }
188237
+ const result = await dataProvider.createSkill(body);
188238
+ return Response.json(result, { status: result.ok ? 201 : 500, headers: jsonHeaders });
188239
+ }
188209
188240
  case "/api/gateway/token": {
188210
188241
  if (req.method !== "POST") {
188211
188242
  return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
@@ -64,6 +64,15 @@ export interface DataProvider {
64
64
  ok: boolean;
65
65
  error?: string;
66
66
  }>;
67
+ createSkill(input: {
68
+ name: string;
69
+ description?: string;
70
+ scope?: string;
71
+ }): Promise<{
72
+ ok: boolean;
73
+ path?: string;
74
+ error?: string;
75
+ }>;
67
76
  getIncidents(limit?: number): Promise<IncidentEntry[]>;
68
77
  getMetrics(range?: string): Promise<MetricsSnapshot[]>;
69
78
  getLogs(): LogEntry[];
@@ -402,3 +402,11 @@ body{font-family:var(--font-body);font-size:var(--text-base);color:var(--text-pr
402
402
 
403
403
  @media(max-width:1024px){.kpi-grid,.grid-2{grid-template-columns:repeat(2,1fr)}.kanban-board{grid-template-columns:repeat(2,1fr)}.gauge-grid{grid-template-columns:repeat(2,1fr)}}
404
404
  @media(max-width:768px){.kpi-grid,.grid-2{grid-template-columns:1fr}.kanban-board{grid-template-columns:1fr}.agent-grid{grid-template-columns:1fr}.goals-grid{grid-template-columns:1fr}}
405
+
406
+ .modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
407
+ .modal-header h3{font-size:var(--text-lg);font-weight:600;color:var(--text-primary)}
408
+ .modal-close{background:none;border:none;color:var(--text-tertiary);font-size:22px;cursor:pointer;line-height:1}
409
+ .modal-body{display:flex;flex-direction:column;gap:8px}
410
+ .modal-label{font-size:var(--text-xs);font-weight:600;color:var(--text-secondary);margin-top:6px}
411
+ .skill-preview{margin-top:8px;background:var(--bg-code);border:1px solid var(--border-default);border-radius:var(--radius-sm);padding:10px;font-family:var(--font-mono);font-size:11px;color:var(--text-secondary);white-space:pre-wrap;max-height:160px;overflow:auto}
412
+ .modal-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:6px}
@@ -171,9 +171,27 @@
171
171
  <div id="tab-skills" class="tab-panel">
172
172
  <div class="page-header">
173
173
  <div><h1 class="page-title">Skills</h1><p class="page-subtitle">Installed MaTrixOS and shared skills</p></div>
174
- <div class="page-actions"><div class="filters-bar" id="skillFilters"><button class="filter-chip active" data-scat="all">All</button><button class="filter-chip" data-scat="builtin">Builtin</button></div></div>
175
- </div>
176
- <div class="skills-grid" id="skillsGrid"></div>
174
+ <div class="page-actions"><div class="filters-bar" id="skillFilters"><button class="filter-chip active" data-scat="all">All</button><button class="filter-chip" data-scat="builtin">Builtin</button></div><button class="btn btn-primary" id="newSkillBtn" style="margin-left:12px">+ New Skill</button></div>
175
+ </div>
176
+ <div class="skills-grid" id="skillsGrid"></div>
177
+ <div class="modal-overlay" id="skillModal" style="display:none">
178
+ <div class="modal-box">
179
+ <div class="modal-header"><h3>New Skill</h3><button class="modal-close" onclick="closeSkillModal()">×</button></div>
180
+ <div class="modal-body">
181
+ <label class="modal-label">Name</label>
182
+ <input class="input" id="skillName" placeholder="my-skill" />
183
+ <label class="modal-label">Description (triggers)</label>
184
+ <input class="input" id="skillDesc" placeholder="What this skill does and when to use it" />
185
+ <label class="modal-label">Scope</label>
186
+ <select class="input" id="skillScope">
187
+ <option value="user">User (~/.config/opencode/skills)</option>
188
+ <option value="project">Project (./.opencode/skills)</option>
189
+ </select>
190
+ <div id="skillPreview" class="skill-preview"></div>
191
+ </div>
192
+ <div class="modal-footer"><button class="btn btn-secondary" onclick="closeSkillModal()">Cancel</button><button class="btn btn-primary" onclick="createSkill()">Create</button></div>
193
+ </div>
194
+ </div>
177
195
  </div>
178
196
 
179
197
  <div id="tab-config" class="tab-panel">
@@ -13,7 +13,7 @@ const API={
13
13
  goalCreate:(body)=>fetchJSON('/goals',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}),
14
14
  goalDelete:(id)=>fetchJSON(`/goals?id=${encodeURIComponent(id)}`,{method:'DELETE'}),
15
15
  goalDecompose:(id)=>fetchJSON('/goals/decompose',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({id})}),
16
- metrics:()=>fetchJSON('/metrics'),
16
+ skillCreate:(body)=>fetchJSON('/skills/create',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}),
17
17
  config:()=>fetchJSON('/config'),
18
18
  memory:()=>fetchJSON('/memory'),
19
19
  skills:()=>fetchJSON('/skills'),
@@ -636,6 +636,35 @@ async function loadSkills(){
636
636
  }catch(e){grid.innerHTML=`<div class="error"><p>Failed to load skills: ${e.message}</p></div>`}
637
637
  }
638
638
 
639
+ function openSkillModal(){
640
+ const modal=document.getElementById('skillModal')
641
+ modal.style.display='flex'
642
+ document.getElementById('skillPreview').textContent=''
643
+ document.getElementById('skillName').value=''
644
+ document.getElementById('skillDesc').value=''
645
+ document.getElementById('skillScope').value='user'
646
+ document.getElementById('skillName').oninput=()=>{
647
+ const name=document.getElementById('skillName').value.trim()
648
+ const desc=document.getElementById('skillDesc').value.trim()
649
+ if(!name){document.getElementById('skillPreview').textContent='';return}
650
+ const slug=name.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+$/g,'')
651
+ document.getElementById('skillPreview').textContent=`---\nname: ${slug}\ndescription: ${desc||slug+' — TODO'}\ncategory: user-generated\n---\n\n# ${name}\n\n## Overview\n...\n`
652
+ }
653
+ document.getElementById('skillDesc').oninput=document.getElementById('skillName').oninput
654
+ }
655
+ function closeSkillModal(){document.getElementById('skillModal').style.display='none'}
656
+ async function createSkill(){
657
+ const name=document.getElementById('skillName').value.trim()
658
+ const desc=document.getElementById('skillDesc').value.trim()
659
+ const scope=document.getElementById('skillScope').value
660
+ if(!name){alert('Name required');return}
661
+ closeSkillModal()
662
+ try{
663
+ await API.skillCreate({name,description:desc,scope})
664
+ loadSkills()
665
+ }catch(e){alert('Skill creation failed: '+e.message)}
666
+ }
667
+
639
668
  // ===== SCHEDULE =====
640
669
  function loadSchedule(){
641
670
  const body=document.getElementById('scheduleBody')
@@ -649,6 +678,7 @@ function loadSchedule(){
649
678
  // ===== INIT =====
650
679
  document.getElementById('refreshBtn').onclick=()=>{const t=document.querySelector('.header-tab.active');t&&loadTab(t.dataset.tab)}
651
680
  document.getElementById('archRefresh').onclick=()=>loadArchitect()
681
+ document.getElementById('newSkillBtn').onclick=()=>openSkillModal()
652
682
  document.getElementById('deployBtn').onclick=()=>alert('Deploy Agent — coming soon')
653
683
  document.getElementById('diagBtn').onclick=()=>alert('Diagnostics — coming soon')
654
684
  document.getElementById('notifBtn').onclick=()=>alert('3 notifications pending')
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.47",
368089
+ version: "0.3.48",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kl-c/matrixos",
3
- "version": "0.3.47",
3
+ "version": "0.3.48",
4
4
  "description": "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "dist/index.d.ts",