erosolar-cli 2.1.242 → 2.1.243

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.
Files changed (35) hide show
  1. package/dist/capabilities/iMessageVerificationCapability.d.ts +31 -0
  2. package/dist/capabilities/iMessageVerificationCapability.d.ts.map +1 -0
  3. package/dist/capabilities/iMessageVerificationCapability.js +56 -0
  4. package/dist/capabilities/iMessageVerificationCapability.js.map +1 -0
  5. package/dist/capabilities/index.d.ts +1 -0
  6. package/dist/capabilities/index.d.ts.map +1 -1
  7. package/dist/capabilities/index.js +1 -0
  8. package/dist/capabilities/index.js.map +1 -1
  9. package/dist/core/agentOrchestrator.d.ts +31 -0
  10. package/dist/core/agentOrchestrator.d.ts.map +1 -1
  11. package/dist/core/agentOrchestrator.js +328 -0
  12. package/dist/core/agentOrchestrator.js.map +1 -1
  13. package/dist/core/iMessageVerification.d.ts +408 -0
  14. package/dist/core/iMessageVerification.d.ts.map +1 -0
  15. package/dist/core/iMessageVerification.js +883 -0
  16. package/dist/core/iMessageVerification.js.map +1 -0
  17. package/dist/core/techFraudInvestigator.d.ts +131 -0
  18. package/dist/core/techFraudInvestigator.d.ts.map +1 -0
  19. package/dist/core/techFraudInvestigator.js +992 -0
  20. package/dist/core/techFraudInvestigator.js.map +1 -0
  21. package/dist/plugins/tools/imessageVerification/iMessageVerificationPlugin.d.ts +3 -0
  22. package/dist/plugins/tools/imessageVerification/iMessageVerificationPlugin.d.ts.map +1 -0
  23. package/dist/plugins/tools/imessageVerification/iMessageVerificationPlugin.js +14 -0
  24. package/dist/plugins/tools/imessageVerification/iMessageVerificationPlugin.js.map +1 -0
  25. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  26. package/dist/plugins/tools/nodeDefaults.js +2 -0
  27. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  28. package/dist/tools/iMessageVerificationTools.d.ts +17 -0
  29. package/dist/tools/iMessageVerificationTools.d.ts.map +1 -0
  30. package/dist/tools/iMessageVerificationTools.js +842 -0
  31. package/dist/tools/iMessageVerificationTools.js.map +1 -0
  32. package/dist/tools/taoTools.d.ts.map +1 -1
  33. package/dist/tools/taoTools.js +1277 -1
  34. package/dist/tools/taoTools.js.map +1 -1
  35. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ /**
2
+ * iMessage Verification Capability
3
+ *
4
+ * Provides cryptographic verification of Apple's iMessage PQ3 implementation.
5
+ * This capability enables users to:
6
+ *
7
+ * 1. Monitor IDS key directory for unauthorized changes
8
+ * 2. Perform out-of-band key verification (like Signal safety numbers)
9
+ * 3. Audit Apple's Key Transparency log independently
10
+ * 4. Analyze network traffic for MITM indicators
11
+ * 5. Generate legal evidence of dishonest implementation
12
+ *
13
+ * This fills the gap that Apple refuses to fill:
14
+ * - No public third-party KT auditors
15
+ * - Closed source clients
16
+ * - No independent verification tools
17
+ */
18
+ import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../runtime/agentHost.js';
19
+ export interface iMessageVerificationCapabilityOptions {
20
+ workingDir?: string;
21
+ id?: string;
22
+ description?: string;
23
+ }
24
+ export declare class iMessageVerificationCapabilityModule implements CapabilityModule {
25
+ readonly id = "capability.imessage-verification";
26
+ private readonly options;
27
+ constructor(options?: iMessageVerificationCapabilityOptions);
28
+ create(context: CapabilityContext): Promise<CapabilityContribution>;
29
+ }
30
+ export declare const iMessageVerificationCapability: typeof iMessageVerificationCapabilityModule;
31
+ //# sourceMappingURL=iMessageVerificationCapability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iMessageVerificationCapability.d.ts","sourceRoot":"","sources":["../../src/capabilities/iMessageVerificationCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3G,MAAM,WAAW,qCAAqC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,oCAAqC,YAAW,gBAAgB;IAC3E,QAAQ,CAAC,EAAE,sCAAsC;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;gBAEpD,OAAO,GAAE,qCAA0C;IAIzD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA4B1E;AAGD,eAAO,MAAM,8BAA8B,6CAAuC,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * iMessage Verification Capability
3
+ *
4
+ * Provides cryptographic verification of Apple's iMessage PQ3 implementation.
5
+ * This capability enables users to:
6
+ *
7
+ * 1. Monitor IDS key directory for unauthorized changes
8
+ * 2. Perform out-of-band key verification (like Signal safety numbers)
9
+ * 3. Audit Apple's Key Transparency log independently
10
+ * 4. Analyze network traffic for MITM indicators
11
+ * 5. Generate legal evidence of dishonest implementation
12
+ *
13
+ * This fills the gap that Apple refuses to fill:
14
+ * - No public third-party KT auditors
15
+ * - Closed source clients
16
+ * - No independent verification tools
17
+ */
18
+ import { createiMessageVerificationTools } from '../tools/iMessageVerificationTools.js';
19
+ export class iMessageVerificationCapabilityModule {
20
+ id = 'capability.imessage-verification';
21
+ options;
22
+ constructor(options = {}) {
23
+ this.options = options;
24
+ }
25
+ async create(context) {
26
+ const workingDir = this.options.workingDir ?? context.workingDir;
27
+ return {
28
+ id: this.options.id ?? 'imessage-verification.tools.core',
29
+ description: this.options.description ?? `Cryptographic verification of Apple's iMessage end-to-end encryption claims.
30
+
31
+ Provides tools to independently verify whether Apple's iMessage PQ3 implementation
32
+ is honest, or if Apple is capable of/actively performing man-in-the-middle attacks
33
+ despite their E2E encryption claims.
34
+
35
+ Key capabilities:
36
+ • Monitor IDS key directory changes over time
37
+ • Out-of-band key verification (safety number style)
38
+ • Independent Key Transparency log auditing
39
+ • Network traffic analysis for MITM detection
40
+ • Legal evidence generation for fraud claims
41
+
42
+ This capability exists because Apple:
43
+ 1. Has no public third-party Key Transparency auditors
44
+ 2. Provides closed-source clients (cannot verify implementation)
45
+ 3. Controls the key directory (can substitute keys at will)
46
+ 4. Markets unverifiable security claims as fact`,
47
+ toolSuite: createiMessageVerificationTools(workingDir),
48
+ metadata: {
49
+ workingDir,
50
+ },
51
+ };
52
+ }
53
+ }
54
+ // Also export as iMessageVerificationCapability for compatibility
55
+ export const iMessageVerificationCapability = iMessageVerificationCapabilityModule;
56
+ //# sourceMappingURL=iMessageVerificationCapability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iMessageVerificationCapability.js","sourceRoot":"","sources":["../../src/capabilities/iMessageVerificationCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAQxF,MAAM,OAAO,oCAAoC;IACtC,EAAE,GAAG,kCAAkC,CAAC;IAChC,OAAO,CAAwC;IAEhE,YAAY,UAAiD,EAAE;QAC7D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;QACjE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,kCAAkC;YACzD,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI;;;;;;;;;;;;;;;;;gDAiBC;YAC1C,SAAS,EAAE,+BAA+B,CAAC,UAAU,CAAC;YACtD,QAAQ,EAAE;gBACR,UAAU;aACX;SACF,CAAC;IACJ,CAAC;CACF;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,8BAA8B,GAAG,oCAAoC,CAAC"}
@@ -25,4 +25,5 @@ export { ValidationCapabilityModule, type ValidationCapabilityOptions, } from '.
25
25
  export { BuildCapabilityModule, type BuildCapabilityOptions, } from './buildCapability.js';
