@prbe.ai/electron-sdk 0.1.14 → 0.1.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/index.d.mts CHANGED
@@ -1,7 +1,9 @@
1
- import { P as PRBEToolDeclaration, a as PRBEToolParameter, b as PRBEInteractionRequester, F as FlaggedFileIn, c as PRBEAgentState, d as PRBEAgentConfig, I as InvestigationSource, e as InteractionPayload, f as InteractionResponse, g as PollResponse, T as TicketInfoOut } from './types-Bn2vj7rp.mjs';
2
- export { A as API_URL, h as AskQuestionPayload, i as AskQuestionResponse, C as ContextRequestOut, j as ConversationEntry, k as ConversationRole, D as DEFAULT_PRBE_STATE, l as InteractionType, m as InvestigationResult, M as MIDDLEWARE_URL, n as PRBEAgentConfigKey, o as PRBEAgentError, p as PRBEAgentErrorType, q as PRBEAgentStatus, r as PRBEAgentStatusType, s as PRBECRInvestigation, t as PRBECompletedInvestigation, u as PRBEInteractionHandler, v as PRBESerializedCR, w as PRBESerializedCompletedInvestigation, x as PRBESerializedState, y as PRBESerializedTicket, z as PRBEStateEvent, B as PRBEStatusEvent, E as PollRequest, R as RequestPathAccessPayload, G as RequestPathAccessResponse, H as RequestPermissionPayload, J as RequestPermissionResponse, K as ResolveSessionsRequest, L as ResolveSessionsResponse, N as ResolvedInteraction, O as ResolvedTicketOut, Q as TicketInfoRequest, S as TicketInfoResponse, U as TicketStatusOut, V as ToolName, W as ToolParamType, X as WSMessage, Y as WSMessageType, Z as redactPII, _ as serializePRBEState } from './types-Bn2vj7rp.mjs';
1
+ import { P as PRBEToolDeclaration, a as PRBEToolParameter, b as PRBEInteractionRequester, F as FlaggedFileIn, c as PRBEAgentState, d as PRBEAgentConfig, I as InvestigationSource, e as InteractionPayload, f as InteractionResponse, g as PollResponse, T as TicketInfoOut } from './types-Cyfgy1uD.mjs';
2
+ export { A as API_URL, h as AskQuestionPayload, i as AskQuestionResponse, C as ContextRequestOut, j as ConversationEntry, k as ConversationRole, D as DEFAULT_PRBE_STATE, l as InteractionType, m as InvestigationResult, M as MIDDLEWARE_URL, n as PRBEAgentConfigKey, o as PRBEAgentError, p as PRBEAgentErrorType, q as PRBEAgentStatus, r as PRBEAgentStatusType, s as PRBECRInvestigation, t as PRBECompletedInvestigation, u as PRBEInteractionHandler, v as PRBESerializedCR, w as PRBESerializedCompletedInvestigation, x as PRBESerializedState, y as PRBESerializedTicket, z as PRBEStateEvent, B as PRBEStatusEvent, E as PollRequest, R as RequestPathAccessPayload, G as RequestPathAccessResponse, H as RequestPermissionPayload, J as RequestPermissionResponse, K as ResolveSessionsRequest, L as ResolveSessionsResponse, N as ResolvedInteraction, O as ResolvedTicketOut, Q as TicketInfoRequest, S as TicketInfoResponse, U as TicketStatusOut, V as ToolName, W as ToolParamType, X as WSMessage, Y as WSMessageType, Z as redactPII, _ as serializePRBEState } from './types-Cyfgy1uD.mjs';
3
3
  import 'events';
4
4
 
5
+ var version = "0.1.16";
6
+
5
7
  /**
6
8
  * tools/index.ts — Tool interface, registry, and closure tool
7
9
  *
@@ -136,6 +138,7 @@ declare class PRBEAgent implements PRBEInteractionRequester {
136
138
  readonly logCapture: PRBELogCapture;
137
139
  private readonly config;
138
140
  private readonly appDataPath?;
141
+ private sessionMetadata;
139
142
  private readonly interactionHandler?;
140
143
  private readonly registry;
141
144
  private readonly grantedPaths;
@@ -165,6 +168,11 @@ declare class PRBEAgent implements PRBEInteractionRequester {
165
168
  * Add an additional root directory to the runtime allowed roots.
166
169
  */
167
170
  addAutoApprovedDir(rootPath: string): void;
