@dexto/server 1.5.2 → 1.5.3
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.
|
@@ -98,6 +98,31 @@ function createManualApprovalHandler(coordinator) {
|
|
|
98
98
|
},
|
|
99
99
|
getPendingRequests: () => {
|
|
100
100
|
return Array.from(pendingApprovals.values()).map((p) => p.request);
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Auto-approve pending requests that match a predicate.
|
|
104
|
+
* Used when a pattern is remembered to auto-approve other parallel requests
|
|
105
|
+
* that would now match the same pattern.
|
|
106
|
+
*/
|
|
107
|
+
autoApprovePending: (predicate, responseData) => {
|
|
108
|
+
let count = 0;
|
|
109
|
+
for (const [approvalId, pending] of pendingApprovals) {
|
|
110
|
+
if (predicate(pending.request)) {
|
|
111
|
+
pending.cleanup();
|
|
112
|
+
pendingApprovals.delete(approvalId);
|
|
113
|
+
const autoApproveResponse = {
|
|
114
|
+
approvalId,
|
|
115
|
+
status: import_core.ApprovalStatus.APPROVED,
|
|
116
|
+
sessionId: pending.request.sessionId,
|
|
117
|
+
message: "Auto-approved due to matching remembered pattern",
|
|
118
|
+
data: responseData
|
|
119
|
+
};
|
|
120
|
+
coordinator.emitResponse(autoApproveResponse);
|
|
121
|
+
pending.resolve(autoApproveResponse);
|
|
122
|
+
count++;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return count;
|
|
101
126
|
}
|
|
102
127
|
});
|
|
103
128
|
return handler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manual-approval-handler.d.ts","sourceRoot":"","sources":["../../src/approval/manual-approval-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAqC,MAAM,aAAa,CAAC;AAEtF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,mBAAmB,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"manual-approval-handler.d.ts","sourceRoot":"","sources":["../../src/approval/manual-approval-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAqC,MAAM,aAAa,CAAC;AAEtF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,mBAAmB,GAAG,eAAe,CAkK7F"}
|
|
@@ -75,6 +75,31 @@ function createManualApprovalHandler(coordinator) {
|
|
|
75
75
|
},
|
|
76
76
|
getPendingRequests: () => {
|
|
77
77
|
return Array.from(pendingApprovals.values()).map((p) => p.request);
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Auto-approve pending requests that match a predicate.
|
|
81
|
+
* Used when a pattern is remembered to auto-approve other parallel requests
|
|
82
|
+
* that would now match the same pattern.
|
|
83
|
+
*/
|
|
84
|
+
autoApprovePending: (predicate, responseData) => {
|
|
85
|
+
let count = 0;
|
|
86
|
+
for (const [approvalId, pending] of pendingApprovals) {
|
|
87
|
+
if (predicate(pending.request)) {
|
|
88
|
+
pending.cleanup();
|
|
89
|
+
pendingApprovals.delete(approvalId);
|
|
90
|
+
const autoApproveResponse = {
|
|
91
|
+
approvalId,
|
|
92
|
+
status: ApprovalStatus.APPROVED,
|
|
93
|
+
sessionId: pending.request.sessionId,
|
|
94
|
+
message: "Auto-approved due to matching remembered pattern",
|
|
95
|
+
data: responseData
|
|
96
|
+
};
|
|
97
|
+
coordinator.emitResponse(autoApproveResponse);
|
|
98
|
+
pending.resolve(autoApproveResponse);
|
|
99
|
+
count++;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return count;
|
|
78
103
|
}
|
|
79
104
|
});
|
|
80
105
|
return handler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/server",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"ws": "^8.18.1",
|
|
32
32
|
"yaml": "^2.7.1",
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
34
|
-
"@dexto/agent-management": "1.5.
|
|
35
|
-
"@dexto/core": "1.5.
|
|
36
|
-
"@dexto/image-local": "1.5.
|
|
34
|
+
"@dexto/agent-management": "1.5.3",
|
|
35
|
+
"@dexto/core": "1.5.3",
|
|
36
|
+
"@dexto/image-local": "1.5.3"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|