@kl-c/matrixos 0.3.42 → 0.3.44

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.42",
2166
+ version: "0.3.44",
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",
@@ -187517,7 +187517,29 @@ ${row.description ? `Description: ${row.description}
187517
187517
  if (!db)
187518
187518
  return { ok: false, error: "database unavailable" };
187519
187519
  try {
187520
+ let extractTasks = function(text) {
187521
+ const summaryMatch = text.match(/"summary"\s*:\\s*"(\[[\\s\\S]*?\])"/);
187522
+ if (summaryMatch) {
187523
+ try {
187524
+ const unescaped = summaryMatch[1].replace(/\\\\"/g, '"').replace(/\\\\n/g, `
187525
+ `).replace(/\\\\\\/g, "/");
187526
+ const parsed = JSON.parse(unescaped);
187527
+ if (Array.isArray(parsed))
187528
+ return parsed;
187529
+ } catch {}
187530
+ }
187531
+ const rawMatch = text.match(/\[[\\s\\S]*?\]/);
187532
+ if (rawMatch) {
187533
+ try {
187534
+ const parsed = JSON.parse(rawMatch[0]);
187535
+ if (Array.isArray(parsed))
187536
+ return parsed;
187537
+ } catch {}
187538
+ }
187539
+ return null;
187540
+ };
187520
187541
  ensureGoalsTable(db);
187542
+ ensureKanbanTable(db);
187521
187543
  const row = db.query("SELECT title, description, status FROM matrixos_goals WHERE id = ?").get(id);
187522
187544
  if (!row)
187523
187545
  return { ok: false, error: "goal not found" };
@@ -187541,17 +187563,10 @@ ${row.description ? `Description: ${row.description}
187541
187563
  db.query("UPDATE matrixos_goals SET status = ?, updated_at = ? WHERE id = ?").run("active", Date.now(), id);
187542
187564
  return { ok: false, error: "decomposition failed", output: combined, status: "active" };
187543
187565
  }
187544
- const jsonMatch = combined.match(/\[[\s\S]*\]/);
187545
- if (!jsonMatch) {
187546
- db.query("UPDATE matrixos_goals SET status = ?, updated_at = ? WHERE id = ?").run("active", Date.now(), id);
187547
- return { ok: false, error: "no task JSON in response", output: combined, status: "active" };
187548
- }
187549
- let tasks = [];
187550
- try {
187551
- tasks = JSON.parse(jsonMatch[0]);
187552
- } catch {
187566
+ const tasks = extractTasks(combined);
187567
+ if (!tasks) {
187553
187568
  db.query("UPDATE matrixos_goals SET status = ?, updated_at = ? WHERE id = ?").run("active", Date.now(), id);
187554
- return { ok: false, error: "invalid task JSON", output: combined, status: "active" };
187569
+ return { ok: false, error: "no valid task JSON in response", output: combined, status: "active" };
187555
187570
  }
187556
187571
  let created = 0;
187557
187572
  for (const t2 of tasks) {
@@ -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.42",
2166
+ version: "0.3.44",
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",
@@ -187572,7 +187572,29 @@ ${row.description ? `Description: ${row.description}
187572
187572
  if (!db)
187573
187573
  return { ok: false, error: "database unavailable" };
187574
187574
  try {
187575
+ let extractTasks = function(text) {
187576
+ const summaryMatch = text.match(/"summary"\s*:\\s*"(\[[\\s\\S]*?\])"/);
187577
+ if (summaryMatch) {
187578
+ try {
187579
+ const unescaped = summaryMatch[1].replace(/\\\\"/g, '"').replace(/\\\\n/g, `
187580
+ `).replace(/\\\\\\/g, "/");
187581
+ const parsed = JSON.parse(unescaped);
187582
+ if (Array.isArray(parsed))
187583
+ return parsed;
187584
+ } catch {}
187585
+ }
187586
+ const rawMatch = text.match(/\[[\\s\\S]*?\]/);
187587
+ if (rawMatch) {
187588
+ try {
187589
+ const parsed = JSON.parse(rawMatch[0]);
187590
+ if (Array.isArray(parsed))
187591
+ return parsed;
187592
+ } catch {}
187593
+ }
187594
+ return null;
187595
+ };
187575
187596
  ensureGoalsTable(db);
187597
+ ensureKanbanTable(db);
187576
187598
  const row = db.query("SELECT title, description, status FROM matrixos_goals WHERE id = ?").get(id);
187577
187599
  if (!row)
187578
187600
  return { ok: false, error: "goal not found" };
@@ -187596,17 +187618,10 @@ ${row.description ? `Description: ${row.description}
187596
187618
  db.query("UPDATE matrixos_goals SET status = ?, updated_at = ? WHERE id = ?").run("active", Date.now(), id);
187597
187619
  return { ok: false, error: "decomposition failed", output: combined, status: "active" };
187598
187620
  }
187599
- const jsonMatch = combined.match(/\[[\s\S]*\]/);
187600
- if (!jsonMatch) {
187601
- db.query("UPDATE matrixos_goals SET status = ?, updated_at = ? WHERE id = ?").run("active", Date.now(), id);
187602
- return { ok: false, error: "no task JSON in response", output: combined, status: "active" };
187603
- }
187604
- let tasks = [];
187605
- try {
187606
- tasks = JSON.parse(jsonMatch[0]);
187607
- } catch {
187621
+ const tasks = extractTasks(combined);
187622
+ if (!tasks) {
187608
187623
  db.query("UPDATE matrixos_goals SET status = ?, updated_at = ? WHERE id = ?").run("active", Date.now(), id);
187609
- return { ok: false, error: "invalid task JSON", output: combined, status: "active" };
187624
+ return { ok: false, error: "no valid task JSON in response", output: combined, status: "active" };
187610
187625
  }
187611
187626
  let created = 0;
187612
187627
  for (const t2 of tasks) {
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.42",
368089
+ version: "0.3.44",
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.42",
3
+ "version": "0.3.44",
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",