@prbe.ai/electron-sdk 0.1.3 → 0.1.5
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 +332 -0
- package/dist/index.d.ts +331 -20
- package/dist/index.js +2471 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2402 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types-DHT-JxMT.d.mts +401 -0
- package/dist/types-DHT-JxMT.d.ts +401 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -14
- package/dist/types.js +160 -30
- package/dist/types.js.map +1 -1
- package/dist/types.mjs +125 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +22 -12
- package/dist/agent.d.ts +0 -106
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -878
- package/dist/agent.js.map +0 -1
- package/dist/assets/index.d.ts +0 -6
- package/dist/assets/index.d.ts.map +0 -1
- package/dist/assets/index.js +0 -13
- package/dist/assets/index.js.map +0 -1
- package/dist/electron/channels.d.ts +0 -21
- package/dist/electron/channels.d.ts.map +0 -1
- package/dist/electron/channels.js +0 -25
- package/dist/electron/channels.js.map +0 -1
- package/dist/electron/index.d.ts +0 -12
- package/dist/electron/index.d.ts.map +0 -1
- package/dist/electron/index.js +0 -22
- package/dist/electron/index.js.map +0 -1
- package/dist/electron/ipc-interaction-handler.d.ts +0 -21
- package/dist/electron/ipc-interaction-handler.d.ts.map +0 -1
- package/dist/electron/ipc-interaction-handler.js +0 -48
- package/dist/electron/ipc-interaction-handler.js.map +0 -1
- package/dist/electron/preload.d.ts +0 -20
- package/dist/electron/preload.d.ts.map +0 -1
- package/dist/electron/preload.js +0 -72
- package/dist/electron/preload.js.map +0 -1
- package/dist/electron/setup-handlers.d.ts +0 -30
- package/dist/electron/setup-handlers.d.ts.map +0 -1
- package/dist/electron/setup-handlers.js +0 -111
- package/dist/electron/setup-handlers.js.map +0 -1
- package/dist/electron/types.d.ts +0 -56
- package/dist/electron/types.d.ts.map +0 -1
- package/dist/electron/types.js +0 -9
- package/dist/electron/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interactions.d.ts +0 -63
- package/dist/interactions.d.ts.map +0 -1
- package/dist/interactions.js +0 -27
- package/dist/interactions.js.map +0 -1
- package/dist/models.d.ts +0 -218
- package/dist/models.d.ts.map +0 -1
- package/dist/models.js +0 -121
- package/dist/models.js.map +0 -1
- package/dist/serialization.d.ts +0 -51
- package/dist/serialization.d.ts.map +0 -1
- package/dist/serialization.js +0 -72
- package/dist/serialization.js.map +0 -1
- package/dist/state.d.ts +0 -70
- package/dist/state.d.ts.map +0 -1
- package/dist/state.js +0 -303
- package/dist/state.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -30
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js +0 -248
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/filesystem.d.ts +0 -63
- package/dist/tools/filesystem.d.ts.map +0 -1
- package/dist/tools/filesystem.js +0 -573
- package/dist/tools/filesystem.js.map +0 -1
- package/dist/tools/index.d.ts +0 -46
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -171
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/interactive.d.ts +0 -15
- package/dist/tools/interactive.d.ts.map +0 -1
- package/dist/tools/interactive.js +0 -58
- package/dist/tools/interactive.js.map +0 -1
- package/dist/tools/logs.d.ts +0 -72
- package/dist/tools/logs.d.ts.map +0 -1
- package/dist/tools/logs.js +0 -366
- package/dist/tools/logs.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
package/dist/state.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,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}
|
package/dist/state.js
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* state.ts — PRBEAgentState: EventEmitter-based observable investigation state
|
|
4
|
-
*
|
|
5
|
-
* Mirrors PRBEAgentState.swift but uses Node.js EventEmitter instead of Combine/@Published.
|
|
6
|
-
* Host apps subscribe to events for UI updates.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PRBEAgentState = exports.PRBEStateEvent = void 0;
|
|
10
|
-
const events_1 = require("events");
|
|
11
|
-
const crypto_1 = require("crypto");
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
// Event types emitted by PRBEAgentState
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
var PRBEStateEvent;
|
|
16
|
-
(function (PRBEStateEvent) {
|
|
17
|
-
/** Emitted on any state change. Payload: void */
|
|
18
|
-
PRBEStateEvent["STATUS"] = "status";
|
|
19
|
-
/** Emitted when a new event is appended. Payload: PRBEStatusEvent */
|
|
20
|
-
PRBEStateEvent["EVENT"] = "event";
|
|
21
|
-
/** Emitted when investigation completes. Payload: { report: string; summary: string } */
|
|
22
|
-
PRBEStateEvent["COMPLETE"] = "complete";
|
|
23
|
-
/** Emitted on error. Payload: { message: string } */
|
|
24
|
-
PRBEStateEvent["ERROR"] = "error";
|
|
25
|
-
/** Emitted when a background CR starts. Payload: PRBECRInvestigation */
|
|
26
|
-
PRBEStateEvent["CR_START"] = "cr-start";
|
|
27
|
-
/** Emitted when a background CR completes/fails. Payload: PRBECRInvestigation */
|
|
28
|
-
PRBEStateEvent["CR_COMPLETE"] = "cr-complete";
|
|
29
|
-
/** Emitted when tracked ticket IDs change. Payload: string[] */
|
|
30
|
-
PRBEStateEvent["TICKETS_CHANGED"] = "tickets-changed";
|
|
31
|
-
/** Emitted when ticket info is updated. Payload: TicketInfoOut[] */
|
|
32
|
-
PRBEStateEvent["TICKET_INFO"] = "ticket-info";
|
|
33
|
-
/** Emitted when an interaction is requested. Payload: InteractionPayload */
|
|
34
|
-
PRBEStateEvent["INTERACTION_REQUESTED"] = "interaction-requested";
|
|
35
|
-
/** Emitted when an interaction is resolved. Payload: void */
|
|
36
|
-
PRBEStateEvent["INTERACTION_RESOLVED"] = "interaction-resolved";
|
|
37
|
-
})(PRBEStateEvent || (exports.PRBEStateEvent = PRBEStateEvent = {}));
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
// PRBEAgentState
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
class PRBEAgentState extends events_1.EventEmitter {
|
|
42
|
-
// User-initiated investigation
|
|
43
|
-
isInvestigating = false;
|
|
44
|
-
events = [];
|
|
45
|
-
report = "";
|
|
46
|
-
summary = "";
|
|
47
|
-
currentQuery = "";
|
|
48
|
-
investigationError;
|
|
49
|
-
pendingInteraction;
|
|
50
|
-
resolvedInteractions = [];
|
|
51
|
-
// Completed user investigations (history)
|
|
52
|
-
completedInvestigations = [];
|
|
53
|
-
// Background context requests
|
|
54
|
-
activeCRs = new Map();
|
|
55
|
-
completedCRs = [];
|
|
56
|
-
// Tracked tickets
|
|
57
|
-
trackedTicketIDs = [];
|
|
58
|
-
ticketInfo = [];
|
|
59
|
-
// Computed
|
|
60
|
-
get hasActiveWork() {
|
|
61
|
-
return this.isInvestigating || this.activeCRs.size > 0;
|
|
62
|
-
}
|
|
63
|
-
get activeCRCount() {
|
|
64
|
-
return this.activeCRs.size;
|
|
65
|
-
}
|
|
66
|
-
get isActive() {
|
|
67
|
-
return this.isInvestigating || this.report.length > 0 || this.investigationError != null;
|
|
68
|
-
}
|
|
69
|
-
// ---------- User investigation mutations ----------
|
|
70
|
-
beginInvestigation(query) {
|
|
71
|
-
this.isInvestigating = true;
|
|
72
|
-
this.events = [];
|
|
73
|
-
this.resolvedInteractions = [];
|
|
74
|
-
this.report = "";
|
|
75
|
-
this.summary = "";
|
|
76
|
-
this.currentQuery = query;
|
|
77
|
-
this.investigationError = undefined;
|
|
78
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
79
|
-
}
|
|
80
|
-
resetInvestigation() {
|
|
81
|
-
this.isInvestigating = false;
|
|
82
|
-
this.events = [];
|
|
83
|
-
this.resolvedInteractions = [];
|
|
84
|
-
this.report = "";
|
|
85
|
-
this.summary = "";
|
|
86
|
-
this.currentQuery = "";
|
|
87
|
-
this.investigationError = undefined;
|
|
88
|
-
this.pendingInteraction = undefined;
|
|
89
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
90
|
-
}
|
|
91
|
-
appendEvent(label, detail, completed = false) {
|
|
92
|
-
// Mark previous event as completed before adding new one
|
|
93
|
-
if (this.events.length > 0) {
|
|
94
|
-
const last = this.events[this.events.length - 1];
|
|
95
|
-
if (!last.isCompleted && !completed) {
|
|
96
|
-
last.isCompleted = true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
const event = {
|
|
100
|
-
id: (0, crypto_1.randomUUID)(),
|
|
101
|
-
label,
|
|
102
|
-
detail,
|
|
103
|
-
isCompleted: completed,
|
|
104
|
-
isExpanded: false,
|
|
105
|
-
};
|
|
106
|
-
this.events.push(event);
|
|
107
|
-
this.emit(PRBEStateEvent.EVENT, event);
|
|
108
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
109
|
-
}
|
|
110
|
-
attachObservation(text) {
|
|
111
|
-
if (this.events.length > 0) {
|
|
112
|
-
this.events[this.events.length - 1].detail = text;
|
|
113
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
completeInvestigation(report, summary) {
|
|
117
|
-
if (this.events.length > 0) {
|
|
118
|
-
this.events[this.events.length - 1].isCompleted = true;
|
|
119
|
-
}
|
|
120
|
-
this.appendEvent("Done", undefined, true);
|
|
121
|
-
// Save to history
|
|
122
|
-
this.completedInvestigations.unshift({
|
|
123
|
-
id: (0, crypto_1.randomUUID)(),
|
|
124
|
-
query: this.currentQuery,
|
|
125
|
-
report,
|
|
126
|
-
summary,
|
|
127
|
-
completedAt: new Date(),
|
|
128
|
-
});
|
|
129
|
-
this.report = report;
|
|
130
|
-
this.summary = summary;
|
|
131
|
-
this.isInvestigating = false;
|
|
132
|
-
this.emit(PRBEStateEvent.COMPLETE, { report, summary });
|
|
133
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
134
|
-
}
|
|
135
|
-
failInvestigation(message) {
|
|
136
|
-
this.appendEvent(`Error: ${message}`);
|
|
137
|
-
this.investigationError = message;
|
|
138
|
-
this.isInvestigating = false;
|
|
139
|
-
this.emit(PRBEStateEvent.ERROR, { message });
|
|
140
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
141
|
-
}
|
|
142
|
-
// ---------- Interaction state mutations ----------
|
|
143
|
-
setPendingInteraction(payload) {
|
|
144
|
-
this.pendingInteraction = payload;
|
|
145
|
-
this.emit(PRBEStateEvent.INTERACTION_REQUESTED, payload);
|
|
146
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
147
|
-
}
|
|
148
|
-
clearPendingInteraction() {
|
|
149
|
-
this.pendingInteraction = undefined;
|
|
150
|
-
this.emit(PRBEStateEvent.INTERACTION_RESOLVED);
|
|
151
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
152
|
-
}
|
|
153
|
-
setCRPendingInteraction(crID, payload) {
|
|
154
|
-
const cr = this.activeCRs.get(crID);
|
|
155
|
-
if (!cr)
|
|
156
|
-
return;
|
|
157
|
-
cr.pendingInteraction = payload;
|
|
158
|
-
this.emit(PRBEStateEvent.INTERACTION_REQUESTED, payload);
|
|
159
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
160
|
-
}
|
|
161
|
-
clearCRPendingInteraction(crID) {
|
|
162
|
-
const cr = this.activeCRs.get(crID);
|
|
163
|
-
if (!cr)
|
|
164
|
-
return;
|
|
165
|
-
cr.pendingInteraction = undefined;
|
|
166
|
-
this.emit(PRBEStateEvent.INTERACTION_RESOLVED);
|
|
167
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
168
|
-
}
|
|
169
|
-
resolveInteraction(response) {
|
|
170
|
-
if (!this.pendingInteraction)
|
|
171
|
-
return;
|
|
172
|
-
this.resolvedInteractions.push({
|
|
173
|
-
interactionId: this.pendingInteraction.interactionId,
|
|
174
|
-
payload: this.pendingInteraction,
|
|
175
|
-
response,
|
|
176
|
-
eventIndex: this.events.length,
|
|
177
|
-
});
|
|
178
|
-
this.pendingInteraction = undefined;
|
|
179
|
-
this.emit(PRBEStateEvent.INTERACTION_RESOLVED);
|
|
180
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
181
|
-
}
|
|
182
|
-
resolveCRInteraction(crID, response) {
|
|
183
|
-
const cr = this.activeCRs.get(crID);
|
|
184
|
-
if (!cr || !cr.pendingInteraction)
|
|
185
|
-
return;
|
|
186
|
-
const resolved = cr.resolvedInteractions ?? [];
|
|
187
|
-
resolved.push({
|
|
188
|
-
interactionId: cr.pendingInteraction.interactionId,
|
|
189
|
-
payload: cr.pendingInteraction,
|
|
190
|
-
response,
|
|
191
|
-
eventIndex: cr.events.length,
|
|
192
|
-
});
|
|
193
|
-
cr.resolvedInteractions = resolved;
|
|
194
|
-
cr.pendingInteraction = undefined;
|
|
195
|
-
this.emit(PRBEStateEvent.INTERACTION_RESOLVED);
|
|
196
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
197
|
-
}
|
|
198
|
-
toggleExpansion(eventId) {
|
|
199
|
-
const event = this.events.find((e) => e.id === eventId);
|
|
200
|
-
if (event) {
|
|
201
|
-
event.isExpanded = !event.isExpanded;
|
|
202
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// ---------- CR state mutations ----------
|
|
206
|
-
beginCR(id, query, slug) {
|
|
207
|
-
const cr = {
|
|
208
|
-
id,
|
|
209
|
-
query,
|
|
210
|
-
slug,
|
|
211
|
-
events: [],
|
|
212
|
-
resolvedInteractions: [],
|
|
213
|
-
isRunning: true,
|
|
214
|
-
isCompleted: false,
|
|
215
|
-
isFailed: false,
|
|
216
|
-
report: "",
|
|
217
|
-
summary: "",
|
|
218
|
-
startedAt: new Date(),
|
|
219
|
-
};
|
|
220
|
-
this.activeCRs.set(id, cr);
|
|
221
|
-
this.emit(PRBEStateEvent.CR_START, cr);
|
|
222
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
223
|
-
}
|
|
224
|
-
appendCREvent(crID, label, detail, completed = false) {
|
|
225
|
-
const cr = this.activeCRs.get(crID);
|
|
226
|
-
if (!cr)
|
|
227
|
-
return;
|
|
228
|
-
if (cr.events.length > 0) {
|
|
229
|
-
const last = cr.events[cr.events.length - 1];
|
|
230
|
-
if (!last.isCompleted && !completed) {
|
|
231
|
-
last.isCompleted = true;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
cr.events.push({
|
|
235
|
-
id: (0, crypto_1.randomUUID)(),
|
|
236
|
-
label,
|
|
237
|
-
detail,
|
|
238
|
-
isCompleted: completed,
|
|
239
|
-
isExpanded: false,
|
|
240
|
-
});
|
|
241
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
242
|
-
}
|
|
243
|
-
attachCRObservation(crID, text) {
|
|
244
|
-
const cr = this.activeCRs.get(crID);
|
|
245
|
-
if (!cr || cr.events.length === 0)
|
|
246
|
-
return;
|
|
247
|
-
cr.events[cr.events.length - 1].detail = text;
|
|
248
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
249
|
-
}
|
|
250
|
-
completeCR(id, report, summary) {
|
|
251
|
-
const cr = this.activeCRs.get(id);
|
|
252
|
-
if (!cr)
|
|
253
|
-
return;
|
|
254
|
-
this.activeCRs.delete(id);
|
|
255
|
-
if (cr.events.length > 0) {
|
|
256
|
-
cr.events[cr.events.length - 1].isCompleted = true;
|
|
257
|
-
}
|
|
258
|
-
cr.events.push({
|
|
259
|
-
id: (0, crypto_1.randomUUID)(),
|
|
260
|
-
label: "Done",
|
|
261
|
-
isCompleted: true,
|
|
262
|
-
isExpanded: false,
|
|
263
|
-
});
|
|
264
|
-
cr.isRunning = false;
|
|
265
|
-
cr.isCompleted = true;
|
|
266
|
-
cr.report = report;
|
|
267
|
-
cr.summary = summary;
|
|
268
|
-
this.completedCRs.unshift(cr);
|
|
269
|
-
this.emit(PRBEStateEvent.CR_COMPLETE, cr);
|
|
270
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
271
|
-
}
|
|
272
|
-
failCR(id, message) {
|
|
273
|
-
const cr = this.activeCRs.get(id);
|
|
274
|
-
if (!cr)
|
|
275
|
-
return;
|
|
276
|
-
this.activeCRs.delete(id);
|
|
277
|
-
cr.events.push({
|
|
278
|
-
id: (0, crypto_1.randomUUID)(),
|
|
279
|
-
label: `Error: ${message}`,
|
|
280
|
-
isCompleted: false,
|
|
281
|
-
isExpanded: false,
|
|
282
|
-
});
|
|
283
|
-
cr.isRunning = false;
|
|
284
|
-
cr.isFailed = true;
|
|
285
|
-
cr.errorMessage = message;
|
|
286
|
-
this.completedCRs.unshift(cr);
|
|
287
|
-
this.emit(PRBEStateEvent.CR_COMPLETE, cr);
|
|
288
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
289
|
-
}
|
|
290
|
-
// ---------- Tickets ----------
|
|
291
|
-
updateTrackedTicketIDs(ids) {
|
|
292
|
-
this.trackedTicketIDs = ids;
|
|
293
|
-
this.emit(PRBEStateEvent.TICKETS_CHANGED, ids);
|
|
294
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
295
|
-
}
|
|
296
|
-
updateTicketInfo(info) {
|
|
297
|
-
this.ticketInfo = info;
|
|
298
|
-
this.emit(PRBEStateEvent.TICKET_INFO, info);
|
|
299
|
-
this.emit(PRBEStateEvent.STATUS);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
exports.PRBEAgentState = PRBEAgentState;
|
|
303
|
-
//# sourceMappingURL=state.js.map
|
package/dist/state.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"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QAC1B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;YACb,EAAE,EAAE,IAAA,mBAAU,GAAE;YAChB,KAAK,EAAE,UAAU,OAAO,EAAE;YAC1B,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;QACH,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC;QACrB,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAC;QACnB,EAAE,CAAC,YAAY,GAAG,OAAO,CAAC;QAC1B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,gCAAgC;IAEhC,sBAAsB,CAAC,GAAa;QAClC,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,gBAAgB,CAAC,IAAqB;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AA/RD,wCA+RC"}
|
package/dist/tools/bash.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tools/bash.ts — BashExecuteTool
|
|
3
|
-
*
|
|
4
|
-
* Allows the agent to execute shell commands during investigations.
|
|
5
|
-
* Uses a whitelist-only safety model: commands on the whitelist run without
|
|
6
|
-
* permission; everything else requires user approval.
|
|
7
|
-
*
|
|
8
|
-
* Platform-aware: uses separate whitelists for Unix and Windows, and
|
|
9
|
-
* runs commands via PowerShell on Windows for consistent behavior.
|
|
10
|
-
*/
|
|
11
|
-
import type { PRBEToolDeclaration } from "../models";
|
|
12
|
-
import type { PRBEInteractionRequester } from "../interactions";
|
|
13
|
-
import type { PRBETool } from "./index";
|
|
14
|
-
export declare class BashExecuteTool implements PRBETool {
|
|
15
|
-
private readonly requester;
|
|
16
|
-
private readonly autoApprovedDirs;
|
|
17
|
-
private readonly grantedPaths;
|
|
18
|
-
constructor(requester: PRBEInteractionRequester, autoApprovedDirs: string[], grantedPaths: Set<string>);
|
|
19
|
-
get declaration(): PRBEToolDeclaration;
|
|
20
|
-
execute(args: Record<string, unknown>): Promise<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Check if a command is on the safe whitelist.
|
|
23
|
-
*/
|
|
24
|
-
private isCommandSafe;
|
|
25
|
-
/**
|
|
26
|
-
* For piped commands, check that every segment uses a safe command.
|
|
27
|
-
*/
|
|
28
|
-
private areAllPipeSegmentsSafe;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=bash.d.ts.map
|
package/dist/tools/bash.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,OAAO,KAAK,EAAE,wBAAwB,EAA6B,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAqDxC,qBAAa,eAAgB,YAAW,QAAQ;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2B;IACrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAW;IAC5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;gBAGzC,SAAS,EAAE,wBAAwB,EACnC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC;IAO3B,IAAI,WAAW,IAAI,mBAAmB,CA2BrC;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IA+E7D;;OAEG;IACH,OAAO,CAAC,aAAa;IA2BrB;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAoB/B"}
|
package/dist/tools/bash.js
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* tools/bash.ts — BashExecuteTool
|
|
4
|
-
*
|
|
5
|
-
* Allows the agent to execute shell commands during investigations.
|
|
6
|
-
* Uses a whitelist-only safety model: commands on the whitelist run without
|
|
7
|
-
* permission; everything else requires user approval.
|
|
8
|
-
*
|
|
9
|
-
* Platform-aware: uses separate whitelists for Unix and Windows, and
|
|
10
|
-
* runs commands via PowerShell on Windows for consistent behavior.
|
|
11
|
-
*/
|
|
12
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
-
}
|
|
18
|
-
Object.defineProperty(o, k2, desc);
|
|
19
|
-
}) : (function(o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
}));
|
|
23
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
-
}) : function(o, v) {
|
|
26
|
-
o["default"] = v;
|
|
27
|
-
});
|
|
28
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
-
var ownKeys = function(o) {
|
|
30
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
-
var ar = [];
|
|
32
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
-
return ar;
|
|
34
|
-
};
|
|
35
|
-
return ownKeys(o);
|
|
36
|
-
};
|
|
37
|
-
return function (mod) {
|
|
38
|
-
if (mod && mod.__esModule) return mod;
|
|
39
|
-
var result = {};
|
|
40
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
-
__setModuleDefault(result, mod);
|
|
42
|
-
return result;
|
|
43
|
-
};
|
|
44
|
-
})();
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.BashExecuteTool = void 0;
|
|
47
|
-
const child_process_1 = require("child_process");
|
|
48
|
-
const crypto_1 = require("crypto");
|
|
49
|
-
const path = __importStar(require("path"));
|
|
50
|
-
const models_1 = require("../models");
|
|
51
|
-
const interactions_1 = require("../interactions");
|
|
52
|
-
const index_1 = require("./index");
|
|
53
|
-
// ---------------------------------------------------------------------------
|
|
54
|
-
// Platform detection
|
|
55
|
-
// ---------------------------------------------------------------------------
|
|
56
|
-
const IS_WINDOWS = process.platform === "win32";
|
|
57
|
-
// ---------------------------------------------------------------------------
|
|
58
|
-
// Safe commands whitelist (read-only / informational only)
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
const UNIX_SAFE_COMMANDS = new Set([
|
|
61
|
-
"ls", "cat", "head", "tail", "grep", "rg", "find", "which",
|
|
62
|
-
"whoami", "pwd", "echo", "printf", "wc", "sort", "uniq",
|
|
63
|
-
"diff", "file", "stat", "du", "df", "uname", "env", "printenv",
|
|
64
|
-
"date", "id", "hostname", "ps", "top", "uptime", "free",
|
|
65
|
-
]);
|
|
66
|
-
const WINDOWS_SAFE_COMMANDS = new Set([
|
|
67
|
-
"dir", "type", "findstr", "where", "whoami", "echo",
|
|
68
|
-
"sort", "fc", "hostname", "date", "systeminfo", "tasklist",
|
|
69
|
-
"set", "ver", "vol", "tree",
|
|
70
|
-
// PowerShell cmdlets (when shell is PowerShell)
|
|
71
|
-
"get-childitem", "get-content", "select-string", "get-process",
|
|
72
|
-
"get-date", "get-host", "get-computerinfo", "get-volume",
|
|
73
|
-
"test-path", "resolve-path", "measure-object",
|
|
74
|
-
]);
|
|
75
|
-
const SAFE_COMMANDS = IS_WINDOWS ? WINDOWS_SAFE_COMMANDS : UNIX_SAFE_COMMANDS;
|
|
76
|
-
/** Two-word commands that are also safe (cross-platform — git/node/npm) */
|
|
77
|
-
const SAFE_COMMAND_PREFIXES = new Set([
|
|
78
|
-
"git status",
|
|
79
|
-
"git log",
|
|
80
|
-
"git diff",
|
|
81
|
-
"git show",
|
|
82
|
-
"git branch",
|
|
83
|
-
"node --version",
|
|
84
|
-
"npm --version",
|
|
85
|
-
"npm list",
|
|
86
|
-
"npm ls",
|
|
87
|
-
]);
|
|
88
|
-
const MAX_OUTPUT_BYTES = 100 * 1024; // 100KB
|
|
89
|
-
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
90
|
-
const MAX_TIMEOUT_MS = 120_000;
|
|
91
|
-
// ---------------------------------------------------------------------------
|
|
92
|
-
// BashExecuteTool
|
|
93
|
-
// ---------------------------------------------------------------------------
|
|
94
|
-
class BashExecuteTool {
|
|
95
|
-
requester;
|
|
96
|
-
autoApprovedDirs;
|
|
97
|
-
grantedPaths;
|
|
98
|
-
constructor(requester, autoApprovedDirs, grantedPaths) {
|
|
99
|
-
this.requester = requester;
|
|
100
|
-
this.autoApprovedDirs = autoApprovedDirs;
|
|
101
|
-
this.grantedPaths = grantedPaths;
|
|
102
|
-
}
|
|
103
|
-
get declaration() {
|
|
104
|
-
return {
|
|
105
|
-
name: models_1.ToolName.CLIENT_BASH_EXECUTE,
|
|
106
|
-
description: "Execute a shell command on the user's machine. Safe read-only commands run immediately; potentially destructive commands require user approval first.",
|
|
107
|
-
interactive: true,
|
|
108
|
-
parameters: [
|
|
109
|
-
{
|
|
110
|
-
name: "command",
|
|
111
|
-
type: models_1.ToolParamType.STRING,
|
|
112
|
-
description: "The shell command to execute",
|
|
113
|
-
required: true,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: "cwd",
|
|
117
|
-
type: models_1.ToolParamType.STRING,
|
|
118
|
-
description: "Working directory for the command (must be within auto-approved directories)",
|
|
119
|
-
required: false,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "timeout",
|
|
123
|
-
type: models_1.ToolParamType.INTEGER,
|
|
124
|
-
description: "Timeout in seconds (default 30, max 120)",
|
|
125
|
-
required: false,
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
async execute(args) {
|
|
131
|
-
const command = args["command"];
|
|
132
|
-
if (!command)
|
|
133
|
-
return "Error: 'command' parameter is required";
|
|
134
|
-
const cwdArg = args["cwd"];
|
|
135
|
-
const timeoutSec = typeof args["timeout"] === "number" ? args["timeout"] : DEFAULT_TIMEOUT_MS / 1000;
|
|
136
|
-
const timeoutMs = Math.min(timeoutSec * 1000, MAX_TIMEOUT_MS);
|
|
137
|
-
// Validate cwd if provided
|
|
138
|
-
let cwd;
|
|
139
|
-
if (cwdArg) {
|
|
140
|
-
const allRoots = [...this.autoApprovedDirs, ...this.grantedPaths];
|
|
141
|
-
const resolved = (0, index_1.resolveAndValidate)(cwdArg, allRoots);
|
|
142
|
-
if (!resolved) {
|
|
143
|
-
return `Error: working directory '${cwdArg}' is outside auto-approved directories`;
|
|
144
|
-
}
|
|
145
|
-
cwd = resolved;
|
|
146
|
-
}
|
|
147
|
-
// Check if command is safe (whitelist-only)
|
|
148
|
-
const isSafe = this.isCommandSafe(command);
|
|
149
|
-
if (!isSafe) {
|
|
150
|
-
const response = await this.requester.requestUserInteraction({
|
|
151
|
-
type: interactions_1.InteractionType.REQUEST_PERMISSION,
|
|
152
|
-
interactionId: (0, crypto_1.randomUUID)(),
|
|
153
|
-
action: "Execute shell command",
|
|
154
|
-
command,
|
|
155
|
-
reason: `The agent wants to run this command${cwd ? ` in ${cwd}` : ""}.`,
|
|
156
|
-
});
|
|
157
|
-
const permResponse = response;
|
|
158
|
-
if (!permResponse.approved) {
|
|
159
|
-
return "Command execution denied by user.";
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// Execute the command
|
|
163
|
-
return new Promise((resolve) => {
|
|
164
|
-
(0, child_process_1.exec)(command, {
|
|
165
|
-
cwd,
|
|
166
|
-
timeout: timeoutMs,
|
|
167
|
-
maxBuffer: MAX_OUTPUT_BYTES,
|
|
168
|
-
env: process.env,
|
|
169
|
-
// On Windows, use PowerShell for more consistent behavior
|
|
170
|
-
...(IS_WINDOWS ? { shell: "powershell.exe" } : {}),
|
|
171
|
-
}, (error, stdout, stderr) => {
|
|
172
|
-
let output = "";
|
|
173
|
-
if (stdout) {
|
|
174
|
-
output += stdout;
|
|
175
|
-
}
|
|
176
|
-
if (stderr) {
|
|
177
|
-
if (output)
|
|
178
|
-
output += "\n--- stderr ---\n";
|
|
179
|
-
output += stderr;
|
|
180
|
-
}
|
|
181
|
-
if (error) {
|
|
182
|
-
if (error.killed) {
|
|
183
|
-
output += `\n[Command timed out after ${timeoutSec}s]`;
|
|
184
|
-
}
|
|
185
|
-
else if (!stdout && !stderr) {
|
|
186
|
-
output = `Error: ${error.message}`;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// Truncate if too large
|
|
190
|
-
if (Buffer.byteLength(output, "utf-8") > MAX_OUTPUT_BYTES) {
|
|
191
|
-
output = output.slice(0, MAX_OUTPUT_BYTES) + "\n[Output truncated at 100KB]";
|
|
192
|
-
}
|
|
193
|
-
resolve(output || "(no output)");
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Check if a command is on the safe whitelist.
|
|
199
|
-
*/
|
|
200
|
-
isCommandSafe(command) {
|
|
201
|
-
const trimmed = command.trim();
|
|
202
|
-
// Check two-word prefixes first (e.g. "git status")
|
|
203
|
-
for (const prefix of SAFE_COMMAND_PREFIXES) {
|
|
204
|
-
if (trimmed === prefix || trimmed.startsWith(prefix + " ")) {
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
// Extract base command
|
|
209
|
-
const firstCommand = IS_WINDOWS
|
|
210
|
-
? trimmed.split(/[|;]/, 1)[0].trim() // PowerShell uses | and ;
|
|
211
|
-
: trimmed.split(/[|;&]/, 1)[0].trim(); // bash uses |, ;, &
|
|
212
|
-
const baseCommand = firstCommand.split(/\s+/, 1)[0];
|
|
213
|
-
const commandName = IS_WINDOWS
|
|
214
|
-
? baseCommand.toLowerCase() // Windows commands are case-insensitive
|
|
215
|
-
: path.basename(baseCommand);
|
|
216
|
-
if (SAFE_COMMANDS.has(commandName)) {
|
|
217
|
-
return this.areAllPipeSegmentsSafe(trimmed);
|
|
218
|
-
}
|
|
219
|
-
return false;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* For piped commands, check that every segment uses a safe command.
|
|
223
|
-
*/
|
|
224
|
-
areAllPipeSegmentsSafe(command) {
|
|
225
|
-
// Chained commands (;, &&, ||) require permission
|
|
226
|
-
if (IS_WINDOWS) {
|
|
227
|
-
if (/;/.test(command) && command.split("|").length <= 1)
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
if (/[;&]|&&|\|\|/.test(command))
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
const segments = command.split("|").map((s) => s.trim());
|
|
235
|
-
for (const segment of segments) {
|
|
236
|
-
const baseCommand = segment.split(/\s+/, 1)[0];
|
|
237
|
-
const commandName = IS_WINDOWS
|
|
238
|
-
? baseCommand.toLowerCase()
|
|
239
|
-
: path.basename(baseCommand);
|
|
240
|
-
if (!SAFE_COMMANDS.has(commandName)) {
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return true;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
exports.BashExecuteTool = BashExecuteTool;
|
|
248
|
-
//# sourceMappingURL=bash.js.map
|
package/dist/tools/bash.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAqC;AACrC,mCAAoC;AACpC,2CAA6B;AAE7B,sCAAoD;AACpD,kDAAkD;AAGlD,mCAA6C;AAE7C,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAEhD,8EAA8E;AAC9E,2DAA2D;AAC3D,8EAA8E;AAE9E,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO;IAC1D,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;IACvD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU;IAC9D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM;CACxD,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IACnD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY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