26
26
  export { TaoCapabilityModule, type TaoCapabilityOptions, } from './taoCapability.js';
27
27
  export { IntegrityCapabilityModule, type IntegrityCapabilityOptions, } from './integrityCapability.js';
28
+ export { iMessageVerificationCapabilityModule, type iMessageVerificationCapabilityOptions, } from './iMessageVerificationCapability.js';
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,KAAK,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACzG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,KAAK,6BAA6B,GACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,2BAA2B,EAC3B,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kCAAkC,EAClC,KAAK,mCAAmC,GACzC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE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AsB,CAAC;AAC9B,OAAO,EACL,+BAA+B,EAC/B,KAAK,gCAAgC,GACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iCAAiC,EACjC,KAAK,kCAAkC,GACxC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,0BAA0B,EAC1B,KAAK,2BAA2B,GACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oCAAoC,EACpC,KAAK,qCAAqC,GAC3C,MAAM,qCAAqC,CAAC"}
@@ -25,4 +25,5 @@ export { ValidationCapabilityModule, } from './validationCapability.js';
25
25
  export { BuildCapabilityModule, } from './buildCapability.js';
26
26
  export { TaoCapabilityModule, } from './taoCapability.js';
27
27
  export { IntegrityCapabilityModule, } from './integrityCapability.js';
