@prbe.ai/electron-sdk 0.1.14 → 0.1.15

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.mjs CHANGED
@@ -62,6 +62,7 @@ var PRBEAgentConfigKey = /* @__PURE__ */ ((PRBEAgentConfigKey3) => {
62
62
  PRBEAgentConfigKey3["IPC_MAIN"] = "ipcMain";
63
63
  PRBEAgentConfigKey3["RENDERER_LOG_CHANNEL"] = "rendererLogChannel";
64
64
  PRBEAgentConfigKey3["APP_DATA_PATH"] = "appDataPath";
65
+ PRBEAgentConfigKey3["SESSION_METADATA"] = "sessionMetadata";
65
66
  return PRBEAgentConfigKey3;
66
67
  })(PRBEAgentConfigKey || {});
67
68
  var PRBEAgentStatusType = /* @__PURE__ */ ((PRBEAgentStatusType2) => {
@@ -1898,6 +1899,7 @@ var PRBEAgent = class _PRBEAgent {
1898
1899
  logCapture;
1899
1900
  config;
1900
1901
  appDataPath;
1902
+ sessionMetadata;
1901
1903
  interactionHandler;
1902
1904
  registry = new PRBEToolRegistry();
1903
1905
  grantedPaths = /* @__PURE__ */ new Set();
@@ -1957,6 +1959,7 @@ var PRBEAgent = class _PRBEAgent {
1957
1959
  };
1958
1960
  this.interactionHandler = config.interactionHandler;
1959
1961
  this.appDataPath = config.appDataPath;
1962
+ this.sessionMetadata = config.sessionMetadata ?? {};
1960
1963
  if (this.appDataPath && !this.config.autoApprovedDirs.includes(this.appDataPath)) {
1961
1964
  this.config.autoApprovedDirs.push(this.appDataPath);
1962
1965
  }
@@ -2110,6 +2113,13 @@ var PRBEAgent = class _PRBEAgent {
2110
2113
  }
2111
2114
  }
2112
2115
  // ---------- Public API ----------
2116
+ /**
2117
+ * Update session metadata. Merged with existing metadata.
2118
+ * Call this to add user profile data, app version, etc. after async initialization.
2119
+ */
2120
+ updateSessionMetadata(metadata) {
2121
+ this.sessionMetadata = { ...this.sessionMetadata, ...metadata };
2122
+ }
2113
2123
  /**
2114
2124
  * Register a custom tool that the middleware can invoke during investigations.
2115
2125
  */
@@ -2410,6 +2420,9 @@ var PRBEAgent = class _PRBEAgent {
2410
2420
  if (contextRequestID) startMetadata["context_request_id"] = contextRequestID;
2411
2421
  if (ticketId) startMetadata["ticket_id"] = ticketId;
2412
2422
  if (this.appDataPath) startMetadata["app_data_path"] = this.appDataPath;
2423
+ if (Object.keys(this.sessionMetadata).length > 0) {
2424
+ startMetadata["session_metadata"] = this.sessionMetadata;
2425
+ }
2413
2426
  if (!conn.send({ type: "start" /* START */, content: query, metadata: startMetadata })) {
2414
2427
  emit({ type: "error" /* ERROR */, message: "Failed to send start message" });
2415
2428
  finish(null);