171
+ /**
172
+ * Update session metadata. Merged with existing metadata.
173
+ * Call this to add user profile data, app version, etc. after async initialization.
174
+ */
175
+ updateSessionMetadata(metadata: Record<string, unknown>): void;
168
176
  /**
169
177
  * Register a custom tool that the middleware can invoke during investigations.
170
178
  */
@@ -338,4 +346,4 @@ declare class BashExecuteTool implements PRBETool {
338
346
  */
339
347
  declare const PROBE_MARK_SVG = "<svg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M50 112 L114 148 L50 184 Z\" fill=\"#111111\" opacity=\"0.07\"/>\n <path d=\"M70 86 L148 134 L70 182 Z\" fill=\"#111111\" opacity=\"0.18\"/>\n <path d=\"M92 56 L192 118 L92 180 Z\" fill=\"#111111\"/>\n</svg>";
340
348
 
341
- export { AskUserTool, BashExecuteTool, ClearAppLogsTool, FindFilesTool, FlagAppLogsTool, FlagFileTool, FlaggedFileIn, InteractionPayload, InteractionResponse, InvestigationSource, ListDirectoryTool, type LogEntry, PRBEAgent, PRBEAgentConfig, PRBEAgentState, PRBEClosureTool, PRBEInteractionRequester, PRBELogCapture, type PRBETool, PRBEToolDeclaration, PRBEToolParameter, PRBEToolRegistry, PROBE_MARK_SVG, PollResponse, ReadAppLogsTool, ReadFileTool, SearchAppLogsTool, SearchContentTool, TicketInfoOut, humanReadableSize, resolveAndValidate, resolveWithAccessRequest };
349
+ export { AskUserTool, BashExecuteTool, ClearAppLogsTool, FindFilesTool, FlagAppLogsTool, FlagFileTool, FlaggedFileIn, InteractionPayload, InteractionResponse, InvestigationSource, ListDirectoryTool, type LogEntry, PRBEAgent, PRBEAgentConfig, PRBEAgentState, PRBEClosureTool, PRBEInteractionRequester, PRBELogCapture, type PRBETool, PRBEToolDeclaration, PRBEToolParameter, PRBEToolRegistry, PROBE_MARK_SVG, PollResponse, ReadAppLogsTool, ReadFileTool, version as SDK_VERSION, SearchAppLogsTool, SearchContentTool, TicketInfoOut, humanReadableSize, resolveAndValidate, resolveWithAccessRequest };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { P as PRBEToolDeclaration, a as PRBEToolParameter, b as PRBEInteractionRequester, F as FlaggedFileIn, c as PRBEAgentState, d as PRBEAgentConfig, I as InvestigationSource, e as InteractionPayload, f as InteractionResponse, g as PollResponse, T as TicketInfoOut } from './types-Bn2vj7rp.js';
2
- export { A as API_URL, h as AskQuestionPayload, i as AskQuestionResponse, C as ContextRequestOut, j as ConversationEntry, k as ConversationRole, D as DEFAULT_PRBE_STATE, l as InteractionType, m as InvestigationResult, M as MIDDLEWARE_URL, n as PRBEAgentConfigKey, o as PRBEAgentError, p as PRBEAgentErrorType, q as PRBEAgentStatus, r as PRBEAgentStatusType, s as PRBECRInvestigation, t as PRBECompletedInvestigation, u as PRBEInteractionHandler, v as PRBESerializedCR, w as PRBESerializedCompletedInvestigation, x as PRBESerializedState, y as PRBESerializedTicket, z as PRBEStateEvent, B as PRBEStatusEvent, E as PollRequest, R as RequestPathAccessPayload, G as RequestPathAccessResponse, H as RequestPermissionPayload, J as RequestPermissionResponse, K as ResolveSessionsRequest, L as ResolveSessionsResponse, N as ResolvedInteraction, O as ResolvedTicketOut, Q as TicketInfoRequest, S as TicketInfoResponse, U as TicketStatusOut, V as ToolName, W as ToolParamType, X as WSMessage, Y as WSMessageType, Z as redactPII, _ as serializePRBEState } from './types-Bn2vj7rp.js';
1
+ import { P as PRBEToolDeclaration, a as PRBEToolParameter, b as PRBEInteractionRequester, F as FlaggedFileIn, c as PRBEAgentState, d as PRBEAgentConfig, I as InvestigationSource, e as InteractionPayload, f as InteractionResponse, g as PollResponse, T as TicketInfoOut } from './types-Cyfgy1uD.js';
2
+ export { A as API_URL, h as AskQuestionPayload, i as AskQuestionResponse, C as ContextRequestOut, j as ConversationEntry, k as ConversationRole, D as DEFAULT_PRBE_STATE, l as InteractionType, m as InvestigationResult, M as MIDDLEWARE_URL, n as PRBEAgentConfigKey, o as PRBEAgentError, p as PRBEAgentErrorType, q as PRBEAgentStatus, r as PRBEAgentStatusType, s as PRBECRInvestigation, t as PRBECompletedInvestigation, u as PRBEInteractionHandler, v as PRBESerializedCR, w as PRBESerializedCompletedInvestigation, x as PRBESerializedState, y as PRBESerializedTicket, z as PRBEStateEvent, B as PRBEStatusEvent, E as PollRequest, R as RequestPathAccessPayload, G as RequestPathAccessResponse, H as RequestPermissionPayload, J as RequestPermissionResponse, K as ResolveSessionsRequest, L as ResolveSessionsResponse, N as ResolvedInteraction, O as ResolvedTicketOut, Q as TicketInfoRequest, S as TicketInfoResponse, U as TicketStatusOut, V as ToolName, W as ToolParamType, X as WSMessage, Y as WSMessageType, Z as redactPII, _ as serializePRBEState } from './types-Cyfgy1uD.js';
3
3
  import 'events';
4
4
 
5
+ var version = "0.1.16";
6
+
5
7
  /**
6
8
  * tools/index.ts — Tool interface, registry, and closure tool
7
9
  *
@@ -136,6 +138,7 @@ declare class PRBEAgent implements PRBEInteractionRequester {
136
138
  readonly logCapture: PRBELogCapture;
137
139
  private readonly config;
138
140
  private readonly appDataPath?;
141
+ private sessionMetadata;
139
142
  private readonly interactionHandler?;
140
143
  private readonly registry;
141
144
  private readonly grantedPaths;
@@ -165,6 +168,11 @@ declare class PRBEAgent implements PRBEInteractionRequester {
165
168
  * Add an additional root directory to the runtime allowed roots.
166
169
  */
167
170
  addAutoApprovedDir(rootPath: string): void;
171
+ /**
172
+ * Update session metadata. Merged with existing metadata.
173
+ * Call this to add user profile data, app version, etc. after async initialization.
174
+ */
175
+ updateSessionMetadata(metadata: Record<string, unknown>): void;
168
176
  /**
169
177
  * Register a custom tool that the middleware can invoke during investigations.
170
178
  */
@@ -338,4 +346,4 @@ declare class BashExecuteTool implements PRBETool {
338
346
  */
339
347
  declare const PROBE_MARK_SVG = "<svg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M50 112 L114 148 L50 184 Z\" fill=\"#111111\" opacity=\"0.07\"/>\n <path d=\"M70 86 L148 134 L70 182 Z\" fill=\"#111111\" opacity=\"0.18\"/>\n <path d=\"M92 56 L192 118 L92 180 Z\" fill=\"#111111\"/>\n</svg>";
340
348
 
341
- export { AskUserTool, BashExecuteTool, ClearAppLogsTool, FindFilesTool, FlagAppLogsTool, FlagFileTool, FlaggedFileIn, InteractionPayload, InteractionResponse, InvestigationSource, ListDirectoryTool, type LogEntry, PRBEAgent, PRBEAgentConfig, PRBEAgentState, PRBEClosureTool, PRBEInteractionRequester, PRBELogCapture, type PRBETool, PRBEToolDeclaration, PRBEToolParameter, PRBEToolRegistry, PROBE_MARK_SVG, PollResponse, ReadAppLogsTool, ReadFileTool, SearchAppLogsTool, SearchContentTool, TicketInfoOut, humanReadableSize, resolveAndValidate, resolveWithAccessRequest };
349
+ export { AskUserTool, BashExecuteTool, ClearAppLogsTool, FindFilesTool, FlagAppLogsTool, FlagFileTool, FlaggedFileIn, InteractionPayload, InteractionResponse, InvestigationSource, ListDirectoryTool, type LogEntry, PRBEAgent, PRBEAgentConfig, PRBEAgentState, PRBEClosureTool, PRBEInteractionRequester, PRBELogCapture, type PRBETool, PRBEToolDeclaration, PRBEToolParameter, PRBEToolRegistry, PROBE_MARK_SVG, PollResponse, ReadAppLogsTool, ReadFileTool, version as SDK_VERSION, SearchAppLogsTool, SearchContentTool, TicketInfoOut, humanReadableSize, resolveAndValidate, resolveWithAccessRequest };
package/dist/index.js CHANGED
@@ -56,6 +56,7 @@ __export(src_exports, {
56
56
  PROBE_MARK_SVG: () => PROBE_MARK_SVG,
57
57
  ReadAppLogsTool: () => ReadAppLogsTool,
58
58
  ReadFileTool: () => ReadFileTool,
59
+ SDK_VERSION: () => version,
59
60
  SearchAppLogsTool: () => SearchAppLogsTool,
60
61
  SearchContentTool: () => SearchContentTool,
61
62
  ToolName: () => ToolName,
@@ -69,6 +70,9 @@ __export(src_exports, {
69
70
  });
70
71
  module.exports = __toCommonJS(src_exports);
71
72
 
73
+ // package.json
74
+ var version = "0.1.16";
75
+
72
76
  // src/agent.ts
73
77
  var fs3 = __toESM(require("fs"));
74
78
  var path5 = __toESM(require("path"));
@@ -133,6 +137,7 @@ var PRBEAgentConfigKey = /* @__PURE__ */ ((PRBEAgentConfigKey3) => {
133
137
  PRBEAgentConfigKey3["IPC_MAIN"] = "ipcMain";
134
138
  PRBEAgentConfigKey3["RENDERER_LOG_CHANNEL"] = "rendererLogChannel";
135
139
  PRBEAgentConfigKey3["APP_DATA_PATH"] = "appDataPath";
140
+ PRBEAgentConfigKey3["SESSION_METADATA"] = "sessionMetadata";
136
141
  return PRBEAgentConfigKey3;
137
142
  })(PRBEAgentConfigKey || {});
138
143
  var PRBEAgentStatusType = /* @__PURE__ */ ((PRBEAgentStatusType2) => {
@@ -1969,6 +1974,7 @@ var PRBEAgent = class _PRBEAgent {
1969
1974
  logCapture;
1970
1975
  config;
1971
1976
  appDataPath;
1977
+ sessionMetadata;
1972
1978
  interactionHandler;
1973
1979
  registry = new PRBEToolRegistry();
1974
1980
  grantedPaths = /* @__PURE__ */ new Set();
@@ -2028,6 +2034,7 @@ var PRBEAgent = class _PRBEAgent {
2028
2034
  };
2029
2035
  this.interactionHandler = config.interactionHandler;
2030
2036
  this.appDataPath = config.appDataPath;
2037
+ this.sessionMetadata = { sdk_version: version, ...config.sessionMetadata };
2031
2038
  if (this.appDataPath && !this.config.autoApprovedDirs.includes(this.appDataPath)) {
2032
2039
  this.config.autoApprovedDirs.push(this.appDataPath);
2033
2040
  }
@@ -2181,6 +2188,13 @@ var PRBEAgent = class _PRBEAgent {
2181
2188
  }
2182
2189
  }
2183
2190
  // ---------- Public API ----------
2191
+ /**
2192
+ * Update session metadata. Merged with existing metadata.
2193
+ * Call this to add user profile data, app version, etc. after async initialization.
2194
+ */
2195
+ updateSessionMetadata(metadata) {
2196
+ this.sessionMetadata = { ...this.sessionMetadata, ...metadata };
2197
+ }
2184
2198
  /**
2185
2199
  * Register a custom tool that the middleware can invoke during investigations.
2186
2200
  */
@@ -2481,6 +2495,9 @@ var PRBEAgent = class _PRBEAgent {
2481
2495
  if (contextRequestID) startMetadata["context_request_id"] = contextRequestID;
2482
2496
  if (ticketId) startMetadata["ticket_id"] = ticketId;
2483
2497
  if (this.appDataPath) startMetadata["app_data_path"] = this.appDataPath;
2498
+ if (Object.keys(this.sessionMetadata).length > 0) {
2499
+ startMetadata["session_metadata"] = this.sessionMetadata;
2500
+ }
2484
2501
  if (!conn.send({ type: "start" /* START */, content: query, metadata: startMetadata })) {
2485
2502
  emit({ type: "error" /* ERROR */, message: "Failed to send start message" });
2486
2503
  finish(null);
@@ -2780,6 +2797,7 @@ var PROBE_MARK_SVG = `<svg width="256" height="256" viewBox="0 0 256 256" fill="
2780
2797
  PROBE_MARK_SVG,
2781
2798
  ReadAppLogsTool,
2782
2799
  ReadFileTool,
2800
+ SDK_VERSION,
2783
2801
  SearchAppLogsTool,
2784
2802
  SearchContentTool,
2785
2803
  ToolName,