@browserbasehq/orca 3.0.8-google-cua-1 → 3.0.8-google-cua-2
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.js +49 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -179,7 +179,7 @@ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")])
|
|
|
179
179
|
var STAGEHAND_VERSION;
|
|
180
180
|
var init_version = __esm({
|
|
181
181
|
"lib/version.ts"() {
|
|
182
|
-
STAGEHAND_VERSION = "3.0.8-google-cua-
|
|
182
|
+
STAGEHAND_VERSION = "3.0.8-google-cua-2";
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
|
|
@@ -35123,6 +35123,51 @@ var GoogleCUAClient = class extends AgentClient {
|
|
|
35123
35123
|
const functionResponses = [];
|
|
35124
35124
|
if (result.actions.length > 0) {
|
|
35125
35125
|
let hasError = false;
|
|
35126
|
+
const safetyAcknowledgements = /* @__PURE__ */ new Map();
|
|
35127
|
+
for (const functionCall of result.functionCalls) {
|
|
35128
|
+
if ((_b = functionCall.args) == null ? void 0 : _b.safety_decision) {
|
|
35129
|
+
logger({
|
|
35130
|
+
category: "agent",
|
|
35131
|
+
message: `Safety decision required before action execution`,
|
|
35132
|
+
level: 1
|
|
35133
|
+
});
|
|
35134
|
+
const acknowledgement = yield this.handleSafetyConfirmation(
|
|
35135
|
+
functionCall.args.safety_decision,
|
|
35136
|
+
logger
|
|
35137
|
+
);
|
|
35138
|
+
safetyAcknowledgements.set(functionCall.name || "", acknowledgement);
|
|
35139
|
+
if (acknowledgement === void 0) {
|
|
35140
|
+
logger({
|
|
35141
|
+
category: "agent",
|
|
35142
|
+
message: `Safety decision rejected - skipping action execution`,
|
|
35143
|
+
level: 1
|
|
35144
|
+
});
|
|
35145
|
+
const rejectionResponse = {
|
|
35146
|
+
functionResponse: {
|
|
35147
|
+
name: functionCall.name,
|
|
35148
|
+
response: {
|
|
35149
|
+
error: "Action rejected by user due to safety concerns",
|
|
35150
|
+
safety_acknowledgement: "false"
|
|
35151
|
+
}
|
|
35152
|
+
}
|
|
35153
|
+
};
|
|
35154
|
+
this.history.push({
|
|
35155
|
+
role: "user",
|
|
35156
|
+
parts: [rejectionResponse]
|
|
35157
|
+
});
|
|
35158
|
+
return {
|
|
35159
|
+
actions: [],
|
|
35160
|
+
message: "Action rejected due to safety concerns",
|
|
35161
|
+
completed: false,
|
|
35162
|
+
usage: {
|
|
35163
|
+
input_tokens: (usageMetadata == null ? void 0 : usageMetadata.promptTokenCount) || 0,
|
|
35164
|
+
output_tokens: (usageMetadata == null ? void 0 : usageMetadata.candidatesTokenCount) || 0,
|
|
35165
|
+
inference_time_ms: endTime - startTime
|
|
35166
|
+
}
|
|
35167
|
+
};
|
|
35168
|
+
}
|
|
35169
|
+
}
|
|
35170
|
+
}
|
|
35126
35171
|
for (let i2 = 0; i2 < result.actions.length; i2++) {
|
|
35127
35172
|
const action = result.actions[i2];
|
|
35128
35173
|
logger({
|
|
@@ -35197,13 +35242,9 @@ var GoogleCUAClient = class extends AgentClient {
|
|
|
35197
35242
|
""
|
|
35198
35243
|
);
|
|
35199
35244
|
for (const functionCall of computerUseFunctionCalls) {
|
|
35200
|
-
|
|
35201
|
-
|
|
35202
|
-
|
|
35203
|
-
functionCall.args.safety_decision,
|
|
35204
|
-
logger
|
|
35205
|
-
);
|
|
35206
|
-
}
|
|
35245
|
+
const safetyAcknowledgement = safetyAcknowledgements.get(
|
|
35246
|
+
functionCall.name || ""
|
|
35247
|
+
);
|
|
35207
35248
|
const functionResponsePart = {
|
|
35208
35249
|
functionResponse: {
|
|
35209
35250
|
name: functionCall.name,
|
package/package.json
CHANGED