omp-config-crypt 0.5.2 → 0.5.4

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/index.js CHANGED
@@ -648,6 +648,46 @@ export default function (pi) {
648
648
  });
649
649
  pi.registerCommand("provider", {
650
650
  description: "Manage LLM providers (/provider ls | add <name> <url> <key> | rm <name>)",
651
+ getArgumentCompletions: (prefix) => {
652
+ const parts = (prefix || "").split(/\s+/);
653
+ const sub = parts[0]?.toLowerCase();
654
+
655
+ if (!prefix.includes(" ") || parts.length <= 1) {
656
+ const subcommands = [
657
+ { value: "add", description: "Auto-probe and add a new provider (wizard)" },
658
+ { value: "ls", description: "List all configured providers & models" },
659
+ { value: "rm", description: "Remove a provider from configuration" },
660
+ ];
661
+ const p = parts[0]?.toLowerCase() || "";
662
+ return subcommands.filter((s) => s.value.startsWith(p));
663
+ }
664
+
665
+ if (sub === "rm" || sub === "remove") {
666
+ if (parts.length === 2) {
667
+ const providers = listProviders({ agentDir: configRoot() });
668
+ const target = parts[1].toLowerCase();
669
+ return providers
670
+ .map((p) => ({
671
+ value: p.name,
672
+ description: `${p.isPrivate ? "Private" : "Public"} (${p.models.length} models)`,
673
+ }))
674
+ .filter((i) => i.value.toLowerCase().startsWith(target));
675
+ }
676
+ }
677
+
678
+ if (sub === "add") {
679
+ const last = parts[parts.length - 1];
680
+ if (last.startsWith("-")) {
681
+ const flags = [
682
+ { value: "--private", description: "Save to local-only, unsynced store (default)" },
683
+ { value: "--public", description: "Save to synced models.yml" },
684
+ ];
685
+ return flags.filter((f) => f.value.startsWith(last));
686
+ }
687
+ }
688
+
689
+ return null;
690
+ },
651
691
  handler: async (args, ctx) => {
652
692
  const cleanArgs = (args || "").trim();
653
693
  const parts = cleanArgs.split(/\s+/).filter(Boolean);
@@ -764,6 +804,47 @@ export default function (pi) {
764
804
 
765
805
  pi.registerCommand("role", {
766
806
  description: "Manage model roles (/role ls | <role> <provider/model>)",
807
+ getArgumentCompletions: (prefix) => {
808
+ const parts = (prefix || "").split(/\s+/);
809
+ const sub = parts[0]?.toLowerCase();
810
+
811
+ if (!prefix.includes(" ") || parts.length <= 1) {
812
+ const roles = [
813
+ { value: "default", description: "Primary chat & orchestration model" },
814
+ { value: "smol", description: "Fast model for lightweight tasks & tools" },
815
+ { value: "plan", description: "High-context architectural planning model" },
816
+ { value: "slow", description: "Deep reasoning / hard debugging model" },
817
+ { value: "web", description: "Web search provider model" },
818
+ { value: "ls", description: "List current role mappings" },
819
+ ];
820
+ const p = parts[0]?.toLowerCase() || "";
821
+ return roles.filter((r) => r.value.startsWith(p));
822
+ }
823
+
824
+ if (VALID_ROLES.includes(sub)) {
825
+ if (parts.length === 2) {
826
+ const providers = listProviders({ agentDir: configRoot() });
827
+ const models = [];
828
+ for (const p of providers) {
829
+ for (const m of p.models) {
830
+ const ref = `${p.name}/${m.id}`;
831
+ const desc = [
832
+ p.isPrivate ? "private" : "public",
833
+ m.reasoning ? "reasoning" : null,
834
+ m.input?.includes("image") ? "vision" : null,
835
+ ]
836
+ .filter(Boolean)
837
+ .join(", ");
838
+ models.push({ value: ref, description: `${m.name || m.id} [${desc}]` });
839
+ }
840
+ }
841
+ const target = parts[1].toLowerCase();
842
+ return models.filter((m) => m.value.toLowerCase().startsWith(target));
843
+ }
844
+ }
845
+
846
+ return null;
847
+ },
767
848
  handler: async (args, ctx) => {
768
849
  const cleanArgs = (args || "").trim();
769
850
  const parts = cleanArgs.split(/\s+/).filter(Boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-config-crypt",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Universal cross-platform encrypted portability for omp config, extensions, and instructions",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/rehydrator.js CHANGED
@@ -195,6 +195,17 @@ export function rehydratePlugins(root, options = {}) {
195
195
  }
196
196
 
197
197
  if (!targetDir || !fs.existsSync(targetDir)) {
198
+ if (!dryRun) {
199
+ try {
200
+ execFileSync("npm", ["install", `${name}@latest`, "--omit=dev", "--no-audit", "--no-fund"], {
201
+ cwd: pluginsDir,
202
+ stdio: "pipe",
203
+ timeout: 60000,
204
+ });
205
+ results.npmInstalled.push(name);
206
+ continue;
207
+ } catch {}
208
+ }
198
209
  results.errors.push(`Target directory for plugin ${name} not found`);
199
210
  continue;
200
211
  }