28
+ export { iMessageVerificationCapabilityModule, } from './iMessageVerificationCapability.js';
28
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAoC,MAAM,2BAA2B,CAAC;AACzG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAA8B,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAgC,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,4BAA4B,GAE7B,MAAM,6BAA6B,CAAC;AACrC,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C;AAC9B,OAAO,EACL,mBAAmB,GAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,GAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oCAAoC,GAErC,MAAM,qCAAqC,CAAC"}
@@ -121,5 +121,36 @@ export declare class AgentOrchestrator {
121
121
  * preventing wasted compute and infinite "thinking" loops.
122
122
  */
123
123
  private checkForHarmfulRequest;
124
+ /**
125
+ * Detect if a request should trigger attack chain execution.
126
+ * Uses natural language parsing to identify security operation intents.
127
+ */
128
+ private shouldExecuteAttackChain;
129
+ /**
130
+ * Validate authorization context for attack chain execution.
131
+ * Ensures proper authorization before executing security techniques.
132
+ */
133
+ private validateAttackAuthorization;
134
+ /**
135
+ * Execute an attack chain with TAO techniques.
136
+ * Returns results including all executed techniques and artifacts.
137
+ */
138
+ executeAttackChain(request: string, options?: {
139
+ targets?: string[];
140
+ depth?: 'quick' | 'standard' | 'deep';
141
+ stealth?: boolean;
142
+ authContext?: string;
143
+ onProgress?: (chain: AttackChain, techniqueId: string, result: TechniqueResult) => void;
144
+ }): Promise<AttackChainResult>;
145
+ /**
146
+ * Run orchestration with optional attack chain integration.
147
+ * When attack chain mode is enabled, security operations are executed
148
+ * directly through TAO techniques rather than relying on LLM tool calls.
149
+ */
150
+ runWithAttackChain(request: string, options?: OrchestratorOptions): Promise<OrchestratorResult>;
151
+ /**
152
+ * Build a human-readable summary of attack chain execution.
153
+ */
154
+ private buildAttackChainSummary;
124
155
  }
125
156
  //# sourceMappingURL=agentOrchestrator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentOrchestrator.d.ts","sourceRoot":"","sources":["../../src/core/agentOrchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAEpE,OAAO,EAA0B,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAOL,KAAK,WAAW,EAEhB,KAAK,eAAe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AE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;QACtC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;KACpF,GACL,OAAO,CAAC,iBAAiB,CAAC;IAwF7B;;;;OAIG;IACG,kBAAkB,CACtB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC;IA4I9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;CA+ChC"}
