@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 +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -0
- package/dist/index.mjs.map +1 -1
- package/dist/{types-Bn2vj7rp.d.mts → types-Cyfgy1uD.d.mts} +4 -1
- package/dist/{types-Bn2vj7rp.d.ts → types-Cyfgy1uD.d.ts} +4 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/types.mjs +1 -0
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var version = "0.1.16";
|
|
3
|
+
|
|
1
4
|
// src/agent.ts
|
|
2
5
|
import * as fs3 from "fs";
|
|
3
6
|
import * as path5 from "path";
|
|
@@ -62,6 +65,7 @@ var PRBEAgentConfigKey = /* @__PURE__ */ ((PRBEAgentConfigKey3) => {
|
|
|
62
65
|
PRBEAgentConfigKey3["IPC_MAIN"] = "ipcMain";
|
|
63
66
|
PRBEAgentConfigKey3["RENDERER_LOG_CHANNEL"] = "rendererLogChannel";
|
|
64
67
|
PRBEAgentConfigKey3["APP_DATA_PATH"] = "appDataPath";
|
|
68
|
+
PRBEAgentConfigKey3["SESSION_METADATA"] = "sessionMetadata";
|
|
65
69
|
return PRBEAgentConfigKey3;
|
|
66
70
|
})(PRBEAgentConfigKey || {});
|
|
67
71
|
var PRBEAgentStatusType = /* @__PURE__ */ ((PRBEAgentStatusType2) => {
|
|
@@ -1898,6 +1902,7 @@ var PRBEAgent = class _PRBEAgent {
|
|
|
1898
1902
|
logCapture;
|
|
1899
1903
|
config;
|
|
1900
1904
|
appDataPath;
|
|
1905
|
+
sessionMetadata;
|
|
1901
1906
|
interactionHandler;
|
|
1902
1907
|
registry = new PRBEToolRegistry();
|
|
1903
1908
|
grantedPaths = /* @__PURE__ */ new Set();
|
|
@@ -1957,6 +1962,7 @@ var PRBEAgent = class _PRBEAgent {
|
|
|
1957
1962
|
};
|
|
1958
1963
|
this.interactionHandler = config.interactionHandler;
|
|
1959
1964
|
this.appDataPath = config.appDataPath;
|
|
1965
|
+
this.sessionMetadata = { sdk_version: version, ...config.sessionMetadata };
|
|
1960
1966
|
if (this.appDataPath && !this.config.autoApprovedDirs.includes(this.appDataPath)) {
|
|
1961
1967
|
this.config.autoApprovedDirs.push(this.appDataPath);
|
|
1962
1968
|
}
|
|
@@ -2110,6 +2116,13 @@ var PRBEAgent = class _PRBEAgent {
|
|
|
2110
2116
|
}
|
|
2111
2117
|
}
|
|
2112
2118
|
// ---------- Public API ----------
|
|
2119
|
+
/**
|
|
2120
|
+
* Update session metadata. Merged with existing metadata.
|
|
2121
|
+
* Call this to add user profile data, app version, etc. after async initialization.
|
|
2122
|
+
*/
|
|
2123
|
+
updateSessionMetadata(metadata) {
|
|
2124
|
+
this.sessionMetadata = { ...this.sessionMetadata, ...metadata };
|
|
2125
|
+
}
|
|
2113
2126
|
/**
|
|
2114
2127
|
* Register a custom tool that the middleware can invoke during investigations.
|
|
2115
2128
|
*/
|
|
@@ -2410,6 +2423,9 @@ var PRBEAgent = class _PRBEAgent {
|
|
|
2410
2423
|
if (contextRequestID) startMetadata["context_request_id"] = contextRequestID;
|
|
2411
2424
|
if (ticketId) startMetadata["ticket_id"] = ticketId;
|
|
2412
2425
|
if (this.appDataPath) startMetadata["app_data_path"] = this.appDataPath;
|
|
2426
|
+
if (Object.keys(this.sessionMetadata).length > 0) {
|
|
2427
|
+
startMetadata["session_metadata"] = this.sessionMetadata;
|
|
2428
|
+
}
|
|
2413
2429
|
if (!conn.send({ type: "start" /* START */, content: query, metadata: startMetadata })) {
|
|
2414
2430
|
emit({ type: "error" /* ERROR */, message: "Failed to send start message" });
|
|
2415
2431
|
finish(null);
|
|
@@ -2708,6 +2724,7 @@ export {
|
|
|
2708
2724
|
PROBE_MARK_SVG,
|
|
2709
2725
|
ReadAppLogsTool,
|
|
2710
2726
|
ReadFileTool,
|
|
2727
|
+
version as SDK_VERSION,
|
|
2711
2728
|
SearchAppLogsTool,
|
|
2712
2729
|
SearchContentTool,
|
|
2713
2730
|
ToolName,
|