dsh-agy-link 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +37 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -543,12 +543,11 @@ var EventMapper = class {
|
|
|
543
543
|
if (ev.kind === "step") {
|
|
544
544
|
if (ev.stepKind === "text") {
|
|
545
545
|
const thoughtTokens = ev.usage?.thinking_tokens ?? 0;
|
|
546
|
-
if (
|
|
546
|
+
if (thoughtTokens > 0 && !this.thinkingAnnounced.has(ev.stepKey)) {
|
|
547
547
|
this.thinkingAnnounced.add(ev.stepKey);
|
|
548
548
|
yield* this.ensureBlock("reasoning");
|
|
549
549
|
const d = this.appendDelta("[agy thinking turn · " + thoughtTokens + " thinking tokens]\n");
|
|
550
550
|
if (d) yield d;
|
|
551
|
-
return;
|
|
552
551
|
}
|
|
553
552
|
if (ev.text === "" && !ev.fragment) return;
|
|
554
553
|
this.sawTextStep = true;
|
|
@@ -2687,6 +2686,7 @@ function presentMirrorCall(args) {
|
|
|
2687
2686
|
};
|
|
2688
2687
|
}
|
|
2689
2688
|
case "read_file":
|
|
2689
|
+
case "view_file":
|
|
2690
2690
|
case "read":
|
|
2691
2691
|
case "open_file": {
|
|
2692
2692
|
const path = asString(input.path) ?? asString(input.file_path) ?? asString(input.filename) ?? "";
|
|
@@ -2705,6 +2705,7 @@ function presentMirrorCall(args) {
|
|
|
2705
2705
|
case "glob":
|
|
2706
2706
|
case "search_files":
|
|
2707
2707
|
case "search":
|
|
2708
|
+
case "search_file_content":
|
|
2708
2709
|
case "grep": {
|
|
2709
2710
|
const q = asString(input.pattern) ?? asString(input.query) ?? asString(input.regex) ?? "";
|
|
2710
2711
|
return {
|
|
@@ -2713,6 +2714,21 @@ function presentMirrorCall(args) {
|
|
|
2713
2714
|
kind: "search"
|
|
2714
2715
|
};
|
|
2715
2716
|
}
|
|
2717
|
+
case "list_dir":
|
|
2718
|
+
case "ls": {
|
|
2719
|
+
const path = asString(input.path) ?? asString(input.directory) ?? "";
|
|
2720
|
+
return {
|
|
2721
|
+
card: "generic",
|
|
2722
|
+
title: path !== "" ? "List " + path : "List directory"
|
|
2723
|
+
};
|
|
2724
|
+
}
|
|
2725
|
+
case "delete_file":
|
|
2726
|
+
case "remove_file":
|
|
2727
|
+
case "rm": return {
|
|
2728
|
+
card: "generic",
|
|
2729
|
+
title: "Delete " + (asString(input.path) ?? asString(input.file_path) ?? ""),
|
|
2730
|
+
kind: "delete"
|
|
2731
|
+
};
|
|
2716
2732
|
default: return {
|
|
2717
2733
|
card: "generic",
|
|
2718
2734
|
title: name !== "" ? name : "agy tool",
|
|
@@ -3198,12 +3214,13 @@ function apply(ctx, entryConfig = {}) {
|
|
|
3198
3214
|
});
|
|
3199
3215
|
}
|
|
3200
3216
|
}));
|
|
3201
|
-
const
|
|
3217
|
+
const toolsSvcRef = { current: null };
|
|
3202
3218
|
const askToolDispose = { current: null };
|
|
3219
|
+
const mirrorToolDispose = { current: null };
|
|
3203
3220
|
const syncAskTool = () => {
|
|
3204
3221
|
const want = getConfig().askTool && bin() !== null;
|
|
3205
|
-
if (want && askToolDispose.current === null &&
|
|
3206
|
-
const reg =
|
|
3222
|
+
if (want && askToolDispose.current === null && toolsSvcRef.current) {
|
|
3223
|
+
const reg = toolsSvcRef.current.register(defineAgyAskTool({
|
|
3207
3224
|
cfg: getConfig,
|
|
3208
3225
|
bin,
|
|
3209
3226
|
catalog: () => catalog.get()
|
|
@@ -3214,19 +3231,29 @@ function apply(ctx, entryConfig = {}) {
|
|
|
3214
3231
|
askToolDispose.current = null;
|
|
3215
3232
|
}
|
|
3216
3233
|
};
|
|
3217
|
-
syncAskTool();
|
|
3218
|
-
const mirrorToolDispose = { current: null };
|
|
3219
3234
|
const syncMirrorTool = () => {
|
|
3220
3235
|
const want = getConfig().enabled && bin() !== null;
|
|
3221
|
-
if (want && mirrorToolDispose.current === null &&
|
|
3222
|
-
const reg =
|
|
3236
|
+
if (want && mirrorToolDispose.current === null && toolsSvcRef.current) {
|
|
3237
|
+
const reg = toolsSvcRef.current.register(defineAgyMirrorTool({ runs }));
|
|
3223
3238
|
mirrorToolDispose.current = typeof reg === "function" ? reg : null;
|
|
3239
|
+
if (mirrorToolDispose.current !== null) log("agy_tool mirror registered with the tools service");
|
|
3224
3240
|
} else if (!want && mirrorToolDispose.current !== null) {
|
|
3225
3241
|
mirrorToolDispose.current();
|
|
3226
3242
|
mirrorToolDispose.current = null;
|
|
3227
3243
|
}
|
|
3228
3244
|
};
|
|
3229
|
-
|
|
3245
|
+
ctx.inject(["tools"], (sub) => {
|
|
3246
|
+
toolsSvcRef.current = sub.get("tools");
|
|
3247
|
+
syncAskTool();
|
|
3248
|
+
syncMirrorTool();
|
|
3249
|
+
return () => {
|
|
3250
|
+
if (askToolDispose.current !== null) askToolDispose.current();
|
|
3251
|
+
askToolDispose.current = null;
|
|
3252
|
+
if (mirrorToolDispose.current !== null) mirrorToolDispose.current();
|
|
3253
|
+
mirrorToolDispose.current = null;
|
|
3254
|
+
toolsSvcRef.current = null;
|
|
3255
|
+
};
|
|
3256
|
+
});
|
|
3230
3257
|
const registerRoutes = (webServer) => {
|
|
3231
3258
|
const disposers = [];
|
|
3232
3259
|
const reg = (route) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agy-link",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Google Antigravity (agy CLI) models for DeepSeek Harness — stream Gemini/Claude/GPT-OSS subscriptions into DSH with thinking, tool activity, token usage and in-GUI Google OAuth login.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|