coding-agent-adapters 0.12.0 → 0.13.0
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.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var promises = require('fs/promises');
|
|
4
4
|
var path = require('path');
|
|
5
|
-
var
|
|
5
|
+
var adapterTypes = require('adapter-types');
|
|
6
6
|
|
|
7
7
|
// src/base-coding-adapter.ts
|
|
8
8
|
|
|
@@ -375,7 +375,7 @@ function getPresetDefinition(preset) {
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
// src/base-coding-adapter.ts
|
|
378
|
-
var BaseCodingAdapter = class extends
|
|
378
|
+
var BaseCodingAdapter = class extends adapterTypes.BaseCLIAdapter {
|
|
379
379
|
/**
|
|
380
380
|
* Coding agent CLIs use TUI menus that require arrow-key navigation.
|
|
381
381
|
*/
|
|
@@ -1251,6 +1251,25 @@ var GeminiAdapter = class extends BaseCodingAdapter {
|
|
|
1251
1251
|
return env;
|
|
1252
1252
|
}
|
|
1253
1253
|
getHookTelemetryProtocol(options) {
|
|
1254
|
+
if (options?.httpUrl) {
|
|
1255
|
+
const sessionHeader = options.sessionId ? ` -H 'X-Parallax-Session-Id: ${options.sessionId}'` : "";
|
|
1256
|
+
const curlCommand = `bash -c 'curl -sf -X POST "${options.httpUrl}" -H "Content-Type: application/json"${sessionHeader} -d @- --max-time 4 2>/dev/null || echo "{\\"continue\\":true}"'`;
|
|
1257
|
+
const hookEntry2 = [{ matcher: "", hooks: [{ type: "command", command: curlCommand, timeout: 5e3 }] }];
|
|
1258
|
+
const hookEntryNoMatcher = [{ hooks: [{ type: "command", command: curlCommand, timeout: 5e3 }] }];
|
|
1259
|
+
const settingsHooks2 = {
|
|
1260
|
+
BeforeTool: hookEntry2,
|
|
1261
|
+
AfterTool: hookEntry2,
|
|
1262
|
+
AfterAgent: hookEntryNoMatcher,
|
|
1263
|
+
SessionEnd: hookEntryNoMatcher,
|
|
1264
|
+
Notification: hookEntry2
|
|
1265
|
+
};
|
|
1266
|
+
return {
|
|
1267
|
+
markerPrefix: "",
|
|
1268
|
+
scriptPath: "",
|
|
1269
|
+
scriptContent: "",
|
|
1270
|
+
settingsHooks: settingsHooks2
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1254
1273
|
const markerPrefix = options?.markerPrefix || GEMINI_HOOK_MARKER_PREFIX;
|
|
1255
1274
|
const scriptPath = options?.scriptPath || ".gemini/hooks/parallax-hook-telemetry.sh";
|
|
1256
1275
|
const scriptCommand = `"${"$"}GEMINI_PROJECT_ROOT"/${scriptPath}`;
|