mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-30 17:00:23 +08:00
1.1.73: adapt DSH 0.2.1-rc.2, Apache-2.0, lab-only default-deny.
This commit is contained in:
1 parent
8df4406a7c
commit
1ea067189c
114 files changed
+21198
-5183
No files matched your search
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { isChildAgentContext, isRedteamSession } from '../identity.js'
|
||||
import { isRedteamSession } from '../identity.js'
|
||||
import { redteamRoot } from './platform-config.js'
|
||||
|
||||
const ROLE_TAG = /^[ \t]*redteamRole:[ \t]*(recon|assess|vuln-scan|exploit|internal)[ \t]*$/im
|
||||
@@ -50,8 +50,9 @@ function remember(agent, role) {
|
||||
}
|
||||
|
||||
function isRedteamChild(session, agent) {
|
||||
const wrapped = { session, agent: agent ? { ...agent, session } : { session } }
|
||||
return isChildAgentContext(wrapped) && isRedteamSession(wrapped)
|
||||
const header = session?.header
|
||||
if (header?.origin !== 'subagent' && !((header?.delegationDepth ?? 0) > 0)) return false
|
||||
return isRedteamSession({ session, agent: agent ? { ...agent, session } : { session } })
|
||||
}
|
||||
|
||||
export function noteClaimedMessage(payload) {
|
||||
|
||||
Reference in new issue
Block a user