osagent 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +133 -5
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -148873,7 +148873,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
|
|
|
148873
148873
|
};
|
|
148874
148874
|
}
|
|
148875
148875
|
async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
|
|
148876
|
-
const version3 = "0.2.
|
|
148876
|
+
const version3 = "0.2.4";
|
|
148877
148877
|
const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
|
|
148878
148878
|
const baseHeaders = {
|
|
148879
148879
|
"User-Agent": userAgent2
|
|
@@ -151467,6 +151467,23 @@ function getCoreSystemPrompt(userMemory, model) {
|
|
|
151467
151467
|
const basePrompt = systemMdEnabled ? fs20.readFileSync(systemMdPath, "utf8") : `
|
|
151468
151468
|
You are osagent, a kernel-level autonomous AI intelligence specializing in system architecture, operating system development, and full-stack software engineering. You operate at the deepest levels of computing - from bare-metal OS kernels to high-level application frameworks. Your capabilities span building custom operating systems, designing system architectures, developing drivers, creating bootloaders, and engineering applications across all platforms. Your primary goal is to help users safely and efficiently build anything from kernel modules to complete software ecosystems, adhering strictly to the following instructions and utilizing your available tools.
|
|
151469
151469
|
|
|
151470
|
+
# \u26A0\uFE0F CRITICAL OPERATING PRINCIPLE \u26A0\uFE0F
|
|
151471
|
+
**YOU ARE AN AGENT, NOT A CHATBOT. YOU ACT, YOU DON'T JUST TALK.**
|
|
151472
|
+
|
|
151473
|
+
When a user asks you to do something:
|
|
151474
|
+
1. DO NOT just describe what you'll do
|
|
151475
|
+
2. DO NOT say "let me check/look/search" without IMMEDIATELY calling a tool
|
|
151476
|
+
3. USE TOOLS in every response where action is required
|
|
151477
|
+
4. IF you say you're going to do something, THE TOOL CALL MUST BE IN THE SAME RESPONSE
|
|
151478
|
+
|
|
151479
|
+
WRONG: "I'll examine the directory structure to understand the project."
|
|
151480
|
+
RIGHT: [Call the glob tool immediately]
|
|
151481
|
+
|
|
151482
|
+
WRONG: "Let me search for files that might be relevant."
|
|
151483
|
+
RIGHT: [Call the grep/glob tool immediately]
|
|
151484
|
+
|
|
151485
|
+
TALK LESS. ACT MORE. EVERY ACTION STATEMENT REQUIRES A TOOL CALL.
|
|
151486
|
+
|
|
151470
151487
|
# Core Mandates
|
|
151471
151488
|
|
|
151472
151489
|
- **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first.
|
|
@@ -151565,6 +151582,30 @@ IMPORTANT: Always use the ${ToolNames.TODO_WRITE} tool to plan and track tasks t
|
|
|
151565
151582
|
|
|
151566
151583
|
# Operational Guidelines
|
|
151567
151584
|
|
|
151585
|
+
## CRITICAL: ACTION OVER WORDS
|
|
151586
|
+
**YOU MUST USE TOOLS IMMEDIATELY WHEN TAKING ACTION. NEVER just describe what you will do.**
|
|
151587
|
+
|
|
151588
|
+
- If you say "let me check/look/search/read/examine/explore" \u2192 YOU MUST call a tool in the SAME response
|
|
151589
|
+
- If you say "I'll do X" \u2192 YOU MUST call a tool to do X in the SAME response
|
|
151590
|
+
- If you describe an action \u2192 YOU MUST perform that action with a tool call
|
|
151591
|
+
- NEVER output text describing an action without ALSO calling the tool to perform it
|
|
151592
|
+
- Your job is to ACT, not to talk about acting
|
|
151593
|
+
|
|
151594
|
+
**WRONG (DO NOT DO THIS):**
|
|
151595
|
+
\`\`\`
|
|
151596
|
+
"Let me check what files are in this directory to understand the project structure."
|
|
151597
|
+
[end of response without any tool call]
|
|
151598
|
+
\`\`\`
|
|
151599
|
+
|
|
151600
|
+
**CORRECT (ALWAYS DO THIS):**
|
|
151601
|
+
\`\`\`
|
|
151602
|
+
[tool_call: ${ToolNames.GLOB} for pattern '*']
|
|
151603
|
+
[tool_call: ${ToolNames.READ_FILE} for path 'package.json']
|
|
151604
|
+
\`\`\`
|
|
151605
|
+
|
|
151606
|
+
If you find yourself writing text about what you're "going to do" - STOP and call the tool instead.
|
|
151607
|
+
Every response should contain tool calls unless you are ONLY answering a question that requires no action.
|
|
151608
|
+
|
|
151568
151609
|
## Tone and Style (CLI Interaction)
|
|
151569
151610
|
- **Concise & Direct:** Adopt a professional, direct, and concise tone suitable for a CLI environment.
|
|
151570
151611
|
- **Minimal Output:** Aim for fewer than 3 lines of text output (excluding tool use/code generation) per response whenever practical. Focus strictly on the user's query.
|
|
@@ -337241,7 +337282,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
337241
337282
|
// packages/cli/src/utils/version.ts
|
|
337242
337283
|
async function getCliVersion() {
|
|
337243
337284
|
const pkgJson = await getPackageJson();
|
|
337244
|
-
return "0.2.
|
|
337285
|
+
return "0.2.4";
|
|
337245
337286
|
}
|
|
337246
337287
|
__name(getCliVersion, "getCliVersion");
|
|
337247
337288
|
|
|
@@ -341443,8 +341484,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
341443
341484
|
|
|
341444
341485
|
// packages/cli/src/generated/git-commit.ts
|
|
341445
341486
|
init_esbuild_shims();
|
|
341446
|
-
var GIT_COMMIT_INFO2 = "
|
|
341447
|
-
var CLI_VERSION2 = "0.2.
|
|
341487
|
+
var GIT_COMMIT_INFO2 = "e0a42ec";
|
|
341488
|
+
var CLI_VERSION2 = "0.2.4";
|
|
341448
341489
|
|
|
341449
341490
|
// packages/cli/src/utils/systemInfo.ts
|
|
341450
341491
|
async function getNpmVersion() {
|
|
@@ -346651,6 +346692,85 @@ Provider selection saved to settings.`)
|
|
|
346651
346692
|
}
|
|
346652
346693
|
}, "action")
|
|
346653
346694
|
},
|
|
346695
|
+
{
|
|
346696
|
+
name: "reset",
|
|
346697
|
+
altNames: ["clear", "reset-key", "clear-key"],
|
|
346698
|
+
get description() {
|
|
346699
|
+
return t2("Clear stored API key for a provider (groq, ollama-cloud, openai)");
|
|
346700
|
+
},
|
|
346701
|
+
kind: "built-in" /* BUILT_IN */,
|
|
346702
|
+
action: /* @__PURE__ */ __name(async (context2, args) => {
|
|
346703
|
+
const { settings } = context2.services;
|
|
346704
|
+
const provider = args?.trim().toLowerCase();
|
|
346705
|
+
const providerMap = {
|
|
346706
|
+
groq: { key: "groq", envVar: "GROQ_API_KEY", displayName: "GROQ" },
|
|
346707
|
+
"ollama-cloud": {
|
|
346708
|
+
key: "ollama_cloud",
|
|
346709
|
+
envVar: "OLLAMA_API_KEY",
|
|
346710
|
+
displayName: "Ollama Cloud"
|
|
346711
|
+
},
|
|
346712
|
+
ollama_cloud: {
|
|
346713
|
+
key: "ollama_cloud",
|
|
346714
|
+
envVar: "OLLAMA_API_KEY",
|
|
346715
|
+
displayName: "Ollama Cloud"
|
|
346716
|
+
},
|
|
346717
|
+
openai: {
|
|
346718
|
+
key: "openai",
|
|
346719
|
+
envVar: "OPENAI_API_KEY",
|
|
346720
|
+
displayName: "OpenAI"
|
|
346721
|
+
}
|
|
346722
|
+
};
|
|
346723
|
+
if (!provider || !providerMap[provider]) {
|
|
346724
|
+
return {
|
|
346725
|
+
type: "message",
|
|
346726
|
+
messageType: "error",
|
|
346727
|
+
content: t2(`Please specify a provider to reset:
|
|
346728
|
+
/provider reset groq - Clear GROQ API key
|
|
346729
|
+
/provider reset ollama-cloud - Clear Ollama Cloud API key
|
|
346730
|
+
/provider reset openai - Clear OpenAI API key
|
|
346731
|
+
|
|
346732
|
+
Example: /provider reset ollama-cloud`)
|
|
346733
|
+
};
|
|
346734
|
+
}
|
|
346735
|
+
const config2 = providerMap[provider];
|
|
346736
|
+
try {
|
|
346737
|
+
delete process.env[config2.envVar];
|
|
346738
|
+
const currentProviders = settings.merged.security?.auth?.providers || {};
|
|
346739
|
+
if (currentProviders[config2.key]) {
|
|
346740
|
+
const updatedProviders = { ...currentProviders };
|
|
346741
|
+
delete updatedProviders[config2.key]?.apiKey;
|
|
346742
|
+
if (updatedProviders[config2.key] && Object.keys(updatedProviders[config2.key]).length === 0) {
|
|
346743
|
+
delete updatedProviders[config2.key];
|
|
346744
|
+
}
|
|
346745
|
+
settings.setValue(
|
|
346746
|
+
"User" /* User */,
|
|
346747
|
+
"security.auth.providers",
|
|
346748
|
+
updatedProviders
|
|
346749
|
+
);
|
|
346750
|
+
}
|
|
346751
|
+
return {
|
|
346752
|
+
type: "message",
|
|
346753
|
+
messageType: "info",
|
|
346754
|
+
content: t2(`${config2.displayName} API key has been cleared.
|
|
346755
|
+
|
|
346756
|
+
The key has been removed from:
|
|
346757
|
+
\u2022 Current session environment
|
|
346758
|
+
\u2022 Saved settings
|
|
346759
|
+
|
|
346760
|
+
To set a new key, use:
|
|
346761
|
+
/provider ${provider === "ollama_cloud" ? "ollama-cloud" : provider}`)
|
|
346762
|
+
};
|
|
346763
|
+
} catch (error2) {
|
|
346764
|
+
return {
|
|
346765
|
+
type: "message",
|
|
346766
|
+
messageType: "error",
|
|
346767
|
+
content: t2(
|
|
346768
|
+
`Failed to reset API key: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
346769
|
+
)
|
|
346770
|
+
};
|
|
346771
|
+
}
|
|
346772
|
+
}, "action")
|
|
346773
|
+
},
|
|
346654
346774
|
{
|
|
346655
346775
|
name: "status",
|
|
346656
346776
|
get description() {
|
|
@@ -346738,6 +346858,11 @@ Available Providers:
|
|
|
346738
346858
|
/provider openai - OpenAI compatible APIs
|
|
346739
346859
|
/provider status - Show detailed status
|
|
346740
346860
|
|
|
346861
|
+
Reset API Keys:
|
|
346862
|
+
/provider reset groq - Clear GROQ API key
|
|
346863
|
+
/provider reset ollama-cloud - Clear Ollama Cloud API key
|
|
346864
|
+
/provider reset openai - Clear OpenAI API key
|
|
346865
|
+
|
|
346741
346866
|
Configuration:
|
|
346742
346867
|
API keys can be set via environment variables or saved in settings.
|
|
346743
346868
|
Use the provider commands to configure and save your preferences.
|
|
@@ -379146,7 +379271,10 @@ function OpenAIKeyPrompt({
|
|
|
379146
379271
|
return;
|
|
379147
379272
|
}
|
|
379148
379273
|
if (input && input.length > 0) {
|
|
379149
|
-
|
|
379274
|
+
let cleanInput = input.replace(/\[200~/g, "").replace(/\[201~/g, "").replace(/\[\d*[A-Za-z]/g, "").replace(/\[[\d;]*[A-Za-z]/g, "").split("").filter((ch) => {
|
|
379275
|
+
const code2 = ch.charCodeAt(0);
|
|
379276
|
+
return code2 >= 32 && code2 !== 127;
|
|
379277
|
+
}).join("").trim();
|
|
379150
379278
|
if (cleanInput.length > 0) {
|
|
379151
379279
|
if (currentField === "apiKey") {
|
|
379152
379280
|
setApiKey((prev) => prev + cleanInput);
|