@massa-ai/opencode-plugin 1.47.0 → 1.48.0

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.
@@ -401,7 +401,7 @@ var init_xdg = () => {};
401
401
 
402
402
  // ../../packages/shared/dist/config/massa-ai-config.js
403
403
  import path2 from "path";
404
- var SCHEDULER_JOB_KINDS, defaultMassaAiConfig;
404
+ var SCHEDULER_JOB_KINDS, MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS = 1024, DEFAULT_CAPTURE_POLICY, DEFAULT_SCHEDULER_CONFIG, defaultMassaAiConfig;
405
405
  var init_massa_ai_config = __esm(() => {
406
406
  init_xdg();
407
407
  SCHEDULER_JOB_KINDS = [
@@ -411,6 +411,54 @@ var init_massa_ai_config = __esm(() => {
411
411
  "observation-bridge",
412
412
  "checkpoint-purge"
413
413
  ];
414
+ DEFAULT_CAPTURE_POLICY = {
415
+ rules: [
416
+ { pattern: "**/node_modules/**", disposition: "Drop" },
417
+ { pattern: "**/.git/**", disposition: "Drop" },
418
+ { pattern: "**/dist/**", disposition: "Drop" },
419
+ { pattern: "**/build/**", disposition: "Drop" },
420
+ { pattern: "**/coverage/**", disposition: "Drop" },
421
+ { pattern: ".env", disposition: "Drop" },
422
+ { pattern: ".env.*", disposition: "Drop" },
423
+ { pattern: "**/generated/**", disposition: "Drop" },
424
+ { pattern: "**/*.generated.*", disposition: "Drop" },
425
+ { pattern: "**/*.d.ts", disposition: "Drop" },
426
+ { pattern: "**/__tests__/**", disposition: "Drop" },
427
+ { pattern: "**/tests/**", disposition: "Drop" },
428
+ { pattern: "**/*.test.ts", disposition: "Drop" },
429
+ { pattern: "**/*.test.tsx", disposition: "Drop" },
430
+ { pattern: "**/*.test.js", disposition: "Drop" },
431
+ { pattern: "**/*.test.jsx", disposition: "Drop" },
432
+ { pattern: "**/*.spec.ts", disposition: "Drop" },
433
+ { pattern: "**/*.spec.tsx", disposition: "Drop" },
434
+ { pattern: "**/*.spec.js", disposition: "Drop" },
435
+ { pattern: "**/*.spec.jsx", disposition: "Drop" },
436
+ { pattern: "**/benchmarks/**", disposition: "Drop" },
437
+ { pattern: "**/fixtures/**", disposition: "Drop" },
438
+ { pattern: "**/*.wasm*", disposition: "Drop" },
439
+ { pattern: "**/*.min.*", disposition: "Drop" },
440
+ { pattern: "**/*.map", disposition: "Drop" },
441
+ { pattern: "**/lock.yaml", disposition: "Drop" },
442
+ { pattern: "**/pnpm-lock.yaml", disposition: "Drop" },
443
+ { pattern: "**/package-lock.json", disposition: "Drop" },
444
+ { pattern: "**/bun.lockb", disposition: "Drop" },
445
+ { pattern: "**/yarn.lock", disposition: "Drop" }
446
+ ],
447
+ maxMatchWork: MAX_MATCH_WORK,
448
+ maxIgnorePatterns: MAX_IGNORE_PATTERNS
449
+ };
450
+ DEFAULT_SCHEDULER_CONFIG = {
451
+ enabled: false,
452
+ tickMs: 60000,
453
+ maxConcurrent: 2,
454
+ jobs: {
455
+ "memory-consolidation": { enabled: false, intervalMs: 30 * 60 * 1000 },
456
+ "decay-sweep": { enabled: false, intervalMs: 60 * 60 * 1000 },
457
+ "auto-improve": { enabled: false, intervalMs: 30 * 60 * 1000 },
458
+ "observation-bridge": { enabled: false, intervalMs: 30 * 60 * 1000 },
459
+ "checkpoint-purge": { enabled: false, intervalMs: 60 * 60 * 1000 }
460
+ }
461
+ };
414
462
  defaultMassaAiConfig = {
415
463
  database: {
416
464
  url: ""
@@ -429,7 +477,7 @@ var init_massa_ai_config = __esm(() => {
429
477
  impact: {
430
478
  bfsCteEnabled: false
431
479
  },
432
- capturePolicy: undefined,
480
+ capturePolicy: DEFAULT_CAPTURE_POLICY,
433
481
  cache: {
434
482
  enabled: true,
435
483
  l1MaxSizeMB: 100,
@@ -552,7 +600,8 @@ var init_massa_ai_config = __esm(() => {
552
600
  },
553
601
  security: {
554
602
  corsOrigins: []
555
- }
603
+ },
604
+ scheduler: DEFAULT_SCHEDULER_CONFIG
556
605
  };
557
606
  });
558
607
 
@@ -562,6 +611,8 @@ __export(exports_config_loader, {
562
611
  writeFileAtomically: () => writeFileAtomically,
563
612
  saveConfig: () => saveConfig,
564
613
  migrateDataDirOnce: () => migrateDataDirOnce,
614
+ mergeSchedulerSection: () => mergeSchedulerSection,
615
+ loadRawUserConfig: () => loadRawUserConfig,
565
616
  loadConfigSafe: () => loadConfigSafe,
566
617
  loadConfig: () => loadConfig,
567
618
  initConfig: () => initConfig,
@@ -584,6 +635,22 @@ function getConfigPath() {
584
635
  function configExists() {
585
636
  return fs.existsSync(CONFIG_FILE);
586
637
  }
638
+ function mergeSchedulerJobs(base, incoming) {
639
+ const defaults = defaultMassaAiConfig.scheduler?.jobs ?? {};
640
+ const merged = {};
641
+ for (const kind of Object.keys(defaults)) {
642
+ merged[kind] = { ...defaults[kind], ...base?.[kind], ...incoming?.[kind] };
643
+ }
644
+ return merged;
645
+ }
646
+ function mergeSchedulerSection(base, incoming) {
647
+ return {
648
+ ...defaultMassaAiConfig.scheduler,
649
+ ...base,
650
+ ...incoming,
651
+ jobs: mergeSchedulerJobs(base?.jobs, incoming?.jobs)
652
+ };
653
+ }
587
654
  function loadConfig() {
588
655
  if (!fs.existsSync(CONFIG_FILE)) {
589
656
  return defaultMassaAiConfig;
@@ -604,13 +671,27 @@ function loadConfig() {
604
671
  memory: { ...defaultMassaAiConfig.memory, ...userConfig.memory },
605
672
  hooks: { ...defaultMassaAiConfig.hooks, ...userConfig.hooks },
606
673
  handoffs: { ...defaultMassaAiConfig.handoffs, ...userConfig.handoffs },
607
- security: { ...defaultMassaAiConfig.security, ...userConfig.security }
674
+ security: { ...defaultMassaAiConfig.security, ...userConfig.security },
675
+ scheduler: mergeSchedulerSection(undefined, userConfig.scheduler),
676
+ capturePolicy: userConfig.capturePolicy ?? defaultMassaAiConfig.capturePolicy
608
677
  };
609
678
  } catch (error) {
610
679
  console.error(`Error loading config from ${CONFIG_FILE}:`, error);
611
680
  return defaultMassaAiConfig;
612
681
  }
613
682
  }
683
+ function loadRawUserConfig() {
684
+ try {
685
+ if (!fs.existsSync(CONFIG_FILE))
686
+ return {};
687
+ const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
688
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
689
+ return {};
690
+ return parsed;
691
+ } catch {
692
+ return {};
693
+ }
694
+ }
614
695
  function loadConfigSafe() {
615
696
  try {
616
697
  return loadConfig();
@@ -742,6 +823,7 @@ try {
742
823
  init_config_loader();
743
824
  init_massa_ai_config();
744
825
  init_massa_ai_config();
826
+ init_massa_ai_config();
745
827
  init_config_loader();
746
828
  import path4 from "path";
747
829
 
@@ -830,7 +912,6 @@ function resolveSchedulerJob(kind, fileJobs) {
830
912
  intervalMs: envNum(meta.intervalVar, fileJob?.intervalMs ?? meta.defaultIntervalMs)
831
913
  };
832
914
  }
833
- var MAX_IGNORE_PATTERNS = 1024;
834
915
  function validateCapturePolicyConfig(raw) {
835
916
  if (!raw || typeof raw !== "object")
836
917
  throw new TypeError("capturePolicy must be an object");
@@ -2479,7 +2560,7 @@ Commands:
2479
2560
  Examples:
2480
2561
  massa-ai-config init
2481
2562
  massa-ai-config init --mistral your-api-key
2482
- massa-ai-config use ollama --model nomic-embed-text:latest
2563
+ massa-ai-config use ollama --model qwen3-embedding:4b
2483
2564
  massa-ai-config use mistral --api-key your-key
2484
2565
  massa-ai-config set embedding.dimensions 1024
2485
2566
  massa-ai-config agents install --user
@@ -2608,9 +2689,9 @@ Using defaults:`);
2608
2689
  if (provider === "ollama") {
2609
2690
  config2.embedding = {
2610
2691
  provider: "ollama",
2611
- model: options.model || "nomic-embed-text:latest",
2692
+ model: options.model || "qwen3-embedding:4b",
2612
2693
  baseURL: options["base-url"] || "http://localhost:11434",
2613
- dimensions: 768
2694
+ dimensions: 2560
2614
2695
  };
2615
2696
  } else if (provider === "mistral") {
2616
2697
  if (!options["api-key"]) {
package/dist/index.js CHANGED
@@ -400,7 +400,7 @@ var init_xdg = () => {};
400
400
 
401
401
  // ../../packages/shared/dist/config/massa-ai-config.js
402
402
  import path2 from "path";
403
- var SCHEDULER_JOB_KINDS, defaultMassaAiConfig;
403
+ var SCHEDULER_JOB_KINDS, MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS = 1024, DEFAULT_CAPTURE_POLICY, DEFAULT_SCHEDULER_CONFIG, defaultMassaAiConfig;
404
404
  var init_massa_ai_config = __esm(() => {
405
405
  init_xdg();
406
406
  SCHEDULER_JOB_KINDS = [
@@ -410,6 +410,54 @@ var init_massa_ai_config = __esm(() => {
410
410
  "observation-bridge",
411
411
  "checkpoint-purge"
412
412
  ];
413
+ DEFAULT_CAPTURE_POLICY = {
414
+ rules: [
415
+ { pattern: "**/node_modules/**", disposition: "Drop" },
416
+ { pattern: "**/.git/**", disposition: "Drop" },
417
+ { pattern: "**/dist/**", disposition: "Drop" },
418
+ { pattern: "**/build/**", disposition: "Drop" },
419
+ { pattern: "**/coverage/**", disposition: "Drop" },
420
+ { pattern: ".env", disposition: "Drop" },
421
+ { pattern: ".env.*", disposition: "Drop" },
422
+ { pattern: "**/generated/**", disposition: "Drop" },
423
+ { pattern: "**/*.generated.*", disposition: "Drop" },
424
+ { pattern: "**/*.d.ts", disposition: "Drop" },
425
+ { pattern: "**/__tests__/**", disposition: "Drop" },
426
+ { pattern: "**/tests/**", disposition: "Drop" },
427
+ { pattern: "**/*.test.ts", disposition: "Drop" },
428
+ { pattern: "**/*.test.tsx", disposition: "Drop" },
429
+ { pattern: "**/*.test.js", disposition: "Drop" },
430
+ { pattern: "**/*.test.jsx", disposition: "Drop" },
431
+ { pattern: "**/*.spec.ts", disposition: "Drop" },
432
+ { pattern: "**/*.spec.tsx", disposition: "Drop" },
433
+ { pattern: "**/*.spec.js", disposition: "Drop" },
434
+ { pattern: "**/*.spec.jsx", disposition: "Drop" },
435
+ { pattern: "**/benchmarks/**", disposition: "Drop" },
436
+ { pattern: "**/fixtures/**", disposition: "Drop" },
437
+ { pattern: "**/*.wasm*", disposition: "Drop" },
438
+ { pattern: "**/*.min.*", disposition: "Drop" },
439
+ { pattern: "**/*.map", disposition: "Drop" },
440
+ { pattern: "**/lock.yaml", disposition: "Drop" },
441
+ { pattern: "**/pnpm-lock.yaml", disposition: "Drop" },
442
+ { pattern: "**/package-lock.json", disposition: "Drop" },
443
+ { pattern: "**/bun.lockb", disposition: "Drop" },
444
+ { pattern: "**/yarn.lock", disposition: "Drop" }
445
+ ],
446
+ maxMatchWork: MAX_MATCH_WORK,
447
+ maxIgnorePatterns: MAX_IGNORE_PATTERNS
448
+ };
449
+ DEFAULT_SCHEDULER_CONFIG = {
450
+ enabled: false,
451
+ tickMs: 60000,
452
+ maxConcurrent: 2,
453
+ jobs: {
454
+ "memory-consolidation": { enabled: false, intervalMs: 30 * 60 * 1000 },
455
+ "decay-sweep": { enabled: false, intervalMs: 60 * 60 * 1000 },
456
+ "auto-improve": { enabled: false, intervalMs: 30 * 60 * 1000 },
457
+ "observation-bridge": { enabled: false, intervalMs: 30 * 60 * 1000 },
458
+ "checkpoint-purge": { enabled: false, intervalMs: 60 * 60 * 1000 }
459
+ }
460
+ };
413
461
  defaultMassaAiConfig = {
414
462
  database: {
415
463
  url: ""
@@ -428,7 +476,7 @@ var init_massa_ai_config = __esm(() => {
428
476
  impact: {
429
477
  bfsCteEnabled: false
430
478
  },
431
- capturePolicy: undefined,
479
+ capturePolicy: DEFAULT_CAPTURE_POLICY,
432
480
  cache: {
433
481
  enabled: true,
434
482
  l1MaxSizeMB: 100,
@@ -551,7 +599,8 @@ var init_massa_ai_config = __esm(() => {
551
599
  },
552
600
  security: {
553
601
  corsOrigins: []
554
- }
602
+ },
603
+ scheduler: DEFAULT_SCHEDULER_CONFIG
555
604
  };
556
605
  });
557
606
 
@@ -561,6 +610,8 @@ __export(exports_config_loader, {
561
610
  writeFileAtomically: () => writeFileAtomically,
562
611
  saveConfig: () => saveConfig,
563
612
  migrateDataDirOnce: () => migrateDataDirOnce,
613
+ mergeSchedulerSection: () => mergeSchedulerSection,
614
+ loadRawUserConfig: () => loadRawUserConfig,
564
615
  loadConfigSafe: () => loadConfigSafe,
565
616
  loadConfig: () => loadConfig,
566
617
  initConfig: () => initConfig,
@@ -583,6 +634,22 @@ function getConfigPath() {
583
634
  function configExists() {
584
635
  return fs.existsSync(CONFIG_FILE);
585
636
  }
637
+ function mergeSchedulerJobs(base, incoming) {
638
+ const defaults = defaultMassaAiConfig.scheduler?.jobs ?? {};
639
+ const merged = {};
640
+ for (const kind of Object.keys(defaults)) {
641
+ merged[kind] = { ...defaults[kind], ...base?.[kind], ...incoming?.[kind] };
642
+ }
643
+ return merged;
644
+ }
645
+ function mergeSchedulerSection(base, incoming) {
646
+ return {
647
+ ...defaultMassaAiConfig.scheduler,
648
+ ...base,
649
+ ...incoming,
650
+ jobs: mergeSchedulerJobs(base?.jobs, incoming?.jobs)
651
+ };
652
+ }
586
653
  function loadConfig() {
587
654
  if (!fs.existsSync(CONFIG_FILE)) {
588
655
  return defaultMassaAiConfig;
@@ -603,13 +670,27 @@ function loadConfig() {
603
670
  memory: { ...defaultMassaAiConfig.memory, ...userConfig.memory },
604
671
  hooks: { ...defaultMassaAiConfig.hooks, ...userConfig.hooks },
605
672
  handoffs: { ...defaultMassaAiConfig.handoffs, ...userConfig.handoffs },
606
- security: { ...defaultMassaAiConfig.security, ...userConfig.security }
673
+ security: { ...defaultMassaAiConfig.security, ...userConfig.security },
674
+ scheduler: mergeSchedulerSection(undefined, userConfig.scheduler),
675
+ capturePolicy: userConfig.capturePolicy ?? defaultMassaAiConfig.capturePolicy
607
676
  };
608
677
  } catch (error) {
609
678
  console.error(`Error loading config from ${CONFIG_FILE}:`, error);
610
679
  return defaultMassaAiConfig;
611
680
  }
612
681
  }
682
+ function loadRawUserConfig() {
683
+ try {
684
+ if (!fs.existsSync(CONFIG_FILE))
685
+ return {};
686
+ const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
687
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
688
+ return {};
689
+ return parsed;
690
+ } catch {
691
+ return {};
692
+ }
693
+ }
613
694
  function loadConfigSafe() {
614
695
  try {
615
696
  return loadConfig();
@@ -741,6 +822,7 @@ try {
741
822
  init_config_loader();
742
823
  init_massa_ai_config();
743
824
  init_massa_ai_config();
825
+ init_massa_ai_config();
744
826
  init_config_loader();
745
827
  import path4 from "path";
746
828
 
@@ -829,7 +911,6 @@ function resolveSchedulerJob(kind, fileJobs) {
829
911
  intervalMs: envNum(meta.intervalVar, fileJob?.intervalMs ?? meta.defaultIntervalMs)
830
912
  };
831
913
  }
832
- var MAX_IGNORE_PATTERNS = 1024;
833
914
  function validateCapturePolicyConfig(raw) {
834
915
  if (!raw || typeof raw !== "object")
835
916
  throw new TypeError("capturePolicy must be an object");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/opencode-plugin",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "description": "massa-ai plugin for OpenCode - Semantic code search, memory, and context compression",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "@opencode-ai/plugin": "^1.2.15",
26
26
  "@opencode-ai/sdk": "^1.2.15",
27
- "@massa-ai/core": "^1.47.0",
28
- "@massa-ai/shared": "^1.47.0"
27
+ "@massa-ai/core": "^1.48.0",
28
+ "@massa-ai/shared": "^1.48.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.10.5",