opencode-collaboration 0.7.0 → 0.8.1
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/README.md +7 -4
- package/README.zh-CN.md +7 -4
- package/dist/commands.js +2 -103
- package/dist/config.js +2 -52
- package/dist/delivery.js +2 -241
- package/dist/feedback.js +2 -40
- package/dist/format.js +2 -107
- package/dist/gating.js +2 -16
- package/dist/index.js +2 -461
- package/dist/listener.js +2 -335
- package/dist/outbox.js +2 -110
- package/dist/permissions.js +2 -194
- package/dist/queue.js +2 -824
- package/dist/registry.js +2 -308
- package/dist/sanitize.js +2 -38
- package/dist/scope.js +2 -23
- package/dist/sender.js +2 -139
- package/dist/session-runtime.js +2 -434
- package/dist/session-tracker.js +2 -39
- package/dist/title-suffix.js +2 -23
- package/dist/tools/peers-tools.js +2 -182
- package/dist/transport.js +2 -46
- package/dist/types.js +2 -1
- package/package.json +8 -4
package/dist/permissions.js
CHANGED
|
@@ -1,194 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* turn, modeled after Claude Code's per-source permission modes.
|
|
4
|
-
*
|
|
5
|
-
* A turn counts as peer-triggered when the user message that started it was
|
|
6
|
-
* injected by this plugin — detectable via the `peerMessage: true` metadata
|
|
7
|
-
* stamped on the injected part (see delivery.ts). Permission requests point
|
|
8
|
-
* at the *assistant* message holding the tool call, so the lookup walks up
|
|
9
|
-
* via parentID to the originating user message before checking its parts.
|
|
10
|
-
*
|
|
11
|
-
* Mechanism: opencode 1.18 does not invoke the plugin SDK's `permission.ask`
|
|
12
|
-
* hook, but it publishes permission request events on the bus and exposes a
|
|
13
|
-
* reply endpoint — the same pair the TUI uses. The plugin listens for
|
|
14
|
-
* `permission.v2.asked` (and the legacy `permission.asked`) and replies
|
|
15
|
-
* "once" (allow) or "reject" (deny) when the requesting turn is
|
|
16
|
-
* peer-triggered. Local user turns get no reply and fall through to
|
|
17
|
-
* opencode's normal prompt flow untouched.
|
|
18
|
-
*/
|
|
19
|
-
const CACHE_CAP = 200;
|
|
20
|
-
/** Assistant message -> its parent user message; 4 hops is generous. */
|
|
21
|
-
const MAX_HOPS = 4;
|
|
22
|
-
function flattenedPermissionText(props) {
|
|
23
|
-
const values = [];
|
|
24
|
-
const visit = (value, depth) => {
|
|
25
|
-
if (depth > 3 || value == null)
|
|
26
|
-
return;
|
|
27
|
-
if (typeof value === "string")
|
|
28
|
-
values.push(value);
|
|
29
|
-
else if (Array.isArray(value))
|
|
30
|
-
for (const item of value)
|
|
31
|
-
visit(item, depth + 1);
|
|
32
|
-
else if (typeof value === "object")
|
|
33
|
-
for (const item of Object.values(value))
|
|
34
|
-
visit(item, depth + 1);
|
|
35
|
-
};
|
|
36
|
-
visit(props, 0);
|
|
37
|
-
return values.join("\n").toLowerCase();
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Requests in these categories always remain under OpenCode's native policy/UI.
|
|
41
|
-
*
|
|
42
|
-
* This is a best-effort denylist, not a security boundary: it matches on the
|
|
43
|
-
* flattened event text, so a determined peer message can phrase a request to
|
|
44
|
-
* avoid these patterns (e.g. `npm config set` never names `.npmrc`). Treat
|
|
45
|
-
* `peerPermissions: "allow"` as fully trusting your peers; use "ask" for
|
|
46
|
-
* anything sensitive.
|
|
47
|
-
*/
|
|
48
|
-
export function isProtectedPermission(props) {
|
|
49
|
-
const permission = String(props.permission ?? props.action ?? props.type ?? "").toLowerCase();
|
|
50
|
-
const text = flattenedPermissionText(props);
|
|
51
|
-
if (permission === "permission" || /permission[ _.-]*(?:escalat|config|rule)/.test(text))
|
|
52
|
-
return true;
|
|
53
|
-
return /(?:^|[\\/\s])agents\.md(?:$|\s)/i.test(text) ||
|
|
54
|
-
/(?:^|[\\/\s])(?:opencode(?:\.jsonc?)?|\.opencode)(?:$|[\\/\s])/i.test(text) ||
|
|
55
|
-
/(?:^|[\\/\s])(?:\.env(?:\.[^\s\\/]*)?|credentials?|secrets?|\.npmrc|\.pypirc|\.netrc|\.gitconfig)(?:$|\s)/i.test(text) ||
|
|
56
|
-
/(?:^|[\\/\s])(?:\.aws|\.ssh|\.gnupg|\.kube|\.docker)[\\/]/i.test(text) ||
|
|
57
|
-
// shell startup / persistence paths
|
|
58
|
-
/(?:^|[\\/\s])(?:\.zshrc|\.zshenv|\.zprofile|\.bashrc|\.bash_profile|\.bash_login|\.profile|config\.fish)(?:$|\s)/i.test(text) ||
|
|
59
|
-
/(?:^|[\\/\s])(?:launchagents|launchdaemons)[\\/]/i.test(text) ||
|
|
60
|
-
/(?:^|\s)(?:crontab|visudo)(?:\s|$)/i.test(text) ||
|
|
61
|
-
/\/(?:etc|private\/etc)\/(?:sudoers|crontab|cron\.)/i.test(text);
|
|
62
|
-
}
|
|
63
|
-
export function PeerPermissions(opts) {
|
|
64
|
-
// messageID -> whether that message's turn is peer-triggered. Verdicts are
|
|
65
|
-
// stable per message, and one turn typically raises several permission
|
|
66
|
-
// requests against the same messageID.
|
|
67
|
-
const turnCache = new Map();
|
|
68
|
-
// permission request IDs already replied to (both "permission.asked" and
|
|
69
|
-
// "permission.updated" may fire for one request)
|
|
70
|
-
const replied = new Set();
|
|
71
|
-
async function fetchMessage(sessionID, messageID) {
|
|
72
|
-
const res = await opts.client.session.message({
|
|
73
|
-
path: { id: sessionID, messageID },
|
|
74
|
-
});
|
|
75
|
-
const data = res.data;
|
|
76
|
-
if (!data)
|
|
77
|
-
return null;
|
|
78
|
-
return {
|
|
79
|
-
role: data.info?.role,
|
|
80
|
-
parentID: data.info?.parentID,
|
|
81
|
-
isPeer: Boolean(data.parts?.some((p) => Boolean(p.metadata?.peerMessage))),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
async function isPeerTurn(sessionID, messageID) {
|
|
85
|
-
const key = `${sessionID}:${messageID}`;
|
|
86
|
-
const hit = turnCache.get(key);
|
|
87
|
-
if (hit !== undefined)
|
|
88
|
-
return hit;
|
|
89
|
-
let verdict = false;
|
|
90
|
-
let transient = false;
|
|
91
|
-
try {
|
|
92
|
-
let cursor = messageID;
|
|
93
|
-
for (let hop = 0; cursor && hop < MAX_HOPS; hop++) {
|
|
94
|
-
const view = await fetchMessage(sessionID, cursor);
|
|
95
|
-
if (!view) {
|
|
96
|
-
// Message not retrievable yet (event raced storage) — the verdict
|
|
97
|
-
// is not stable, so do not cache it.
|
|
98
|
-
transient = true;
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
if (view.isPeer) {
|
|
102
|
-
verdict = true;
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
if (view.role === "user" || !view.parentID)
|
|
106
|
-
break;
|
|
107
|
-
cursor = view.parentID;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch (err) {
|
|
111
|
-
// Message gone, server unreachable, ... — stay out of the way.
|
|
112
|
-
await opts.logger("debug", "peer-message lookup failed; leaving permission to default", {
|
|
113
|
-
error: String(err),
|
|
114
|
-
sessionID,
|
|
115
|
-
messageID,
|
|
116
|
-
});
|
|
117
|
-
return false; // not cached: a transient failure may succeed next time
|
|
118
|
-
}
|
|
119
|
-
if (transient)
|
|
120
|
-
return false; // not cached: re-evaluate on the next event
|
|
121
|
-
if (turnCache.size >= CACHE_CAP) {
|
|
122
|
-
const oldest = turnCache.keys().next().value;
|
|
123
|
-
if (oldest !== undefined)
|
|
124
|
-
turnCache.delete(oldest);
|
|
125
|
-
}
|
|
126
|
-
turnCache.set(key, verdict);
|
|
127
|
-
return verdict;
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
async handleEvent(event) {
|
|
131
|
-
if (event.type !== "permission.v2.asked" && event.type !== "permission.asked")
|
|
132
|
-
return;
|
|
133
|
-
const mode = opts.mode();
|
|
134
|
-
if (mode === "ask")
|
|
135
|
-
return;
|
|
136
|
-
const props = event.properties ?? {};
|
|
137
|
-
const permissionID = props.id;
|
|
138
|
-
const sessionID = props.sessionID;
|
|
139
|
-
// v2 events carry the requesting tool call in `source`; legacy events
|
|
140
|
-
// (and the SSE compat mapping) use `messageID` / `tool.messageID`.
|
|
141
|
-
const source = props.source;
|
|
142
|
-
const tool = props.tool;
|
|
143
|
-
const messageID = (source?.messageID ?? tool?.messageID ?? props.messageID);
|
|
144
|
-
if (!permissionID || !sessionID || !messageID)
|
|
145
|
-
return;
|
|
146
|
-
if (replied.has(permissionID))
|
|
147
|
-
return;
|
|
148
|
-
if (!(await isPeerTurn(sessionID, messageID)))
|
|
149
|
-
return;
|
|
150
|
-
if (mode === "allow" && isProtectedPermission(props)) {
|
|
151
|
-
await opts.logger("warn", "protected peer permission left to OpenCode policy", {
|
|
152
|
-
permission: props.permission ?? props.action ?? props.type,
|
|
153
|
-
sessionID,
|
|
154
|
-
permissionID,
|
|
155
|
-
});
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
replied.add(permissionID);
|
|
159
|
-
if (replied.size > CACHE_CAP) {
|
|
160
|
-
const oldest = replied.values().next().value;
|
|
161
|
-
if (oldest !== undefined)
|
|
162
|
-
replied.delete(oldest);
|
|
163
|
-
}
|
|
164
|
-
const response = mode === "deny" ? "reject" : "once";
|
|
165
|
-
try {
|
|
166
|
-
const client = opts.client;
|
|
167
|
-
if (typeof client.postSessionIdPermissionsPermissionId !== "function") {
|
|
168
|
-
await opts.logger("warn", "permission reply endpoint unavailable in this SDK");
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
// invoked as a method: the SDK class needs its `this` binding
|
|
172
|
-
await client.postSessionIdPermissionsPermissionId({
|
|
173
|
-
path: { id: sessionID, permissionID },
|
|
174
|
-
body: { response },
|
|
175
|
-
query: { directory: opts.directory },
|
|
176
|
-
});
|
|
177
|
-
await opts.logger("info", `auto-${mode} permission in peer-triggered turn`, {
|
|
178
|
-
permission: props.action ?? props.type,
|
|
179
|
-
title: props.title,
|
|
180
|
-
sessionID,
|
|
181
|
-
permissionID,
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
catch (err) {
|
|
185
|
-
replied.delete(permissionID); // allow a retry on the next event
|
|
186
|
-
await opts.logger("warn", "failed to auto-resolve permission", {
|
|
187
|
-
error: String(err),
|
|
188
|
-
sessionID,
|
|
189
|
-
permissionID,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
};
|
|
194
|
-
}
|
|
1
|
+
function _0x5756(_0x3c534b,_0x550ed2){_0x3c534b=_0x3c534b-0x6c;const _0x524791=_0x5247();let _0x575680=_0x524791[_0x3c534b];if(_0x5756['pSUXTt']===undefined){var _0x47f296=function(_0x1c5bb9){const _0x11eea9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c0168='',_0x258184='';for(let _0x9a2c4b=0x0,_0x201524,_0x5d3803,_0x2ed9f1=0x0;_0x5d3803=_0x1c5bb9['charAt'](_0x2ed9f1++);~_0x5d3803&&(_0x201524=_0x9a2c4b%0x4?_0x201524*0x40+_0x5d3803:_0x5d3803,_0x9a2c4b++%0x4)?_0x2c0168+=String['fromCharCode'](0xff&_0x201524>>(-0x2*_0x9a2c4b&0x6)):0x0){_0x5d3803=_0x11eea9['indexOf'](_0x5d3803);}for(let _0x413b99=0x0,_0x3ea855=_0x2c0168['length'];_0x413b99<_0x3ea855;_0x413b99++){_0x258184+='%'+('00'+_0x2c0168['charCodeAt'](_0x413b99)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x258184);};_0x5756['eVfAGO']=_0x47f296,_0x5756['jdOois']={},_0x5756['pSUXTt']=!![];}const _0x5b26fa=_0x524791[0x0];_0x5756['oYSUii']!==_0x5b26fa&&(_0x5756['jdOois']={},_0x5756['oYSUii']=_0x5b26fa);const _0x453a44=_0x5756['jdOois'][_0x3c534b];return _0x453a44===undefined?(_0x575680=_0x5756['eVfAGO'](_0x575680),_0x5756['jdOois'][_0x3c534b]=_0x575680):_0x575680=_0x453a44,_0x575680;}function _0x5247(){const _0x492650=['DxnLCG','y2XPzw50','C2v0','A2v5CW','D2fYBG','AM9PBG','mtqXmtK4q1vmDuvk','Aw5MBW','ChvZAa','yxnR','DhLWzq','DgvZDa','mZe1m21KuhrkqG','CgfYzw50suq','z2v0','C2vZC2LVBKLe','mZmWmdzvDfDeBNm','CgvYBwLZC2LVBIbYzxbSEsbLBMrWB2LUDcb1BMf2ywLSywjSzsbPBIb0AgLZifnesW','C29Tzq','zgf0yq','CMvQzwn0','ywrK','CM9Szq','mta4nJKXmdH6B1zyt0W','CgvLCK1LC3nHz2u','odaWANzgz1D0','nJyWyMDHvNzT','Dg9mB3DLCKnHC2u','ywn0Aw9U','ihbLCM1PC3nPB24GAw4GCgvLCI10CMLNz2vYzwqGDhvYBG','C2L6zq','ywXSB3C','Bw9Kzq','ndmWsuP0uM1R','mtm3ote4sNPlEMvx','Bg9Nz2vY','DMfSDwu','BwvZC2fNzuLe','AxnqzwvY','nZC2m2rksLDnAq','DMfSDwvZ','AgfZ','mwnYtMzKtW','ChjVCgvYDgLLCW','nJq2nJa2ogjWzfDtsq','B25Jzq','zMfPBgvKihrVigf1Dg8TCMvZB2X2zsbWzxjTAxnZAw9U','C2vZC2LVBG','C291CMnL','BMv4Da','CgvYBwLZC2LVBI5HC2TLza','zgLYzwn0B3j5','BwvZC2fNzq','mJa1DLPHwMv5','yxv0BY0','B2jQzwn0','zgvIDwC','Cg9ZDfnLC3nPB25jzfbLCM1PC3nPB25ZugvYBwLZC2LVBKLK','zNvUy3rPB24','ChjVDgvJDgvKihbLzxiGCgvYBwLZC2LVBIbSzwz0ihrVie9Wzw5dB2rLihbVBgLJEq','CgfYDhm','CgvLCI1TzxnZywDLigXVB2T1CcbMywLSzwq7igXLyxzPBMCGCgvYBwLZC2LVBIb0BYbKzwzHDwX0','CgvYBwLZC2LVBG','zgvSzxrL'];_0x5247=function(){return _0x492650;};return _0x5247();}(function(stringArrayFunction,_0x3bd867){const _0xa95285=_0x5756,stringArray=stringArrayFunction();while(!![]){try{const _0xe00457=-parseInt(_0xa95285(0x79))/0x1*(parseInt(_0xa95285(0x95))/0x2)+-parseInt(_0xa95285(0x9b))/0x3*(parseInt(_0xa95285(0xa9))/0x4)+parseInt(_0xa95285(0x84))/0x5*(-parseInt(_0xa95285(0x9f))/0x6)+-parseInt(_0xa95285(0x76))/0x7*(-parseInt(_0xa95285(0xa8))/0x8)+-parseInt(_0xa95285(0x7b))/0x9+parseInt(_0xa95285(0x70))/0xa*(parseInt(_0xa95285(0x71))/0xb)+parseInt(_0xa95285(0xa6))/0xc;if(_0xe00457===_0x3bd867)break;else stringArray['push'](stringArray['shift']());}catch(_0x269dd1){stringArray['push'](stringArray['shift']());}}}(_0x5247,0x59caa));const _0x258184=0xc8,_0x9a2c4b=0x4;function _0x201524(_0x5d3803){const _0x32efb2=_0x5756,_0x2ed9f1=[],_0x413b99=(_0x3ea855,_0x562b90)=>{const _0x184383=_0x5756;if(_0x562b90>0x3||_0x3ea855==null)return;if(typeof _0x3ea855==='string')_0x2ed9f1[_0x184383(0x97)](_0x3ea855);else{if(Array['isArray'](_0x3ea855)){for(const _0x560c9b of _0x3ea855)_0x413b99(_0x560c9b,_0x562b90+0x1);}else{if(typeof _0x3ea855===_0x184383(0x86)){for(const _0x3117f1 of Object[_0x184383(0x77)](_0x3ea855))_0x413b99(_0x3117f1,_0x562b90+0x1);}}}};return _0x413b99(_0x5d3803,0x0),_0x2ed9f1[_0x32efb2(0x94)]('\x0a')[_0x32efb2(0xaa)]();}export function isProtectedPermission(_0x19e7c6){const _0x563b3b=_0x5756,_0x38fdcc=String(_0x19e7c6[_0x563b3b(0x8d)]??_0x19e7c6[_0x563b3b(0xab)]??_0x19e7c6[_0x563b3b(0x99)]??'')[_0x563b3b(0xaa)](),_0x51d258=_0x201524(_0x19e7c6);if(_0x38fdcc===_0x563b3b(0x8d)||/permission[ _.-]*(?:escalat|config|rule)/[_0x563b3b(0x9a)](_0x51d258))return!![];return/(?:^|[\\/\s])agents\.md(?:$|\s)/i[_0x563b3b(0x9a)](_0x51d258)||/(?:^|[\\/\s])(?:opencode(?:\.jsonc?)?|\.opencode)(?:$|[\\/\s])/i[_0x563b3b(0x9a)](_0x51d258)||/(?:^|[\\/\s])(?:\.env(?:\.[^\s\\/]*)?|credentials?|secrets?|\.npmrc|\.pypirc|\.netrc|\.gitconfig)(?:$|\s)/i[_0x563b3b(0x9a)](_0x51d258)||/(?:^|[\\/\s])(?:\.aws|\.ssh|\.gnupg|\.kube|\.docker)[\\/]/i['test'](_0x51d258)||/(?:^|[\\/\s])(?:\.zshrc|\.zshenv|\.zprofile|\.bashrc|\.bash_profile|\.bash_login|\.profile|config\.fish)(?:$|\s)/i[_0x563b3b(0x9a)](_0x51d258)||/(?:^|[\\/\s])(?:launchagents|launchdaemons)[\\/]/i[_0x563b3b(0x9a)](_0x51d258)||/(?:^|\s)(?:crontab|visudo)(?:\s|$)/i['test'](_0x51d258)||/\/(?:etc|private\/etc)\/(?:sudoers|crontab|cron\.)/i[_0x563b3b(0x9a)](_0x51d258);}export function PeerPermissions(_0x2dae4a){const _0x1c4a00=new Map(),_0x5373eb=new Set();async function fetchMessage(_0xc18974,_0xc57014){const _0xaa84=_0x5756,_0xfaae48=await _0x2dae4a[_0xaa84(0x90)][_0xaa84(0x7e)][_0xaa84(0x83)]({'path':{'id':_0xc18974,'messageID':_0xc57014}}),_0x2879f7=_0xfaae48[_0xaa84(0xa2)];if(!_0x2879f7)return null;return{'role':_0x2879f7['info']?.['role'],'parentID':_0x2879f7[_0xaa84(0x96)]?.[_0xaa84(0x9c)],'isPeer':Boolean(_0x2879f7[_0xaa84(0x8b)]?.[_0xaa84(0xa1)](_0x20ef01=>Boolean(_0x20ef01['metadata']?.[_0xaa84(0xa7)])))};}async function _0xf9b114(_0x36912b,_0x42e477){const _0x2e0214=_0x5756,_0x5cae56=_0x36912b+':'+_0x42e477,_0x2a99e1=_0x1c4a00[_0x2e0214(0x9d)](_0x5cae56);if(_0x2a99e1!==undefined)return _0x2a99e1;let _0x4239ae=![],_0x32149b=![];try{let _0x3c3f5c=_0x42e477;for(let _0x5347a5=0x0;_0x3c3f5c&&_0x5347a5<_0x9a2c4b;_0x5347a5++){const _0x3c0245=await fetchMessage(_0x36912b,_0x3c3f5c);if(!_0x3c0245){_0x32149b=!![];break;}if(_0x3c0245[_0x2e0214(0x75)]){_0x4239ae=!![];break;}if(_0x3c0245[_0x2e0214(0xa5)]===_0x2e0214(0x8f)||!_0x3c0245[_0x2e0214(0x9c)])break;_0x3c3f5c=_0x3c0245[_0x2e0214(0x9c)];}}catch(_0x4841bb){return await _0x2dae4a[_0x2e0214(0x72)](_0x2e0214(0x87),_0x2e0214(0x8c),{'error':String(_0x4841bb),'sessionID':_0x36912b,'messageID':_0x42e477}),![];}if(_0x32149b)return![];if(_0x1c4a00[_0x2e0214(0x6d)]>=_0x258184){const _0x3a9da5=_0x1c4a00[_0x2e0214(0x92)]()[_0x2e0214(0x80)]()[_0x2e0214(0x73)];if(_0x3a9da5!==undefined)_0x1c4a00[_0x2e0214(0x8e)](_0x3a9da5);}return _0x1c4a00[_0x2e0214(0x91)](_0x5cae56,_0x4239ae),_0x4239ae;}return{async 'handleEvent'(_0x164fb1){const _0xadb045=_0x5756;if(_0x164fb1[_0xadb045(0x99)]!=='permission.v2.asked'&&_0x164fb1[_0xadb045(0x99)]!==_0xadb045(0x81))return;const _0x18dee1=_0x2dae4a[_0xadb045(0x6f)]();if(_0x18dee1===_0xadb045(0x98))return;const _0x348304=_0x164fb1[_0xadb045(0x7a)]??{},_0x16e52f=_0x348304['id'],_0x394b36=_0x348304[_0xadb045(0x9e)],_0x1ec225=_0x348304[_0xadb045(0x7f)],_0x1f7e72=_0x348304['tool'],_0x482f3c=_0x1ec225?.[_0xadb045(0x74)]??_0x1f7e72?.['messageID']??_0x348304[_0xadb045(0x74)];if(!_0x16e52f||!_0x394b36||!_0x482f3c)return;if(_0x5373eb[_0xadb045(0x78)](_0x16e52f))return;if(!await _0xf9b114(_0x394b36,_0x482f3c))return;if(_0x18dee1===_0xadb045(0x6e)&&isProtectedPermission(_0x348304)){await _0x2dae4a[_0xadb045(0x72)](_0xadb045(0x93),_0xadb045(0x8a),{'permission':_0x348304[_0xadb045(0x8d)]??_0x348304[_0xadb045(0xab)]??_0x348304[_0xadb045(0x99)],'sessionID':_0x394b36,'permissionID':_0x16e52f});return;}_0x5373eb[_0xadb045(0xa4)](_0x16e52f);if(_0x5373eb[_0xadb045(0x6d)]>_0x258184){const _0x2a6d08=_0x5373eb['values']()[_0xadb045(0x80)]()[_0xadb045(0x73)];if(_0x2a6d08!==undefined)_0x5373eb['delete'](_0x2a6d08);}const _0x8af3a9=_0x18dee1==='deny'?_0xadb045(0xa3):_0xadb045(0x7c);try{const _0x23f477=_0x2dae4a['client'];if(typeof _0x23f477[_0xadb045(0x88)]!==_0xadb045(0x89)){await _0x2dae4a[_0xadb045(0x72)](_0xadb045(0x93),_0xadb045(0xa0));return;}await _0x23f477[_0xadb045(0x88)]({'path':{'id':_0x394b36,'permissionID':_0x16e52f},'body':{'response':_0x8af3a9},'query':{'directory':_0x2dae4a[_0xadb045(0x82)]}}),await _0x2dae4a[_0xadb045(0x72)](_0xadb045(0x96),_0xadb045(0x85)+_0x18dee1+_0xadb045(0x6c),{'permission':_0x348304[_0xadb045(0xab)]??_0x348304['type'],'title':_0x348304['title'],'sessionID':_0x394b36,'permissionID':_0x16e52f});}catch(_0x39d833){_0x5373eb[_0xadb045(0x8e)](_0x16e52f),await _0x2dae4a['logger'](_0xadb045(0x93),_0xadb045(0x7d),{'error':String(_0x39d833),'sessionID':_0x394b36,'permissionID':_0x16e52f});}}};}
|
|
2
|
+
//# sourceMappingURL=.js.map
|