@kl-c/matrixos 0.3.56 → 0.3.58

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.58",
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",
@@ -170045,7 +170045,8 @@ var HookNameSchema = exports_external.enum([
170045
170045
  "fsync-skip-warning",
170046
170046
  "plan-format-validator",
170047
170047
  "legacy-plugin-toast",
170048
- "egress-filter"
170048
+ "egress-filter",
170049
+ "session-memory-loader"
170049
170050
  ]);
170050
170051
  // packages/omo-opencode/src/config/schema/i18n.ts
170051
170052
  init_zod();
@@ -170104,6 +170105,13 @@ var DreamerConfigSchema = exports_external.object({
170104
170105
  init_src4();
170105
170106
  var GatewayConfigSectionSchema = GatewayConfigSchema.optional();
170106
170107
 
170108
+ // packages/omo-opencode/src/config/schema/memory.ts
170109
+ init_zod();
170110
+ var MemoryConfigSchema = exports_external.object({
170111
+ enabled: exports_external.boolean().optional(),
170112
+ max_entries: exports_external.number().int().min(1).max(100).optional()
170113
+ });
170114
+
170107
170115
  // packages/omo-opencode/src/config/schema/monitor.ts
170108
170116
  init_zod();
170109
170117
  var MonitorConfigSchema = exports_external.object({
@@ -170331,6 +170339,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
170331
170339
  egress: EgressConfigSectionSchema,
170332
170340
  cron: CronConfigSchema.optional(),
170333
170341
  default_mode: DefaultModeConfigSchema.optional(),
170342
+ memory: MemoryConfigSchema.optional(),
170334
170343
  dreamer: DreamerConfigSchema.optional(),
170335
170344
  profiles: ProfileReferencesSchema.optional(),
170336
170345
  profileRegistry: ProfileRegistrySchema.optional(),
@@ -189592,6 +189601,30 @@ function createDashboardServer(dataProvider, config5) {
189592
189601
  const result = await dataProvider.decomposeGoal(body.id);
189593
189602
  return Response.json(result, { status: result.ok ? 200 : 500, headers: jsonHeaders });
189594
189603
  }
189604
+ case "/api/deploy": {
189605
+ if (req.method !== "POST") {
189606
+ return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
189607
+ }
189608
+ const body = await req.json();
189609
+ if (!body.target) {
189610
+ return Response.json({ ok: false, error: "target required" }, { status: 400, headers: jsonHeaders });
189611
+ }
189612
+ try {
189613
+ const { spawnSync: spawnSync4 } = await import("child_process");
189614
+ const args = ["deploy", body.target];
189615
+ if (body.environment)
189616
+ args.push("--env", body.environment);
189617
+ if (body.projectRoot)
189618
+ args.push("--project-root", body.projectRoot);
189619
+ if (body.dryRun !== false)
189620
+ args.push("--dry-run");
189621
+ const res = spawnSync4("matrixos", args, { encoding: "utf-8" });
189622
+ const output = (res.stdout || res.stderr || "no output").trim();
189623
+ return Response.json({ ok: true, output }, { headers: jsonHeaders });
189624
+ } catch (e) {
189625
+ return Response.json({ ok: false, error: e instanceof Error ? e.message : String(e) }, { status: 500, headers: jsonHeaders });
189626
+ }
189627
+ }
189595
189628
  case "/api/notifications":
189596
189629
  return Response.json(await dataProvider.getNotifications(), { headers: jsonHeaders });
189597
189630
  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.58",
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",
@@ -170100,7 +170100,8 @@ var HookNameSchema = exports_external.enum([
170100
170100
  "fsync-skip-warning",
170101
170101
  "plan-format-validator",
170102
170102
  "legacy-plugin-toast",
170103
- "egress-filter"
170103
+ "egress-filter",
170104
+ "session-memory-loader"
170104
170105
  ]);
170105
170106
  // packages/omo-opencode/src/config/schema/i18n.ts
170106
170107
  init_zod();
@@ -170159,6 +170160,13 @@ var DreamerConfigSchema = exports_external.object({
170159
170160
  init_src4();
170160
170161
  var GatewayConfigSectionSchema = GatewayConfigSchema.optional();
170161
170162
 
170163
+ // packages/omo-opencode/src/config/schema/memory.ts
170164
+ init_zod();
170165
+ var MemoryConfigSchema = exports_external.object({
170166
+ enabled: exports_external.boolean().optional(),
170167
+ max_entries: exports_external.number().int().min(1).max(100).optional()
170168
+ });
170169
+
170162
170170
  // packages/omo-opencode/src/config/schema/monitor.ts
170163
170171
  init_zod();
170164
170172
  var MonitorConfigSchema = exports_external.object({
@@ -170386,6 +170394,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
170386
170394
  egress: EgressConfigSectionSchema,
170387
170395
  cron: CronConfigSchema.optional(),
170388
170396
  default_mode: DefaultModeConfigSchema.optional(),
170397
+ memory: MemoryConfigSchema.optional(),
170389
170398
  dreamer: DreamerConfigSchema.optional(),
170390
170399
  profiles: ProfileReferencesSchema.optional(),
170391
170400
  profileRegistry: ProfileRegistrySchema.optional(),
@@ -189647,6 +189656,30 @@ function createDashboardServer(dataProvider, config5) {
189647
189656
  const result = await dataProvider.decomposeGoal(body.id);
189648
189657
  return Response.json(result, { status: result.ok ? 200 : 500, headers: jsonHeaders });
189649
189658
  }
189659
+ case "/api/deploy": {
189660
+ if (req.method !== "POST") {
189661
+ return new Response("Method Not Allowed", { status: 405, headers: corsHeaders });
189662
+ }
189663
+ const body = await req.json();
189664
+ if (!body.target) {
189665
+ return Response.json({ ok: false, error: "target required" }, { status: 400, headers: jsonHeaders });
189666
+ }
189667
+ try {
189668
+ const { spawnSync: spawnSync4 } = await import("child_process");
189669
+ const args = ["deploy", body.target];
189670
+ if (body.environment)
189671
+ args.push("--env", body.environment);
189672
+ if (body.projectRoot)
189673
+ args.push("--project-root", body.projectRoot);
189674
+ if (body.dryRun !== false)
189675
+ args.push("--dry-run");
189676
+ const res = spawnSync4("matrixos", args, { encoding: "utf-8" });
189677
+ const output = (res.stdout || res.stderr || "no output").trim();
189678
+ return Response.json({ ok: true, output }, { headers: jsonHeaders });
189679
+ } catch (e) {
189680
+ return Response.json({ ok: false, error: e instanceof Error ? e.message : String(e) }, { status: 500, headers: jsonHeaders });
189681
+ }
189682
+ }
189650
189683
  case "/api/notifications":
189651
189684
  return Response.json(await dataProvider.getNotifications(), { headers: jsonHeaders });
189652
189685
  case "/api/incidents": {
@@ -57,5 +57,6 @@ export declare const HookNameSchema: z.ZodEnum<{
57
57
  "plan-format-validator": "plan-format-validator";
58
58
  "legacy-plugin-toast": "legacy-plugin-toast";
59
59
  "egress-filter": "egress-filter";
60
+ "session-memory-loader": "session-memory-loader";
60
61
  }>;
61
62
  export type HookName = z.infer<typeof HookNameSchema>;
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Auto-memory config (P2 — à la Hermes).
4
+ * When enabled, Morpheus auto-loads prior session learnings from the
5
+ * persistent episodic memory DB at session start (RGPD-consented).
6
+ */
7
+ export declare const MemoryConfigSchema: z.ZodObject<{
8
+ enabled: z.ZodOptional<z.ZodBoolean>;
9
+ max_entries: z.ZodOptional<z.ZodNumber>;
10
+ }, z.core.$strip>;
11
+ export type MemoryConfig = z.infer<typeof MemoryConfigSchema>;
@@ -2504,6 +2504,10 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
2504
2504
  ultrawork: z.ZodDefault<z.ZodBoolean>;
2505
2505
  ralph_loop: z.ZodDefault<z.ZodBoolean>;
2506
2506
  }, z.core.$strip>>;
2507
+ memory: z.ZodOptional<z.ZodObject<{
2508
+ enabled: z.ZodOptional<z.ZodBoolean>;
2509
+ max_entries: z.ZodOptional<z.ZodNumber>;
2510
+ }, z.core.$strip>>;
2507
2511
  dreamer: z.ZodOptional<z.ZodObject<{
2508
2512
  enabled: z.ZodDefault<z.ZodBoolean>;
2509
2513
  idle_delay_ms: z.ZodDefault<z.ZodNumber>;
@@ -90,5 +90,6 @@ export declare function createHooks(args: {
90
90
  taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook> | null;
91
91
  runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
92
92
  legacyPluginToast: ReturnType<typeof import("./hooks").createLegacyPluginToastHook> | null;
93
+ sessionMemoryLoader: ReturnType<typeof import("./hooks").createSessionMemoryLoaderHook> | null;
93
94
  };
94
95
  export {};
@@ -2,7 +2,7 @@
2
2
  * Source identifier for context injection
3
3
  * Each source registers context that will be merged and injected together
4
4
  */
5
- export type ContextSourceType = "keyword-detector" | "rules-injector" | "directory-agents" | "directory-readme" | "custom";
5
+ export type ContextSourceType = "keyword-detector" | "rules-injector" | "directory-agents" | "directory-readme" | "custom" | "session-memory-loader";
6
6
  /**
7
7
  * Priority levels for context ordering
8
8
  * Higher priority contexts appear first in the merged output
@@ -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(){
@@ -59,3 +59,4 @@ export { createFsyncSkipWarningHook } from "./fsync-skip-warning";
59
59
  export { createNotepadWriteGuardHook } from "./notepad-write-guard";
60
60
  export { createPlanFormatValidatorHook } from "./plan-format-validator";
61
61
  export { createMonitorStatusInjectorHook } from "./monitor-status-injector";
62
+ export { createSessionMemoryLoaderHook } from "./session-memory-loader";
@@ -0,0 +1,12 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ export declare const HOOK_NAME = "session-memory-loader";
3
+ export declare function createSessionMemoryLoaderHook(_ctx: PluginInput): {
4
+ "session-memory-loader": {
5
+ event: {
6
+ type: string;
7
+ };
8
+ handler: (input: {
9
+ sessionID?: string;
10
+ }) => void;
11
+ };
12
+ };