osagent 0.1.25 → 0.1.26
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/cli.js +537 -76
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -142653,6 +142653,60 @@ var init_ollama = __esm({
|
|
|
142653
142653
|
}
|
|
142654
142654
|
});
|
|
142655
142655
|
|
|
142656
|
+
// packages/core/dist/src/core/openaiContentGenerator/provider/groq.js
|
|
142657
|
+
var GroqOpenAICompatibleProvider;
|
|
142658
|
+
var init_groq = __esm({
|
|
142659
|
+
"packages/core/dist/src/core/openaiContentGenerator/provider/groq.js"() {
|
|
142660
|
+
"use strict";
|
|
142661
|
+
init_esbuild_shims();
|
|
142662
|
+
init_default();
|
|
142663
|
+
GroqOpenAICompatibleProvider = class _GroqOpenAICompatibleProvider extends DefaultOpenAICompatibleProvider {
|
|
142664
|
+
static {
|
|
142665
|
+
__name(this, "GroqOpenAICompatibleProvider");
|
|
142666
|
+
}
|
|
142667
|
+
constructor(contentGeneratorConfig, cliConfig) {
|
|
142668
|
+
super(contentGeneratorConfig, cliConfig);
|
|
142669
|
+
}
|
|
142670
|
+
/**
|
|
142671
|
+
* Check if this is a GROQ provider based on baseUrl or API key prefix
|
|
142672
|
+
*/
|
|
142673
|
+
static isGroqProvider(contentGeneratorConfig) {
|
|
142674
|
+
const baseURL = contentGeneratorConfig.baseUrl || "";
|
|
142675
|
+
const apiKey = contentGeneratorConfig.apiKey || "";
|
|
142676
|
+
return baseURL.includes("groq.com") || baseURL.includes("api.groq.com") || apiKey.startsWith("gsk_");
|
|
142677
|
+
}
|
|
142678
|
+
/**
|
|
142679
|
+
* Check if model is a Kimi model from Moonshot AI
|
|
142680
|
+
*/
|
|
142681
|
+
static isKimiModel(model) {
|
|
142682
|
+
return model.includes("kimi") || model.includes("moonshotai");
|
|
142683
|
+
}
|
|
142684
|
+
buildHeaders() {
|
|
142685
|
+
const baseHeaders = super.buildHeaders();
|
|
142686
|
+
return {
|
|
142687
|
+
...baseHeaders
|
|
142688
|
+
// GROQ-specific headers if any
|
|
142689
|
+
};
|
|
142690
|
+
}
|
|
142691
|
+
buildRequest(request4, _userPromptId) {
|
|
142692
|
+
const result = { ...request4 };
|
|
142693
|
+
if (_GroqOpenAICompatibleProvider.isKimiModel(result.model)) {
|
|
142694
|
+
if (result.max_tokens && result.max_tokens > 16384) {
|
|
142695
|
+
result.max_tokens = 16384;
|
|
142696
|
+
}
|
|
142697
|
+
}
|
|
142698
|
+
return result;
|
|
142699
|
+
}
|
|
142700
|
+
/**
|
|
142701
|
+
* Get GROQ base URL
|
|
142702
|
+
*/
|
|
142703
|
+
static getGroqBaseUrl() {
|
|
142704
|
+
return "https://api.groq.com/openai/v1";
|
|
142705
|
+
}
|
|
142706
|
+
};
|
|
142707
|
+
}
|
|
142708
|
+
});
|
|
142709
|
+
|
|
142656
142710
|
// packages/core/dist/src/core/openaiContentGenerator/provider/index.js
|
|
142657
142711
|
var init_provider = __esm({
|
|
142658
142712
|
"packages/core/dist/src/core/openaiContentGenerator/provider/index.js"() {
|
|
@@ -142664,6 +142718,7 @@ var init_provider = __esm({
|
|
|
142664
142718
|
init_openrouter();
|
|
142665
142719
|
init_anthropic();
|
|
142666
142720
|
init_ollama();
|
|
142721
|
+
init_groq();
|
|
142667
142722
|
init_default();
|
|
142668
142723
|
}
|
|
142669
142724
|
});
|
|
@@ -145860,6 +145915,7 @@ __export(openaiContentGenerator_exports, {
|
|
|
145860
145915
|
DeepSeekOpenAICompatibleProvider: () => DeepSeekOpenAICompatibleProvider,
|
|
145861
145916
|
DefaultTelemetryService: () => DefaultTelemetryService,
|
|
145862
145917
|
EnhancedErrorHandler: () => EnhancedErrorHandler,
|
|
145918
|
+
GroqOpenAICompatibleProvider: () => GroqOpenAICompatibleProvider,
|
|
145863
145919
|
OllamaOpenAICompatibleProvider: () => OllamaOpenAICompatibleProvider,
|
|
145864
145920
|
OpenAIContentConverter: () => OpenAIContentConverter,
|
|
145865
145921
|
OpenAIContentGenerator: () => OpenAIContentGenerator,
|
|
@@ -145891,6 +145947,9 @@ function determineProvider(contentGeneratorConfig, cliConfig) {
|
|
|
145891
145947
|
if (OllamaOpenAICompatibleProvider.isOllamaProvider(config)) {
|
|
145892
145948
|
return new OllamaOpenAICompatibleProvider(contentGeneratorConfig, cliConfig);
|
|
145893
145949
|
}
|
|
145950
|
+
if (GroqOpenAICompatibleProvider.isGroqProvider(config)) {
|
|
145951
|
+
return new GroqOpenAICompatibleProvider(contentGeneratorConfig, cliConfig);
|
|
145952
|
+
}
|
|
145894
145953
|
return new DefaultOpenAICompatibleProvider(contentGeneratorConfig, cliConfig);
|
|
145895
145954
|
}
|
|
145896
145955
|
var init_openaiContentGenerator2 = __esm({
|
|
@@ -146102,13 +146161,22 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
146102
146161
|
apiKey: newContentGeneratorConfig?.apiKey || "ollama"
|
|
146103
146162
|
};
|
|
146104
146163
|
}
|
|
146164
|
+
if (authType === AuthType2.USE_GROQ) {
|
|
146165
|
+
return {
|
|
146166
|
+
...newContentGeneratorConfig,
|
|
146167
|
+
model: newContentGeneratorConfig?.model || "moonshotai/kimi-k2-instruct-0905",
|
|
146168
|
+
baseUrl: newContentGeneratorConfig?.baseUrl || "https://api.groq.com/openai/v1",
|
|
146169
|
+
// API key from GROQ_API_KEY env var or settings
|
|
146170
|
+
apiKey: newContentGeneratorConfig?.apiKey || process.env["GROQ_API_KEY"]
|
|
146171
|
+
};
|
|
146172
|
+
}
|
|
146105
146173
|
return {
|
|
146106
146174
|
...newContentGeneratorConfig,
|
|
146107
146175
|
model: newContentGeneratorConfig?.model || DEFAULT_OSA_MODEL
|
|
146108
146176
|
};
|
|
146109
146177
|
}
|
|
146110
146178
|
async function createContentGenerator(config, gcConfig, sessionId2, isInitialAuth) {
|
|
146111
|
-
const version2 = "0.1.
|
|
146179
|
+
const version2 = "0.1.26";
|
|
146112
146180
|
const userAgent2 = `OSAgent/${version2} (${process.platform}; ${process.arch})`;
|
|
146113
146181
|
const baseHeaders = {
|
|
146114
146182
|
"User-Agent": userAgent2
|
|
@@ -146154,6 +146222,13 @@ async function createContentGenerator(config, gcConfig, sessionId2, isInitialAut
|
|
|
146154
146222
|
const { createOpenAIContentGenerator: createOpenAIContentGenerator2 } = await Promise.resolve().then(() => (init_openaiContentGenerator2(), openaiContentGenerator_exports));
|
|
146155
146223
|
return createOpenAIContentGenerator2(config, gcConfig);
|
|
146156
146224
|
}
|
|
146225
|
+
if (config.authType === AuthType2.USE_GROQ) {
|
|
146226
|
+
if (!config.apiKey) {
|
|
146227
|
+
throw new Error("GROQ API key is required. Set GROQ_API_KEY environment variable.");
|
|
146228
|
+
}
|
|
146229
|
+
const { createOpenAIContentGenerator: createOpenAIContentGenerator2 } = await Promise.resolve().then(() => (init_openaiContentGenerator2(), openaiContentGenerator_exports));
|
|
146230
|
+
return createOpenAIContentGenerator2(config, gcConfig);
|
|
146231
|
+
}
|
|
146157
146232
|
if (config.authType === AuthType2.OSA_OAUTH) {
|
|
146158
146233
|
const { getOSAOAuthClient: getOSAOauthClient } = await Promise.resolve().then(() => (init_qwenOAuth2(), qwenOAuth2_exports));
|
|
146159
146234
|
const { OSAContentGenerator: OSAContentGenerator2 } = await Promise.resolve().then(() => (init_qwenContentGenerator(), qwenContentGenerator_exports));
|
|
@@ -146185,6 +146260,7 @@ var init_contentGenerator = __esm({
|
|
|
146185
146260
|
AuthType3["OSA_OAUTH"] = "OSA-oauth";
|
|
146186
146261
|
AuthType3["OLLAMA_CLOUD"] = "ollama-cloud";
|
|
146187
146262
|
AuthType3["OLLAMA_LOCAL"] = "ollama-local";
|
|
146263
|
+
AuthType3["USE_GROQ"] = "groq";
|
|
146188
146264
|
})(AuthType2 || (AuthType2 = {}));
|
|
146189
146265
|
__name(createContentGeneratorConfig, "createContentGeneratorConfig");
|
|
146190
146266
|
__name(createContentGenerator, "createContentGenerator");
|
|
@@ -309699,7 +309775,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
309699
309775
|
// packages/cli/src/utils/version.ts
|
|
309700
309776
|
async function getCliVersion() {
|
|
309701
309777
|
const pkgJson = await getPackageJson();
|
|
309702
|
-
return "0.1.
|
|
309778
|
+
return "0.1.26";
|
|
309703
309779
|
}
|
|
309704
309780
|
__name(getCliVersion, "getCliVersion");
|
|
309705
309781
|
|
|
@@ -313868,7 +313944,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
313868
313944
|
|
|
313869
313945
|
// packages/cli/src/generated/git-commit.ts
|
|
313870
313946
|
init_esbuild_shims();
|
|
313871
|
-
var GIT_COMMIT_INFO2 = "
|
|
313947
|
+
var GIT_COMMIT_INFO2 = "20c4873";
|
|
313948
|
+
var CLI_VERSION2 = "0.1.26";
|
|
313872
313949
|
|
|
313873
313950
|
// packages/cli/src/utils/systemInfo.ts
|
|
313874
313951
|
async function getNpmVersion() {
|
|
@@ -314700,14 +314777,14 @@ init_esbuild_shims();
|
|
|
314700
314777
|
var consultCommand = {
|
|
314701
314778
|
name: "consult",
|
|
314702
314779
|
get description() {
|
|
314703
|
-
return t2("Manage consultation
|
|
314780
|
+
return t2("Manage consultation - always-active context gathering");
|
|
314704
314781
|
},
|
|
314705
314782
|
kind: "built-in" /* BUILT_IN */,
|
|
314706
314783
|
subCommands: [
|
|
314707
314784
|
{
|
|
314708
|
-
name: "
|
|
314785
|
+
name: "active",
|
|
314709
314786
|
get description() {
|
|
314710
|
-
return t2("
|
|
314787
|
+
return t2("Set to active mode - questions shown but agent continues");
|
|
314711
314788
|
},
|
|
314712
314789
|
kind: "built-in" /* BUILT_IN */,
|
|
314713
314790
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
@@ -314715,37 +314792,60 @@ var consultCommand = {
|
|
|
314715
314792
|
return {
|
|
314716
314793
|
type: "message",
|
|
314717
314794
|
messageType: "info",
|
|
314718
|
-
content: t2(
|
|
314795
|
+
content: t2(`Consultation mode: ACTIVE
|
|
314796
|
+
|
|
314797
|
+
Questions are shown as you work, but the agent continues operating.
|
|
314798
|
+
Answer questions when convenient to improve results.`)
|
|
314719
314799
|
};
|
|
314720
314800
|
}, "action")
|
|
314721
314801
|
},
|
|
314722
314802
|
{
|
|
314723
|
-
name: "
|
|
314803
|
+
name: "blocking",
|
|
314724
314804
|
get description() {
|
|
314725
|
-
return t2("
|
|
314805
|
+
return t2("Set to blocking mode - high priority questions pause the agent");
|
|
314726
314806
|
},
|
|
314727
314807
|
kind: "built-in" /* BUILT_IN */,
|
|
314728
314808
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314729
|
-
context2.services.consultation?.setConsultationMode("
|
|
314809
|
+
context2.services.consultation?.setConsultationMode("blocking");
|
|
314730
314810
|
return {
|
|
314731
314811
|
type: "message",
|
|
314732
314812
|
messageType: "info",
|
|
314733
|
-
content: t2(
|
|
314813
|
+
content: t2(`Consultation mode: BLOCKING
|
|
314814
|
+
|
|
314815
|
+
High-priority questions (architecture, critical decisions) will PAUSE
|
|
314816
|
+
the agent until you answer. This ensures important decisions get your input.`)
|
|
314734
314817
|
};
|
|
314735
314818
|
}, "action")
|
|
314736
314819
|
},
|
|
314737
314820
|
{
|
|
314738
|
-
name: "
|
|
314821
|
+
name: "status",
|
|
314739
314822
|
get description() {
|
|
314740
|
-
return t2("
|
|
314823
|
+
return t2("Show current consultation status and collected context");
|
|
314741
314824
|
},
|
|
314742
314825
|
kind: "built-in" /* BUILT_IN */,
|
|
314743
314826
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314744
|
-
context2.services.consultation
|
|
314827
|
+
const consultation = context2.services.consultation;
|
|
314828
|
+
const mode = consultation?.consultationMode || "blocking";
|
|
314829
|
+
const contextStr = consultation?.getContextForAgent() || "";
|
|
314830
|
+
const questionCount = consultation?.questionQueue?.length || 0;
|
|
314831
|
+
let statusContent = `Consultation Status
|
|
314832
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
314833
|
+
|
|
314834
|
+
Mode: ${mode.toUpperCase()}
|
|
314835
|
+
Pending Questions: ${questionCount}
|
|
314836
|
+
`;
|
|
314837
|
+
if (contextStr) {
|
|
314838
|
+
statusContent += `
|
|
314839
|
+
\u2501\u2501\u2501 Collected Context \u2501\u2501\u2501
|
|
314840
|
+
${contextStr}`;
|
|
314841
|
+
} else {
|
|
314842
|
+
statusContent += `
|
|
314843
|
+
No context collected yet. Answer questions as they appear.`;
|
|
314844
|
+
}
|
|
314745
314845
|
return {
|
|
314746
314846
|
type: "message",
|
|
314747
314847
|
messageType: "info",
|
|
314748
|
-
content: t2(
|
|
314848
|
+
content: t2(statusContent)
|
|
314749
314849
|
};
|
|
314750
314850
|
}, "action")
|
|
314751
314851
|
},
|
|
@@ -314814,34 +314914,40 @@ ${contextStr}`)
|
|
|
314814
314914
|
return {
|
|
314815
314915
|
type: "message",
|
|
314816
314916
|
messageType: "info",
|
|
314817
|
-
content: t2("Added 3 demo consultation questions. Check the consultation panel
|
|
314917
|
+
content: t2("Added 3 demo consultation questions. Check the consultation panel.")
|
|
314818
314918
|
};
|
|
314819
314919
|
}, "action")
|
|
314820
314920
|
}
|
|
314821
314921
|
],
|
|
314822
314922
|
action: /* @__PURE__ */ __name(async (context2, args) => {
|
|
314823
314923
|
const argTrimmed = args.trim().toLowerCase();
|
|
314824
|
-
const currentMode = context2.services.consultation?.consultationMode || "
|
|
314924
|
+
const currentMode = context2.services.consultation?.consultationMode || "blocking";
|
|
314825
314925
|
if (!argTrimmed) {
|
|
314826
314926
|
return {
|
|
314827
314927
|
type: "message",
|
|
314828
314928
|
messageType: "info",
|
|
314829
|
-
content: t2(`Consultation
|
|
314929
|
+
content: t2(`Consultation System (Always Active)
|
|
314930
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
314931
|
+
|
|
314932
|
+
The consultation system continuously gathers context from you
|
|
314933
|
+
to improve the orchestrator's understanding of your project
|
|
314934
|
+
and requirements. This is a core feature that cannot be disabled.
|
|
314830
314935
|
|
|
314831
|
-
|
|
314832
|
-
- Questions appear below the status bar
|
|
314833
|
-
- Answer questions to improve agent responses
|
|
314834
|
-
- Context is used across your session
|
|
314936
|
+
Current mode: ${currentMode.toUpperCase()}
|
|
314835
314937
|
|
|
314836
314938
|
Commands:
|
|
314837
|
-
/consult
|
|
314838
|
-
/consult blocking -
|
|
314839
|
-
/consult
|
|
314840
|
-
/consult context - View collected context
|
|
314939
|
+
/consult active - Questions shown, agent continues
|
|
314940
|
+
/consult blocking - High-priority questions pause agent (recommended)
|
|
314941
|
+
/consult status - View status and collected context
|
|
314942
|
+
/consult context - View collected context only
|
|
314841
314943
|
/consult clear - Clear all context
|
|
314842
314944
|
/consult demo - Add demo questions for testing
|
|
314843
314945
|
|
|
314844
|
-
|
|
314946
|
+
How it works:
|
|
314947
|
+
1. The orchestrator analyzes your prompts
|
|
314948
|
+
2. Relevant questions are generated automatically
|
|
314949
|
+
3. Your answers inform development decisions
|
|
314950
|
+
4. Context persists across your session`)
|
|
314845
314951
|
};
|
|
314846
314952
|
}
|
|
314847
314953
|
return {
|
|
@@ -317517,6 +317623,47 @@ var AVAILABLE_MODELS_OSA = [
|
|
|
317517
317623
|
isVision: true
|
|
317518
317624
|
}
|
|
317519
317625
|
];
|
|
317626
|
+
var AVAILABLE_MODELS_GROQ = [
|
|
317627
|
+
{
|
|
317628
|
+
id: "moonshotai/kimi-k2-instruct-0905",
|
|
317629
|
+
label: "Kimi K2 0905 (Recommended)",
|
|
317630
|
+
get description() {
|
|
317631
|
+
return t2(
|
|
317632
|
+
"Kimi K2 0905 - Best coding model with 256K context, ~200 tok/s on GROQ"
|
|
317633
|
+
);
|
|
317634
|
+
}
|
|
317635
|
+
},
|
|
317636
|
+
{
|
|
317637
|
+
id: "moonshotai/kimi-k2-instruct",
|
|
317638
|
+
label: "Kimi K2 Instruct",
|
|
317639
|
+
get description() {
|
|
317640
|
+
return t2(
|
|
317641
|
+
"Kimi K2 Instruct - 131K context, excellent for coding and tool use"
|
|
317642
|
+
);
|
|
317643
|
+
}
|
|
317644
|
+
},
|
|
317645
|
+
{
|
|
317646
|
+
id: "llama-3.3-70b-versatile",
|
|
317647
|
+
label: "Llama 3.3 70B",
|
|
317648
|
+
get description() {
|
|
317649
|
+
return t2("Llama 3.3 70B - Versatile model for general coding tasks");
|
|
317650
|
+
}
|
|
317651
|
+
},
|
|
317652
|
+
{
|
|
317653
|
+
id: "llama-3.1-8b-instant",
|
|
317654
|
+
label: "Llama 3.1 8B Instant",
|
|
317655
|
+
get description() {
|
|
317656
|
+
return t2("Llama 3.1 8B - Ultra-fast for simple tasks");
|
|
317657
|
+
}
|
|
317658
|
+
},
|
|
317659
|
+
{
|
|
317660
|
+
id: "mixtral-8x7b-32768",
|
|
317661
|
+
label: "Mixtral 8x7B",
|
|
317662
|
+
get description() {
|
|
317663
|
+
return t2("Mixtral 8x7B MoE - 32K context, good balance of speed/quality");
|
|
317664
|
+
}
|
|
317665
|
+
}
|
|
317666
|
+
];
|
|
317520
317667
|
var AVAILABLE_MODELS_OLLAMA_LOCAL = [
|
|
317521
317668
|
{
|
|
317522
317669
|
id: "qwen2.5-coder:32b",
|
|
@@ -317579,6 +317726,8 @@ function getAvailableModelsForAuthType(authType) {
|
|
|
317579
317726
|
return AVAILABLE_MODELS_OSA;
|
|
317580
317727
|
case AuthType2.OLLAMA_LOCAL:
|
|
317581
317728
|
return AVAILABLE_MODELS_OLLAMA_LOCAL;
|
|
317729
|
+
case AuthType2.USE_GROQ:
|
|
317730
|
+
return AVAILABLE_MODELS_GROQ;
|
|
317582
317731
|
case AuthType2.USE_OPENAI: {
|
|
317583
317732
|
const openAIModel = getOpenAIAvailableModelFromEnv();
|
|
317584
317733
|
return openAIModel ? [openAIModel] : [];
|
|
@@ -317666,6 +317815,247 @@ var permissionsCommand = {
|
|
|
317666
317815
|
}), "action")
|
|
317667
317816
|
};
|
|
317668
317817
|
|
|
317818
|
+
// packages/cli/src/ui/commands/providerCommand.ts
|
|
317819
|
+
init_esbuild_shims();
|
|
317820
|
+
var providerCommand = {
|
|
317821
|
+
name: "provider",
|
|
317822
|
+
get description() {
|
|
317823
|
+
return t2("Switch AI provider (GROQ, Ollama, OpenAI, etc.)");
|
|
317824
|
+
},
|
|
317825
|
+
kind: "built-in" /* BUILT_IN */,
|
|
317826
|
+
subCommands: [
|
|
317827
|
+
{
|
|
317828
|
+
name: "groq",
|
|
317829
|
+
get description() {
|
|
317830
|
+
return t2("Switch to GROQ (fast inference with Kimi K2)");
|
|
317831
|
+
},
|
|
317832
|
+
kind: "built-in" /* BUILT_IN */,
|
|
317833
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
317834
|
+
const { config } = context2.services;
|
|
317835
|
+
if (!config) {
|
|
317836
|
+
return {
|
|
317837
|
+
type: "message",
|
|
317838
|
+
messageType: "error",
|
|
317839
|
+
content: t2("Configuration not available.")
|
|
317840
|
+
};
|
|
317841
|
+
}
|
|
317842
|
+
const apiKey = process.env["GROQ_API_KEY"];
|
|
317843
|
+
if (!apiKey) {
|
|
317844
|
+
return {
|
|
317845
|
+
type: "message",
|
|
317846
|
+
messageType: "error",
|
|
317847
|
+
content: t2(`GROQ API key required. Set GROQ_API_KEY environment variable.
|
|
317848
|
+
|
|
317849
|
+
Get your API key at: https://console.groq.com/keys`)
|
|
317850
|
+
};
|
|
317851
|
+
}
|
|
317852
|
+
try {
|
|
317853
|
+
await config.refreshAuth(AuthType2.USE_GROQ);
|
|
317854
|
+
return {
|
|
317855
|
+
type: "message",
|
|
317856
|
+
messageType: "info",
|
|
317857
|
+
content: t2(`Switched to GROQ provider.
|
|
317858
|
+
|
|
317859
|
+
Model: moonshotai/kimi-k2-instruct-0905
|
|
317860
|
+
Speed: ~200 tok/s
|
|
317861
|
+
Context: 256K tokens
|
|
317862
|
+
|
|
317863
|
+
Use /model to change models within GROQ.`)
|
|
317864
|
+
};
|
|
317865
|
+
} catch (error) {
|
|
317866
|
+
return {
|
|
317867
|
+
type: "message",
|
|
317868
|
+
messageType: "error",
|
|
317869
|
+
content: t2(`Failed to switch to GROQ: ${error instanceof Error ? error.message : String(error)}`)
|
|
317870
|
+
};
|
|
317871
|
+
}
|
|
317872
|
+
}, "action")
|
|
317873
|
+
},
|
|
317874
|
+
{
|
|
317875
|
+
name: "ollama",
|
|
317876
|
+
get description() {
|
|
317877
|
+
return t2("Switch to local Ollama");
|
|
317878
|
+
},
|
|
317879
|
+
kind: "built-in" /* BUILT_IN */,
|
|
317880
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
317881
|
+
const { config } = context2.services;
|
|
317882
|
+
if (!config) {
|
|
317883
|
+
return {
|
|
317884
|
+
type: "message",
|
|
317885
|
+
messageType: "error",
|
|
317886
|
+
content: t2("Configuration not available.")
|
|
317887
|
+
};
|
|
317888
|
+
}
|
|
317889
|
+
try {
|
|
317890
|
+
await config.refreshAuth(AuthType2.OLLAMA_LOCAL);
|
|
317891
|
+
return {
|
|
317892
|
+
type: "message",
|
|
317893
|
+
messageType: "info",
|
|
317894
|
+
content: t2(`Switched to local Ollama provider.
|
|
317895
|
+
|
|
317896
|
+
Make sure Ollama is running: ollama serve
|
|
317897
|
+
Use /model to select a local model.`)
|
|
317898
|
+
};
|
|
317899
|
+
} catch (error) {
|
|
317900
|
+
return {
|
|
317901
|
+
type: "message",
|
|
317902
|
+
messageType: "error",
|
|
317903
|
+
content: t2(`Failed to switch to Ollama: ${error instanceof Error ? error.message : String(error)}`)
|
|
317904
|
+
};
|
|
317905
|
+
}
|
|
317906
|
+
}, "action")
|
|
317907
|
+
},
|
|
317908
|
+
{
|
|
317909
|
+
name: "openai",
|
|
317910
|
+
get description() {
|
|
317911
|
+
return t2("Switch to OpenAI compatible provider");
|
|
317912
|
+
},
|
|
317913
|
+
kind: "built-in" /* BUILT_IN */,
|
|
317914
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
317915
|
+
const { config } = context2.services;
|
|
317916
|
+
if (!config) {
|
|
317917
|
+
return {
|
|
317918
|
+
type: "message",
|
|
317919
|
+
messageType: "error",
|
|
317920
|
+
content: t2("Configuration not available.")
|
|
317921
|
+
};
|
|
317922
|
+
}
|
|
317923
|
+
const apiKey = process.env["OPENAI_API_KEY"];
|
|
317924
|
+
if (!apiKey) {
|
|
317925
|
+
return {
|
|
317926
|
+
type: "message",
|
|
317927
|
+
messageType: "error",
|
|
317928
|
+
content: t2(`OpenAI API key required. Set OPENAI_API_KEY environment variable.`)
|
|
317929
|
+
};
|
|
317930
|
+
}
|
|
317931
|
+
try {
|
|
317932
|
+
await config.refreshAuth(AuthType2.USE_OPENAI);
|
|
317933
|
+
return {
|
|
317934
|
+
type: "message",
|
|
317935
|
+
messageType: "info",
|
|
317936
|
+
content: t2(`Switched to OpenAI provider.
|
|
317937
|
+
|
|
317938
|
+
Set OPENAI_BASE_URL for custom endpoints.
|
|
317939
|
+
Use /model to select a model.`)
|
|
317940
|
+
};
|
|
317941
|
+
} catch (error) {
|
|
317942
|
+
return {
|
|
317943
|
+
type: "message",
|
|
317944
|
+
messageType: "error",
|
|
317945
|
+
content: t2(`Failed to switch to OpenAI: ${error instanceof Error ? error.message : String(error)}`)
|
|
317946
|
+
};
|
|
317947
|
+
}
|
|
317948
|
+
}, "action")
|
|
317949
|
+
},
|
|
317950
|
+
{
|
|
317951
|
+
name: "status",
|
|
317952
|
+
get description() {
|
|
317953
|
+
return t2("Show current provider status");
|
|
317954
|
+
},
|
|
317955
|
+
kind: "built-in" /* BUILT_IN */,
|
|
317956
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
317957
|
+
const { config } = context2.services;
|
|
317958
|
+
if (!config) {
|
|
317959
|
+
return {
|
|
317960
|
+
type: "message",
|
|
317961
|
+
messageType: "error",
|
|
317962
|
+
content: t2("Configuration not available.")
|
|
317963
|
+
};
|
|
317964
|
+
}
|
|
317965
|
+
const authType = config.getAuthType();
|
|
317966
|
+
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
317967
|
+
const model = contentGeneratorConfig?.model || "unknown";
|
|
317968
|
+
const baseUrl = contentGeneratorConfig?.baseUrl || "default";
|
|
317969
|
+
let providerName = "Unknown";
|
|
317970
|
+
switch (authType) {
|
|
317971
|
+
case AuthType2.USE_GROQ:
|
|
317972
|
+
providerName = "GROQ";
|
|
317973
|
+
break;
|
|
317974
|
+
case AuthType2.OLLAMA_LOCAL:
|
|
317975
|
+
providerName = "Ollama (Local)";
|
|
317976
|
+
break;
|
|
317977
|
+
case AuthType2.OLLAMA_CLOUD:
|
|
317978
|
+
providerName = "Ollama (Cloud)";
|
|
317979
|
+
break;
|
|
317980
|
+
case AuthType2.USE_OPENAI:
|
|
317981
|
+
providerName = "OpenAI Compatible";
|
|
317982
|
+
break;
|
|
317983
|
+
case AuthType2.OSA_OAUTH:
|
|
317984
|
+
providerName = "OSAgent Cloud";
|
|
317985
|
+
break;
|
|
317986
|
+
default:
|
|
317987
|
+
providerName = String(authType);
|
|
317988
|
+
}
|
|
317989
|
+
return {
|
|
317990
|
+
type: "message",
|
|
317991
|
+
messageType: "info",
|
|
317992
|
+
content: t2(`Provider Status
|
|
317993
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
317994
|
+
Provider: ${providerName}
|
|
317995
|
+
Model: ${model}
|
|
317996
|
+
Base URL: ${baseUrl}
|
|
317997
|
+
|
|
317998
|
+
Commands:
|
|
317999
|
+
/provider groq - Switch to GROQ (Kimi K2)
|
|
318000
|
+
/provider ollama - Switch to local Ollama
|
|
318001
|
+
/provider openai - Switch to OpenAI compatible
|
|
318002
|
+
/model - Change model within current provider`)
|
|
318003
|
+
};
|
|
318004
|
+
}, "action")
|
|
318005
|
+
}
|
|
318006
|
+
],
|
|
318007
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
318008
|
+
const { config } = context2.services;
|
|
318009
|
+
if (!config) {
|
|
318010
|
+
return {
|
|
318011
|
+
type: "message",
|
|
318012
|
+
messageType: "error",
|
|
318013
|
+
content: t2("Configuration not available.")
|
|
318014
|
+
};
|
|
318015
|
+
}
|
|
318016
|
+
const authType = config.getAuthType();
|
|
318017
|
+
let providerName = "Unknown";
|
|
318018
|
+
switch (authType) {
|
|
318019
|
+
case AuthType2.USE_GROQ:
|
|
318020
|
+
providerName = "GROQ";
|
|
318021
|
+
break;
|
|
318022
|
+
case AuthType2.OLLAMA_LOCAL:
|
|
318023
|
+
providerName = "Ollama (Local)";
|
|
318024
|
+
break;
|
|
318025
|
+
case AuthType2.OLLAMA_CLOUD:
|
|
318026
|
+
providerName = "Ollama (Cloud)";
|
|
318027
|
+
break;
|
|
318028
|
+
case AuthType2.USE_OPENAI:
|
|
318029
|
+
providerName = "OpenAI Compatible";
|
|
318030
|
+
break;
|
|
318031
|
+
case AuthType2.OSA_OAUTH:
|
|
318032
|
+
providerName = "OSAgent Cloud";
|
|
318033
|
+
break;
|
|
318034
|
+
default:
|
|
318035
|
+
providerName = String(authType);
|
|
318036
|
+
}
|
|
318037
|
+
return {
|
|
318038
|
+
type: "message",
|
|
318039
|
+
messageType: "info",
|
|
318040
|
+
content: t2(`AI Provider Management
|
|
318041
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
318042
|
+
|
|
318043
|
+
Current Provider: ${providerName}
|
|
318044
|
+
|
|
318045
|
+
Available Providers:
|
|
318046
|
+
/provider groq - GROQ (Kimi K2, ~200 tok/s, 256K context)
|
|
318047
|
+
/provider ollama - Local Ollama (qwen2.5-coder, etc.)
|
|
318048
|
+
/provider openai - OpenAI compatible APIs
|
|
318049
|
+
/provider status - Show detailed status
|
|
318050
|
+
|
|
318051
|
+
Environment Variables:
|
|
318052
|
+
GROQ_API_KEY - For GROQ provider
|
|
318053
|
+
OPENAI_API_KEY - For OpenAI provider
|
|
318054
|
+
OPENAI_BASE_URL - Custom endpoint URL`)
|
|
318055
|
+
};
|
|
318056
|
+
}, "action")
|
|
318057
|
+
};
|
|
318058
|
+
|
|
317669
318059
|
// packages/cli/src/ui/commands/quitCommand.ts
|
|
317670
318060
|
init_esbuild_shims();
|
|
317671
318061
|
var quitConfirmCommand = {
|
|
@@ -319844,6 +320234,7 @@ var BuiltinCommandLoader = class {
|
|
|
319844
320234
|
memoryCommand,
|
|
319845
320235
|
modelCommand,
|
|
319846
320236
|
...this.config?.getFolderTrust() ? [permissionsCommand] : [],
|
|
320237
|
+
providerCommand,
|
|
319847
320238
|
quitCommand,
|
|
319848
320239
|
quitConfirmCommand,
|
|
319849
320240
|
resetCommand,
|
|
@@ -347435,7 +347826,7 @@ init_esbuild_shims();
|
|
|
347435
347826
|
|
|
347436
347827
|
// packages/cli/src/ui/components/AsciiArt.ts
|
|
347437
347828
|
init_esbuild_shims();
|
|
347438
|
-
var
|
|
347829
|
+
var getLongAsciiLogo = /* @__PURE__ */ __name(() => `
|
|
347439
347830
|
\u250F\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513
|
|
347440
347831
|
\u2503 \u2503
|
|
347441
347832
|
\u2503 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2503
|
|
@@ -347446,10 +347837,10 @@ var longAsciiLogo = `
|
|
|
347446
347837
|
\u2503 \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u2503
|
|
347447
347838
|
\u2503 \u2503
|
|
347448
347839
|
\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2503
|
|
347449
|
-
\u2503 \u25B8
|
|
347840
|
+
\u2503 \u25B8 AUTONOMOUS DEVELOPMENT \u25B8 INTELLIGENT ORCHESTRATION \u25B8 v${CLI_VERSION2.padEnd(6)}\u2503
|
|
347450
347841
|
\u2517\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251B
|
|
347451
|
-
|
|
347452
|
-
var
|
|
347842
|
+
`, "getLongAsciiLogo");
|
|
347843
|
+
var getShortAsciiLogo = /* @__PURE__ */ __name(() => `
|
|
347453
347844
|
\u250F\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513
|
|
347454
347845
|
\u2503 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2503
|
|
347455
347846
|
\u2503 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2588\u2588\u2554\u2550\u255D\u2503
|
|
@@ -347458,16 +347849,21 @@ var shortAsciiLogo = `
|
|
|
347458
347849
|
\u2503 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2503
|
|
347459
347850
|
\u2503 \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u2503
|
|
347460
347851
|
\u2523\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u252B
|
|
347461
|
-
\u2503 \u25B8
|
|
347852
|
+
\u2503 \u25B8 CONTEXT-AWARE ORCHESTRATION v${CLI_VERSION2.padEnd(6)} \u2503
|
|
347462
347853
|
\u2517\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251B
|
|
347463
|
-
|
|
347464
|
-
var
|
|
347854
|
+
`, "getShortAsciiLogo");
|
|
347855
|
+
var getTinyAsciiLogo = /* @__PURE__ */ __name(() => `
|
|
347465
347856
|
\u250F\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513
|
|
347466
347857
|
\u2503 \u25C6 O S A G E N T \u25C6 \u2503
|
|
347467
347858
|
\u2523\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u252B
|
|
347468
|
-
\u2503 \u25B8
|
|
347859
|
+
\u2503 \u25B8 v${CLI_VERSION2.padEnd(6)} \u25B8 READY \u2503
|
|
347469
347860
|
\u2517\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251B
|
|
347470
|
-
|
|
347861
|
+
`, "getTinyAsciiLogo");
|
|
347862
|
+
var getMinimalLogo = /* @__PURE__ */ __name(() => getTinyAsciiLogo(), "getMinimalLogo");
|
|
347863
|
+
var longAsciiLogo = getLongAsciiLogo();
|
|
347864
|
+
var shortAsciiLogo = getShortAsciiLogo();
|
|
347865
|
+
var tinyAsciiLogo = getTinyAsciiLogo();
|
|
347866
|
+
var minimalLogo = getMinimalLogo();
|
|
347471
347867
|
|
|
347472
347868
|
// packages/cli/src/ui/components/Header.tsx
|
|
347473
347869
|
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -347517,22 +347913,24 @@ var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
|
|
|
347517
347913
|
var Tips = /* @__PURE__ */ __name(({ config }) => {
|
|
347518
347914
|
const OSAMdFileCount = config.getOSAMdFileCount();
|
|
347519
347915
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
347520
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.primary, children: t2("
|
|
347521
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.
|
|
347522
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.primary, children: t2("
|
|
347916
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.primary, bold: true, children: t2("Autonomous Development System") }),
|
|
347917
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.secondary, dimColor: true, children: t2("Consultation, context tracking, and orchestration are always active.") }),
|
|
347918
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.primary, children: t2("1. Describe what you want to build - I'll analyze and ask clarifying questions.") }),
|
|
347919
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.primary, children: t2("2. Answer questions as they appear to improve results.") }),
|
|
347920
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { color: theme.text.primary, children: t2("3. Your roadmap is tracked and saved for continuity.") }),
|
|
347523
347921
|
OSAMdFileCount === 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text3, { color: theme.text.primary, children: [
|
|
347524
|
-
"
|
|
347922
|
+
"4. Create",
|
|
347525
347923
|
" ",
|
|
347526
347924
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { bold: true, color: theme.text.accent, children: "OSAGENT.md" }),
|
|
347527
347925
|
" ",
|
|
347528
|
-
t2("
|
|
347926
|
+
t2("to provide project context.")
|
|
347529
347927
|
] }),
|
|
347530
347928
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text3, { color: theme.text.primary, children: [
|
|
347531
|
-
OSAMdFileCount === 0 ? "
|
|
347929
|
+
OSAMdFileCount === 0 ? "5." : "4.",
|
|
347532
347930
|
" ",
|
|
347533
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { bold: true, color: theme.text.accent, children: "/
|
|
347931
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text3, { bold: true, color: theme.text.accent, children: "/consult status" }),
|
|
347534
347932
|
" ",
|
|
347535
|
-
t2("
|
|
347933
|
+
t2("to view collected context.")
|
|
347536
347934
|
] })
|
|
347537
347935
|
] });
|
|
347538
347936
|
}, "Tips");
|
|
@@ -353990,11 +354388,11 @@ function useConsultation() {
|
|
|
353990
354388
|
}
|
|
353991
354389
|
__name(useConsultation, "useConsultation");
|
|
353992
354390
|
function ConsultationProvider({ children }) {
|
|
353993
|
-
const
|
|
354391
|
+
const isActive = true;
|
|
353994
354392
|
const [currentQuestion, setCurrentQuestion] = (0, import_react101.useState)(null);
|
|
353995
354393
|
const [questionQueue, setQuestionQueue] = (0, import_react101.useState)([]);
|
|
353996
354394
|
const [isBlocking, setIsBlocking] = (0, import_react101.useState)(false);
|
|
353997
|
-
const [consultationMode, setConsultationModeState] = (0, import_react101.useState)("
|
|
354395
|
+
const [consultationMode, setConsultationModeState] = (0, import_react101.useState)("blocking");
|
|
353998
354396
|
const [collectedContext, setCollectedContext] = (0, import_react101.useState)({
|
|
353999
354397
|
questions: [],
|
|
354000
354398
|
answers: /* @__PURE__ */ new Map(),
|
|
@@ -354031,6 +354429,7 @@ function ConsultationProvider({ children }) {
|
|
|
354031
354429
|
setCollectedContext((prev) => {
|
|
354032
354430
|
const newAnswers = new Map(prev.answers);
|
|
354033
354431
|
newAnswers.set(questionId, answer);
|
|
354432
|
+
const answeredQuestion = prev.questions.find((q) => q.id === questionId);
|
|
354034
354433
|
const updatedQuestions = prev.questions.map(
|
|
354035
354434
|
(q) => q.id === questionId ? { ...q, answered: true, answer } : q
|
|
354036
354435
|
);
|
|
@@ -354038,8 +354437,11 @@ function ConsultationProvider({ children }) {
|
|
|
354038
354437
|
...prev,
|
|
354039
354438
|
answers: newAnswers,
|
|
354040
354439
|
questions: updatedQuestions,
|
|
354041
|
-
projectContext: [
|
|
354042
|
-
|
|
354440
|
+
projectContext: [
|
|
354441
|
+
...prev.projectContext,
|
|
354442
|
+
`Q: ${answeredQuestion?.question}
|
|
354443
|
+
A: ${answer}`
|
|
354444
|
+
]
|
|
354043
354445
|
};
|
|
354044
354446
|
});
|
|
354045
354447
|
setQuestionQueue((prev) => prev.filter((q) => q.id !== questionId));
|
|
@@ -354048,10 +354450,14 @@ A: ${answer}`]
|
|
|
354048
354450
|
setCurrentQuestion(next);
|
|
354049
354451
|
if (!next) {
|
|
354050
354452
|
setIsBlocking(false);
|
|
354453
|
+
} else if (consultationMode === "blocking" && next.priority === "high") {
|
|
354454
|
+
setIsBlocking(true);
|
|
354455
|
+
} else {
|
|
354456
|
+
setIsBlocking(false);
|
|
354051
354457
|
}
|
|
354052
354458
|
return prev.slice(1);
|
|
354053
354459
|
});
|
|
354054
|
-
}, []);
|
|
354460
|
+
}, [consultationMode]);
|
|
354055
354461
|
const skipQuestion = (0, import_react101.useCallback)((questionId) => {
|
|
354056
354462
|
setQuestionQueue((prev) => {
|
|
354057
354463
|
const filtered = prev.filter((q) => q.id !== questionId);
|
|
@@ -354059,17 +354465,22 @@ A: ${answer}`]
|
|
|
354059
354465
|
setCurrentQuestion(next);
|
|
354060
354466
|
if (!next) {
|
|
354061
354467
|
setIsBlocking(false);
|
|
354468
|
+
} else if (consultationMode === "blocking" && next.priority === "high") {
|
|
354469
|
+
setIsBlocking(true);
|
|
354470
|
+
} else {
|
|
354471
|
+
setIsBlocking(false);
|
|
354062
354472
|
}
|
|
354063
354473
|
return filtered.slice(1);
|
|
354064
354474
|
});
|
|
354065
|
-
}, []);
|
|
354475
|
+
}, [consultationMode]);
|
|
354066
354476
|
const setConsultationMode = (0, import_react101.useCallback)((mode) => {
|
|
354067
354477
|
setConsultationModeState(mode);
|
|
354068
|
-
|
|
354069
|
-
|
|
354478
|
+
if (mode === "blocking" && currentQuestion?.priority === "high") {
|
|
354479
|
+
setIsBlocking(true);
|
|
354480
|
+
} else if (mode === "active") {
|
|
354070
354481
|
setIsBlocking(false);
|
|
354071
354482
|
}
|
|
354072
|
-
}, []);
|
|
354483
|
+
}, [currentQuestion]);
|
|
354073
354484
|
const getContextForAgent = (0, import_react101.useCallback)(() => {
|
|
354074
354485
|
const contextParts = [];
|
|
354075
354486
|
if (collectedContext.projectContext.length > 0) {
|
|
@@ -354082,6 +354493,13 @@ A: ${answer}`]
|
|
|
354082
354493
|
contextParts.push(`- ${key}: ${value2}`);
|
|
354083
354494
|
}
|
|
354084
354495
|
}
|
|
354496
|
+
const unansweredQuestions = collectedContext.questions.filter((q) => !q.answered);
|
|
354497
|
+
if (unansweredQuestions.length > 0) {
|
|
354498
|
+
contextParts.push("\n## Pending Questions\n");
|
|
354499
|
+
for (const q of unansweredQuestions) {
|
|
354500
|
+
contextParts.push(`- [${q.priority}] ${q.question}`);
|
|
354501
|
+
}
|
|
354502
|
+
}
|
|
354085
354503
|
return contextParts.join("\n");
|
|
354086
354504
|
}, [collectedContext]);
|
|
354087
354505
|
const clearContext = (0, import_react101.useCallback)(() => {
|
|
@@ -354098,6 +354516,23 @@ A: ${answer}`]
|
|
|
354098
354516
|
const setBlocking2 = (0, import_react101.useCallback)((blocking) => {
|
|
354099
354517
|
setIsBlocking(blocking);
|
|
354100
354518
|
}, []);
|
|
354519
|
+
const addUserContext = (0, import_react101.useCallback)((context2, category) => {
|
|
354520
|
+
setCollectedContext((prev) => {
|
|
354521
|
+
if (category) {
|
|
354522
|
+
return {
|
|
354523
|
+
...prev,
|
|
354524
|
+
userPreferences: {
|
|
354525
|
+
...prev.userPreferences,
|
|
354526
|
+
[category]: context2
|
|
354527
|
+
}
|
|
354528
|
+
};
|
|
354529
|
+
}
|
|
354530
|
+
return {
|
|
354531
|
+
...prev,
|
|
354532
|
+
projectContext: [...prev.projectContext, context2]
|
|
354533
|
+
};
|
|
354534
|
+
});
|
|
354535
|
+
}, []);
|
|
354101
354536
|
const value = {
|
|
354102
354537
|
isActive,
|
|
354103
354538
|
currentQuestion,
|
|
@@ -354111,7 +354546,8 @@ A: ${answer}`]
|
|
|
354111
354546
|
setConsultationMode,
|
|
354112
354547
|
getContextForAgent,
|
|
354113
354548
|
clearContext,
|
|
354114
|
-
setBlocking: setBlocking2
|
|
354549
|
+
setBlocking: setBlocking2,
|
|
354550
|
+
addUserContext
|
|
354115
354551
|
};
|
|
354116
354552
|
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(ConsultationContext.Provider, { value, children });
|
|
354117
354553
|
}
|
|
@@ -354120,9 +354556,12 @@ __name(ConsultationProvider, "ConsultationProvider");
|
|
|
354120
354556
|
// packages/cli/src/ui/components/TaskMasterPanel.tsx
|
|
354121
354557
|
var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
|
|
354122
354558
|
var STATUS_ICONS2 = {
|
|
354123
|
-
pending: "\
|
|
354559
|
+
pending: "\u2610",
|
|
354560
|
+
// Empty checkbox
|
|
354124
354561
|
in_progress: "\u25D0",
|
|
354125
|
-
|
|
354562
|
+
// Half-filled
|
|
354563
|
+
completed: "\u2611"
|
|
354564
|
+
// Checked checkbox
|
|
354126
354565
|
};
|
|
354127
354566
|
function formatTokenCount(count) {
|
|
354128
354567
|
if (count >= 1e6) {
|
|
@@ -354200,7 +354639,7 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
354200
354639
|
const totalCount = todos.length;
|
|
354201
354640
|
const progressPercent = totalCount > 0 ? Math.round(completedCount / totalCount * 100) : 0;
|
|
354202
354641
|
const allQuestions = currentQuestion ? [currentQuestion, ...questionQueue.filter((q) => q.id !== currentQuestion.id)] : questionQueue;
|
|
354203
|
-
if (
|
|
354642
|
+
if (todos.length === 0 && !isResponding && subagentComments.length === 0) {
|
|
354204
354643
|
return null;
|
|
354205
354644
|
}
|
|
354206
354645
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
@@ -354275,32 +354714,36 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
354275
354714
|
] })
|
|
354276
354715
|
] }),
|
|
354277
354716
|
todos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, paddingLeft: 1, children: [
|
|
354278
|
-
todos.slice(0, compact ?
|
|
354717
|
+
todos.slice(0, compact ? 5 : 10).map((todo, idx) => {
|
|
354279
354718
|
const isCompleted = todo.status === "completed";
|
|
354280
354719
|
const isInProgress = todo.status === "in_progress";
|
|
354281
|
-
const isLast = idx === Math.min(todos.length, compact ?
|
|
354282
|
-
const
|
|
354720
|
+
const isLast = idx === Math.min(todos.length, compact ? 5 : 10) - 1;
|
|
354721
|
+
const iconColor = isInProgress ? Colors.AccentYellow : isCompleted ? theme.text.secondary : theme.text.primary;
|
|
354722
|
+
const textColor = isInProgress ? Colors.AccentYellow : isCompleted ? theme.text.secondary : theme.text.primary;
|
|
354283
354723
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { children: [
|
|
354284
|
-
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color, children: [
|
|
354285
|
-
isLast ? "\u2514
|
|
354286
|
-
" "
|
|
354287
|
-
|
|
354724
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354725
|
+
isLast ? "\u2514" : "\u251C",
|
|
354726
|
+
" "
|
|
354727
|
+
] }),
|
|
354728
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: iconColor, children: [
|
|
354729
|
+
STATUS_ICONS2[todo.status],
|
|
354288
354730
|
" "
|
|
354289
354731
|
] }),
|
|
354290
354732
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
354291
354733
|
Text3,
|
|
354292
354734
|
{
|
|
354293
|
-
color,
|
|
354735
|
+
color: textColor,
|
|
354294
354736
|
dimColor: isCompleted,
|
|
354295
354737
|
strikethrough: isCompleted,
|
|
354738
|
+
bold: isInProgress,
|
|
354296
354739
|
children: isInProgress && todo.activeForm ? todo.activeForm : todo.content
|
|
354297
354740
|
}
|
|
354298
354741
|
)
|
|
354299
354742
|
] }, todo.id);
|
|
354300
354743
|
}),
|
|
354301
|
-
todos.length > (compact ?
|
|
354302
|
-
"\u2514
|
|
354303
|
-
todos.length - (compact ?
|
|
354744
|
+
todos.length > (compact ? 5 : 10) && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354745
|
+
"\u2514 ... and ",
|
|
354746
|
+
todos.length - (compact ? 5 : 10),
|
|
354304
354747
|
" more"
|
|
354305
354748
|
] })
|
|
354306
354749
|
] })
|
|
@@ -355247,7 +355690,7 @@ var McpPromptLoader = class {
|
|
|
355247
355690
|
};
|
|
355248
355691
|
|
|
355249
355692
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
355250
|
-
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, setOSAMdFileCount, actions, extensionsUpdateState, isConfigInitialized) => {
|
|
355693
|
+
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, setOSAMdFileCount, actions, extensionsUpdateState, isConfigInitialized, consultation) => {
|
|
355251
355694
|
const session = useSessionStats();
|
|
355252
355695
|
const [commands, setCommands] = (0, import_react112.useState)([]);
|
|
355253
355696
|
const [reloadTrigger, setReloadTrigger] = (0, import_react112.useState)(0);
|
|
@@ -355345,7 +355788,8 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
355345
355788
|
config,
|
|
355346
355789
|
settings,
|
|
355347
355790
|
git: gitService,
|
|
355348
|
-
logger: logger6
|
|
355791
|
+
logger: logger6,
|
|
355792
|
+
consultation
|
|
355349
355793
|
},
|
|
355350
355794
|
ui: {
|
|
355351
355795
|
addItem,
|
|
@@ -355377,6 +355821,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
355377
355821
|
settings,
|
|
355378
355822
|
gitService,
|
|
355379
355823
|
logger6,
|
|
355824
|
+
consultation,
|
|
355380
355825
|
loadHistory,
|
|
355381
355826
|
addItem,
|
|
355382
355827
|
clearItems,
|
|
@@ -361552,9 +361997,6 @@ function useConsultationGenerator({
|
|
|
361552
361997
|
const lastPromptRef = (0, import_react127.useRef)(void 0);
|
|
361553
361998
|
const questionsGeneratedRef = (0, import_react127.useRef)(false);
|
|
361554
361999
|
(0, import_react127.useEffect)(() => {
|
|
361555
|
-
if (!isActive || consultationMode === "passive") {
|
|
361556
|
-
return;
|
|
361557
|
-
}
|
|
361558
362000
|
if (streamingState === "responding" /* Responding */ && currentPrompt && currentPrompt !== lastPromptRef.current && !questionsGeneratedRef.current) {
|
|
361559
362001
|
lastPromptRef.current = currentPrompt;
|
|
361560
362002
|
questionsGeneratedRef.current = true;
|
|
@@ -362271,6 +362713,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362271
362713
|
const { stdout } = use_stdout_default();
|
|
362272
362714
|
const { stats: sessionStats } = useSessionStats();
|
|
362273
362715
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
362716
|
+
const consultationContext = useConsultation();
|
|
362274
362717
|
const mainControlsRef = (0, import_react139.useRef)(null);
|
|
362275
362718
|
const originalTitleRef = (0, import_react139.useRef)(
|
|
362276
362719
|
computeWindowTitle(basename14(config.getTargetDir()))
|
|
@@ -362518,7 +362961,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362518
362961
|
setOSAMdFileCount,
|
|
362519
362962
|
slashCommandActions,
|
|
362520
362963
|
extensionsUpdateStateInternal,
|
|
362521
|
-
isConfigInitialized
|
|
362964
|
+
isConfigInitialized,
|
|
362965
|
+
// Consultation service for command context - always active
|
|
362966
|
+
{
|
|
362967
|
+
isActive: consultationContext.isActive,
|
|
362968
|
+
consultationMode: consultationContext.consultationMode,
|
|
362969
|
+
setConsultationMode: consultationContext.setConsultationMode,
|
|
362970
|
+
addQuestion: consultationContext.addQuestion,
|
|
362971
|
+
getContextForAgent: consultationContext.getContextForAgent,
|
|
362972
|
+
clearContext: consultationContext.clearContext,
|
|
362973
|
+
questionQueue: consultationContext.questionQueue
|
|
362974
|
+
}
|
|
362522
362975
|
);
|
|
362523
362976
|
const handleVisionSwitchRequired = (0, import_react139.useCallback)(
|
|
362524
362977
|
async (_query) => new Promise((resolve25, reject) => {
|
|
@@ -362757,17 +363210,25 @@ ${queuedText}` : queuedText;
|
|
|
362757
363210
|
]);
|
|
362758
363211
|
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react139.useState)(false);
|
|
362759
363212
|
const [currentIDE, setCurrentIDE] = (0, import_react139.useState)(null);
|
|
363213
|
+
const idePromptShownRef = (0, import_react139.useRef)(false);
|
|
362760
363214
|
(0, import_react139.useEffect)(() => {
|
|
362761
363215
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
362762
363216
|
const ideClient = await IdeClient.getInstance();
|
|
362763
363217
|
const currentIde = ideClient.getCurrentIde();
|
|
362764
|
-
|
|
363218
|
+
if (!idePromptShownRef.current) {
|
|
363219
|
+
setCurrentIDE(currentIde || null);
|
|
363220
|
+
}
|
|
362765
363221
|
}, "getIde");
|
|
362766
363222
|
getIde();
|
|
362767
363223
|
}, []);
|
|
362768
363224
|
const shouldShowIdePrompt = Boolean(
|
|
362769
|
-
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
363225
|
+
!idePromptShownRef.current && currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
362770
363226
|
);
|
|
363227
|
+
(0, import_react139.useEffect)(() => {
|
|
363228
|
+
if (shouldShowIdePrompt) {
|
|
363229
|
+
idePromptShownRef.current = true;
|
|
363230
|
+
}
|
|
363231
|
+
}, [shouldShowIdePrompt]);
|
|
362771
363232
|
const [showErrorDetails, setShowErrorDetails] = (0, import_react139.useState)(false);
|
|
362772
363233
|
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react139.useState)(false);
|
|
362773
363234
|
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react139.useState)(false);
|