@@ -1,5 +1,6 @@
1
1
  import { TASK_FULLY_COMPLETE } from './constants.js';
2
2
  import { TaskCompletionDetector } from './taskCompletionDetector.js';
3
+ import { planAttackChain, selectNextTechnique, executeTechniqueInChain, techniqueRegistry, parseNaturalLanguageIntent, validateAuthorizationContext, } from '../tools/tao/index.js';
3
4
  /**
4
5
  * Single-pass orchestration: drive the agent to finish as much as possible
5
6
  * in one go, with strong bias toward real actions over planning.
@@ -872,5 +873,332 @@ Please provide context so I can help appropriately.`,
872
873
  }
873
874
  return { isHarmful: false, response: '' };
874
875
  }
876
+ // ═══════════════════════════════════════════════════════════════════════════════
877
+ // ATTACK CHAIN EXECUTION
878
+ // ═══════════════════════════════════════════════════════════════════════════════
879
+ /**
880
+ * Detect if a request should trigger attack chain execution.
881
+ * Uses natural language parsing to identify security operation intents.
882
+ */
883
+ shouldExecuteAttackChain(request, mode = 'auto') {
884
+ if (mode === 'disabled') {
885
+ return { shouldExecute: false, intent: null };
886
+ }
887
+ if (mode === 'forced') {
888
+ const intent = parseNaturalLanguageIntent(request);
889
+ return { shouldExecute: true, intent };
890
+ }
891
+ // Auto mode: parse intent and check for security operations
892
+ const intent = parseNaturalLanguageIntent(request);
893
+ const securityActions = ['recon', 'scan', 'enumerate', 'exploit', 'extract', 'test', 'monitor'];
894
+ const isSecurityOp = securityActions.includes(intent.action);
895
+ const hasTargets = intent.targets.length > 0;
896
+ return {
897
+ shouldExecute: isSecurityOp && hasTargets,
898
+ intent: isSecurityOp ? intent : null,
899
+ };
900
+ }
901
+ /**
902
+ * Validate authorization context for attack chain execution.
903
+ * Ensures proper authorization before executing security techniques.
904
+ */
905
+ validateAttackAuthorization(intent, authContext) {
906
+ // Use the TAO authorization validator
907
+ const validation = validateAuthorizationContext(intent);
908
+ // Additional checks for protected targets
909
+ const protectedTargets = [
910
+ 'google.com', 'microsoft.com', 'apple.com', 'amazon.com',
911
+ 'facebook.com', 'twitter.com', 'github.com',
912
+ ];
913
+ const targetingProtected = intent.targets.some(t => protectedTargets.some(pt => t.toLowerCase().includes(pt)));
914
+ if (targetingProtected && !validation.valid) {
915
+ return {
916
+ authorized: false,
917
+ reason: 'Targeting protected production systems without explicit authorization',
918
+ warnings: [
919
+ 'Protected targets detected. Provide CTF/lab context or authorization scope.',
920
+ ...validation.warnings,
921
+ ],
922
+ };
923
+ }
924
+ // Check for explicit authorization context
925
+ if (authContext) {
926
+ const authorizedContexts = ['ctf', 'lab', 'pentest', 'bug-bounty', 'authorized'];
927
+ const hasExplicitAuth = authorizedContexts.some(ctx => authContext.toLowerCase().includes(ctx));
928
+ if (hasExplicitAuth) {
929
+ return {
930
+ authorized: true,
931
+ reason: `Explicit authorization: ${authContext}`,
932
+ warnings: validation.warnings,
933
+ };
934
+ }
935
+ }
936
+ return {
937
+ authorized: validation.valid,
938
+ reason: validation.type,
939
+ warnings: validation.warnings,
940
+ };
941
+ }
942
+ /**
943
+ * Execute an attack chain with TAO techniques.
944
+ * Returns results including all executed techniques and artifacts.
945
+ */
946
+ async executeAttackChain(request, options = {}) {
947
+ const intent = parseNaturalLanguageIntent(request);
948
+ const targets = options.targets ?? intent.targets;
949
+ // Normalize depth - map 'comprehensive' to 'deep'
950
+ const rawDepth = options.depth ?? intent.depth;
951
+ const depth = rawDepth === 'comprehensive' ? 'deep' : rawDepth;
952
+ const stealth = options.stealth ?? intent.constraints.includes('stealth');
953
+ // Validate authorization
954
+ const auth = this.validateAttackAuthorization(intent, options.authContext);
955
+ if (!auth.authorized) {
956
+ throw new Error(`Attack chain execution not authorized: ${auth.reason}`);
957
+ }
958
+ const executedTechniques = [];
959
+ const phasesCompleted = new Set();
960
+ const startTime = Date.now();
961
+ // Execute chain for each target
962
+ for (const target of targets) {
963
+ const chain = planAttackChain(intent, `Attack chain: ${target}`);
964
+ while (chain.state === 'planning' || chain.state === 'executing') {
965
+ const action = selectNextTechnique(chain);
966
+ if (!action)
967
+ break;
968
+ const technique = techniqueRegistry.get(action.id);
969
+ if (!technique)
970
+ continue;
971
+ const params = {
972
+ target,
973
+ depth,
974
+ stealth,
975
+ timeout: depth === 'deep' ? 60000 : depth === 'standard' ? 30000 : 10000,
976
+ context: {
977
+ chainId: chain.id,
978
+ phase: technique.phase,
979
+ previousArtifacts: executedTechniques
980
+ .filter(t => t.success)
981
+ .flatMap(t => t.artifacts),
982
+ },
983
+ };
984
+ try {
985
+ const { result } = await executeTechniqueInChain(chain, action, params);
986
+ executedTechniques.push({
987
+ id: technique.id,
988
+ name: technique.name,
989
+ phase: technique.phase,
990
+ success: result.success,
991
+ duration: result.duration,
992
+ artifacts: result.artifacts,
993
+ });
994
+ if (result.success) {
995
+ phasesCompleted.add(technique.phase);
996
+ }
997
+ options.onProgress?.(chain, technique.id, result);
998
+ }
999
+ catch (err) {
1000
+ // Log but continue chain execution
1001
+ executedTechniques.push({
1002
+ id: technique.id,
1003
+ name: technique.name,
1004
+ phase: technique.phase,
1005
+ success: false,
1006
+ duration: 0,
1007
+ artifacts: [{ type: 'error', data: String(err) }],
1008
+ });
1009
+ }
1010
+ }
1011
+ }
1012
+ const successCount = executedTechniques.filter(t => t.success).length;
1013
+ return {
1014
+ chain: planAttackChain(intent, request), // Return final chain state
1015
+ techniques: executedTechniques,
1016
+ totalDuration: Date.now() - startTime,
1017
+ successRate: executedTechniques.length > 0
1018
+ ? successCount / executedTechniques.length
1019
+ : 0,
1020
+ phasesCompleted: Array.from(phasesCompleted),
1021
+ };
1022
+ }
1023
+ /**
1024
+ * Run orchestration with optional attack chain integration.
1025
+ * When attack chain mode is enabled, security operations are executed
1026
+ * directly through TAO techniques rather than relying on LLM tool calls.
1027
+ */
1028
+ async runWithAttackChain(request, options = {}) {
1029
+ const attackChainMode = options.attackChainMode ?? 'auto';
1030
+ // Check if we should execute attack chain
1031
+ const { shouldExecute, intent } = this.shouldExecuteAttackChain(request, attackChainMode);
1032
+ if (!shouldExecute || !intent) {
1033
+ // Fall back to normal orchestration
1034
+ return this.runToCompletion(request, options);
1035
+ }
1036
+ // Validate authorization
1037
+ const auth = this.validateAttackAuthorization(intent, options.authorizationContext);
1038
+ if (!auth.authorized) {
1039
+ return {
1040
+ finalResponse: `Cannot execute security operation: ${auth.reason}\n\n${auth.warnings.join('\n')}`,
1041
+ toolsUsed: [],
1042
+ planOnly: false,
1043
+ tookAction: false,
1044
+ completion: {
1045
+ isComplete: true,
1046
+ confidence: 1.0,
1047
+ signals: {
1048
+ hasExplicitCompletionStatement: true,
1049
+ hasIncompleteWorkIndicators: false,
1050
+ hasPendingActionIndicators: false,
1051
+ hasErrorIndicators: false,
1052
+ hasFollowUpQuestions: false,
1053
+ toolsUsedInLastResponse: 0,
1054
+ lastToolWasReadOnly: false,
1055
+ consecutiveResponsesWithoutTools: 0,
1056
+ hasRecentFileWrites: false,
1057
+ hasRecentCommits: false,
1058
+ todoItemsPending: 0,
1059
+ todoItemsCompleted: 0,
1060
+ mentionsFutureWork: false,
1061
+ completionConfidence: 1.0,
1062
+ },
1063
+ reason: 'Authorization required',
1064
+ shouldVerify: false,
1065
+ },
1066
+ exitReason: 'attack-chain-aborted',
1067
+ statusSummary: `Authorization required: ${auth.reason}`,
1068
+ limitations: auth.warnings,
1069
+ recommendations: [
1070
+ 'Provide explicit authorization context (CTF, lab, pentest scope)',
1071
+ 'Use --auth-context flag to specify authorization',
1072
+ ],
1073
+ };
1074
+ }
1075
+ // Execute attack chain
1076
+ try {
1077
+ // Normalize depth for attack chain
1078
+ const attackRawDepth = options.attackDepth ?? intent.depth;
1079
+ const attackDepth = attackRawDepth === 'comprehensive' ? 'deep' : attackRawDepth;
1080
+ const chainResult = await this.executeAttackChain(request, {
1081
+ targets: options.attackTargets ?? intent.targets,
1082
+ depth: attackDepth,
1083
+ stealth: options.stealthMode ?? intent.constraints.includes('stealth'),
1084
+ authContext: options.authorizationContext,
1085
+ onProgress: options.onAttackChainProgress,
1086
+ });
1087
+ // Build response summary
1088
+ const summary = this.buildAttackChainSummary(chainResult);
1089
+ return {
1090
+ finalResponse: summary,
1091
+ toolsUsed: chainResult.techniques.map(t => t.id),
1092
+ planOnly: false,
1093
+ tookAction: true,
1094
+ completion: {
1095
+ isComplete: true,
1096
+ confidence: chainResult.successRate,
1097
+ signals: {
1098
+ hasExplicitCompletionStatement: true,
1099
+ hasIncompleteWorkIndicators: false,
1100
+ hasPendingActionIndicators: false,
1101
+ hasErrorIndicators: chainResult.successRate < 0.5,
1102
+ hasFollowUpQuestions: false,
1103
+ toolsUsedInLastResponse: chainResult.techniques.length,
1104
+ lastToolWasReadOnly: false,
1105
+ consecutiveResponsesWithoutTools: 0,
1106
+ hasRecentFileWrites: false,
1107
+ hasRecentCommits: false,
1108
+ todoItemsPending: 0,
1109
+ todoItemsCompleted: chainResult.techniques.length,
1110
+ mentionsFutureWork: false,
1111
+ completionConfidence: chainResult.successRate,
1112
+ },
1113
+ reason: 'Attack chain completed',
1114
+ shouldVerify: chainResult.successRate < 1.0,
1115
+ },
1116
+ exitReason: 'attack-chain-complete',
1117
+ statusSummary: `Attack chain: ${chainResult.techniques.length} techniques, ${Math.round(chainResult.successRate * 100)}% success`,
1118
+ limitations: [],
1119
+ recommendations: chainResult.successRate < 1.0
1120
+ ? ['Review failed techniques and adjust approach']
1121
+ : [],
1122
+ attackChainResult: chainResult,
1123
+ };
1124
+ }
1125
+ catch (err) {
1126
+ return {
1127
+ finalResponse: `Attack chain execution failed: ${String(err)}`,
1128
+ toolsUsed: [],
1129
+ planOnly: false,
1130
+ tookAction: false,
1131
+ completion: {
1132
+ isComplete: true,
1133
+ confidence: 0,
1134
+ signals: {
1135
+ hasExplicitCompletionStatement: true,
1136
+ hasIncompleteWorkIndicators: false,
1137
+ hasPendingActionIndicators: false,
1138
+ hasErrorIndicators: true,
1139
+ hasFollowUpQuestions: false,
1140
+ toolsUsedInLastResponse: 0,
1141
+ lastToolWasReadOnly: false,
1142
+ consecutiveResponsesWithoutTools: 0,
1143
+ hasRecentFileWrites: false,
1144
+ hasRecentCommits: false,
1145
+ todoItemsPending: 0,
1146
+ todoItemsCompleted: 0,
1147
+ mentionsFutureWork: false,
1148
+ completionConfidence: 0,
1149
+ },
1150
+ reason: `Error: ${String(err)}`,
1151
+ shouldVerify: false,
1152
+ },
1153
+ exitReason: 'attack-chain-aborted',
1154
+ statusSummary: `Attack chain failed: ${String(err)}`,
1155
+ limitations: [String(err)],
1156
+ recommendations: ['Check target connectivity', 'Verify authorization context'],
1157
+ };
1158
+ }
1159
+ }
1160
+ /**
1161
+ * Build a human-readable summary of attack chain execution.
1162
+ */
1163
+ buildAttackChainSummary(result) {
1164
+ const lines = [];
1165
+ lines.push('## Attack Chain Execution Summary\n');
1166
+ // Overall stats
1167
+ lines.push(`**Duration:** ${Math.round(result.totalDuration / 1000)}s`);
1168
+ lines.push(`**Success Rate:** ${Math.round(result.successRate * 100)}%`);
1169
+ lines.push(`**Phases Completed:** ${result.phasesCompleted.join(', ')}\n`);
1170
+ // Technique breakdown
1171
+ lines.push('### Techniques Executed\n');
1172
+ const byPhase = new Map();
1173
+ for (const tech of result.techniques) {
1174
+ const list = byPhase.get(tech.phase) || [];
1175
+ list.push(tech);
1176
+ byPhase.set(tech.phase, list);
1177
+ }
1178
+ for (const [phase, techniques] of byPhase) {
1179
+ lines.push(`#### ${phase}`);
1180
+ for (const tech of techniques) {
1181
+ const status = tech.success ? '✓' : '✗';
1182
+ lines.push(`- ${status} **${tech.name}** (${Math.round(tech.duration / 1000)}s)`);
1183
+ if (tech.artifacts.length > 0) {
1184
+ lines.push(` - Artifacts: ${tech.artifacts.length} collected`);
1185
+ }
1186
+ }
1187
+ lines.push('');
1188
+ }
1189
+ // Artifacts summary
1190
+ const allArtifacts = result.techniques.flatMap(t => t.artifacts);
1191
+ if (allArtifacts.length > 0) {
1192
+ lines.push('### Collected Artifacts\n');
1193
+ const artifactsByType = new Map();
1194
+ for (const artifact of allArtifacts) {
1195
+ artifactsByType.set(artifact.type, (artifactsByType.get(artifact.type) || 0) + 1);
1196
+ }
1197
+ for (const [type, count] of artifactsByType) {
1198
+ lines.push(`- **${type}:** ${count}`);
1199
+ }
1200
+ }
1201
+ return lines.join('\n');
1202
+ }
875
1203
  }
876
1204
  //# sourceMappingURL=agentOrchestrator.js.map