osagent 0.2.78 → 0.2.80
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/README.md +24 -149
- package/cli.js +915 -521
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -54719,14 +54719,14 @@ var init_node = __esm({
|
|
|
54719
54719
|
Mode2["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
54720
54720
|
Mode2["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
54721
54721
|
})(Mode || (Mode = {}));
|
|
54722
|
-
(function(
|
|
54723
|
-
|
|
54724
|
-
|
|
54725
|
-
|
|
54726
|
-
|
|
54727
|
-
|
|
54728
|
-
|
|
54729
|
-
|
|
54722
|
+
(function(AuthType3) {
|
|
54723
|
+
AuthType3["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
|
|
54724
|
+
AuthType3["NO_AUTH"] = "NO_AUTH";
|
|
54725
|
+
AuthType3["API_KEY_AUTH"] = "API_KEY_AUTH";
|
|
54726
|
+
AuthType3["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
|
|
54727
|
+
AuthType3["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
|
|
54728
|
+
AuthType3["OAUTH"] = "OAUTH";
|
|
54729
|
+
AuthType3["OIDC_AUTH"] = "OIDC_AUTH";
|
|
54730
54730
|
})(AuthType2 || (AuthType2 = {}));
|
|
54731
54731
|
(function(ApiSpec2) {
|
|
54732
54732
|
ApiSpec2["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
@@ -61117,6 +61117,7 @@ var init_tool_error = __esm({
|
|
|
61117
61117
|
ToolErrorType2["WEB_FETCH_NO_URL_IN_PROMPT"] = "web_fetch_no_url_in_prompt";
|
|
61118
61118
|
ToolErrorType2["WEB_FETCH_FALLBACK_FAILED"] = "web_fetch_fallback_failed";
|
|
61119
61119
|
ToolErrorType2["WEB_FETCH_PROCESSING_ERROR"] = "web_fetch_processing_error";
|
|
61120
|
+
ToolErrorType2["SSRF_BLOCKED"] = "ssrf_blocked";
|
|
61120
61121
|
ToolErrorType2["WEB_SEARCH_FAILED"] = "web_search_failed";
|
|
61121
61122
|
})(ToolErrorType || (ToolErrorType = {}));
|
|
61122
61123
|
}
|
|
@@ -84451,16 +84452,16 @@ var require_error = __commonJS({
|
|
|
84451
84452
|
"use strict";
|
|
84452
84453
|
init_esbuild_shims();
|
|
84453
84454
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
84454
|
-
exports2.getErrorMessage =
|
|
84455
|
+
exports2.getErrorMessage = getErrorMessage3;
|
|
84455
84456
|
exports2.getErrorCode = getErrorCode;
|
|
84456
|
-
function
|
|
84457
|
+
function getErrorMessage3(error2) {
|
|
84457
84458
|
if (error2 instanceof Error) {
|
|
84458
84459
|
return error2.message;
|
|
84459
84460
|
} else {
|
|
84460
84461
|
return String(error2);
|
|
84461
84462
|
}
|
|
84462
84463
|
}
|
|
84463
|
-
__name(
|
|
84464
|
+
__name(getErrorMessage3, "getErrorMessage");
|
|
84464
84465
|
function getErrorCode(error2) {
|
|
84465
84466
|
if (typeof error2 === "object" && error2 !== null && "code" in error2 && typeof error2.code === "number") {
|
|
84466
84467
|
return error2.code;
|
|
@@ -133087,7 +133088,7 @@ var init_geminiContentGenerator = __esm({
|
|
|
133087
133088
|
}
|
|
133088
133089
|
models;
|
|
133089
133090
|
constructor(contentGeneratorConfig, config2) {
|
|
133090
|
-
const version3 = "0.2.
|
|
133091
|
+
const version3 = "0.2.80";
|
|
133091
133092
|
const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
|
|
133092
133093
|
let headers = {
|
|
133093
133094
|
"User-Agent": userAgent2
|
|
@@ -140790,7 +140791,7 @@ var init_credentialValidator = __esm({
|
|
|
140790
140791
|
DEFAULT_VALIDATION_TIMEOUT = 5e3;
|
|
140791
140792
|
PROVIDER_HELP_TEXT = {
|
|
140792
140793
|
[AuthType.USE_GROQ]: "Get your API key at: https://console.groq.com/keys\nSet it with: export GROQ_API_KEY=your_key",
|
|
140793
|
-
[AuthType.OLLAMA_CLOUD]: "Get your API key at: https://ollama.com/settings/keys\nSet it with: export OLLAMA_API_KEY=your_key\nCloud models use format: qwen3-coder:480b-cloud",
|
|
140794
|
+
[AuthType.OLLAMA_CLOUD]: "Get your API key at: https://ollama.com/settings/keys\nSet it with: export OLLAMA_API_KEY=your_key\nCloud models use format: qwen3-coder:480b-cloud or kimi-k2.5:cloud",
|
|
140794
140795
|
[AuthType.OLLAMA_LOCAL]: "Ensure Ollama is running with: ollama serve\nPull models with: ollama pull qwen3-coder",
|
|
140795
140796
|
[AuthType.USE_OPENAI]: "Verify your API key at your provider dashboard"
|
|
140796
140797
|
};
|
|
@@ -146845,9 +146846,7 @@ __export(openaiContentGenerator_exports, {
|
|
|
146845
146846
|
function createOpenAIContentGenerator(contentGeneratorConfig, cliConfig, options2) {
|
|
146846
146847
|
const provider = determineProvider(contentGeneratorConfig, cliConfig);
|
|
146847
146848
|
if (options2?.validateCredentials && provider.validateCredentials) {
|
|
146848
|
-
return provider.validateCredentials().then(() =>
|
|
146849
|
-
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
146850
|
-
});
|
|
146849
|
+
return provider.validateCredentials().then(() => new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider));
|
|
146851
146850
|
}
|
|
146852
146851
|
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
146853
146852
|
}
|
|
@@ -146884,14 +146883,296 @@ var init_openaiContentGenerator2 = __esm({
|
|
|
146884
146883
|
}
|
|
146885
146884
|
});
|
|
146886
146885
|
|
|
146886
|
+
// packages/core/dist/src/core/ollamaCloudContentGenerator/nativeOllamaCloudGenerator.js
|
|
146887
|
+
function createNativeOllamaCloudGenerator(contentGeneratorConfig, cliConfig) {
|
|
146888
|
+
return new NativeOllamaCloudGenerator(contentGeneratorConfig, cliConfig);
|
|
146889
|
+
}
|
|
146890
|
+
var OLLAMA_CLOUD_API_URL, NativeOllamaCloudGenerator;
|
|
146891
|
+
var init_nativeOllamaCloudGenerator = __esm({
|
|
146892
|
+
"packages/core/dist/src/core/ollamaCloudContentGenerator/nativeOllamaCloudGenerator.js"() {
|
|
146893
|
+
"use strict";
|
|
146894
|
+
init_esbuild_shims();
|
|
146895
|
+
init_request_tokenizer();
|
|
146896
|
+
init_uiTelemetry();
|
|
146897
|
+
init_converter();
|
|
146898
|
+
OLLAMA_CLOUD_API_URL = "https://ollama.com/api/chat";
|
|
146899
|
+
NativeOllamaCloudGenerator = class {
|
|
146900
|
+
static {
|
|
146901
|
+
__name(this, "NativeOllamaCloudGenerator");
|
|
146902
|
+
}
|
|
146903
|
+
apiKey;
|
|
146904
|
+
model;
|
|
146905
|
+
baseUrl;
|
|
146906
|
+
timeout;
|
|
146907
|
+
cliConfig;
|
|
146908
|
+
constructor(contentGeneratorConfig, cliConfig) {
|
|
146909
|
+
this.apiKey = contentGeneratorConfig.apiKey || "";
|
|
146910
|
+
this.model = contentGeneratorConfig.model || "qwen3-coder:480b-cloud";
|
|
146911
|
+
this.baseUrl = OLLAMA_CLOUD_API_URL;
|
|
146912
|
+
this.timeout = contentGeneratorConfig.timeout || 12e4;
|
|
146913
|
+
this.cliConfig = cliConfig;
|
|
146914
|
+
}
|
|
146915
|
+
/**
|
|
146916
|
+
* Build headers for Ollama Cloud API
|
|
146917
|
+
*/
|
|
146918
|
+
buildHeaders() {
|
|
146919
|
+
const version3 = this.cliConfig.getCliVersion() || "unknown";
|
|
146920
|
+
return {
|
|
146921
|
+
"Authorization": `Bearer ${this.apiKey}`,
|
|
146922
|
+
"Content-Type": "application/json",
|
|
146923
|
+
"User-Agent": `OSAgent/${version3} (${process.platform}; ${process.arch})`
|
|
146924
|
+
};
|
|
146925
|
+
}
|
|
146926
|
+
/**
|
|
146927
|
+
* Convert Gemini-format content to Ollama messages
|
|
146928
|
+
*/
|
|
146929
|
+
convertToOllamaMessages(contents) {
|
|
146930
|
+
const messages = [];
|
|
146931
|
+
for (const content of contents) {
|
|
146932
|
+
const role = content.role === "model" ? "assistant" : content.role;
|
|
146933
|
+
let textContent2 = "";
|
|
146934
|
+
const images = [];
|
|
146935
|
+
for (const part of content.parts || []) {
|
|
146936
|
+
if ("text" in part && part.text) {
|
|
146937
|
+
textContent2 += part.text;
|
|
146938
|
+
} else if ("inlineData" in part && part.inlineData?.data) {
|
|
146939
|
+
images.push(part.inlineData.data);
|
|
146940
|
+
}
|
|
146941
|
+
}
|
|
146942
|
+
if (textContent2 || images.length > 0) {
|
|
146943
|
+
const message2 = { role, content: textContent2 };
|
|
146944
|
+
if (images.length > 0) {
|
|
146945
|
+
message2.images = images;
|
|
146946
|
+
}
|
|
146947
|
+
messages.push(message2);
|
|
146948
|
+
}
|
|
146949
|
+
}
|
|
146950
|
+
return messages;
|
|
146951
|
+
}
|
|
146952
|
+
/**
|
|
146953
|
+
* Convert Ollama response to Gemini format
|
|
146954
|
+
*/
|
|
146955
|
+
convertToGeminiResponse(ollamaResponse) {
|
|
146956
|
+
const parts = [];
|
|
146957
|
+
if (ollamaResponse.message?.content) {
|
|
146958
|
+
parts.push({ text: ollamaResponse.message.content });
|
|
146959
|
+
}
|
|
146960
|
+
return {
|
|
146961
|
+
candidates: [
|
|
146962
|
+
{
|
|
146963
|
+
content: {
|
|
146964
|
+
role: "model",
|
|
146965
|
+
parts
|
|
146966
|
+
},
|
|
146967
|
+
finishReason: ollamaResponse.done ? "STOP" : void 0,
|
|
146968
|
+
index: 0
|
|
146969
|
+
}
|
|
146970
|
+
],
|
|
146971
|
+
usageMetadata: {
|
|
146972
|
+
promptTokenCount: ollamaResponse.prompt_eval_count,
|
|
146973
|
+
candidatesTokenCount: ollamaResponse.eval_count,
|
|
146974
|
+
totalTokenCount: (ollamaResponse.prompt_eval_count || 0) + (ollamaResponse.eval_count || 0)
|
|
146975
|
+
}
|
|
146976
|
+
};
|
|
146977
|
+
}
|
|
146978
|
+
/**
|
|
146979
|
+
* Generate content (non-streaming)
|
|
146980
|
+
*/
|
|
146981
|
+
async generateContent(request4, _userPromptId) {
|
|
146982
|
+
const normalizedContents = request4.contents ? toContents(request4.contents) : [];
|
|
146983
|
+
const messages = this.convertToOllamaMessages(normalizedContents);
|
|
146984
|
+
if (request4.config?.systemInstruction) {
|
|
146985
|
+
const systemParts = request4.config.systemInstruction.parts || [];
|
|
146986
|
+
const systemText = systemParts.map((p) => "text" in p ? p.text : "").join("");
|
|
146987
|
+
if (systemText) {
|
|
146988
|
+
messages.unshift({ role: "system", content: systemText });
|
|
146989
|
+
}
|
|
146990
|
+
}
|
|
146991
|
+
const ollamaRequest = {
|
|
146992
|
+
model: this.model,
|
|
146993
|
+
messages,
|
|
146994
|
+
stream: false,
|
|
146995
|
+
options: {
|
|
146996
|
+
temperature: request4.config?.temperature,
|
|
146997
|
+
top_p: request4.config?.topP,
|
|
146998
|
+
top_k: request4.config?.topK,
|
|
146999
|
+
num_predict: request4.config?.maxOutputTokens
|
|
147000
|
+
}
|
|
147001
|
+
};
|
|
147002
|
+
const controller = new AbortController();
|
|
147003
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
147004
|
+
try {
|
|
147005
|
+
const response = await fetch(this.baseUrl, {
|
|
147006
|
+
method: "POST",
|
|
147007
|
+
headers: this.buildHeaders(),
|
|
147008
|
+
body: JSON.stringify(ollamaRequest),
|
|
147009
|
+
signal: request4.config?.abortSignal || controller.signal
|
|
147010
|
+
});
|
|
147011
|
+
clearTimeout(timeoutId);
|
|
147012
|
+
if (!response.ok) {
|
|
147013
|
+
const errorText = await response.text();
|
|
147014
|
+
throw new Error(`Ollama Cloud API error ${response.status}: ${errorText}`);
|
|
147015
|
+
}
|
|
147016
|
+
const ollamaResponse = await response.json();
|
|
147017
|
+
const geminiResponse = this.convertToGeminiResponse(ollamaResponse);
|
|
147018
|
+
if (geminiResponse.usageMetadata?.promptTokenCount !== void 0) {
|
|
147019
|
+
uiTelemetryService.setLastPromptTokenCount(geminiResponse.usageMetadata.promptTokenCount);
|
|
147020
|
+
}
|
|
147021
|
+
return geminiResponse;
|
|
147022
|
+
} catch (error2) {
|
|
147023
|
+
clearTimeout(timeoutId);
|
|
147024
|
+
if (error2 instanceof Error && error2.name === "AbortError") {
|
|
147025
|
+
throw new Error("Request timed out");
|
|
147026
|
+
}
|
|
147027
|
+
throw error2;
|
|
147028
|
+
}
|
|
147029
|
+
}
|
|
147030
|
+
/**
|
|
147031
|
+
* Generate content with streaming
|
|
147032
|
+
*/
|
|
147033
|
+
async generateContentStream(request4, _userPromptId) {
|
|
147034
|
+
const normalizedContents = request4.contents ? toContents(request4.contents) : [];
|
|
147035
|
+
const messages = this.convertToOllamaMessages(normalizedContents);
|
|
147036
|
+
if (request4.config?.systemInstruction) {
|
|
147037
|
+
const systemParts = request4.config.systemInstruction.parts || [];
|
|
147038
|
+
const systemText = systemParts.map((p) => "text" in p ? p.text : "").join("");
|
|
147039
|
+
if (systemText) {
|
|
147040
|
+
messages.unshift({ role: "system", content: systemText });
|
|
147041
|
+
}
|
|
147042
|
+
}
|
|
147043
|
+
const ollamaRequest = {
|
|
147044
|
+
model: this.model,
|
|
147045
|
+
messages,
|
|
147046
|
+
stream: true,
|
|
147047
|
+
options: {
|
|
147048
|
+
temperature: request4.config?.temperature,
|
|
147049
|
+
top_p: request4.config?.topP,
|
|
147050
|
+
top_k: request4.config?.topK,
|
|
147051
|
+
num_predict: request4.config?.maxOutputTokens
|
|
147052
|
+
}
|
|
147053
|
+
};
|
|
147054
|
+
const response = await fetch(this.baseUrl, {
|
|
147055
|
+
method: "POST",
|
|
147056
|
+
headers: this.buildHeaders(),
|
|
147057
|
+
body: JSON.stringify(ollamaRequest),
|
|
147058
|
+
signal: request4.config?.abortSignal
|
|
147059
|
+
});
|
|
147060
|
+
if (!response.ok) {
|
|
147061
|
+
const errorText = await response.text();
|
|
147062
|
+
throw new Error(`Ollama Cloud API error ${response.status}: ${errorText}`);
|
|
147063
|
+
}
|
|
147064
|
+
if (!response.body) {
|
|
147065
|
+
throw new Error("No response body for streaming");
|
|
147066
|
+
}
|
|
147067
|
+
return async function* () {
|
|
147068
|
+
const reader = response.body.getReader();
|
|
147069
|
+
const decoder2 = new TextDecoder();
|
|
147070
|
+
let buffer = "";
|
|
147071
|
+
try {
|
|
147072
|
+
while (true) {
|
|
147073
|
+
const { done, value } = await reader.read();
|
|
147074
|
+
if (done)
|
|
147075
|
+
break;
|
|
147076
|
+
buffer += decoder2.decode(value, { stream: true });
|
|
147077
|
+
const lines = buffer.split("\n");
|
|
147078
|
+
buffer = lines.pop() || "";
|
|
147079
|
+
for (const line of lines) {
|
|
147080
|
+
if (!line.trim())
|
|
147081
|
+
continue;
|
|
147082
|
+
try {
|
|
147083
|
+
const chunk = JSON.parse(line);
|
|
147084
|
+
const parts = [];
|
|
147085
|
+
if (chunk.message?.content) {
|
|
147086
|
+
parts.push({ text: chunk.message.content });
|
|
147087
|
+
}
|
|
147088
|
+
const geminiChunk = {
|
|
147089
|
+
candidates: [
|
|
147090
|
+
{
|
|
147091
|
+
content: {
|
|
147092
|
+
role: "model",
|
|
147093
|
+
parts
|
|
147094
|
+
},
|
|
147095
|
+
finishReason: chunk.done ? "STOP" : void 0,
|
|
147096
|
+
index: 0
|
|
147097
|
+
}
|
|
147098
|
+
],
|
|
147099
|
+
usageMetadata: chunk.done ? {
|
|
147100
|
+
promptTokenCount: chunk.prompt_eval_count,
|
|
147101
|
+
candidatesTokenCount: chunk.eval_count,
|
|
147102
|
+
totalTokenCount: (chunk.prompt_eval_count || 0) + (chunk.eval_count || 0)
|
|
147103
|
+
} : void 0
|
|
147104
|
+
};
|
|
147105
|
+
if (chunk.done && chunk.prompt_eval_count !== void 0) {
|
|
147106
|
+
uiTelemetryService.setLastPromptTokenCount(chunk.prompt_eval_count);
|
|
147107
|
+
}
|
|
147108
|
+
yield geminiChunk;
|
|
147109
|
+
} catch {
|
|
147110
|
+
continue;
|
|
147111
|
+
}
|
|
147112
|
+
}
|
|
147113
|
+
}
|
|
147114
|
+
if (buffer.trim()) {
|
|
147115
|
+
try {
|
|
147116
|
+
const chunk = JSON.parse(buffer);
|
|
147117
|
+
const parts = [];
|
|
147118
|
+
if (chunk.message?.content) {
|
|
147119
|
+
parts.push({ text: chunk.message.content });
|
|
147120
|
+
}
|
|
147121
|
+
yield {
|
|
147122
|
+
candidates: [
|
|
147123
|
+
{
|
|
147124
|
+
content: {
|
|
147125
|
+
role: "model",
|
|
147126
|
+
parts
|
|
147127
|
+
},
|
|
147128
|
+
finishReason: chunk.done ? "STOP" : void 0,
|
|
147129
|
+
index: 0
|
|
147130
|
+
}
|
|
147131
|
+
]
|
|
147132
|
+
};
|
|
147133
|
+
} catch {
|
|
147134
|
+
}
|
|
147135
|
+
}
|
|
147136
|
+
} finally {
|
|
147137
|
+
reader.releaseLock();
|
|
147138
|
+
}
|
|
147139
|
+
}();
|
|
147140
|
+
}
|
|
147141
|
+
/**
|
|
147142
|
+
* Count tokens in request
|
|
147143
|
+
*/
|
|
147144
|
+
async countTokens(request4) {
|
|
147145
|
+
try {
|
|
147146
|
+
const tokenizer = getDefaultTokenizer();
|
|
147147
|
+
const result = await tokenizer.calculateTokens(request4, {
|
|
147148
|
+
textEncoding: "cl100k_base"
|
|
147149
|
+
});
|
|
147150
|
+
return { totalTokens: result.totalTokens };
|
|
147151
|
+
} catch {
|
|
147152
|
+
const content = JSON.stringify(request4.contents);
|
|
147153
|
+
return { totalTokens: Math.ceil(content.length / 4) };
|
|
147154
|
+
}
|
|
147155
|
+
}
|
|
147156
|
+
/**
|
|
147157
|
+
* Embed content (not supported by Ollama Cloud chat API)
|
|
147158
|
+
*/
|
|
147159
|
+
async embedContent(_request) {
|
|
147160
|
+
throw new Error("Embedding not supported by Ollama Cloud chat API");
|
|
147161
|
+
}
|
|
147162
|
+
};
|
|
147163
|
+
__name(createNativeOllamaCloudGenerator, "createNativeOllamaCloudGenerator");
|
|
147164
|
+
}
|
|
147165
|
+
});
|
|
147166
|
+
|
|
146887
147167
|
// packages/core/dist/src/core/ollamaCloudContentGenerator/constants.js
|
|
146888
|
-
var OLLAMA_CLOUD_BASE_URL, DEFAULT_OLLAMA_CLOUD_MODEL, DEFAULT_TIMEOUT4, DEFAULT_MAX_RETRIES4;
|
|
147168
|
+
var OLLAMA_CLOUD_BASE_URL, OLLAMA_CLOUD_CHAT_URL, DEFAULT_OLLAMA_CLOUD_MODEL, DEFAULT_TIMEOUT4, DEFAULT_MAX_RETRIES4;
|
|
146889
147169
|
var init_constants7 = __esm({
|
|
146890
147170
|
"packages/core/dist/src/core/ollamaCloudContentGenerator/constants.js"() {
|
|
146891
147171
|
"use strict";
|
|
146892
147172
|
init_esbuild_shims();
|
|
146893
|
-
OLLAMA_CLOUD_BASE_URL = "https://ollama.com
|
|
146894
|
-
|
|
147173
|
+
OLLAMA_CLOUD_BASE_URL = "https://ollama.com";
|
|
147174
|
+
OLLAMA_CLOUD_CHAT_URL = "https://ollama.com/api/chat";
|
|
147175
|
+
DEFAULT_OLLAMA_CLOUD_MODEL = "qwen3-coder:480b-cloud";
|
|
146895
147176
|
DEFAULT_TIMEOUT4 = 12e4;
|
|
146896
147177
|
DEFAULT_MAX_RETRIES4 = 3;
|
|
146897
147178
|
}
|
|
@@ -146965,31 +147246,37 @@ __export(ollamaCloudContentGenerator_exports, {
|
|
|
146965
147246
|
DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES4,
|
|
146966
147247
|
DEFAULT_OLLAMA_CLOUD_MODEL: () => DEFAULT_OLLAMA_CLOUD_MODEL,
|
|
146967
147248
|
DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT4,
|
|
147249
|
+
NativeOllamaCloudGenerator: () => NativeOllamaCloudGenerator,
|
|
146968
147250
|
OLLAMA_CLOUD_BASE_URL: () => OLLAMA_CLOUD_BASE_URL,
|
|
147251
|
+
OLLAMA_CLOUD_CHAT_URL: () => OLLAMA_CLOUD_CHAT_URL,
|
|
146969
147252
|
OllamaCloudProvider: () => OllamaCloudProvider,
|
|
147253
|
+
createNativeOllamaCloudGenerator: () => createNativeOllamaCloudGenerator,
|
|
146970
147254
|
createOllamaCloudContentGenerator: () => createOllamaCloudContentGenerator,
|
|
146971
147255
|
isOllamaCloudConfig: () => isOllamaCloudConfig
|
|
146972
147256
|
});
|
|
146973
147257
|
function createOllamaCloudContentGenerator(contentGeneratorConfig, cliConfig, options2) {
|
|
146974
|
-
const
|
|
147258
|
+
const apiKey = contentGeneratorConfig.apiKey;
|
|
146975
147259
|
if (options2?.validateCredentials) {
|
|
146976
|
-
|
|
146977
|
-
return new
|
|
146978
|
-
}
|
|
147260
|
+
if (!apiKey) {
|
|
147261
|
+
return Promise.reject(new Error("Ollama Cloud API key is required"));
|
|
147262
|
+
}
|
|
147263
|
+
return validateOllamaCloudCredentials(apiKey).then(() => createNativeOllamaCloudGenerator(contentGeneratorConfig, cliConfig));
|
|
146979
147264
|
}
|
|
146980
|
-
return
|
|
147265
|
+
return createNativeOllamaCloudGenerator(contentGeneratorConfig, cliConfig);
|
|
146981
147266
|
}
|
|
146982
147267
|
function isOllamaCloudConfig(config2) {
|
|
146983
|
-
|
|
147268
|
+
const baseUrl = config2.baseUrl?.toLowerCase() || "";
|
|
147269
|
+
return baseUrl.includes("ollama.com");
|
|
146984
147270
|
}
|
|
146985
147271
|
var init_ollamaCloudContentGenerator = __esm({
|
|
146986
147272
|
"packages/core/dist/src/core/ollamaCloudContentGenerator/index.js"() {
|
|
146987
147273
|
"use strict";
|
|
146988
147274
|
init_esbuild_shims();
|
|
146989
|
-
|
|
146990
|
-
|
|
147275
|
+
init_nativeOllamaCloudGenerator();
|
|
147276
|
+
init_credentialValidator();
|
|
146991
147277
|
init_ollamaCloudProvider();
|
|
146992
147278
|
init_constants7();
|
|
147279
|
+
init_nativeOllamaCloudGenerator();
|
|
146993
147280
|
__name(createOllamaCloudContentGenerator, "createOllamaCloudContentGenerator");
|
|
146994
147281
|
__name(isOllamaCloudConfig, "isOllamaCloudConfig");
|
|
146995
147282
|
}
|
|
@@ -147159,9 +147446,7 @@ __export(ollamaLocalContentGenerator_exports, {
|
|
|
147159
147446
|
function createOllamaLocalContentGenerator(contentGeneratorConfig, cliConfig, options2) {
|
|
147160
147447
|
const provider = new OllamaLocalProvider(contentGeneratorConfig, cliConfig);
|
|
147161
147448
|
if (options2?.validateCredentials) {
|
|
147162
|
-
return provider.validateCredentials().then(() =>
|
|
147163
|
-
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
147164
|
-
});
|
|
147449
|
+
return provider.validateCredentials().then(() => new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider));
|
|
147165
147450
|
}
|
|
147166
147451
|
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
147167
147452
|
}
|
|
@@ -147285,9 +147570,7 @@ __export(groqContentGenerator_exports, {
|
|
|
147285
147570
|
function createGroqContentGenerator(contentGeneratorConfig, cliConfig, options2) {
|
|
147286
147571
|
const provider = new GroqProvider(contentGeneratorConfig, cliConfig);
|
|
147287
147572
|
if (options2?.validateCredentials) {
|
|
147288
|
-
return provider.validateCredentials().then(() =>
|
|
147289
|
-
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
147290
|
-
});
|
|
147573
|
+
return provider.validateCredentials().then(() => new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider));
|
|
147291
147574
|
}
|
|
147292
147575
|
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
147293
147576
|
}
|
|
@@ -152866,9 +153149,7 @@ __export(anthropicContentGenerator_exports, {
|
|
|
152866
153149
|
function createAnthropicContentGenerator(contentGeneratorConfig, cliConfig, options2) {
|
|
152867
153150
|
const provider = new AnthropicProvider(contentGeneratorConfig, cliConfig);
|
|
152868
153151
|
if (options2?.validateCredentials) {
|
|
152869
|
-
return provider.validateCredentials().then(() =>
|
|
152870
|
-
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
152871
|
-
});
|
|
153152
|
+
return provider.validateCredentials().then(() => new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider));
|
|
152872
153153
|
}
|
|
152873
153154
|
return new OpenAIContentGenerator(contentGeneratorConfig, cliConfig, provider);
|
|
152874
153155
|
}
|
|
@@ -152955,8 +153236,8 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
|
|
|
152955
153236
|
return {
|
|
152956
153237
|
...baseConfig,
|
|
152957
153238
|
model: ollamaModel,
|
|
152958
|
-
// Ollama Cloud uses
|
|
152959
|
-
baseUrl: "https://ollama.com
|
|
153239
|
+
// Ollama Cloud uses native API at /api/chat endpoint
|
|
153240
|
+
baseUrl: "https://ollama.com",
|
|
152960
153241
|
apiKey: ollamaApiKey,
|
|
152961
153242
|
authType: AuthType.OLLAMA_CLOUD,
|
|
152962
153243
|
// Ollama doesn't need special cache control handling
|
|
@@ -153007,7 +153288,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
|
|
|
153007
153288
|
};
|
|
153008
153289
|
}
|
|
153009
153290
|
async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
|
|
153010
|
-
const version3 = "0.2.
|
|
153291
|
+
const version3 = "0.2.80";
|
|
153011
153292
|
const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
|
|
153012
153293
|
const baseHeaders = {
|
|
153013
153294
|
"User-Agent": userAgent2
|
|
@@ -153075,16 +153356,16 @@ var init_contentGenerator = __esm({
|
|
|
153075
153356
|
init_models();
|
|
153076
153357
|
init_loggingContentGenerator2();
|
|
153077
153358
|
__name(getEffectiveOllamaUrl2, "getEffectiveOllamaUrl");
|
|
153078
|
-
(function(
|
|
153079
|
-
|
|
153080
|
-
|
|
153081
|
-
|
|
153082
|
-
|
|
153083
|
-
|
|
153084
|
-
|
|
153085
|
-
|
|
153086
|
-
|
|
153087
|
-
|
|
153359
|
+
(function(AuthType3) {
|
|
153360
|
+
AuthType3["LOGIN_WITH_OSAGENT"] = "oauth-personal";
|
|
153361
|
+
AuthType3["USE_OSA"] = "OSA-api-key";
|
|
153362
|
+
AuthType3["USE_VERTEX_AI"] = "vertex-ai";
|
|
153363
|
+
AuthType3["CLOUD_SHELL"] = "cloud-shell";
|
|
153364
|
+
AuthType3["USE_OPENAI"] = "openai";
|
|
153365
|
+
AuthType3["OLLAMA_CLOUD"] = "ollama-cloud";
|
|
153366
|
+
AuthType3["OLLAMA_LOCAL"] = "ollama-local";
|
|
153367
|
+
AuthType3["USE_GROQ"] = "groq";
|
|
153368
|
+
AuthType3["USE_ANTHROPIC"] = "anthropic";
|
|
153088
153369
|
})(AuthType || (AuthType = {}));
|
|
153089
153370
|
__name(createCleanConfigBase, "createCleanConfigBase");
|
|
153090
153371
|
__name(isModelFromDifferentProvider, "isModelFromDifferentProvider");
|
|
@@ -189777,14 +190058,14 @@ var require_react_reconciler_production = __commonJS({
|
|
|
189777
190058
|
__name(markRetryLaneIfNotHydrated, "markRetryLaneIfNotHydrated");
|
|
189778
190059
|
var exports3 = {};
|
|
189779
190060
|
"use strict";
|
|
189780
|
-
var
|
|
190061
|
+
var React29 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
189781
190062
|
Symbol.for("react.scope");
|
|
189782
190063
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
189783
190064
|
Symbol.for("react.legacy_hidden");
|
|
189784
190065
|
Symbol.for("react.tracing_marker");
|
|
189785
190066
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
189786
190067
|
Symbol.for("react.view_transition");
|
|
189787
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
190068
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React29.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance2 = $$$config.createInstance;
|
|
189788
190069
|
$$$config.cloneMutableInstance;
|
|
189789
190070
|
var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
|
|
189790
190071
|
$$$config.cloneMutableTextInstance;
|
|
@@ -201000,14 +201281,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
201000
201281
|
__name(getLaneLabelMap, "getLaneLabelMap");
|
|
201001
201282
|
var exports3 = {};
|
|
201002
201283
|
"use strict";
|
|
201003
|
-
var
|
|
201284
|
+
var React29 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
201004
201285
|
Symbol.for("react.scope");
|
|
201005
201286
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
201006
201287
|
Symbol.for("react.legacy_hidden");
|
|
201007
201288
|
Symbol.for("react.tracing_marker");
|
|
201008
201289
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
201009
201290
|
Symbol.for("react.view_transition");
|
|
201010
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
201291
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React29.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance2 = $$$config.createInstance;
|
|
201011
201292
|
$$$config.cloneMutableInstance;
|
|
201012
201293
|
var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
|
|
201013
201294
|
$$$config.cloneMutableTextInstance;
|
|
@@ -236537,20 +236818,20 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
236537
236818
|
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
|
236538
236819
|
}
|
|
236539
236820
|
__name(validateChildKeys, "validateChildKeys");
|
|
236540
|
-
var
|
|
236821
|
+
var React29 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
236541
236822
|
Symbol.for("react.provider");
|
|
236542
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals =
|
|
236823
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React29.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty2 = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
236543
236824
|
return null;
|
|
236544
236825
|
};
|
|
236545
|
-
|
|
236826
|
+
React29 = {
|
|
236546
236827
|
"react-stack-bottom-frame": /* @__PURE__ */ __name(function(callStackForError) {
|
|
236547
236828
|
return callStackForError();
|
|
236548
236829
|
}, "react-stack-bottom-frame")
|
|
236549
236830
|
};
|
|
236550
236831
|
var specialPropKeyWarningShown;
|
|
236551
236832
|
var didWarnAboutElementRef = {};
|
|
236552
|
-
var unknownOwnerDebugStack =
|
|
236553
|
-
|
|
236833
|
+
var unknownOwnerDebugStack = React29["react-stack-bottom-frame"].bind(
|
|
236834
|
+
React29,
|
|
236554
236835
|
UnknownOwner
|
|
236555
236836
|
)();
|
|
236556
236837
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -251987,62 +252268,10 @@ I've found some existing telemetry code. Let me mark the first todo as in_progre
|
|
|
251987
252268
|
|
|
251988
252269
|
# Primary Workflows
|
|
251989
252270
|
|
|
251990
|
-
## CRITICAL: Project Context Discovery (Do This FIRST)
|
|
251991
|
-
|
|
251992
|
-
**BEFORE doing ANY work on a project, you MUST check for project context:**
|
|
251993
|
-
|
|
251994
|
-
1. **Check for OSAGENT.md:** Use '${ToolNames.READ_FILE}' to check if \`OSAGENT.md\` exists in the project root directory. This file contains critical project-specific instructions, conventions, and context that you MUST follow.
|
|
251995
|
-
|
|
251996
|
-
2. **If OSAGENT.md exists:** Read it completely and follow ALL instructions within it. This file takes precedence over default behaviors. It may contain:
|
|
251997
|
-
- Project architecture and structure
|
|
251998
|
-
- Coding conventions and patterns to follow
|
|
251999
|
-
- Files and directories that should not be modified
|
|
252000
|
-
- Specific workflows or approval requirements
|
|
252001
|
-
- Technology stack details
|
|
252002
|
-
- Testing and build commands
|
|
252003
|
-
|
|
252004
|
-
3. **If OSAGENT.md does not exist:** Ask the user if you should create it, then initialize:
|
|
252005
|
-
- First, explore the project (package.json, README, src/) to understand it
|
|
252006
|
-
- Ask: "I don't see an OSAGENT.md file. Would you like me to create one to track project context?"
|
|
252007
|
-
- If yes, use '${ToolNames.WRITE_FILE}' to create \`OSAGENT.md\` with this template:
|
|
252008
|
-
\`\`\`markdown
|
|
252009
|
-
# Project: [Name from package.json or folder]
|
|
252010
|
-
|
|
252011
|
-
## Description
|
|
252012
|
-
[Brief description of what this project does]
|
|
252013
|
-
|
|
252014
|
-
## Tech Stack
|
|
252015
|
-
- [Framework/language]
|
|
252016
|
-
- [Key dependencies]
|
|
252017
|
-
|
|
252018
|
-
## Project Structure
|
|
252019
|
-
- [Key directories and their purpose]
|
|
252020
|
-
|
|
252021
|
-
## Conventions
|
|
252022
|
-
- [Coding patterns to follow]
|
|
252023
|
-
- [Naming conventions]
|
|
252024
|
-
|
|
252025
|
-
## Commands
|
|
252026
|
-
- Build: \`[command]\`
|
|
252027
|
-
- Test: \`[command]\`
|
|
252028
|
-
- Dev: \`[command]\`
|
|
252029
|
-
|
|
252030
|
-
## Important Notes
|
|
252031
|
-
- [Any restrictions or guidelines]
|
|
252032
|
-
\`\`\`
|
|
252033
|
-
- NEVER overwrite an existing OSAGENT.md - only create if truly missing
|
|
252034
|
-
|
|
252035
|
-
4. **Also check for .osagent/ directory:** If it doesn't exist and user approved OSAGENT.md creation:
|
|
252036
|
-
- Use '${ToolNames.SHELL}' to run \`mkdir -p .osagent\`
|
|
252037
|
-
- This directory stores project-specific configuration
|
|
252038
|
-
- You can create \`.osagent/settings.json\` for tool-specific settings if needed
|
|
252039
|
-
|
|
252040
|
-
**This step is NON-NEGOTIABLE. Do NOT skip it even for simple requests like "hello world". The project context file may contain critical information about what is and isn't allowed.**
|
|
252041
|
-
|
|
252042
252271
|
## Software Engineering Tasks
|
|
252043
252272
|
When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this iterative approach:
|
|
252044
252273
|
- **Plan:** After understanding the user's request, create an initial plan based on your existing knowledge and any immediately obvious context. Use the '${ToolNames.TODO_WRITE}' tool to capture this rough plan for complex or multi-step work. Don't wait for complete understanding - start with what you know.
|
|
252045
|
-
- **Check Context:**
|
|
252274
|
+
- **Check Context:** If an OSAGENT.md file exists in the project root, it has been loaded into context. Follow any project-specific instructions it contains.
|
|
252046
252275
|
- **Implement:** Begin implementing the plan while gathering additional context as needed. Use '${ToolNames.GREP}', '${ToolNames.GLOB}', '${ToolNames.READ_FILE}', and '${ToolNames.READ_MANY_FILES}' tools strategically when you encounter specific unknowns during implementation. Use the available tools (e.g., '${ToolNames.EDIT}', '${ToolNames.WRITE_FILE}' '${ToolNames.SHELL}' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core Mandates').
|
|
252047
252276
|
- **Adapt:** As you discover new information or encounter obstacles, update your plan and todos accordingly. Mark todos as in_progress when starting and completed when finishing each task. Add new todos if the scope expands. Refine your approach based on what you learn.
|
|
252048
252277
|
- **Verify (Tests):** If applicable and feasible, verify the changes using the project's testing procedures. Identify the correct test commands and frameworks by examining 'README' files, build/package configuration (e.g., 'package.json'), or existing test execution patterns. NEVER assume standard test commands.
|
|
@@ -254566,11 +254795,14 @@ ${result.output}`;
|
|
|
254566
254795
|
if (!gitCommitPattern.test(command2.trim())) {
|
|
254567
254796
|
return command2;
|
|
254568
254797
|
}
|
|
254569
|
-
const sanitizeName = /* @__PURE__ */ __name((name3) =>
|
|
254570
|
-
|
|
254571
|
-
|
|
254798
|
+
const sanitizeName = /* @__PURE__ */ __name((name3) => (
|
|
254799
|
+
// Whitelist approach: only allow alphanumeric, spaces, and safe name chars
|
|
254800
|
+
name3.replace(/[^a-zA-Z0-9\s\-'.]/g, "").trim().slice(0, 100)
|
|
254801
|
+
), "sanitizeName");
|
|
254572
254802
|
const sanitizeEmail = /* @__PURE__ */ __name((email2) => {
|
|
254573
|
-
|
|
254803
|
+
const emailRegex2 = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
254804
|
+
const sanitized = email2.trim().toLowerCase();
|
|
254805
|
+
return emailRegex2.test(sanitized) ? sanitized.slice(0, 254) : "";
|
|
254574
254806
|
}, "sanitizeEmail");
|
|
254575
254807
|
const safeName = sanitizeName(gitCoAuthorSettings.name ?? "");
|
|
254576
254808
|
const safeEmail = sanitizeEmail(gitCoAuthorSettings.email ?? "");
|
|
@@ -288275,13 +288507,13 @@ var RoadmapToolInvocation = class extends BaseToolInvocation {
|
|
|
288275
288507
|
}
|
|
288276
288508
|
const formatItem = /* @__PURE__ */ __name((item, indent = 0) => {
|
|
288277
288509
|
const prefix = " ".repeat(indent);
|
|
288278
|
-
const
|
|
288510
|
+
const statusIcon3 = {
|
|
288279
288511
|
planned: "[ ]",
|
|
288280
288512
|
in_progress: "[>>]",
|
|
288281
288513
|
completed: "[OK]",
|
|
288282
288514
|
blocked: "[XX]"
|
|
288283
288515
|
}[item.status];
|
|
288284
|
-
let line = `${prefix}${
|
|
288516
|
+
let line = `${prefix}${statusIcon3} [${item.id}] ${item.title} (P${item.priority})`;
|
|
288285
288517
|
if (item.assignedAgent) {
|
|
288286
288518
|
line += ` @${item.assignedAgent}`;
|
|
288287
288519
|
}
|
|
@@ -290155,6 +290387,21 @@ function getTodoFilePath(sessionId2) {
|
|
|
290155
290387
|
return path42.join(todoDir, filename);
|
|
290156
290388
|
}
|
|
290157
290389
|
__name(getTodoFilePath, "getTodoFilePath");
|
|
290390
|
+
async function readTodosFromFile(sessionId2) {
|
|
290391
|
+
try {
|
|
290392
|
+
const todoFilePath = getTodoFilePath(sessionId2);
|
|
290393
|
+
const content = await fs36.readFile(todoFilePath, "utf-8");
|
|
290394
|
+
const data = JSON.parse(content);
|
|
290395
|
+
return Array.isArray(data.todos) ? data.todos : [];
|
|
290396
|
+
} catch (err) {
|
|
290397
|
+
const error2 = err;
|
|
290398
|
+
if (!(error2 instanceof Error) || error2.code !== "ENOENT") {
|
|
290399
|
+
throw err;
|
|
290400
|
+
}
|
|
290401
|
+
return [];
|
|
290402
|
+
}
|
|
290403
|
+
}
|
|
290404
|
+
__name(readTodosFromFile, "readTodosFromFile");
|
|
290158
290405
|
async function writeTodosToFile(todos, sessionId2) {
|
|
290159
290406
|
const todoFilePath = getTodoFilePath(sessionId2);
|
|
290160
290407
|
const todoDir = path42.dirname(todoFilePath);
|
|
@@ -290235,6 +290482,10 @@ Todo list modification failed with error: ${errorMessage}. You may need to retry
|
|
|
290235
290482
|
}
|
|
290236
290483
|
}
|
|
290237
290484
|
};
|
|
290485
|
+
async function readTodosForSession(sessionId2) {
|
|
290486
|
+
return readTodosFromFile(sessionId2);
|
|
290487
|
+
}
|
|
290488
|
+
__name(readTodosForSession, "readTodosForSession");
|
|
290238
290489
|
var TodoWriteTool = class _TodoWriteTool extends BaseDeclarativeTool {
|
|
290239
290490
|
static {
|
|
290240
290491
|
__name(this, "TodoWriteTool");
|
|
@@ -293019,7 +293270,12 @@ var ToolRegistry = class {
|
|
|
293019
293270
|
});
|
|
293020
293271
|
});
|
|
293021
293272
|
const functions = [];
|
|
293022
|
-
|
|
293273
|
+
let discoveredItems;
|
|
293274
|
+
try {
|
|
293275
|
+
discoveredItems = JSON.parse(stdout.trim());
|
|
293276
|
+
} catch (parseError) {
|
|
293277
|
+
throw new Error(`Tool discovery command returned invalid JSON: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
293278
|
+
}
|
|
293023
293279
|
if (!discoveredItems || !Array.isArray(discoveredItems)) {
|
|
293024
293280
|
throw new Error("Tool discovery command did not return a JSON array of tools.");
|
|
293025
293281
|
}
|
|
@@ -298513,10 +298769,17 @@ ${textContent2}
|
|
|
298513
298769
|
async execute(signal) {
|
|
298514
298770
|
const isPrivate = isPrivateIp(this.params.url);
|
|
298515
298771
|
if (isPrivate) {
|
|
298516
|
-
console.
|
|
298517
|
-
|
|
298518
|
-
|
|
298772
|
+
console.warn(`[WebFetchTool] Blocked fetch to private IP: ${this.params.url}`);
|
|
298773
|
+
return {
|
|
298774
|
+
llmContent: `Error: Cannot fetch from private IP addresses. The URL ${this.params.url} points to a private/internal network address.`,
|
|
298775
|
+
returnDisplay: `Error: Cannot fetch from private IP addresses.`,
|
|
298776
|
+
error: {
|
|
298777
|
+
message: `SSRF protection: blocked fetch to private IP ${this.params.url}`,
|
|
298778
|
+
type: ToolErrorType.SSRF_BLOCKED
|
|
298779
|
+
}
|
|
298780
|
+
};
|
|
298519
298781
|
}
|
|
298782
|
+
console.debug(`[WebFetchTool] Public URL detected for ${this.params.url}, using direct fetch`);
|
|
298520
298783
|
return this.executeDirectFetch(signal);
|
|
298521
298784
|
}
|
|
298522
298785
|
};
|
|
@@ -314484,7 +314747,7 @@ var AgentRegistry = class {
|
|
|
314484
314747
|
/**
|
|
314485
314748
|
* Update agent statistics
|
|
314486
314749
|
*/
|
|
314487
|
-
updateAgentStats(agentId, success,
|
|
314750
|
+
updateAgentStats(agentId, success, _duration) {
|
|
314488
314751
|
const agent = this.agents.get(agentId);
|
|
314489
314752
|
if (!agent)
|
|
314490
314753
|
return;
|
|
@@ -316547,7 +316810,7 @@ var DynamicAgentFactory = class {
|
|
|
316547
316810
|
${techStack.map((tech, i) => `${i + 1}. ${tech}`).join("\n")}
|
|
316548
316811
|
|
|
316549
316812
|
Project patterns and conventions:
|
|
316550
|
-
${patterns.map((pattern,
|
|
316813
|
+
${patterns.map((pattern, _i) => `- ${pattern}`).join("\n")}
|
|
316551
316814
|
|
|
316552
316815
|
You have deep knowledge of this project's codebase, architecture, and conventions.
|
|
316553
316816
|
Always follow the established patterns when making changes.`;
|
|
@@ -316560,7 +316823,10 @@ Always follow the established patterns when making changes.`;
|
|
|
316560
316823
|
capabilities: [
|
|
316561
316824
|
{
|
|
316562
316825
|
name: `${projectName.toLowerCase()}-specialist`,
|
|
316563
|
-
keywords: [
|
|
316826
|
+
keywords: [
|
|
316827
|
+
projectName.toLowerCase(),
|
|
316828
|
+
...techStack.map((t3) => t3.toLowerCase())
|
|
316829
|
+
],
|
|
316564
316830
|
confidence: 0.95
|
|
316565
316831
|
}
|
|
316566
316832
|
],
|
|
@@ -316758,7 +317024,10 @@ var DynamicSkillFactory = class {
|
|
|
316758
317024
|
name: name3,
|
|
316759
317025
|
description,
|
|
316760
317026
|
triggerKeywords,
|
|
316761
|
-
steps: steps.map((s2) => ({
|
|
317027
|
+
steps: steps.map((s2) => ({
|
|
317028
|
+
...s2,
|
|
317029
|
+
description: s2.prompt.slice(0, 100)
|
|
317030
|
+
}))
|
|
316762
317031
|
}, createdBy);
|
|
316763
317032
|
}
|
|
316764
317033
|
/**
|
|
@@ -316789,11 +317058,13 @@ var DynamicSkillFactory = class {
|
|
|
316789
317058
|
name: `${workflowName.toLowerCase().replace(/\s+/g, "-")}-verification`,
|
|
316790
317059
|
displayName: `${workflowName} Verification`,
|
|
316791
317060
|
description: `Verification workflow for ${workflowName}`,
|
|
316792
|
-
triggers: [
|
|
316793
|
-
|
|
316794
|
-
|
|
316795
|
-
|
|
316796
|
-
|
|
317061
|
+
triggers: [
|
|
317062
|
+
{
|
|
317063
|
+
type: "manual",
|
|
317064
|
+
patterns: [],
|
|
317065
|
+
confidence: 1
|
|
317066
|
+
}
|
|
317067
|
+
],
|
|
316797
317068
|
steps,
|
|
316798
317069
|
priority: 90,
|
|
316799
317070
|
enabled: true,
|
|
@@ -316994,11 +317265,11 @@ var ResponseFormatter = class {
|
|
|
316994
317265
|
* Format verification section
|
|
316995
317266
|
*/
|
|
316996
317267
|
formatVerification(verification) {
|
|
316997
|
-
const
|
|
317268
|
+
const statusIcon3 = verification.passed ? "\u2705" : "\u274C";
|
|
316998
317269
|
const passedCount = verification.checks.filter((c3) => c3.passed).length;
|
|
316999
317270
|
const totalCount = verification.checks.length;
|
|
317000
317271
|
let output = `\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
|
|
317001
|
-
\u2502 ${
|
|
317272
|
+
\u2502 ${statusIcon3} VERIFICATION \u2502
|
|
317002
317273
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524`;
|
|
317003
317274
|
for (const check2 of verification.checks) {
|
|
317004
317275
|
const checkIcon = check2.passed ? "\u2611" : "\u2610";
|
|
@@ -317219,7 +317490,7 @@ var VerificationRunner = class {
|
|
|
317219
317490
|
/**
|
|
317220
317491
|
* Run pattern match check
|
|
317221
317492
|
*/
|
|
317222
|
-
async runPatternMatchCheck(name3,
|
|
317493
|
+
async runPatternMatchCheck(name3, _pattern) {
|
|
317223
317494
|
return {
|
|
317224
317495
|
name: name3,
|
|
317225
317496
|
passed: true,
|
|
@@ -327177,13 +327448,6 @@ import * as os23 from "node:os";
|
|
|
327177
327448
|
|
|
327178
327449
|
// packages/cli/src/utils/errors.ts
|
|
327179
327450
|
init_esbuild_shims();
|
|
327180
|
-
function getErrorMessage3(error2) {
|
|
327181
|
-
if (error2 instanceof Error) {
|
|
327182
|
-
return error2.message;
|
|
327183
|
-
}
|
|
327184
|
-
return String(error2);
|
|
327185
|
-
}
|
|
327186
|
-
__name(getErrorMessage3, "getErrorMessage");
|
|
327187
327451
|
function extractErrorCode(error2) {
|
|
327188
327452
|
const errorWithCode = error2;
|
|
327189
327453
|
if (typeof errorWithCode.exitCode === "number") {
|
|
@@ -327211,7 +327475,7 @@ function handleError(error2, config2, customErrorCode) {
|
|
|
327211
327475
|
const formatter = new JsonFormatter();
|
|
327212
327476
|
const errorCode = customErrorCode ?? extractErrorCode(error2);
|
|
327213
327477
|
const formattedError = formatter.formatError(
|
|
327214
|
-
error2 instanceof Error ? error2 : new Error(
|
|
327478
|
+
error2 instanceof Error ? error2 : new Error(getErrorMessage(error2)),
|
|
327215
327479
|
errorCode
|
|
327216
327480
|
);
|
|
327217
327481
|
console.error(formattedError);
|
|
@@ -332480,7 +332744,7 @@ async function cloneFromGit(installMetadata, destination) {
|
|
|
332480
332744
|
await git.checkout("FETCH_HEAD");
|
|
332481
332745
|
} catch (error2) {
|
|
332482
332746
|
throw new Error(
|
|
332483
|
-
`Failed to clone Git repository from ${installMetadata.source} ${
|
|
332747
|
+
`Failed to clone Git repository from ${installMetadata.source} ${getErrorMessage(error2)}`,
|
|
332484
332748
|
{
|
|
332485
332749
|
cause: error2
|
|
332486
332750
|
}
|
|
@@ -332597,7 +332861,7 @@ async function checkForExtensionUpdate(extension, setExtensionUpdateState, cwd7
|
|
|
332597
332861
|
}
|
|
332598
332862
|
} catch (error2) {
|
|
332599
332863
|
console.error(
|
|
332600
|
-
`Failed to check for updates for extension "${installMetadata.source}": ${
|
|
332864
|
+
`Failed to check for updates for extension "${installMetadata.source}": ${getErrorMessage(error2)}`
|
|
332601
332865
|
);
|
|
332602
332866
|
setExtensionUpdateState("error" /* ERROR */);
|
|
332603
332867
|
return;
|
|
@@ -332671,7 +332935,7 @@ async function downloadFromGitHubRelease(installMetadata, destination) {
|
|
|
332671
332935
|
};
|
|
332672
332936
|
} catch (error2) {
|
|
332673
332937
|
throw new Error(
|
|
332674
|
-
`Failed to download release from ${installMetadata.source}: ${
|
|
332938
|
+
`Failed to download release from ${installMetadata.source}: ${getErrorMessage(error2)}`
|
|
332675
332939
|
);
|
|
332676
332940
|
}
|
|
332677
332941
|
}
|
|
@@ -333590,7 +333854,7 @@ function loadExtension(context2) {
|
|
|
333590
333854
|
};
|
|
333591
333855
|
} catch (e2) {
|
|
333592
333856
|
console.error(
|
|
333593
|
-
`Warning: Skipping extension in ${effectiveExtensionPath}: ${
|
|
333857
|
+
`Warning: Skipping extension in ${effectiveExtensionPath}: ${getErrorMessage(
|
|
333594
333858
|
e2
|
|
333595
333859
|
)}`
|
|
333596
333860
|
);
|
|
@@ -333872,7 +334136,7 @@ function loadExtensionConfig(context2) {
|
|
|
333872
334136
|
return config2;
|
|
333873
334137
|
} catch (e2) {
|
|
333874
334138
|
throw new Error(
|
|
333875
|
-
`Failed to load extension config from ${configFilePath2}: ${
|
|
334139
|
+
`Failed to load extension config from ${configFilePath2}: ${getErrorMessage(
|
|
333876
334140
|
e2
|
|
333877
334141
|
)}`
|
|
333878
334142
|
);
|
|
@@ -334617,18 +334881,36 @@ function saveSettings(settingsFile) {
|
|
|
334617
334881
|
__name(saveSettings, "saveSettings");
|
|
334618
334882
|
|
|
334619
334883
|
// packages/cli/src/config/auth.ts
|
|
334884
|
+
function getProviderApiKey(settings, envVar, providerKey) {
|
|
334885
|
+
if (process.env[envVar]) {
|
|
334886
|
+
return process.env[envVar];
|
|
334887
|
+
}
|
|
334888
|
+
const providers = settings.merged.security?.auth?.providers;
|
|
334889
|
+
if (providers?.[providerKey]?.apiKey) {
|
|
334890
|
+
return providers[providerKey].apiKey;
|
|
334891
|
+
}
|
|
334892
|
+
if (settings.merged.security?.auth?.apiKey) {
|
|
334893
|
+
return settings.merged.security.auth.apiKey;
|
|
334894
|
+
}
|
|
334895
|
+
return void 0;
|
|
334896
|
+
}
|
|
334897
|
+
__name(getProviderApiKey, "getProviderApiKey");
|
|
334620
334898
|
function validateAuthMethod(authMethod, mergedSettings) {
|
|
334621
334899
|
const settings = mergedSettings ? { merged: mergedSettings } : loadSettings();
|
|
334622
334900
|
loadEnvironment(settings.merged);
|
|
334623
334901
|
if (authMethod === AuthType.USE_OPENAI) {
|
|
334624
|
-
const hasApiKey =
|
|
334902
|
+
const hasApiKey = getProviderApiKey(settings, "OPENAI_API_KEY", "openai");
|
|
334625
334903
|
if (!hasApiKey) {
|
|
334626
334904
|
return "OPENAI_API_KEY environment variable not found. You can enter it interactively or add it to your .env file.";
|
|
334627
334905
|
}
|
|
334628
334906
|
return null;
|
|
334629
334907
|
}
|
|
334630
334908
|
if (authMethod === AuthType.OLLAMA_CLOUD) {
|
|
334631
|
-
const hasApiKey =
|
|
334909
|
+
const hasApiKey = getProviderApiKey(
|
|
334910
|
+
settings,
|
|
334911
|
+
"OLLAMA_API_KEY",
|
|
334912
|
+
"ollama_cloud"
|
|
334913
|
+
);
|
|
334632
334914
|
if (!hasApiKey) {
|
|
334633
334915
|
return "OLLAMA_API_KEY environment variable not found. Get your API key at https://ollama.com/settings/keys";
|
|
334634
334916
|
}
|
|
@@ -334638,14 +334920,18 @@ function validateAuthMethod(authMethod, mergedSettings) {
|
|
|
334638
334920
|
return null;
|
|
334639
334921
|
}
|
|
334640
334922
|
if (authMethod === AuthType.USE_GROQ) {
|
|
334641
|
-
const hasApiKey =
|
|
334923
|
+
const hasApiKey = getProviderApiKey(settings, "GROQ_API_KEY", "groq");
|
|
334642
334924
|
if (!hasApiKey) {
|
|
334643
334925
|
return "GROQ_API_KEY environment variable not found. Get your API key at https://console.groq.com/keys";
|
|
334644
334926
|
}
|
|
334645
334927
|
return null;
|
|
334646
334928
|
}
|
|
334647
334929
|
if (authMethod === AuthType.USE_ANTHROPIC) {
|
|
334648
|
-
const hasApiKey =
|
|
334930
|
+
const hasApiKey = getProviderApiKey(
|
|
334931
|
+
settings,
|
|
334932
|
+
"ANTHROPIC_API_KEY",
|
|
334933
|
+
"anthropic"
|
|
334934
|
+
);
|
|
334649
334935
|
if (!hasApiKey) {
|
|
334650
334936
|
return "ANTHROPIC_API_KEY environment variable not found. Get your API key at https://console.anthropic.com/settings/keys";
|
|
334651
334937
|
}
|
|
@@ -334697,7 +334983,7 @@ async function handleInstall(args) {
|
|
|
334697
334983
|
);
|
|
334698
334984
|
console.log(`Extension "${name3}" installed successfully and enabled.`);
|
|
334699
334985
|
} catch (error2) {
|
|
334700
|
-
console.error(
|
|
334986
|
+
console.error(getErrorMessage(error2));
|
|
334701
334987
|
process.exit(1);
|
|
334702
334988
|
}
|
|
334703
334989
|
}
|
|
@@ -334737,7 +335023,7 @@ async function handleUninstall(args) {
|
|
|
334737
335023
|
await uninstallExtension(args.name);
|
|
334738
335024
|
console.log(`Extension "${args.name}" successfully uninstalled.`);
|
|
334739
335025
|
} catch (error2) {
|
|
334740
|
-
console.error(
|
|
335026
|
+
console.error(getErrorMessage(error2));
|
|
334741
335027
|
process.exit(1);
|
|
334742
335028
|
}
|
|
334743
335029
|
}
|
|
@@ -334776,7 +335062,7 @@ async function handleList() {
|
|
|
334776
335062
|
extensions.map((extension, _) => toOutputString(extension, process.cwd())).join("\n\n")
|
|
334777
335063
|
);
|
|
334778
335064
|
} catch (error2) {
|
|
334779
|
-
console.error(
|
|
335065
|
+
console.error(getErrorMessage(error2));
|
|
334780
335066
|
process.exit(1);
|
|
334781
335067
|
}
|
|
334782
335068
|
}
|
|
@@ -334863,7 +335149,7 @@ async function updateExtension(extension, cwd7 = process.cwd(), requestConsent,
|
|
|
334863
335149
|
};
|
|
334864
335150
|
} catch (e2) {
|
|
334865
335151
|
console.error(
|
|
334866
|
-
`Error updating extension, rolling back. ${
|
|
335152
|
+
`Error updating extension, rolling back. ${getErrorMessage(e2)}`
|
|
334867
335153
|
);
|
|
334868
335154
|
dispatchExtensionStateUpdate({
|
|
334869
335155
|
type: "SET_STATE",
|
|
@@ -334975,7 +335261,7 @@ async function handleUpdate(args) {
|
|
|
334975
335261
|
console.log(`Extension "${args.name}" is already up to date.`);
|
|
334976
335262
|
}
|
|
334977
335263
|
} catch (error2) {
|
|
334978
|
-
console.error(
|
|
335264
|
+
console.error(getErrorMessage(error2));
|
|
334979
335265
|
}
|
|
334980
335266
|
}
|
|
334981
335267
|
if (args.all) {
|
|
@@ -335007,7 +335293,7 @@ async function handleUpdate(args) {
|
|
|
335007
335293
|
}
|
|
335008
335294
|
console.log(updateInfos.map((info) => updateOutput(info)).join("\n"));
|
|
335009
335295
|
} catch (error2) {
|
|
335010
|
-
console.error(
|
|
335296
|
+
console.error(getErrorMessage(error2));
|
|
335011
335297
|
}
|
|
335012
335298
|
}
|
|
335013
335299
|
}
|
|
@@ -340077,7 +340363,7 @@ function handleDisable(args) {
|
|
|
340077
340363
|
`Extension "${args.name}" successfully disabled for scope "${args.scope}".`
|
|
340078
340364
|
);
|
|
340079
340365
|
} catch (error2) {
|
|
340080
|
-
console.error(
|
|
340366
|
+
console.error(getErrorMessage(error2));
|
|
340081
340367
|
process.exit(1);
|
|
340082
340368
|
}
|
|
340083
340369
|
}
|
|
@@ -340176,7 +340462,7 @@ async function handleLink(args) {
|
|
|
340176
340462
|
`Extension "${extensionName}" linked successfully and enabled.`
|
|
340177
340463
|
);
|
|
340178
340464
|
} catch (error2) {
|
|
340179
|
-
console.error(
|
|
340465
|
+
console.error(getErrorMessage(error2));
|
|
340180
340466
|
process.exit(1);
|
|
340181
340467
|
}
|
|
340182
340468
|
}
|
|
@@ -340254,7 +340540,7 @@ async function handleNew(args) {
|
|
|
340254
340540
|
`You can install this using "OSA extensions link ${args.path}" to test it out.`
|
|
340255
340541
|
);
|
|
340256
340542
|
} catch (error2) {
|
|
340257
|
-
console.error(
|
|
340543
|
+
console.error(getErrorMessage(error2));
|
|
340258
340544
|
throw error2;
|
|
340259
340545
|
}
|
|
340260
340546
|
}
|
|
@@ -340555,7 +340841,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
340555
340841
|
// packages/cli/src/utils/version.ts
|
|
340556
340842
|
async function getCliVersion() {
|
|
340557
340843
|
const pkgJson = await getPackageJson();
|
|
340558
|
-
return "0.2.
|
|
340844
|
+
return "0.2.80";
|
|
340559
340845
|
}
|
|
340560
340846
|
__name(getCliVersion, "getCliVersion");
|
|
340561
340847
|
|
|
@@ -344462,10 +344748,28 @@ function ensureOsagentDirectories() {
|
|
|
344462
344748
|
}
|
|
344463
344749
|
}
|
|
344464
344750
|
__name(ensureOsagentDirectories, "ensureOsagentDirectories");
|
|
344751
|
+
function loadProviderKeysFromSettings(settings) {
|
|
344752
|
+
const providers = settings.merged.security?.auth?.providers;
|
|
344753
|
+
if (!providers) return;
|
|
344754
|
+
const authType = settings.merged.security?.auth?.selectedType;
|
|
344755
|
+
const providerEnvMap = {
|
|
344756
|
+
[AuthType.OLLAMA_CLOUD]: { key: "ollama_cloud", envVar: "OLLAMA_API_KEY" },
|
|
344757
|
+
[AuthType.USE_GROQ]: { key: "groq", envVar: "GROQ_API_KEY" },
|
|
344758
|
+
[AuthType.USE_ANTHROPIC]: { key: "anthropic", envVar: "ANTHROPIC_API_KEY" },
|
|
344759
|
+
[AuthType.USE_OPENAI]: { key: "openai", envVar: "OPENAI_API_KEY" }
|
|
344760
|
+
};
|
|
344761
|
+
if (!authType || !providerEnvMap[authType]) return;
|
|
344762
|
+
const { key, envVar } = providerEnvMap[authType];
|
|
344763
|
+
if (!process.env[envVar] && providers[key]?.apiKey) {
|
|
344764
|
+
process.env[envVar] = providers[key].apiKey;
|
|
344765
|
+
}
|
|
344766
|
+
}
|
|
344767
|
+
__name(loadProviderKeysFromSettings, "loadProviderKeysFromSettings");
|
|
344465
344768
|
async function initializeApp(config2, settings) {
|
|
344466
344769
|
ensureOsagentDirectories();
|
|
344467
344770
|
const languageSetting = process.env["OSA_CODE_LANG"] || settings.merged.general?.language || "auto";
|
|
344468
344771
|
await initializeI18n(languageSetting);
|
|
344772
|
+
loadProviderKeysFromSettings(settings);
|
|
344469
344773
|
const authType = settings.merged.security?.auth?.selectedType;
|
|
344470
344774
|
const authError = await performInitialAuth(config2, authType);
|
|
344471
344775
|
if (authError) {
|
|
@@ -344712,16 +345016,6 @@ import { execSync as execSync5 } from "node:child_process";
|
|
|
344712
345016
|
|
|
344713
345017
|
// packages/cli/src/ui/utils/formatters.ts
|
|
344714
345018
|
init_esbuild_shims();
|
|
344715
|
-
var formatMemoryUsage2 = /* @__PURE__ */ __name((bytes) => {
|
|
344716
|
-
const gb = bytes / (1024 * 1024 * 1024);
|
|
344717
|
-
if (bytes < 1024 * 1024) {
|
|
344718
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
344719
|
-
}
|
|
344720
|
-
if (bytes < 1024 * 1024 * 1024) {
|
|
344721
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
344722
|
-
}
|
|
344723
|
-
return `${gb.toFixed(2)} GB`;
|
|
344724
|
-
}, "formatMemoryUsage");
|
|
344725
345019
|
var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
344726
345020
|
if (milliseconds <= 0) {
|
|
344727
345021
|
return "0s";
|
|
@@ -344756,8 +345050,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
344756
345050
|
|
|
344757
345051
|
// packages/cli/src/generated/git-commit.ts
|
|
344758
345052
|
init_esbuild_shims();
|
|
344759
|
-
var GIT_COMMIT_INFO2 = "
|
|
344760
|
-
var CLI_VERSION2 = "0.2.
|
|
345053
|
+
var GIT_COMMIT_INFO2 = "7e20a8e";
|
|
345054
|
+
var CLI_VERSION2 = "0.2.80";
|
|
344761
345055
|
|
|
344762
345056
|
// packages/cli/src/utils/systemInfo.ts
|
|
344763
345057
|
async function getNpmVersion() {
|
|
@@ -344824,7 +345118,7 @@ async function getSystemInfo(context2) {
|
|
|
344824
345118
|
__name(getSystemInfo, "getSystemInfo");
|
|
344825
345119
|
async function getExtendedSystemInfo(context2) {
|
|
344826
345120
|
const baseInfo = await getSystemInfo(context2);
|
|
344827
|
-
const memoryUsage =
|
|
345121
|
+
const memoryUsage = formatMemoryUsage(process29.memoryUsage().rss);
|
|
344828
345122
|
const sandboxEnv = getSandboxEnv(true);
|
|
344829
345123
|
const baseUrl = baseInfo.selectedAuthType === AuthType.USE_OPENAI ? context2.services.config?.getContentGeneratorConfig()?.baseUrl : void 0;
|
|
344830
345124
|
const gitCommit = GIT_COMMIT_INFO2 && !["N/A"].includes(GIT_COMMIT_INFO2) ? GIT_COMMIT_INFO2 : void 0;
|
|
@@ -345022,18 +345316,169 @@ function formatBytes(bytes) {
|
|
|
345022
345316
|
}
|
|
345023
345317
|
__name(formatBytes, "formatBytes");
|
|
345024
345318
|
|
|
345025
|
-
// packages/cli/src/ui/commands/
|
|
345319
|
+
// packages/cli/src/ui/commands/delegateCommand.ts
|
|
345320
|
+
init_esbuild_shims();
|
|
345026
345321
|
var BUILTIN_AGENTS2 = [
|
|
345027
|
-
{
|
|
345028
|
-
|
|
345029
|
-
|
|
345030
|
-
|
|
345031
|
-
|
|
345032
|
-
{
|
|
345033
|
-
|
|
345034
|
-
|
|
345035
|
-
|
|
345036
|
-
|
|
345322
|
+
{
|
|
345323
|
+
name: "general-purpose",
|
|
345324
|
+
shorthand: "gp",
|
|
345325
|
+
description: "General-purpose research and code analysis"
|
|
345326
|
+
},
|
|
345327
|
+
{
|
|
345328
|
+
name: "research-explorer",
|
|
345329
|
+
shorthand: "re",
|
|
345330
|
+
description: "Deep codebase exploration and architecture analysis"
|
|
345331
|
+
},
|
|
345332
|
+
{
|
|
345333
|
+
name: "code-reviewer",
|
|
345334
|
+
shorthand: "cr",
|
|
345335
|
+
description: "Code quality, security, and performance review"
|
|
345336
|
+
},
|
|
345337
|
+
{
|
|
345338
|
+
name: "test-writer",
|
|
345339
|
+
shorthand: "tw",
|
|
345340
|
+
description: "Test suite creation and coverage"
|
|
345341
|
+
},
|
|
345342
|
+
{
|
|
345343
|
+
name: "documentation",
|
|
345344
|
+
shorthand: "doc",
|
|
345345
|
+
description: "Documentation generation and updates"
|
|
345346
|
+
},
|
|
345347
|
+
{
|
|
345348
|
+
name: "osa-orchestrator",
|
|
345349
|
+
shorthand: "osa",
|
|
345350
|
+
description: "Automatic agent coordination and task delegation"
|
|
345351
|
+
}
|
|
345352
|
+
];
|
|
345353
|
+
function resolveAgentName(input) {
|
|
345354
|
+
const normalized2 = input.toLowerCase().trim();
|
|
345355
|
+
for (const agent of BUILTIN_AGENTS2) {
|
|
345356
|
+
if (agent.name === normalized2 || agent.shorthand === normalized2) {
|
|
345357
|
+
return agent.name;
|
|
345358
|
+
}
|
|
345359
|
+
}
|
|
345360
|
+
return null;
|
|
345361
|
+
}
|
|
345362
|
+
__name(resolveAgentName, "resolveAgentName");
|
|
345363
|
+
var delegateCommand = {
|
|
345364
|
+
name: "delegate",
|
|
345365
|
+
altNames: ["d"],
|
|
345366
|
+
get description() {
|
|
345367
|
+
return t2(
|
|
345368
|
+
"Delegate a task to a specific agent. Usage: /delegate <agent> <task>"
|
|
345369
|
+
);
|
|
345370
|
+
},
|
|
345371
|
+
kind: "built-in" /* BUILT_IN */,
|
|
345372
|
+
action: /* @__PURE__ */ __name((_context, args) => {
|
|
345373
|
+
const trimmedArgs = args.trim();
|
|
345374
|
+
if (!trimmedArgs) {
|
|
345375
|
+
const agentList = BUILTIN_AGENTS2.map(
|
|
345376
|
+
(a) => ` ${a.shorthand.padEnd(5)} (${a.name}): ${a.description}`
|
|
345377
|
+
).join("\n");
|
|
345378
|
+
return {
|
|
345379
|
+
type: "message",
|
|
345380
|
+
messageType: "info",
|
|
345381
|
+
content: t2(
|
|
345382
|
+
`Delegate a task to a specialized OSA agent.
|
|
345383
|
+
|
|
345384
|
+
Usage: /delegate <agent> <task>
|
|
345385
|
+
/d <agent> <task>
|
|
345386
|
+
|
|
345387
|
+
Available agents:
|
|
345388
|
+
${agentList}
|
|
345389
|
+
|
|
345390
|
+
Examples:
|
|
345391
|
+
/delegate cr Review the authentication module for security issues
|
|
345392
|
+
/d tw Write tests for the user service
|
|
345393
|
+
/delegate re How does the caching system work?
|
|
345394
|
+
/d doc Generate API documentation for the REST endpoints`
|
|
345395
|
+
)
|
|
345396
|
+
};
|
|
345397
|
+
}
|
|
345398
|
+
const spaceIndex = trimmedArgs.indexOf(" ");
|
|
345399
|
+
if (spaceIndex === -1) {
|
|
345400
|
+
return {
|
|
345401
|
+
type: "message",
|
|
345402
|
+
messageType: "error",
|
|
345403
|
+
content: t2(
|
|
345404
|
+
"Please provide both an agent and a task.\nUsage: /delegate <agent> <task>"
|
|
345405
|
+
)
|
|
345406
|
+
};
|
|
345407
|
+
}
|
|
345408
|
+
const agentInput = trimmedArgs.substring(0, spaceIndex);
|
|
345409
|
+
const task = trimmedArgs.substring(spaceIndex + 1).trim();
|
|
345410
|
+
if (!task) {
|
|
345411
|
+
return {
|
|
345412
|
+
type: "message",
|
|
345413
|
+
messageType: "error",
|
|
345414
|
+
content: t2("Please provide a task for the agent to work on.")
|
|
345415
|
+
};
|
|
345416
|
+
}
|
|
345417
|
+
const agentName = resolveAgentName(agentInput);
|
|
345418
|
+
if (!agentName) {
|
|
345419
|
+
const availableAgents = BUILTIN_AGENTS2.map(
|
|
345420
|
+
(a) => `${a.shorthand}/${a.name}`
|
|
345421
|
+
).join(", ");
|
|
345422
|
+
return {
|
|
345423
|
+
type: "message",
|
|
345424
|
+
messageType: "error",
|
|
345425
|
+
content: t2(
|
|
345426
|
+
`Unknown agent: "${agentInput}"
|
|
345427
|
+
Available agents: ${availableAgents}`
|
|
345428
|
+
)
|
|
345429
|
+
};
|
|
345430
|
+
}
|
|
345431
|
+
const delegationPrompt = `[OSA DELEGATION]
|
|
345432
|
+
Delegate this task to the "${agentName}" agent:
|
|
345433
|
+
|
|
345434
|
+
Task: ${task}
|
|
345435
|
+
|
|
345436
|
+
Use the Task tool to spawn the "${agentName}" subagent with this task. The agent should complete the task autonomously and return a comprehensive result.`;
|
|
345437
|
+
return {
|
|
345438
|
+
type: "submit_prompt",
|
|
345439
|
+
content: [{ text: delegationPrompt }]
|
|
345440
|
+
};
|
|
345441
|
+
}, "action"),
|
|
345442
|
+
// Provide completion for agent names
|
|
345443
|
+
completion: /* @__PURE__ */ __name(async (_context, partialArg) => {
|
|
345444
|
+
const normalized2 = partialArg.toLowerCase();
|
|
345445
|
+
const matches = [];
|
|
345446
|
+
for (const agent of BUILTIN_AGENTS2) {
|
|
345447
|
+
if (agent.name.startsWith(normalized2) || agent.shorthand.startsWith(normalized2)) {
|
|
345448
|
+
matches.push(agent.name);
|
|
345449
|
+
}
|
|
345450
|
+
}
|
|
345451
|
+
return matches;
|
|
345452
|
+
}, "completion")
|
|
345453
|
+
};
|
|
345454
|
+
|
|
345455
|
+
// packages/cli/src/ui/commands/agentsCommand.ts
|
|
345456
|
+
var BUILTIN_AGENTS3 = [
|
|
345457
|
+
...BUILTIN_AGENTS2.map((a) => ({
|
|
345458
|
+
name: a.name,
|
|
345459
|
+
description: a.description,
|
|
345460
|
+
tier: a.name === "osa-orchestrator" ? "orchestrator" : ["research-explorer", "documentation"].includes(a.name) ? "utility" : "specialist"
|
|
345461
|
+
})),
|
|
345462
|
+
{
|
|
345463
|
+
name: "architect",
|
|
345464
|
+
description: "System design, architecture decisions",
|
|
345465
|
+
tier: "specialist"
|
|
345466
|
+
},
|
|
345467
|
+
{
|
|
345468
|
+
name: "debugger",
|
|
345469
|
+
description: "Bug investigation, systematic debugging",
|
|
345470
|
+
tier: "specialist"
|
|
345471
|
+
},
|
|
345472
|
+
{
|
|
345473
|
+
name: "security-auditor",
|
|
345474
|
+
description: "Security analysis, vulnerability detection",
|
|
345475
|
+
tier: "specialist"
|
|
345476
|
+
},
|
|
345477
|
+
{
|
|
345478
|
+
name: "performance-optimizer",
|
|
345479
|
+
description: "Performance analysis, optimization",
|
|
345480
|
+
tier: "specialist"
|
|
345481
|
+
}
|
|
345037
345482
|
];
|
|
345038
345483
|
function loadCustomAgents() {
|
|
345039
345484
|
const agentsDir = join37(homedir18(), ".osagent", "agents");
|
|
@@ -345074,7 +345519,7 @@ function formatAgentList() {
|
|
|
345074
345519
|
utility: [],
|
|
345075
345520
|
custom: []
|
|
345076
345521
|
};
|
|
345077
|
-
for (const agent of
|
|
345522
|
+
for (const agent of BUILTIN_AGENTS3) {
|
|
345078
345523
|
tiers[agent.tier]?.push(agent);
|
|
345079
345524
|
}
|
|
345080
345525
|
const customAgents = loadCustomAgents();
|
|
@@ -345093,7 +345538,13 @@ function formatAgentList() {
|
|
|
345093
345538
|
};
|
|
345094
345539
|
for (const [tier, agents] of Object.entries(tiers)) {
|
|
345095
345540
|
if (agents.length === 0) continue;
|
|
345096
|
-
lines.push(
|
|
345541
|
+
lines.push(
|
|
345542
|
+
colorize2(
|
|
345543
|
+
tierLabels[tier] || tier,
|
|
345544
|
+
colors.bold,
|
|
345545
|
+
tierColors[tier] || colors.white
|
|
345546
|
+
)
|
|
345547
|
+
);
|
|
345097
345548
|
lines.push("");
|
|
345098
345549
|
for (const agent of agents) {
|
|
345099
345550
|
const nameStr = colorize2(agent.name.padEnd(22), colors.white);
|
|
@@ -345105,9 +345556,15 @@ function formatAgentList() {
|
|
|
345105
345556
|
lines.push(divider(width));
|
|
345106
345557
|
lines.push("");
|
|
345107
345558
|
lines.push(sectionHeader("Quick Commands", icons.lightning));
|
|
345108
|
-
lines.push(
|
|
345109
|
-
|
|
345110
|
-
|
|
345559
|
+
lines.push(
|
|
345560
|
+
` ${colorize2("/agents create", colors.cyan)} - Create a new custom agent`
|
|
345561
|
+
);
|
|
345562
|
+
lines.push(
|
|
345563
|
+
` ${colorize2("/agents manage", colors.cyan)} - Manage existing agents`
|
|
345564
|
+
);
|
|
345565
|
+
lines.push(
|
|
345566
|
+
` ${colorize2("/agents batch", colors.cyan)} - Run multiple agents in parallel`
|
|
345567
|
+
);
|
|
345111
345568
|
lines.push("");
|
|
345112
345569
|
lines.push(colorize2(`Custom agents: ~/.osagent/agents/`, colors.gray));
|
|
345113
345570
|
lines.push("");
|
|
@@ -345182,22 +345639,17 @@ var agentsCommand = {
|
|
|
345182
345639
|
};
|
|
345183
345640
|
}
|
|
345184
345641
|
const agents = agentList.split(",").map((a) => a.trim());
|
|
345185
|
-
const
|
|
345186
|
-
|
|
345187
|
-
|
|
345188
|
-
|
|
345189
|
-
"test-writer",
|
|
345190
|
-
"documentation",
|
|
345191
|
-
"osa-orchestrator"
|
|
345192
|
-
];
|
|
345193
|
-
const invalidAgents = agents.filter((a) => !validAgents.includes(a));
|
|
345642
|
+
const validAgentNames = BUILTIN_AGENTS3.map((a) => a.name);
|
|
345643
|
+
const invalidAgents = agents.filter(
|
|
345644
|
+
(a) => !validAgentNames.includes(a)
|
|
345645
|
+
);
|
|
345194
345646
|
if (invalidAgents.length > 0) {
|
|
345195
345647
|
return {
|
|
345196
345648
|
type: "message",
|
|
345197
345649
|
messageType: "error",
|
|
345198
345650
|
content: t2(
|
|
345199
345651
|
`Unknown agent(s): ${invalidAgents.join(", ")}
|
|
345200
|
-
Available agents: ${
|
|
345652
|
+
Available agents: ${validAgentNames.join(", ")}`
|
|
345201
345653
|
)
|
|
345202
345654
|
};
|
|
345203
345655
|
}
|
|
@@ -346600,142 +347052,6 @@ var yoloCommand = {
|
|
|
346600
347052
|
subCommands: dangerouslyCommand.subCommands
|
|
346601
347053
|
};
|
|
346602
347054
|
|
|
346603
|
-
// packages/cli/src/ui/commands/delegateCommand.ts
|
|
346604
|
-
init_esbuild_shims();
|
|
346605
|
-
var BUILTIN_AGENTS3 = [
|
|
346606
|
-
{
|
|
346607
|
-
name: "general-purpose",
|
|
346608
|
-
shorthand: "gp",
|
|
346609
|
-
description: "General-purpose research and code analysis"
|
|
346610
|
-
},
|
|
346611
|
-
{
|
|
346612
|
-
name: "research-explorer",
|
|
346613
|
-
shorthand: "re",
|
|
346614
|
-
description: "Deep codebase exploration and architecture analysis"
|
|
346615
|
-
},
|
|
346616
|
-
{
|
|
346617
|
-
name: "code-reviewer",
|
|
346618
|
-
shorthand: "cr",
|
|
346619
|
-
description: "Code quality, security, and performance review"
|
|
346620
|
-
},
|
|
346621
|
-
{
|
|
346622
|
-
name: "test-writer",
|
|
346623
|
-
shorthand: "tw",
|
|
346624
|
-
description: "Test suite creation and coverage"
|
|
346625
|
-
},
|
|
346626
|
-
{
|
|
346627
|
-
name: "documentation",
|
|
346628
|
-
shorthand: "doc",
|
|
346629
|
-
description: "Documentation generation and updates"
|
|
346630
|
-
},
|
|
346631
|
-
{
|
|
346632
|
-
name: "osa-orchestrator",
|
|
346633
|
-
shorthand: "osa",
|
|
346634
|
-
description: "Automatic agent coordination and task delegation"
|
|
346635
|
-
}
|
|
346636
|
-
];
|
|
346637
|
-
function resolveAgentName(input) {
|
|
346638
|
-
const normalized2 = input.toLowerCase().trim();
|
|
346639
|
-
for (const agent of BUILTIN_AGENTS3) {
|
|
346640
|
-
if (agent.name === normalized2 || agent.shorthand === normalized2) {
|
|
346641
|
-
return agent.name;
|
|
346642
|
-
}
|
|
346643
|
-
}
|
|
346644
|
-
return null;
|
|
346645
|
-
}
|
|
346646
|
-
__name(resolveAgentName, "resolveAgentName");
|
|
346647
|
-
var delegateCommand = {
|
|
346648
|
-
name: "delegate",
|
|
346649
|
-
altNames: ["d"],
|
|
346650
|
-
get description() {
|
|
346651
|
-
return t2(
|
|
346652
|
-
"Delegate a task to a specific agent. Usage: /delegate <agent> <task>"
|
|
346653
|
-
);
|
|
346654
|
-
},
|
|
346655
|
-
kind: "built-in" /* BUILT_IN */,
|
|
346656
|
-
action: /* @__PURE__ */ __name((_context, args) => {
|
|
346657
|
-
const trimmedArgs = args.trim();
|
|
346658
|
-
if (!trimmedArgs) {
|
|
346659
|
-
const agentList = BUILTIN_AGENTS3.map(
|
|
346660
|
-
(a) => ` ${a.shorthand.padEnd(5)} (${a.name}): ${a.description}`
|
|
346661
|
-
).join("\n");
|
|
346662
|
-
return {
|
|
346663
|
-
type: "message",
|
|
346664
|
-
messageType: "info",
|
|
346665
|
-
content: t2(
|
|
346666
|
-
`Delegate a task to a specialized OSA agent.
|
|
346667
|
-
|
|
346668
|
-
Usage: /delegate <agent> <task>
|
|
346669
|
-
/d <agent> <task>
|
|
346670
|
-
|
|
346671
|
-
Available agents:
|
|
346672
|
-
${agentList}
|
|
346673
|
-
|
|
346674
|
-
Examples:
|
|
346675
|
-
/delegate cr Review the authentication module for security issues
|
|
346676
|
-
/d tw Write tests for the user service
|
|
346677
|
-
/delegate re How does the caching system work?
|
|
346678
|
-
/d doc Generate API documentation for the REST endpoints`
|
|
346679
|
-
)
|
|
346680
|
-
};
|
|
346681
|
-
}
|
|
346682
|
-
const spaceIndex = trimmedArgs.indexOf(" ");
|
|
346683
|
-
if (spaceIndex === -1) {
|
|
346684
|
-
return {
|
|
346685
|
-
type: "message",
|
|
346686
|
-
messageType: "error",
|
|
346687
|
-
content: t2(
|
|
346688
|
-
"Please provide both an agent and a task.\nUsage: /delegate <agent> <task>"
|
|
346689
|
-
)
|
|
346690
|
-
};
|
|
346691
|
-
}
|
|
346692
|
-
const agentInput = trimmedArgs.substring(0, spaceIndex);
|
|
346693
|
-
const task = trimmedArgs.substring(spaceIndex + 1).trim();
|
|
346694
|
-
if (!task) {
|
|
346695
|
-
return {
|
|
346696
|
-
type: "message",
|
|
346697
|
-
messageType: "error",
|
|
346698
|
-
content: t2("Please provide a task for the agent to work on.")
|
|
346699
|
-
};
|
|
346700
|
-
}
|
|
346701
|
-
const agentName = resolveAgentName(agentInput);
|
|
346702
|
-
if (!agentName) {
|
|
346703
|
-
const availableAgents = BUILTIN_AGENTS3.map(
|
|
346704
|
-
(a) => `${a.shorthand}/${a.name}`
|
|
346705
|
-
).join(", ");
|
|
346706
|
-
return {
|
|
346707
|
-
type: "message",
|
|
346708
|
-
messageType: "error",
|
|
346709
|
-
content: t2(
|
|
346710
|
-
`Unknown agent: "${agentInput}"
|
|
346711
|
-
Available agents: ${availableAgents}`
|
|
346712
|
-
)
|
|
346713
|
-
};
|
|
346714
|
-
}
|
|
346715
|
-
const delegationPrompt = `[OSA DELEGATION]
|
|
346716
|
-
Delegate this task to the "${agentName}" agent:
|
|
346717
|
-
|
|
346718
|
-
Task: ${task}
|
|
346719
|
-
|
|
346720
|
-
Use the Task tool to spawn the "${agentName}" subagent with this task. The agent should complete the task autonomously and return a comprehensive result.`;
|
|
346721
|
-
return {
|
|
346722
|
-
type: "submit_prompt",
|
|
346723
|
-
content: [{ text: delegationPrompt }]
|
|
346724
|
-
};
|
|
346725
|
-
}, "action"),
|
|
346726
|
-
// Provide completion for agent names
|
|
346727
|
-
completion: /* @__PURE__ */ __name(async (_context, partialArg) => {
|
|
346728
|
-
const normalized2 = partialArg.toLowerCase();
|
|
346729
|
-
const matches = [];
|
|
346730
|
-
for (const agent of BUILTIN_AGENTS3) {
|
|
346731
|
-
if (agent.name.startsWith(normalized2) || agent.shorthand.startsWith(normalized2)) {
|
|
346732
|
-
matches.push(agent.name);
|
|
346733
|
-
}
|
|
346734
|
-
}
|
|
346735
|
-
return matches;
|
|
346736
|
-
}, "completion")
|
|
346737
|
-
};
|
|
346738
|
-
|
|
346739
347055
|
// packages/cli/src/ui/commands/doctorCommand.ts
|
|
346740
347056
|
init_esbuild_shims();
|
|
346741
347057
|
var import_react28 = __toESM(require_react(), 1);
|
|
@@ -346759,9 +347075,7 @@ var plainStatusIcon = /* @__PURE__ */ __name((status) => {
|
|
|
346759
347075
|
}
|
|
346760
347076
|
}, "plainStatusIcon");
|
|
346761
347077
|
var plainDivider = /* @__PURE__ */ __name((width = 50) => "\u2500".repeat(width), "plainDivider");
|
|
346762
|
-
var plainKeyValue = /* @__PURE__ */ __name((key, value, keyWidth = 20) => {
|
|
346763
|
-
return `${key.padEnd(keyWidth)}${value}`;
|
|
346764
|
-
}, "plainKeyValue");
|
|
347078
|
+
var plainKeyValue = /* @__PURE__ */ __name((key, value, keyWidth = 20) => `${key.padEnd(keyWidth)}${value}`, "plainKeyValue");
|
|
346765
347079
|
var plainSectionHeader = /* @__PURE__ */ __name((title, icon) => {
|
|
346766
347080
|
const prefix = icon ? `${icon} ` : "";
|
|
346767
347081
|
return `\u2550\u2550\u2550 ${prefix}${title} \u2550\u2550\u2550`;
|
|
@@ -348018,7 +348332,7 @@ async function updateAction(context2, args) {
|
|
|
348018
348332
|
context2.ui.addItem(
|
|
348019
348333
|
{
|
|
348020
348334
|
type: "error" /* ERROR */,
|
|
348021
|
-
text:
|
|
348335
|
+
text: getErrorMessage(error2)
|
|
348022
348336
|
},
|
|
348023
348337
|
Date.now()
|
|
348024
348338
|
);
|
|
@@ -349958,7 +350272,7 @@ var permissionsCommand = {
|
|
|
349958
350272
|
|
|
349959
350273
|
// packages/cli/src/ui/commands/providerCommand.ts
|
|
349960
350274
|
init_esbuild_shims();
|
|
349961
|
-
function
|
|
350275
|
+
function getProviderApiKey2(context2, providerKey, envVar) {
|
|
349962
350276
|
const { settings } = context2.services;
|
|
349963
350277
|
const providers = settings.merged.security?.auth?.providers;
|
|
349964
350278
|
const providerConfig = providers?.[providerKey];
|
|
@@ -349967,7 +350281,7 @@ function getProviderApiKey(context2, providerKey, envVar) {
|
|
|
349967
350281
|
}
|
|
349968
350282
|
return process.env[envVar];
|
|
349969
350283
|
}
|
|
349970
|
-
__name(
|
|
350284
|
+
__name(getProviderApiKey2, "getProviderApiKey");
|
|
349971
350285
|
async function persistProviderSelection(context2, authType, apiKey, model) {
|
|
349972
350286
|
const { settings } = context2.services;
|
|
349973
350287
|
settings.setValue("User" /* User */, "security.auth.selectedType", authType);
|
|
@@ -350030,7 +350344,7 @@ var providerCommand = {
|
|
|
350030
350344
|
content: t2("Configuration not available.")
|
|
350031
350345
|
};
|
|
350032
350346
|
}
|
|
350033
|
-
const apiKey =
|
|
350347
|
+
const apiKey = getProviderApiKey2(context2, "groq", "GROQ_API_KEY");
|
|
350034
350348
|
if (!apiKey) {
|
|
350035
350349
|
return {
|
|
350036
350350
|
type: "start_auth",
|
|
@@ -350127,7 +350441,7 @@ Provider selection saved to settings.`)
|
|
|
350127
350441
|
content: t2("Configuration not available.")
|
|
350128
350442
|
};
|
|
350129
350443
|
}
|
|
350130
|
-
const apiKey =
|
|
350444
|
+
const apiKey = getProviderApiKey2(context2, "ollama_cloud", "OLLAMA_API_KEY");
|
|
350131
350445
|
if (!apiKey) {
|
|
350132
350446
|
return {
|
|
350133
350447
|
type: "start_auth",
|
|
@@ -350182,7 +350496,7 @@ Provider selection saved to settings.`)
|
|
|
350182
350496
|
content: t2("Configuration not available.")
|
|
350183
350497
|
};
|
|
350184
350498
|
}
|
|
350185
|
-
const apiKey =
|
|
350499
|
+
const apiKey = getProviderApiKey2(context2, "openai", "OPENAI_API_KEY");
|
|
350186
350500
|
if (!apiKey) {
|
|
350187
350501
|
return {
|
|
350188
350502
|
type: "start_auth",
|
|
@@ -350229,7 +350543,7 @@ Provider selection saved to settings.`)
|
|
|
350229
350543
|
content: t2("Configuration not available.")
|
|
350230
350544
|
};
|
|
350231
350545
|
}
|
|
350232
|
-
const apiKey =
|
|
350546
|
+
const apiKey = getProviderApiKey2(context2, "anthropic", "ANTHROPIC_API_KEY");
|
|
350233
350547
|
if (!apiKey) {
|
|
350234
350548
|
return {
|
|
350235
350549
|
type: "start_auth",
|
|
@@ -351584,32 +351898,73 @@ var spCommand = {
|
|
|
351584
351898
|
|
|
351585
351899
|
// packages/cli/src/ui/commands/taskmasterCommand.ts
|
|
351586
351900
|
init_esbuild_shims();
|
|
351901
|
+
function statusIcon2(status) {
|
|
351902
|
+
switch (status) {
|
|
351903
|
+
case "pending":
|
|
351904
|
+
return "[ ]";
|
|
351905
|
+
case "in_progress":
|
|
351906
|
+
return "[~]";
|
|
351907
|
+
case "completed":
|
|
351908
|
+
return "[x]";
|
|
351909
|
+
default:
|
|
351910
|
+
return "[ ]";
|
|
351911
|
+
}
|
|
351912
|
+
}
|
|
351913
|
+
__name(statusIcon2, "statusIcon");
|
|
351914
|
+
async function getCurrentTodos(context2) {
|
|
351915
|
+
const sessionId2 = context2.services.config?.getSessionId();
|
|
351916
|
+
return readTodosForSession(sessionId2);
|
|
351917
|
+
}
|
|
351918
|
+
__name(getCurrentTodos, "getCurrentTodos");
|
|
351587
351919
|
var taskmasterCommand = {
|
|
351588
351920
|
name: "taskmaster",
|
|
351589
351921
|
altNames: ["tm", "tasks"],
|
|
351590
351922
|
get description() {
|
|
351591
|
-
return t2("
|
|
351923
|
+
return t2("View and manage session tasks");
|
|
351592
351924
|
},
|
|
351593
351925
|
kind: "built-in" /* BUILT_IN */,
|
|
351594
351926
|
subCommands: [
|
|
351595
351927
|
{
|
|
351596
351928
|
name: "status",
|
|
351597
351929
|
get description() {
|
|
351598
|
-
return t2("Show
|
|
351930
|
+
return t2("Show task counts by status");
|
|
351599
351931
|
},
|
|
351600
351932
|
kind: "built-in" /* BUILT_IN */,
|
|
351601
|
-
action: /* @__PURE__ */ __name(async (
|
|
351602
|
-
|
|
351603
|
-
|
|
351604
|
-
|
|
351933
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
351934
|
+
const todos = await getCurrentTodos(context2);
|
|
351935
|
+
if (todos.length === 0) {
|
|
351936
|
+
return {
|
|
351937
|
+
type: "message",
|
|
351938
|
+
messageType: "info",
|
|
351939
|
+
content: t2(
|
|
351940
|
+
`Taskmaster Status
|
|
351941
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
351942
|
+
|
|
351943
|
+
No tasks in this session.
|
|
351944
|
+
Tasks are created automatically when the agent plans work,
|
|
351945
|
+
or use /taskmaster add "description" to add one manually.`
|
|
351946
|
+
)
|
|
351947
|
+
};
|
|
351948
|
+
}
|
|
351949
|
+
const pending = todos.filter((t3) => t3.status === "pending").length;
|
|
351950
|
+
const inProgress = todos.filter(
|
|
351951
|
+
(t3) => t3.status === "in_progress"
|
|
351952
|
+
).length;
|
|
351953
|
+
const completed = todos.filter((t3) => t3.status === "completed").length;
|
|
351954
|
+
return {
|
|
351955
|
+
type: "message",
|
|
351956
|
+
messageType: "info",
|
|
351957
|
+
content: t2(
|
|
351958
|
+
`Taskmaster Status
|
|
351605
351959
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
351606
351960
|
|
|
351607
|
-
|
|
351608
|
-
|
|
351961
|
+
${pending} pending, ${inProgress} in-progress, ${completed} completed
|
|
351962
|
+
Total: ${todos.length} task${todos.length !== 1 ? "s" : ""}
|
|
351609
351963
|
|
|
351610
|
-
|
|
351611
|
-
|
|
351612
|
-
|
|
351964
|
+
Use /taskmaster view to see all tasks.`
|
|
351965
|
+
)
|
|
351966
|
+
};
|
|
351967
|
+
}, "action")
|
|
351613
351968
|
},
|
|
351614
351969
|
{
|
|
351615
351970
|
name: "view",
|
|
@@ -351617,22 +351972,41 @@ Use /taskmaster view to see all tasks.`)
|
|
|
351617
351972
|
return t2("View all current tasks");
|
|
351618
351973
|
},
|
|
351619
351974
|
kind: "built-in" /* BUILT_IN */,
|
|
351620
|
-
action: /* @__PURE__ */ __name(async (
|
|
351621
|
-
|
|
351622
|
-
|
|
351623
|
-
|
|
351975
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
351976
|
+
const todos = await getCurrentTodos(context2);
|
|
351977
|
+
if (todos.length === 0) {
|
|
351978
|
+
return {
|
|
351979
|
+
type: "message",
|
|
351980
|
+
messageType: "info",
|
|
351981
|
+
content: t2(
|
|
351982
|
+
`Current Tasks
|
|
351624
351983
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
351625
351984
|
|
|
351626
|
-
No tasks
|
|
351627
|
-
Tasks will appear here when the agent is working.
|
|
351985
|
+
No tasks in this session.
|
|
351628
351986
|
|
|
351629
|
-
Tip: Use /taskmaster add "task description" to
|
|
351630
|
-
|
|
351987
|
+
Tip: Use /taskmaster add "task description" to add a task.`
|
|
351988
|
+
)
|
|
351989
|
+
};
|
|
351990
|
+
}
|
|
351991
|
+
const lines = todos.map(
|
|
351992
|
+
(todo) => ` ${statusIcon2(todo.status)} ${todo.content}`
|
|
351993
|
+
);
|
|
351994
|
+
return {
|
|
351995
|
+
type: "message",
|
|
351996
|
+
messageType: "info",
|
|
351997
|
+
content: t2(
|
|
351998
|
+
`Current Tasks
|
|
351999
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
352000
|
+
|
|
352001
|
+
${lines.join("\n")}`
|
|
352002
|
+
)
|
|
352003
|
+
};
|
|
352004
|
+
}, "action")
|
|
351631
352005
|
},
|
|
351632
352006
|
{
|
|
351633
352007
|
name: "add",
|
|
351634
352008
|
get description() {
|
|
351635
|
-
return t2("Add a task
|
|
352009
|
+
return t2("Add a task via the AI agent");
|
|
351636
352010
|
},
|
|
351637
352011
|
kind: "built-in" /* BUILT_IN */,
|
|
351638
352012
|
action: /* @__PURE__ */ __name(async (_context, args) => {
|
|
@@ -351641,76 +352015,34 @@ Tip: Use /taskmaster add "task description" to manually add a task.`)
|
|
|
351641
352015
|
return {
|
|
351642
352016
|
type: "message",
|
|
351643
352017
|
messageType: "error",
|
|
351644
|
-
content: t2(
|
|
352018
|
+
content: t2(
|
|
352019
|
+
'Please provide a task description: /taskmaster add "task description"'
|
|
352020
|
+
)
|
|
351645
352021
|
};
|
|
351646
352022
|
}
|
|
351647
352023
|
return {
|
|
351648
|
-
type: "
|
|
351649
|
-
|
|
351650
|
-
|
|
351651
|
-
|
|
351652
|
-
|
|
351653
|
-
|
|
351654
|
-
|
|
351655
|
-
The task has been added to the queue and will be processed.`)
|
|
352024
|
+
type: "submit_prompt",
|
|
352025
|
+
content: [
|
|
352026
|
+
{
|
|
352027
|
+
text: `Add the following task to the todo list using the todo_write tool: "${taskDescription}"`
|
|
352028
|
+
}
|
|
352029
|
+
]
|
|
351656
352030
|
};
|
|
351657
352031
|
}, "action")
|
|
351658
352032
|
},
|
|
351659
352033
|
{
|
|
351660
352034
|
name: "clear",
|
|
351661
352035
|
get description() {
|
|
351662
|
-
return t2("Clear all tasks
|
|
352036
|
+
return t2("Clear all tasks via the AI agent");
|
|
351663
352037
|
},
|
|
351664
352038
|
kind: "built-in" /* BUILT_IN */,
|
|
351665
352039
|
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
351666
|
-
type: "
|
|
351667
|
-
|
|
351668
|
-
|
|
351669
|
-
|
|
351670
|
-
|
|
351671
|
-
|
|
351672
|
-
name: "pause",
|
|
351673
|
-
get description() {
|
|
351674
|
-
return t2("Pause task processing");
|
|
351675
|
-
},
|
|
351676
|
-
kind: "built-in" /* BUILT_IN */,
|
|
351677
|
-
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
351678
|
-
type: "message",
|
|
351679
|
-
messageType: "info",
|
|
351680
|
-
content: t2("Task processing paused. Use /taskmaster resume to continue.")
|
|
351681
|
-
}), "action")
|
|
351682
|
-
},
|
|
351683
|
-
{
|
|
351684
|
-
name: "resume",
|
|
351685
|
-
get description() {
|
|
351686
|
-
return t2("Resume task processing");
|
|
351687
|
-
},
|
|
351688
|
-
kind: "built-in" /* BUILT_IN */,
|
|
351689
|
-
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
351690
|
-
type: "message",
|
|
351691
|
-
messageType: "info",
|
|
351692
|
-
content: t2("Task processing resumed.")
|
|
351693
|
-
}), "action")
|
|
351694
|
-
},
|
|
351695
|
-
{
|
|
351696
|
-
name: "agents",
|
|
351697
|
-
get description() {
|
|
351698
|
-
return t2("Show agent status and activity");
|
|
351699
|
-
},
|
|
351700
|
-
kind: "built-in" /* BUILT_IN */,
|
|
351701
|
-
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
351702
|
-
type: "message",
|
|
351703
|
-
messageType: "info",
|
|
351704
|
-
content: t2(`Agent Status
|
|
351705
|
-
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
351706
|
-
|
|
351707
|
-
\u{1F3AF} Orchestrator: Ready
|
|
351708
|
-
\u{1F4BB} Coder: Idle
|
|
351709
|
-
\u{1F441}\uFE0F Reviewer: Idle
|
|
351710
|
-
\u{1F9EA} Tester: Idle
|
|
351711
|
-
\u{1F4CA} Analyst: Idle
|
|
351712
|
-
|
|
351713
|
-
All agents are standing by for task assignment.`)
|
|
352040
|
+
type: "submit_prompt",
|
|
352041
|
+
content: [
|
|
352042
|
+
{
|
|
352043
|
+
text: "Clear all tasks from the todo list using the todo_write tool with an empty todos array."
|
|
352044
|
+
}
|
|
352045
|
+
]
|
|
351714
352046
|
}), "action")
|
|
351715
352047
|
}
|
|
351716
352048
|
],
|
|
@@ -351719,32 +352051,29 @@ All agents are standing by for task assignment.`)
|
|
|
351719
352051
|
return {
|
|
351720
352052
|
type: "message",
|
|
351721
352053
|
messageType: "error",
|
|
351722
|
-
content: t2(
|
|
351723
|
-
|
|
352054
|
+
content: t2(
|
|
352055
|
+
`Unknown subcommand: ${args.trim()}
|
|
352056
|
+
Use /taskmaster for help.`
|
|
352057
|
+
)
|
|
351724
352058
|
};
|
|
351725
352059
|
}
|
|
351726
352060
|
return {
|
|
351727
352061
|
type: "message",
|
|
351728
352062
|
messageType: "info",
|
|
351729
|
-
content: t2(
|
|
352063
|
+
content: t2(
|
|
352064
|
+
`Taskmaster - Task Management
|
|
351730
352065
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
351731
352066
|
|
|
351732
|
-
|
|
351733
|
-
\u2022 Queues and prioritizes incoming prompts
|
|
351734
|
-
\u2022 Delegates tasks to specialized agents
|
|
351735
|
-
\u2022 Tracks progress and manages dependencies
|
|
351736
|
-
\u2022 Collects context from user consultation
|
|
352067
|
+
View and manage session tasks:
|
|
351737
352068
|
|
|
351738
352069
|
Commands:
|
|
351739
|
-
/taskmaster status - Show
|
|
352070
|
+
/taskmaster status - Show task counts
|
|
351740
352071
|
/taskmaster view - View all tasks
|
|
351741
|
-
/taskmaster add - Add a task
|
|
352072
|
+
/taskmaster add - Add a task
|
|
351742
352073
|
/taskmaster clear - Clear all tasks
|
|
351743
|
-
/taskmaster pause - Pause processing
|
|
351744
|
-
/taskmaster resume - Resume processing
|
|
351745
|
-
/taskmaster agents - Show agent status
|
|
351746
352074
|
|
|
351747
|
-
Shortcuts: /tm, /tasks`
|
|
352075
|
+
Shortcuts: /tm, /tasks`
|
|
352076
|
+
)
|
|
351748
352077
|
};
|
|
351749
352078
|
}, "action")
|
|
351750
352079
|
};
|
|
@@ -356814,9 +357143,7 @@ function FocusProvider({ children }) {
|
|
|
356814
357143
|
},
|
|
356815
357144
|
[]
|
|
356816
357145
|
);
|
|
356817
|
-
const currentFocus = (0, import_react36.useMemo)(() =>
|
|
356818
|
-
return focusStack.length > 0 ? focusStack[focusStack.length - 1] ?? null : null;
|
|
356819
|
-
}, [focusStack]);
|
|
357146
|
+
const currentFocus = (0, import_react36.useMemo)(() => focusStack.length > 0 ? focusStack[focusStack.length - 1] ?? null : null, [focusStack]);
|
|
356820
357147
|
const contextValue = (0, import_react36.useMemo)(
|
|
356821
357148
|
() => ({
|
|
356822
357149
|
focusStack,
|
|
@@ -376832,13 +377159,11 @@ function useFocusScope(focusId) {
|
|
|
376832
377159
|
pushFocus(focusId);
|
|
376833
377160
|
isPushedRef.current = true;
|
|
376834
377161
|
}
|
|
376835
|
-
(0, import_react59.useLayoutEffect)(() => {
|
|
376836
|
-
|
|
376837
|
-
|
|
376838
|
-
|
|
376839
|
-
|
|
376840
|
-
}
|
|
376841
|
-
};
|
|
377162
|
+
(0, import_react59.useLayoutEffect)(() => () => {
|
|
377163
|
+
if (isPushedRef.current) {
|
|
377164
|
+
popFocus(focusId);
|
|
377165
|
+
isPushedRef.current = false;
|
|
377166
|
+
}
|
|
376842
377167
|
}, [focusId, popFocus]);
|
|
376843
377168
|
return {
|
|
376844
377169
|
isFocused: hasFocus(focusId)
|
|
@@ -378444,7 +378769,7 @@ var ToolCallsList = /* @__PURE__ */ __name(({ toolCalls, displayMode }) => {
|
|
|
378444
378769
|
}, "ToolCallsList");
|
|
378445
378770
|
var ToolCallItem = /* @__PURE__ */ __name(({ toolCall, compact = false }) => {
|
|
378446
378771
|
const STATUS_INDICATOR_WIDTH2 = 3;
|
|
378447
|
-
const
|
|
378772
|
+
const statusIcon3 = import_react67.default.useMemo(() => {
|
|
378448
378773
|
const color = getStatusColor(toolCall.status);
|
|
378449
378774
|
switch (toolCall.status) {
|
|
378450
378775
|
case "executing":
|
|
@@ -378472,7 +378797,7 @@ var ToolCallItem = /* @__PURE__ */ __name(({ toolCall, compact = false }) => {
|
|
|
378472
378797
|
}, [toolCall.resultDisplay]);
|
|
378473
378798
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, marginBottom: 0, children: [
|
|
378474
378799
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
378475
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { minWidth: STATUS_INDICATOR_WIDTH2, children:
|
|
378800
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { minWidth: STATUS_INDICATOR_WIDTH2, children: statusIcon3 }),
|
|
378476
378801
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text3, { wrap: "truncate-end", children: [
|
|
378477
378802
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text3, { children: toolCall.name }),
|
|
378478
378803
|
" ",
|
|
@@ -380791,7 +381116,7 @@ var HistoryItemDisplayComponent = /* @__PURE__ */ __name(({
|
|
|
380791
381116
|
}
|
|
380792
381117
|
),
|
|
380793
381118
|
itemForDisplay.type === "compression" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CompressionMessage, { compression: itemForDisplay.compression }),
|
|
380794
|
-
|
|
381119
|
+
itemForDisplay.type === "summary" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SummaryMessage, { summary: itemForDisplay.summary }),
|
|
380795
381120
|
itemForDisplay.type === "extensions_list" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ExtensionsList, {}),
|
|
380796
381121
|
itemForDisplay.type === "tools_list" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
380797
381122
|
ToolsList,
|
|
@@ -382859,7 +383184,7 @@ function OpenAIKeyPrompt({
|
|
|
382859
383184
|
return;
|
|
382860
383185
|
}
|
|
382861
383186
|
if (input && input.length > 0) {
|
|
382862
|
-
|
|
383187
|
+
const cleanInput = input.replace(/\[200~/g, "").replace(/\[201~/g, "").replace(/\[\d*[A-Za-z]/g, "").replace(/\[[\d;]*[A-Za-z]/g, "").split("").filter((ch) => {
|
|
382863
383188
|
const code2 = ch.charCodeAt(0);
|
|
382864
383189
|
return code2 >= 32 && code2 !== 127;
|
|
382865
383190
|
}).join("").trim();
|
|
@@ -382983,6 +383308,11 @@ function AuthDialog() {
|
|
|
382983
383308
|
label: t2("GROQ (Kimi K2 - Fast Inference)"),
|
|
382984
383309
|
value: AuthType.USE_GROQ
|
|
382985
383310
|
},
|
|
383311
|
+
{
|
|
383312
|
+
key: AuthType.USE_ANTHROPIC,
|
|
383313
|
+
label: t2("Anthropic (Claude Models)"),
|
|
383314
|
+
value: AuthType.USE_ANTHROPIC
|
|
383315
|
+
},
|
|
382986
383316
|
{
|
|
382987
383317
|
key: AuthType.USE_OPENAI,
|
|
382988
383318
|
label: t2("OpenAI Compatible API"),
|
|
@@ -383059,9 +383389,7 @@ function AuthDialog() {
|
|
|
383059
383389
|
) }),
|
|
383060
383390
|
(authError || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text3, { color: Colors.AccentRed, children: authError || errorMessage }) }),
|
|
383061
383391
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text3, { color: Colors.AccentPurple, children: t2("Press Enter to continue") }) }),
|
|
383062
|
-
hasApiKey && currentSelectedAuthType === AuthType.OLLAMA_CLOUD && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text3, { color: Colors.Gray, dimColor: true, children: t2(
|
|
383063
|
-
"Your existing API key will be preserved."
|
|
383064
|
-
) }) }),
|
|
383392
|
+
hasApiKey && currentSelectedAuthType === AuthType.OLLAMA_CLOUD && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text3, { color: Colors.Gray, dimColor: true, children: t2("Your existing API key will be preserved.") }) }),
|
|
383065
383393
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Box_default, { marginTop: 1, flexDirection: "row", justifyContent: "space-between", children: [
|
|
383066
383394
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text3, { color: Colors.Gray, dimColor: true, children: "Powered by Ollama & GROQ" }),
|
|
383067
383395
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text3, { color: Colors.AccentBlue, children: "https://osa.dev" })
|
|
@@ -384468,11 +384796,15 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
384468
384796
|
OpenAIKeyPrompt,
|
|
384469
384797
|
{
|
|
384470
384798
|
onSubmit: (apiKey, baseUrl, model) => {
|
|
384471
|
-
uiActions.handleAuthSelect(
|
|
384472
|
-
|
|
384473
|
-
|
|
384474
|
-
|
|
384475
|
-
|
|
384799
|
+
uiActions.handleAuthSelect(
|
|
384800
|
+
AuthType.USE_OPENAI,
|
|
384801
|
+
"User" /* User */,
|
|
384802
|
+
{
|
|
384803
|
+
apiKey,
|
|
384804
|
+
baseUrl,
|
|
384805
|
+
model
|
|
384806
|
+
}
|
|
384807
|
+
);
|
|
384476
384808
|
},
|
|
384477
384809
|
onCancel: () => {
|
|
384478
384810
|
uiActions.cancelAuthentication();
|
|
@@ -384490,19 +384822,23 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
384490
384822
|
{
|
|
384491
384823
|
onSubmit: (apiKey, baseUrl, model) => {
|
|
384492
384824
|
process34.env["OLLAMA_API_KEY"] = apiKey;
|
|
384493
|
-
uiActions.handleAuthSelect(
|
|
384494
|
-
|
|
384495
|
-
|
|
384496
|
-
|
|
384497
|
-
|
|
384825
|
+
uiActions.handleAuthSelect(
|
|
384826
|
+
AuthType.OLLAMA_CLOUD,
|
|
384827
|
+
"User" /* User */,
|
|
384828
|
+
{
|
|
384829
|
+
apiKey,
|
|
384830
|
+
baseUrl: "https://ollama.com",
|
|
384831
|
+
model: model || "qwen3-coder:480b-cloud"
|
|
384832
|
+
}
|
|
384833
|
+
);
|
|
384498
384834
|
},
|
|
384499
384835
|
onCancel: () => {
|
|
384500
384836
|
uiActions.cancelAuthentication();
|
|
384501
384837
|
uiActions.setAuthState("updating" /* Updating */);
|
|
384502
384838
|
},
|
|
384503
384839
|
defaultApiKey: process34.env["OLLAMA_API_KEY"] || "",
|
|
384504
|
-
defaultBaseUrl: "https://ollama.com
|
|
384505
|
-
defaultModel: "qwen3-coder:480b",
|
|
384840
|
+
defaultBaseUrl: "https://ollama.com",
|
|
384841
|
+
defaultModel: "qwen3-coder:480b-cloud",
|
|
384506
384842
|
providerName: "Ollama Cloud",
|
|
384507
384843
|
apiKeyUrl: "https://ollama.com/settings/keys"
|
|
384508
384844
|
}
|
|
@@ -384533,6 +384869,34 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
384533
384869
|
}
|
|
384534
384870
|
) }, "groq-key-prompt");
|
|
384535
384871
|
}
|
|
384872
|
+
if (uiState.pendingAuthType === AuthType.USE_ANTHROPIC) {
|
|
384873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
384874
|
+
OpenAIKeyPrompt,
|
|
384875
|
+
{
|
|
384876
|
+
onSubmit: (apiKey, _baseUrl, model) => {
|
|
384877
|
+
process34.env["ANTHROPIC_API_KEY"] = apiKey;
|
|
384878
|
+
uiActions.handleAuthSelect(
|
|
384879
|
+
AuthType.USE_ANTHROPIC,
|
|
384880
|
+
"User" /* User */,
|
|
384881
|
+
{
|
|
384882
|
+
apiKey,
|
|
384883
|
+
baseUrl: "https://api.anthropic.com",
|
|
384884
|
+
model: model || "claude-sonnet-4-20250514"
|
|
384885
|
+
}
|
|
384886
|
+
);
|
|
384887
|
+
},
|
|
384888
|
+
onCancel: () => {
|
|
384889
|
+
uiActions.cancelAuthentication();
|
|
384890
|
+
uiActions.setAuthState("updating" /* Updating */);
|
|
384891
|
+
},
|
|
384892
|
+
defaultApiKey: process34.env["ANTHROPIC_API_KEY"] || "",
|
|
384893
|
+
defaultBaseUrl: "https://api.anthropic.com",
|
|
384894
|
+
defaultModel: "claude-sonnet-4-20250514",
|
|
384895
|
+
providerName: "Anthropic",
|
|
384896
|
+
apiKeyUrl: "https://console.anthropic.com/settings/keys"
|
|
384897
|
+
}
|
|
384898
|
+
) }, "anthropic-key-prompt");
|
|
384899
|
+
}
|
|
384536
384900
|
if (uiState.pendingAuthType === AuthType.OLLAMA_LOCAL) {
|
|
384537
384901
|
const ollamaHost = process34.env["OLLAMA_HOST"];
|
|
384538
384902
|
const ollamaBaseUrl = process34.env["OLLAMA_BASE_URL"];
|
|
@@ -384546,11 +384910,15 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
384546
384910
|
OllamaModelSelector,
|
|
384547
384911
|
{
|
|
384548
384912
|
onSelect: (model) => {
|
|
384549
|
-
uiActions.handleAuthSelect(
|
|
384550
|
-
|
|
384551
|
-
|
|
384552
|
-
|
|
384553
|
-
|
|
384913
|
+
uiActions.handleAuthSelect(
|
|
384914
|
+
AuthType.OLLAMA_LOCAL,
|
|
384915
|
+
"User" /* User */,
|
|
384916
|
+
{
|
|
384917
|
+
apiKey: "ollama",
|
|
384918
|
+
baseUrl: `${baseUrl}/v1`,
|
|
384919
|
+
model
|
|
384920
|
+
}
|
|
384921
|
+
);
|
|
384554
384922
|
},
|
|
384555
384923
|
onCancel: () => {
|
|
384556
384924
|
uiActions.cancelAuthentication();
|
|
@@ -387027,7 +387395,7 @@ var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
|
387027
387395
|
(0, import_react104.useEffect)(() => {
|
|
387028
387396
|
const updateMemory = /* @__PURE__ */ __name(() => {
|
|
387029
387397
|
const usage2 = process35.memoryUsage().rss;
|
|
387030
|
-
setMemoryUsage(
|
|
387398
|
+
setMemoryUsage(formatMemoryUsage(usage2));
|
|
387031
387399
|
setMemoryUsageColor(
|
|
387032
387400
|
usage2 >= 2 * 1024 * 1024 * 1024 ? theme.status.error : theme.text.secondary
|
|
387033
387401
|
);
|
|
@@ -387842,41 +388210,23 @@ var OrchestrationProvider = /* @__PURE__ */ __name(({
|
|
|
387842
388210
|
const result = await defaultOrchestrator.submit(prompt, { priority });
|
|
387843
388211
|
return result.promptId;
|
|
387844
388212
|
}, []);
|
|
387845
|
-
const cancelPrompt = (0, import_react109.useCallback)((promptId) =>
|
|
387846
|
-
|
|
387847
|
-
|
|
387848
|
-
const getPrompt = (0, import_react109.useCallback)((promptId) => {
|
|
387849
|
-
return defaultOrchestrator.getPrompt(promptId);
|
|
387850
|
-
}, []);
|
|
387851
|
-
const getQueueStats = (0, import_react109.useCallback)(() => {
|
|
387852
|
-
return defaultOrchestrator.getStats();
|
|
387853
|
-
}, []);
|
|
388213
|
+
const cancelPrompt = (0, import_react109.useCallback)((promptId) => defaultOrchestrator.cancel(promptId), []);
|
|
388214
|
+
const getPrompt = (0, import_react109.useCallback)((promptId) => defaultOrchestrator.getPrompt(promptId), []);
|
|
388215
|
+
const getQueueStats = (0, import_react109.useCallback)(() => defaultOrchestrator.getStats(), []);
|
|
387854
388216
|
const clearEvents = (0, import_react109.useCallback)(() => {
|
|
387855
388217
|
setState((prev) => ({ ...prev, events: [] }));
|
|
387856
388218
|
}, []);
|
|
387857
|
-
const getAgent = (0, import_react109.useCallback)((id) =>
|
|
387858
|
-
|
|
387859
|
-
|
|
387860
|
-
const
|
|
387861
|
-
|
|
387862
|
-
}, []);
|
|
387863
|
-
const findAgentsForPrompt = (0, import_react109.useCallback)((prompt) => {
|
|
387864
|
-
return defaultAgentRegistry.findAgentsForPrompt(prompt);
|
|
387865
|
-
}, []);
|
|
387866
|
-
const getSkill = (0, import_react109.useCallback)((id) => {
|
|
387867
|
-
return defaultSkillRegistry.getSkill(id);
|
|
387868
|
-
}, []);
|
|
387869
|
-
const getActiveSkills = (0, import_react109.useCallback)(() => {
|
|
387870
|
-
return defaultSkillRegistry.getActiveSkills();
|
|
387871
|
-
}, []);
|
|
388219
|
+
const getAgent = (0, import_react109.useCallback)((id) => defaultAgentRegistry.getAgent(id), []);
|
|
388220
|
+
const getAgentsByTier = (0, import_react109.useCallback)((tier) => defaultAgentRegistry.getAgentsByTier(tier), []);
|
|
388221
|
+
const findAgentsForPrompt = (0, import_react109.useCallback)((prompt) => defaultAgentRegistry.findAgentsForPrompt(prompt), []);
|
|
388222
|
+
const getSkill = (0, import_react109.useCallback)((id) => defaultSkillRegistry.getSkill(id), []);
|
|
388223
|
+
const getActiveSkills = (0, import_react109.useCallback)(() => defaultSkillRegistry.getActiveSkills(), []);
|
|
387872
388224
|
const updateContext2 = (0, import_react109.useCallback)((directory, file, task) => {
|
|
387873
388225
|
const context2 = defaultContextManager.updateContext(directory, file, task);
|
|
387874
388226
|
setState((prev) => ({ ...prev, context: context2 }));
|
|
387875
388227
|
return context2;
|
|
387876
388228
|
}, []);
|
|
387877
|
-
const getContext2 = (0, import_react109.useCallback)(() =>
|
|
387878
|
-
return defaultContextManager.getContext();
|
|
387879
|
-
}, []);
|
|
388229
|
+
const getContext2 = (0, import_react109.useCallback)(() => defaultContextManager.getContext(), []);
|
|
387880
388230
|
const createAgent = (0, import_react109.useCallback)((spec) => {
|
|
387881
388231
|
const agent = defaultFactoryManager.createAgent(spec);
|
|
387882
388232
|
defaultAgentRegistry.registerAgent(agent);
|
|
@@ -387904,9 +388254,7 @@ var OrchestrationProvider = /* @__PURE__ */ __name(({
|
|
|
387904
388254
|
setState((prev) => ({ ...prev, verification: result, status: "complete" }));
|
|
387905
388255
|
return result;
|
|
387906
388256
|
}, []);
|
|
387907
|
-
const formatResponse = (0, import_react109.useCallback)((content, metadata, verification) =>
|
|
387908
|
-
return defaultResponseFormatter.formatCompleteResponse(content, metadata, verification);
|
|
387909
|
-
}, []);
|
|
388257
|
+
const formatResponse = (0, import_react109.useCallback)((content, metadata, verification) => defaultResponseFormatter.formatCompleteResponse(content, metadata, verification), []);
|
|
387910
388258
|
const value = (0, import_react109.useMemo)(
|
|
387911
388259
|
() => ({
|
|
387912
388260
|
state,
|
|
@@ -388486,10 +388834,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config2, addItem) => {
|
|
|
388486
388834
|
const [pendingAuthType, setPendingAuthType] = (0, import_react114.useState)(
|
|
388487
388835
|
void 0
|
|
388488
388836
|
);
|
|
388489
|
-
const { deviceAuthState, cancelDeviceAuth: _cancelDeviceAuth } = useDeviceAuth(
|
|
388490
|
-
pendingAuthType,
|
|
388491
|
-
isAuthenticating
|
|
388492
|
-
);
|
|
388837
|
+
const { deviceAuthState, cancelDeviceAuth: _cancelDeviceAuth } = useDeviceAuth(pendingAuthType, isAuthenticating);
|
|
388493
388838
|
const onAuthError = (0, import_react114.useCallback)(
|
|
388494
388839
|
(error2) => {
|
|
388495
388840
|
setAuthError(error2);
|
|
@@ -388541,6 +388886,23 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config2, addItem) => {
|
|
|
388541
388886
|
if (credentials?.model != null) {
|
|
388542
388887
|
settings.setValue(scope, "model.name", credentials.model);
|
|
388543
388888
|
}
|
|
388889
|
+
if (credentials?.apiKey != null) {
|
|
388890
|
+
const providerKey = authType.replace(/-/g, "_");
|
|
388891
|
+
const currentProviders = settings.merged.security?.auth?.providers || {};
|
|
388892
|
+
const updatedProviders = {
|
|
388893
|
+
...currentProviders,
|
|
388894
|
+
[providerKey]: {
|
|
388895
|
+
...currentProviders[providerKey],
|
|
388896
|
+
apiKey: credentials.apiKey,
|
|
388897
|
+
model: credentials.model || currentProviders[providerKey]?.model
|
|
388898
|
+
}
|
|
388899
|
+
};
|
|
388900
|
+
settings.setValue(
|
|
388901
|
+
scope,
|
|
388902
|
+
"security.auth.providers",
|
|
388903
|
+
updatedProviders
|
|
388904
|
+
);
|
|
388905
|
+
}
|
|
388544
388906
|
await clearCachedCredentialFile();
|
|
388545
388907
|
}
|
|
388546
388908
|
} catch (error2) {
|
|
@@ -388631,6 +388993,23 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config2, addItem) => {
|
|
|
388631
388993
|
});
|
|
388632
388994
|
return;
|
|
388633
388995
|
}
|
|
388996
|
+
if (authType === AuthType.USE_ANTHROPIC) {
|
|
388997
|
+
if (credentials) {
|
|
388998
|
+
const effectiveBaseUrl = credentials.baseUrl || "https://api.anthropic.com";
|
|
388999
|
+
const effectiveModel = credentials.model || "claude-sonnet-4-20250514";
|
|
389000
|
+
config2.updateCredentials({
|
|
389001
|
+
apiKey: credentials.apiKey,
|
|
389002
|
+
baseUrl: effectiveBaseUrl,
|
|
389003
|
+
model: effectiveModel
|
|
389004
|
+
});
|
|
389005
|
+
await performAuth(authType, scope, {
|
|
389006
|
+
...credentials,
|
|
389007
|
+
baseUrl: effectiveBaseUrl,
|
|
389008
|
+
model: effectiveModel
|
|
389009
|
+
});
|
|
389010
|
+
}
|
|
389011
|
+
return;
|
|
389012
|
+
}
|
|
388634
389013
|
if (authType === AuthType.USE_GROQ) {
|
|
388635
389014
|
if (credentials) {
|
|
388636
389015
|
const effectiveBaseUrl = "https://api.groq.com/openai/v1";
|
|
@@ -388676,7 +389055,8 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config2, addItem) => {
|
|
|
388676
389055
|
AuthType.USE_OPENAI,
|
|
388677
389056
|
AuthType.OLLAMA_CLOUD,
|
|
388678
389057
|
AuthType.OLLAMA_LOCAL,
|
|
388679
|
-
AuthType.USE_GROQ
|
|
389058
|
+
AuthType.USE_GROQ,
|
|
389059
|
+
AuthType.USE_ANTHROPIC
|
|
388680
389060
|
];
|
|
388681
389061
|
if (defaultAuthType && !validAuthTypes.includes(defaultAuthType)) {
|
|
388682
389062
|
onAuthError(
|
|
@@ -389902,7 +390282,7 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
|
|
|
389902
390282
|
let currentDisplayOutput;
|
|
389903
390283
|
if (isBinaryStream) {
|
|
389904
390284
|
if (binaryBytesReceived > 0) {
|
|
389905
|
-
currentDisplayOutput = `[Receiving binary output... ${
|
|
390285
|
+
currentDisplayOutput = `[Receiving binary output... ${formatMemoryUsage(
|
|
389906
390286
|
binaryBytesReceived
|
|
389907
390287
|
)} received]`;
|
|
389908
390288
|
} else {
|
|
@@ -396120,13 +396500,21 @@ function scanProjectSync(config2) {
|
|
|
396120
396500
|
if (checks.packageJson) {
|
|
396121
396501
|
projectType = "node";
|
|
396122
396502
|
try {
|
|
396123
|
-
const pkg2 = JSON.parse(
|
|
396124
|
-
|
|
396125
|
-
|
|
396126
|
-
if (pkg2.dependencies?.
|
|
396127
|
-
|
|
396128
|
-
if (pkg2.dependencies?.
|
|
396129
|
-
|
|
396503
|
+
const pkg2 = JSON.parse(
|
|
396504
|
+
fs98.readFileSync(path114.join(targetDir, "package.json"), "utf-8")
|
|
396505
|
+
);
|
|
396506
|
+
if (pkg2.dependencies?.react || pkg2.devDependencies?.react)
|
|
396507
|
+
mainTech.push("React");
|
|
396508
|
+
if (pkg2.dependencies?.next || pkg2.devDependencies?.next)
|
|
396509
|
+
mainTech.push("Next.js");
|
|
396510
|
+
if (pkg2.dependencies?.svelte || pkg2.devDependencies?.svelte)
|
|
396511
|
+
mainTech.push("Svelte");
|
|
396512
|
+
if (pkg2.dependencies?.vue || pkg2.devDependencies?.vue)
|
|
396513
|
+
mainTech.push("Vue");
|
|
396514
|
+
if (pkg2.dependencies?.typescript || pkg2.devDependencies?.typescript)
|
|
396515
|
+
mainTech.push("TypeScript");
|
|
396516
|
+
if (pkg2.dependencies?.express || pkg2.devDependencies?.express)
|
|
396517
|
+
mainTech.push("Express");
|
|
396130
396518
|
if (pkg2.workspaces) mainTech.push("Monorepo");
|
|
396131
396519
|
} catch {
|
|
396132
396520
|
}
|
|
@@ -396155,7 +396543,9 @@ function scanProjectSync(config2) {
|
|
|
396155
396543
|
if (entry.name.startsWith(".")) continue;
|
|
396156
396544
|
if (entry.isDirectory()) {
|
|
396157
396545
|
dirCount++;
|
|
396158
|
-
if (["src", "lib", "app", "packages", "cmd", "internal"].includes(
|
|
396546
|
+
if (["src", "lib", "app", "packages", "cmd", "internal"].includes(
|
|
396547
|
+
entry.name
|
|
396548
|
+
)) {
|
|
396159
396549
|
entryPoints.push(entry.name);
|
|
396160
396550
|
}
|
|
396161
396551
|
} else {
|
|
@@ -396167,7 +396557,9 @@ function scanProjectSync(config2) {
|
|
|
396167
396557
|
let description;
|
|
396168
396558
|
if (checks.packageJson) {
|
|
396169
396559
|
try {
|
|
396170
|
-
const pkg2 = JSON.parse(
|
|
396560
|
+
const pkg2 = JSON.parse(
|
|
396561
|
+
fs98.readFileSync(path114.join(targetDir, "package.json"), "utf-8")
|
|
396562
|
+
);
|
|
396171
396563
|
description = pkg2.description;
|
|
396172
396564
|
} catch {
|
|
396173
396565
|
}
|
|
@@ -396204,7 +396596,9 @@ function generateGreeting(info) {
|
|
|
396204
396596
|
} else if (info.hasReadme) {
|
|
396205
396597
|
parts.push(`No OSAGENT.md yet. Run \`/init\` for deep project analysis.`);
|
|
396206
396598
|
} else {
|
|
396207
|
-
parts.push(
|
|
396599
|
+
parts.push(
|
|
396600
|
+
`No README or OSAGENT.md found. Run \`/init\` to set up context.`
|
|
396601
|
+
);
|
|
396208
396602
|
}
|
|
396209
396603
|
parts.push(`
|
|
396210
396604
|
What would you like to do?`);
|
|
@@ -396475,7 +396869,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
396475
396869
|
addItem(
|
|
396476
396870
|
{
|
|
396477
396871
|
type: "error" /* ERROR */,
|
|
396478
|
-
text:
|
|
396872
|
+
text: getErrorMessage(error2)
|
|
396479
396873
|
},
|
|
396480
396874
|
Date.now()
|
|
396481
396875
|
);
|
|
@@ -400359,7 +400753,7 @@ var Session2 = class {
|
|
|
400359
400753
|
}
|
|
400360
400754
|
} catch (globError) {
|
|
400361
400755
|
console.error(
|
|
400362
|
-
`Error during glob search for ${pathName}: ${
|
|
400756
|
+
`Error during glob search for ${pathName}: ${getErrorMessage(globError)}`
|
|
400363
400757
|
);
|
|
400364
400758
|
}
|
|
400365
400759
|
} else {
|
|
@@ -400487,7 +400881,7 @@ Content from @${filePathSpecInContent}:
|
|
|
400487
400881
|
type: "content",
|
|
400488
400882
|
content: {
|
|
400489
400883
|
type: "text",
|
|
400490
|
-
text: `Error reading files (${contentLabelsForDisplay.join(", ")}): ${
|
|
400884
|
+
text: `Error reading files (${contentLabelsForDisplay.join(", ")}): ${getErrorMessage(error2)}`
|
|
400491
400885
|
}
|
|
400492
400886
|
}
|
|
400493
400887
|
]
|