@omnidev-ai/cli 0.5.0 → 0.5.1
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/index.js +34 -66
- package/dist/shared/chunk-7txw9v1e.js +3017 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import {
|
|
3
|
+
__require,
|
|
4
|
+
__toESM,
|
|
5
|
+
debug,
|
|
6
|
+
disableCapability,
|
|
7
|
+
disableProvider,
|
|
8
|
+
discoverCapabilities,
|
|
9
|
+
enableCapability,
|
|
10
|
+
enableProvider,
|
|
11
|
+
generateInstructionsTemplate,
|
|
12
|
+
getActiveProfile,
|
|
13
|
+
getEnabledCapabilities,
|
|
14
|
+
loadCapabilityConfig,
|
|
15
|
+
loadConfig,
|
|
16
|
+
readEnabledProviders,
|
|
17
|
+
resolveEnabledCapabilities,
|
|
18
|
+
setActiveProfile,
|
|
19
|
+
syncAgentConfiguration,
|
|
20
|
+
writeConfig,
|
|
21
|
+
writeEnabledProviders
|
|
22
|
+
} from "./shared/chunk-7txw9v1e.js";
|
|
20
23
|
|
|
21
24
|
// src/index.ts
|
|
22
25
|
import { run } from "@stricli/core";
|
|
@@ -181,7 +184,6 @@ function generateOpencodeTemplate() {
|
|
|
181
184
|
`;
|
|
182
185
|
}
|
|
183
186
|
// ../adapters/src/registry.ts
|
|
184
|
-
import { readEnabledProviders } from "@omnidev-ai/core";
|
|
185
187
|
var builtInAdapters = [
|
|
186
188
|
claudeCodeAdapter,
|
|
187
189
|
codexAdapter,
|
|
@@ -197,14 +199,6 @@ async function getEnabledAdapters() {
|
|
|
197
199
|
return enabledIds.map((id) => adapterMap.get(id)).filter((a) => a != null);
|
|
198
200
|
}
|
|
199
201
|
// src/commands/capability.ts
|
|
200
|
-
import {
|
|
201
|
-
disableCapability,
|
|
202
|
-
discoverCapabilities,
|
|
203
|
-
enableCapability,
|
|
204
|
-
getEnabledCapabilities,
|
|
205
|
-
loadCapabilityConfig,
|
|
206
|
-
syncAgentConfiguration
|
|
207
|
-
} from "@omnidev-ai/core";
|
|
208
202
|
import { buildCommand, buildRouteMap } from "@stricli/core";
|
|
209
203
|
async function runCapabilityList() {
|
|
210
204
|
try {
|
|
@@ -426,8 +420,8 @@ async function checkConfig() {
|
|
|
426
420
|
};
|
|
427
421
|
}
|
|
428
422
|
try {
|
|
429
|
-
const { loadConfig } = await import("
|
|
430
|
-
await
|
|
423
|
+
const { loadConfig: loadConfig2 } = await import("./shared/chunk-7txw9v1e.js");
|
|
424
|
+
await loadConfig2();
|
|
431
425
|
return {
|
|
432
426
|
name: "Configuration",
|
|
433
427
|
passed: true,
|
|
@@ -494,14 +488,6 @@ async function checkCapabilitiesDir() {
|
|
|
494
488
|
|
|
495
489
|
// src/commands/init.ts
|
|
496
490
|
import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "node:fs";
|
|
497
|
-
import {
|
|
498
|
-
generateInstructionsTemplate,
|
|
499
|
-
loadConfig,
|
|
500
|
-
setActiveProfile,
|
|
501
|
-
syncAgentConfiguration as syncAgentConfiguration2,
|
|
502
|
-
writeConfig,
|
|
503
|
-
writeEnabledProviders
|
|
504
|
-
} from "@omnidev-ai/core";
|
|
505
491
|
import { buildCommand as buildCommand3 } from "@stricli/core";
|
|
506
492
|
|
|
507
493
|
// src/prompts/provider.ts
|
|
@@ -572,7 +558,7 @@ async function runInit(_flags, providerArg) {
|
|
|
572
558
|
}
|
|
573
559
|
}
|
|
574
560
|
const enabledAdapters = await getEnabledAdapters();
|
|
575
|
-
await
|
|
561
|
+
await syncAgentConfiguration({ silent: true, adapters: enabledAdapters });
|
|
576
562
|
console.log("");
|
|
577
563
|
console.log(`✓ OmniDev initialized for ${selectedAdapters.map((a) => a.displayName).join(" and ")}!`);
|
|
578
564
|
console.log("");
|
|
@@ -657,13 +643,6 @@ ${missingEntries.join(`
|
|
|
657
643
|
|
|
658
644
|
// src/commands/profile.ts
|
|
659
645
|
import { existsSync as existsSync6 } from "node:fs";
|
|
660
|
-
import {
|
|
661
|
-
getActiveProfile,
|
|
662
|
-
loadConfig as loadConfig2,
|
|
663
|
-
resolveEnabledCapabilities,
|
|
664
|
-
setActiveProfile as setActiveProfile2,
|
|
665
|
-
syncAgentConfiguration as syncAgentConfiguration3
|
|
666
|
-
} from "@omnidev-ai/core";
|
|
667
646
|
import { buildCommand as buildCommand4, buildRouteMap as buildRouteMap2 } from "@stricli/core";
|
|
668
647
|
var listCommand2 = buildCommand4({
|
|
669
648
|
docs: {
|
|
@@ -711,7 +690,7 @@ async function runProfileList() {
|
|
|
711
690
|
console.log(" Run: omnidev init");
|
|
712
691
|
process.exit(1);
|
|
713
692
|
}
|
|
714
|
-
const config = await
|
|
693
|
+
const config = await loadConfig();
|
|
715
694
|
const activeProfile = await getActiveProfile() ?? config.active_profile ?? "default";
|
|
716
695
|
const profiles = config.profiles ?? {};
|
|
717
696
|
const profileNames = Object.keys(profiles);
|
|
@@ -751,7 +730,7 @@ async function runProfileSet(profileName) {
|
|
|
751
730
|
console.log(" Run: omnidev init");
|
|
752
731
|
process.exit(1);
|
|
753
732
|
}
|
|
754
|
-
const config = await
|
|
733
|
+
const config = await loadConfig();
|
|
755
734
|
const profiles = config.profiles ?? {};
|
|
756
735
|
if (!(profileName in profiles)) {
|
|
757
736
|
console.log(`✗ Profile "${profileName}" not found in omni.toml`);
|
|
@@ -767,11 +746,11 @@ async function runProfileSet(profileName) {
|
|
|
767
746
|
}
|
|
768
747
|
process.exit(1);
|
|
769
748
|
}
|
|
770
|
-
await
|
|
749
|
+
await setActiveProfile(profileName);
|
|
771
750
|
console.log(`✓ Active profile set to: ${profileName}`);
|
|
772
751
|
console.log("");
|
|
773
752
|
const adapters = await getEnabledAdapters();
|
|
774
|
-
await
|
|
753
|
+
await syncAgentConfiguration({ adapters });
|
|
775
754
|
} catch (error) {
|
|
776
755
|
console.error("✗ Error setting profile:", error);
|
|
777
756
|
process.exit(1);
|
|
@@ -779,15 +758,9 @@ async function runProfileSet(profileName) {
|
|
|
779
758
|
}
|
|
780
759
|
|
|
781
760
|
// src/commands/provider.ts
|
|
782
|
-
import {
|
|
783
|
-
disableProvider,
|
|
784
|
-
enableProvider,
|
|
785
|
-
readEnabledProviders as readEnabledProviders2,
|
|
786
|
-
syncAgentConfiguration as syncAgentConfiguration4
|
|
787
|
-
} from "@omnidev-ai/core";
|
|
788
761
|
import { buildCommand as buildCommand5, buildRouteMap as buildRouteMap3 } from "@stricli/core";
|
|
789
762
|
async function runProviderList() {
|
|
790
|
-
const enabled = await
|
|
763
|
+
const enabled = await readEnabledProviders();
|
|
791
764
|
const allAdapters = getAllAdapters();
|
|
792
765
|
console.log("Available providers:");
|
|
793
766
|
console.log("");
|
|
@@ -818,7 +791,7 @@ async function runProviderEnable(_flags, providerId) {
|
|
|
818
791
|
await enableProvider(providerId);
|
|
819
792
|
console.log(`✓ Enabled provider: ${adapter.displayName}`);
|
|
820
793
|
const enabledAdapters = await getEnabledAdapters();
|
|
821
|
-
await
|
|
794
|
+
await syncAgentConfiguration({ silent: false, adapters: enabledAdapters });
|
|
822
795
|
}
|
|
823
796
|
async function runProviderDisable(_flags, providerId) {
|
|
824
797
|
if (!providerId) {
|
|
@@ -899,7 +872,6 @@ var providerRoutes = buildRouteMap3({
|
|
|
899
872
|
});
|
|
900
873
|
|
|
901
874
|
// src/commands/sync.ts
|
|
902
|
-
import { getActiveProfile as getActiveProfile2, loadConfig as loadConfig3, syncAgentConfiguration as syncAgentConfiguration5 } from "@omnidev-ai/core";
|
|
903
875
|
import { buildCommand as buildCommand6 } from "@stricli/core";
|
|
904
876
|
var syncCommand = buildCommand6({
|
|
905
877
|
docs: {
|
|
@@ -914,10 +886,10 @@ async function runSync() {
|
|
|
914
886
|
console.log("Syncing OmniDev configuration...");
|
|
915
887
|
console.log("");
|
|
916
888
|
try {
|
|
917
|
-
const config = await
|
|
918
|
-
const activeProfile = await
|
|
889
|
+
const config = await loadConfig();
|
|
890
|
+
const activeProfile = await getActiveProfile() ?? config.active_profile ?? "default";
|
|
919
891
|
const adapters = await getEnabledAdapters();
|
|
920
|
-
const result = await
|
|
892
|
+
const result = await syncAgentConfiguration({ silent: false, adapters });
|
|
921
893
|
console.log("");
|
|
922
894
|
console.log("✓ Sync completed successfully!");
|
|
923
895
|
console.log("");
|
|
@@ -940,10 +912,6 @@ async function runSync() {
|
|
|
940
912
|
process.exit(1);
|
|
941
913
|
}
|
|
942
914
|
}
|
|
943
|
-
|
|
944
|
-
// src/lib/debug.ts
|
|
945
|
-
import { debug } from "@omnidev-ai/core";
|
|
946
|
-
|
|
947
915
|
// src/lib/dynamic-app.ts
|
|
948
916
|
async function buildDynamicApp() {
|
|
949
917
|
const routes = {
|
|
@@ -991,7 +959,7 @@ async function buildDynamicApp() {
|
|
|
991
959
|
return app;
|
|
992
960
|
}
|
|
993
961
|
async function loadCapabilityCommands() {
|
|
994
|
-
const { buildCapabilityRegistry, installCapabilityDependencies } = await import("
|
|
962
|
+
const { buildCapabilityRegistry, installCapabilityDependencies } = await import("./shared/chunk-7txw9v1e.js");
|
|
995
963
|
await installCapabilityDependencies(true);
|
|
996
964
|
const registry = await buildCapabilityRegistry();
|
|
997
965
|
const capabilities = registry.getAllCapabilities();
|