@kl-c/matrixos 0.3.56 → 0.3.57

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.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * CLI: `matrixos deploy <target>`
3
+ *
4
+ * Deploy helper (A9). Honest minimal implementation:
5
+ * - `--dry-run` (default) prints the plan for the given target.
6
+ * - Apply mode reports the target is not yet wired (no false deployment).
7
+ *
8
+ * This is a user-on-demand feature (generic OS, not KLC-specific). Full
9
+ * VPS/vercel/static deployment is out of scope until a user requests it.
10
+ */
11
+ export interface DeployOptions {
12
+ target: string;
13
+ environment?: "staging" | "production" | "preview";
14
+ dryRun?: boolean;
15
+ force?: boolean;
16
+ projectRoot?: string;
17
+ params?: string[];
18
+ }
19
+ export declare function runDeploy(options: DeployOptions): Promise<number>;
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.56",
2166
+ version: "0.3.57",
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",
@@ -189592,6 +189592,30 @@ function createDashboardServer(dataProvider, config5) {
189592
189592
  const result = await dataProvider.decomposeGoal(body.id);
189593
189593
  return Response.json(result, { status: result.ok ? 200 : 500, headers: jsonHeaders });
189594
189594
  }
189595
+ case "/api/deploy": {
189596
+ if (req.method !== "POST") {
189597
+ return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
189598
+ }
189599
+ const body = await req.json();
189600
+ if (!body.target) {
189601
+ return Response.json({ ok: false, error: "target required" }, { status: 400, headers: jsonHeaders });
189602
+ }
189603
+ try {
189604
+ const { spawnSync: spawnSync4 } = await import("child_process");
189605
+ const args = ["deploy", body.target];
189606
+ if (body.environment)
189607
+ args.push("--env", body.environment);
189608
+ if (body.projectRoot)
189609
+ args.push("--project-root", body.projectRoot);
189610
+ if (body.dryRun !== false)
189611
+ args.push("--dry-run");
189612
+ const res = spawnSync4("matrixos", args, { encoding: "utf-8" });
189613
+ const output = (res.stdout || res.stderr || "no output").trim();
189614
+ return Response.json({ ok: true, output }, { headers: jsonHeaders });
189615
+ } catch (e) {
189616
+ return Response.json({ ok: false, error: e instanceof Error ? e.message : String(e) }, { status: 500, headers: jsonHeaders });
189617
+ }
189618
+ }
189595
189619
  case "/api/notifications":
189596
189620
  return Response.json(await dataProvider.getNotifications(), { headers: jsonHeaders });
