agent-sh 0.12.15 → 0.12.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/conversation-state.js +15 -5
- package/dist/index.js +6 -0
- package/package.json +1 -1
|
@@ -83,11 +83,21 @@ export class ConversationState {
|
|
|
83
83
|
this.eagerNucleateUser(text);
|
|
84
84
|
}
|
|
85
85
|
addAssistantMessage(content, toolCalls, extras) {
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
const hasToolCalls = !!toolCalls?.length;
|
|
87
|
+
// Promote reasoning into content on reasoning-only turns; strict
|
|
88
|
+
// providers (DeepSeek native) reject content="" with no tool_calls.
|
|
89
|
+
if (!content && !hasToolCalls) {
|
|
90
|
+
const r = (extras?.reasoning_content ?? extras?.reasoning);
|
|
91
|
+
if (typeof r === "string" && r)
|
|
92
|
+
content = r;
|
|
93
|
+
}
|
|
94
|
+
if (!content && !hasToolCalls)
|
|
95
|
+
return;
|
|
96
|
+
const base = {
|
|
97
|
+
role: "assistant",
|
|
98
|
+
content: hasToolCalls ? (content ?? null) : content,
|
|
99
|
+
};
|
|
100
|
+
if (hasToolCalls) {
|
|
91
101
|
base.tool_calls = toolCalls.map((tc) => ({
|
|
92
102
|
id: tc.id,
|
|
93
103
|
type: "function",
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { loadExtensions } from "./extension-loader.js";
|
|
|
9
9
|
import { getSettings } from "./settings.js";
|
|
10
10
|
import { discoverSkills } from "./agent/skills.js";
|
|
11
11
|
import { runInit } from "./init.js";
|
|
12
|
+
import { PACKAGE_VERSION } from "./utils/package-version.js";
|
|
12
13
|
/**
|
|
13
14
|
* Capture the user's full shell environment.
|
|
14
15
|
* This picks up env vars exported in .zshrc/.bashrc that the
|
|
@@ -102,6 +103,10 @@ function parseArgs(argv) {
|
|
|
102
103
|
const exts = argv[++i].split(",").map(s => s.trim());
|
|
103
104
|
extensions = extensions ? [...extensions, ...exts] : exts;
|
|
104
105
|
}
|
|
106
|
+
else if (arg === "--version" || arg === "-V") {
|
|
107
|
+
console.log(PACKAGE_VERSION);
|
|
108
|
+
process.exit(0);
|
|
109
|
+
}
|
|
105
110
|
else if (arg === "--help" || arg === "-h") {
|
|
106
111
|
console.log(`agent-sh — a shell-first terminal where AI is one keystroke away
|
|
107
112
|
|
|
@@ -120,6 +125,7 @@ General Options:
|
|
|
120
125
|
--shell <path> Shell to use (default: $SHELL or /bin/bash)
|
|
121
126
|
-e, --extensions Extensions to load (comma-separated, repeatable)
|
|
122
127
|
-h, --help Show this help
|
|
128
|
+
-V, --version Print version and exit
|
|
123
129
|
|
|
124
130
|
Environment Variables:
|
|
125
131
|
OPENAI_API_KEY API key for LLM provider
|