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.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'pty-manager';
1
+ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'adapter-types';
2
2
 
3
3
  /**
4
4
  * Approval Presets
@@ -397,6 +397,8 @@ declare class GeminiAdapter extends BaseCodingAdapter {
397
397
  getHookTelemetryProtocol(options?: {
398
398
  scriptPath?: string;
399
399
  markerPrefix?: string;
400
+ httpUrl?: string;
401
+ sessionId?: string;
400
402
  }): {
401
403
  markerPrefix: string;
402
404
  scriptPath: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'pty-manager';
1
+ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'adapter-types';
2
2
 
3
3
  /**
4
4
  * Approval Presets
@@ -397,6 +397,8 @@ declare class GeminiAdapter extends BaseCodingAdapter {
397
397
  getHookTelemetryProtocol(options?: {
398
398
  scriptPath?: string;
399
399
  markerPrefix?: string;
400
+ httpUrl?: string;
401
+ sessionId?: string;
400
402
  }): {
401
403
  markerPrefix: string;
402
404
  scriptPath: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { mkdir, writeFile, appendFile } from 'fs/promises';
2
2
  import { join, dirname } from 'path';
3
- import { BaseCLIAdapter } from 'pty-manager';
3
+ import { BaseCLIAdapter } from 'adapter-types';
4
4
 
5
5
  // src/base-coding-adapter.ts
6
6
 
@@ -1249,6 +1249,25 @@ var GeminiAdapter = class extends BaseCodingAdapter {
1249
1249
  return env;
1250
1250
  }
1251
1251
  getHookTelemetryProtocol(options) {
1252
+ if (options?.httpUrl) {
1253
+ const sessionHeader = options.sessionId ? ` -H 'X-Parallax-Session-Id: ${options.sessionId}'` : "";
1254
+ 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}"'`;
1255
+ const hookEntry2 = [{ matcher: "", hooks: [{ type: "command", command: curlCommand, timeout: 5e3 }] }];
1256
+ const hookEntryNoMatcher = [{ hooks: [{ type: "command", command: curlCommand, timeout: 5e3 }] }];
1257
+ const settingsHooks2 = {
1258
+ BeforeTool: hookEntry2,
1259
+ AfterTool: hookEntry2,
1260
+ AfterAgent: hookEntryNoMatcher,
1261
+ SessionEnd: hookEntryNoMatcher,
1262
+ Notification: hookEntry2
1263
+ };
1264
+ return {
1265
+ markerPrefix: "",
1266
+ scriptPath: "",
1267
+ scriptContent: "",
1268
+ settingsHooks: settingsHooks2
1269
+ };
1270
+ }
1252
1271
  const markerPrefix = options?.markerPrefix || GEMINI_HOOK_MARKER_PREFIX;
1253
1272
  const scriptPath = options?.scriptPath || ".gemini/hooks/parallax-hook-telemetry.sh";
1254
1273
  const scriptCommand = `"${"$"}GEMINI_PROJECT_ROOT"/${scriptPath}`;