189597
189621
  case "/api/incidents": {
@@ -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.56",
2166
+ version: "0.3.57",
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",
@@ -189647,6 +189647,30 @@ function createDashboardServer(dataProvider, config5) {
189647
189647
  const result = await dataProvider.decomposeGoal(body.id);
189648
189648
  return Response.json(result, { status: result.ok ? 200 : 500, headers: jsonHeaders });
189649
189649
  }
189650
+ case "/api/deploy": {
189651
+ if (req.method !== "POST") {
189652
+ return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
189653
+ }
189654
+ const body = await req.json();
189655
+ if (!body.target) {
189656
+ return Response.json({ ok: false, error: "target required" }, { status: 400, headers: jsonHeaders });
189657
+ }
189658
+ try {
189659
+ const { spawnSync: spawnSync4 } = await import("child_process");
189660
+ const args = ["deploy", body.target];
189661
+ if (body.environment)
189662
+ args.push("--env", body.environment);
189663
+ if (body.projectRoot)
189664
+ args.push("--project-root", body.projectRoot);
189665
+ if (body.dryRun !== false)
189666
+ args.push("--dry-run");
189667
+ const res = spawnSync4("matrixos", args, { encoding: "utf-8" });
189668
+ const output = (res.stdout || res.stderr || "no output").trim();
189669
+ return Response.json({ ok: true, output }, { headers: jsonHeaders });
189670
+ } catch (e) {
189671
+ return Response.json({ ok: false, error: e instanceof Error ? e.message : String(e) }, { status: 500, headers: jsonHeaders });
189672
+ }
189673
+ }
189650
189674
  case "/api/notifications":
189651
189675
  return Response.json(await dataProvider.getNotifications(), { headers: jsonHeaders });
189652
189676
  case "/api/incidents": {
@@ -234,6 +234,29 @@
234
234
  <div class="modal-footer"><button class="btn btn-secondary" onclick="closeCronModal()">Cancel</button><button class="btn btn-primary" onclick="createCron()">Create</button></div>
235
235
  </div>
236
236
  </div>
237
+ <div class="modal-overlay" id="deployModal" style="display:none">
238
+ <div class="modal-box">
239
+ <div class="modal-header"><h3>Deploy</h3><button class="modal-close" onclick="closeDeployModal()">×</button></div>
240
+ <div class="modal-body">
241
+ <label class="modal-label">Target</label>
242
+ <select class="input" id="deployTarget">
243
+ <option value="static">static</option>
244
+ <option value="vps">vps</option>
245
+ <option value="vercel">vercel</option>
246
+ </select>
247
+ <label class="modal-label">Environment</label>
248
+ <select class="input" id="deployEnv">
249
+ <option value="production">production</option>
250
+ <option value="staging">staging</option>
251
+ <option value="preview">preview</option>
252
+ </select>
253
+ <label class="modal-label">Project root</label>
254
+ <input class="input" id="deployRoot" placeholder="/path/to/project" />
255
+ <p class="modal-help">Dry-run par défaut : aucun changement. Le mode apply est en cours de câblage par target.</p>
256
+ </div>
257
+ <div class="modal-footer"><button class="btn btn-secondary" onclick="closeDeployModal()">Cancel</button><button class="btn btn-primary" onclick="runDeploy()">Dry-run</button></div>
258
+ </div>
259
+ </div>
237
260
  </div>
238
261
  </div>
239
262
  </div>
@@ -21,6 +21,7 @@ const API={
21
21
  cronAdd:(body)=>fetchJSON('/cron',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}),
22
22
  cronRemove:(id)=>fetchJSON(`/cron?id=${encodeURIComponent(id)}`,{method:'DELETE'}),
23
23
  notifications:()=>fetchJSON('/notifications'),
24
+ deploy:(body)=>fetchJSON('/deploy',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}),
24
25
  gatewayToken:(type,token,passphrase)=>fetch('/api/gateway/token',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({type,token,passphrase})}).then(r=>r.json())
25
26
  }
26
27
  async function fetchJSON(e, opts) {
@@ -713,7 +713,20 @@ document.getElementById('refreshBtn').onclick=()=>{const t=document.querySelecto
713
713
  document.getElementById('archRefresh').onclick=()=>loadArchitect()
714
714
  document.getElementById('newSkillBtn').onclick=()=>openSkillModal()
715
715
  document.getElementById('newCronBtn').onclick=()=>openCronModal()
716
- document.getElementById('deployBtn').onclick=()=>alert('Deploy Agent — coming soon')
716
+ document.getElementById('deployBtn').onclick=()=>openDeployModal()
717
+ function openDeployModal(){document.getElementById('deployModal').style.display='flex'}
718
+ function closeDeployModal(){document.getElementById('deployModal').style.display='none'}
719
+ async function runDeploy(){
720
+ const target=document.getElementById('deployTarget').value
721
+ const env=document.getElementById('deployEnv').value
722
+ const root=document.getElementById('deployRoot').value.trim()
723
+ closeDeployModal()
724
+ try{
725
+ const res=await API.deploy({target,environment:env,projectRoot:root||undefined,dryRun:true})
726
+ if(res&&res.output)alert(res.output)
727
+ else alert('Deploy dry-run done (no output)')
728
+ }catch(e){alert('Deploy failed: '+e.message)}
729
+ }
717
730
  document.getElementById('diagBtn').onclick=()=>alert('Diagnostics — coming soon')
718
731
  document.getElementById('notifBtn').onclick=(e)=>{e.stopPropagation();toggleNotifications()}
719
732
  async function loadNotifications(){
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.56",
368089
+ version: "0.3.57",
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.56",
3
+ "version": "0.3.57",
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",