evolcore 0.0.28 → 0.0.29-test.0
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/CHANGELOG.md +12 -0
- package/bin/ec-safe-output.js +270 -54
- package/dist/agents/baseagent-availability.js +37 -1
- package/dist/agents/baseagent.js +19 -9
- package/dist/agents/claude-runner.js +171 -13
- package/dist/agents/codex/app-server-client.js +6 -2
- package/dist/agents/codex/diagnostics.js +4 -3
- package/dist/agents/codex-runner.js +396 -95
- package/dist/agents/gemini-runner.js +35 -17
- package/dist/aun/group/history.js +130 -90
- package/dist/aun/group/operations.js +1 -3
- package/dist/aun/menu/transport.js +5 -3
- package/dist/aun/msg/managed-operation.js +70 -0
- package/dist/aun/msg/p2p.js +1 -3
- package/dist/aun/msg/upload.js +2 -2
- package/dist/aun/outbox.js +1 -37
- package/dist/channels/aun.js +249 -89
- package/dist/channels/daemon.js +18 -1
- package/dist/channels/feishu.js +1 -2
- package/dist/cli/agent-command.js +23 -3
- package/dist/cli/agent-create.js +68 -2
- package/dist/cli/agent.js +12 -2
- package/dist/cli/aun-commands.js +87 -13
- package/dist/cli/cli-argv.js +26 -0
- package/dist/cli/daemon-commands.js +40 -10
- package/dist/cli/data-command.js +4 -4
- package/dist/cli/handoff-command.js +2 -0
- package/dist/cli/index.js +18 -1
- package/dist/cli/managed-command-guard.js +10 -0
- package/dist/cli/memory-command.js +441 -0
- package/dist/cli/restart-monitor.js +62 -6
- package/dist/cli/skill-command.js +41 -0
- package/dist/cli/task-context.js +2 -23
- package/dist/cli/trigger-command.js +9 -1
- package/dist/cli/watch-msg-diag.js +209 -0
- package/dist/config/config-field-policy.js +52 -3
- package/dist/config/config-manager.js +17 -4
- package/dist/config/contact-book-store.js +2 -2
- package/dist/config/mention-mode.js +7 -2
- package/dist/config/merge.js +28 -9
- package/dist/config/resolved-config-op.js +1 -1
- package/dist/config/runtime-env.js +137 -0
- package/dist/config/schema-registry.js +11 -1
- package/dist/config-store.js +10 -10
- package/dist/core/audit/event-key.js +3 -1
- package/dist/core/audit/log-integrity.js +4 -0
- package/dist/core/auth/agent-delegation.js +2 -1
- package/dist/core/auth/auth-gateway.js +13 -6
- package/dist/core/auth/authorization-audit.js +54 -19
- package/dist/core/auth/operation-authorizer.js +17 -0
- package/dist/core/auth/operation-catalog.js +9 -0
- package/dist/core/causation/context.js +5 -1
- package/dist/core/command/agent-control.js +1 -2
- package/dist/core/command/command-handler.js +51 -23
- package/dist/core/command/memory-slash.js +270 -0
- package/dist/core/command/menu-catalog.js +1 -0
- package/dist/core/command/menu-handler.js +315 -60
- package/dist/core/command/menu-protocol.js +42 -4
- package/dist/core/command/slash-gate.js +10 -10
- package/dist/core/command/slash-handler.js +206 -64
- package/dist/core/data-migration.js +282 -505
- package/dist/core/event-catalog.js +26 -0
- package/dist/core/evolagent-registry.js +6 -0
- package/dist/core/evolagent.js +0 -10
- package/dist/core/handoff/store.js +1 -20
- package/dist/core/inference/text-inference.js +57 -1
- package/dist/core/memory/consolidation-context.js +505 -0
- package/dist/core/memory/consolidation-ops-records.js +124 -0
- package/dist/core/memory/consolidation-trigger.js +394 -0
- package/dist/core/memory/index-manager.js +308 -0
- package/dist/core/memory/launch-consolidation.js +395 -0
- package/dist/core/memory/memory-admin.js +234 -0
- package/dist/core/memory/memory-document.js +100 -0
- package/dist/core/memory/memory-session-policy.js +41 -0
- package/dist/core/memory/memory-signature.js +257 -0
- package/dist/core/memory/memory-writer.js +432 -0
- package/dist/core/memory/staleness.js +117 -0
- package/dist/core/message/auto-mention-gate.js +454 -0
- package/dist/core/message/im-renderer.js +69 -16
- package/dist/core/message/message-bridge.js +287 -21
- package/dist/core/message/message-log.js +1 -0
- package/dist/core/message/message-queue.js +114 -27
- package/dist/core/message/pending-hints.js +329 -161
- package/dist/core/message/response-engine.js +567 -80
- package/dist/core/permission/ec-command-parser.js +1029 -80
- package/dist/core/permission/protected-paths.js +376 -126
- package/dist/core/permission/sandbox-runtime.js +40 -12
- package/dist/core/permission/tool-error-code.js +96 -13
- package/dist/core/permission/tool-policy.js +276 -23
- package/dist/core/role/runtime-policy.js +3 -7
- package/dist/core/session/{runner-task-history.js → runner-event-summary.js} +1 -1
- package/dist/core/session/session-fs-store.js +0 -76
- package/dist/core/session/session-idle-monitor.js +355 -0
- package/dist/core/session/session-manager.js +478 -17
- package/dist/core/session/session-mapper.js +33 -16
- package/dist/core/session/session-renew.js +217 -155
- package/dist/core/session/{session-turns.js → session-transcript.js} +35 -6
- package/dist/core/skill/global-watcher.js +282 -0
- package/dist/core/skill/index-generator.js +84 -0
- package/dist/core/skill/startup.js +73 -0
- package/dist/core/skill/switch-resolver.js +115 -0
- package/dist/core/task/task-activity-store.js +219 -0
- package/dist/eck/kit-renderer.js +30 -3
- package/dist/eck/manifest-engine.js +26 -4
- package/dist/index.js +708 -18
- package/dist/ipc.js +564 -2
- package/dist/paths.js +30 -9
- package/dist/response-system/engines/v1/proactive-flow.js +116 -15
- package/dist/response-system/modes/single-session/index.js +3 -0
- package/dist/trigger/feedback.js +1 -0
- package/dist/trigger/manager.js +0 -10
- package/dist/trigger/scheduler.js +11 -0
- package/dist/trigger/validation.js +22 -0
- package/dist/utils/avatar-upload.js +59 -18
- package/dist/utils/error-dict.json +6 -3
- package/dist/utils/error-utils.js +27 -0
- package/dist/utils/logger.js +32 -10
- package/dist/utils/media-cache.js +84 -0
- package/dist/utils/msg-diag.js +97 -0
- package/dist/utils/welcome.js +37 -8
- package/kits/docs/AUTHORING.md +314 -0
- package/kits/docs/GUIDE.md +2 -0
- package/kits/docs/INDEX.md +2 -0
- package/kits/docs/aun/CHEATSHEET.md +4 -0
- package/kits/docs/aun/SDK.md +60 -0
- package/kits/docs/context-assembly.md +10 -6
- package/kits/docs/evolcore/INDEX.md +17 -3
- package/kits/docs/evolcore/agent-create.md +24 -0
- package/kits/docs/evolcore/agent.md +5 -2
- package/kits/docs/evolcore/config.md +1 -1
- package/kits/docs/evolcore/ec-capabilities.md +364 -0
- package/kits/docs/evolcore/group.md +34 -18
- package/kits/docs/evolcore/memory-architecture.md +78 -0
- package/kits/docs/evolcore/memory-consolidation-batches.md +133 -0
- package/kits/docs/evolcore/memory-consolidation.md +263 -0
- package/kits/docs/evolcore/memory-tags.md +63 -0
- package/kits/docs/evolcore/memory.md +110 -0
- package/kits/docs/evolcore/menu-client.md +27 -11
- package/kits/{schemas → docs/evolcore}/menu-exec-schema-commands.md +12 -6
- package/kits/docs/evolcore/menu-protocol.md +213 -0
- package/kits/docs/evolcore/msg.md +2 -0
- package/kits/docs/evolcore/trigger.md +7 -5
- package/kits/docs/path-registry.md +6 -8
- package/kits/docs/prompt-loading-architecture.md +5 -3
- package/kits/docs/venues/group.md +5 -4
- package/kits/eck_manifest.json +294 -88
- package/kits/eck_manifest.memory.json +257 -0
- package/kits/rules/03-identity.md +8 -8
- package/kits/rules/05-venue.md +4 -2
- package/kits/rules/06-channel.md +1 -1
- package/kits/schemas/_meta.json +276 -47
- package/kits/schemas/agent-config.schema.12.json +38 -2
- package/kits/schemas/agent-config.schema.13.json +591 -0
- package/kits/schemas/daemon.schema.6.json +9 -9
- package/kits/schemas/defaults.schema.5.json +29 -0
- package/kits/schemas/relation-config.schema.8.json +14 -1
- package/kits/schemas/relation-config.schema.9.json +129 -0
- package/kits/schemas/role-config.schema.1.json +3 -3
- package/kits/skills/.switches.json +3 -0
- package/kits/skills/ec-skill/SKILL.md +217 -0
- package/kits/skills/ec-skill/scripts/cli.mjs +128 -0
- package/kits/skills/ec-skill/scripts/deps.mjs +107 -0
- package/kits/skills/ec-skill/scripts/frontmatter.mjs +104 -0
- package/kits/skills/ec-skill/scripts/skill.mjs +629 -0
- package/kits/skills/ec-skill/scripts/template/SKILL.md.tmpl +30 -0
- package/kits/templates/decision/auto-mention.md +25 -0
- package/kits/templates/decision/session-renew.md +22 -0
- package/kits/templates/memory-consolidation/forget.md +104 -0
- package/kits/templates/memory-consolidation/generalize.md +76 -0
- package/kits/templates/memory-consolidation/notes.md +133 -0
- package/kits/templates/memory-consolidation/profile.md +58 -0
- package/kits/templates/memory-consolidation/promote.md +72 -0
- package/kits/templates/memory-consolidation/workflow.md +75 -0
- package/kits/templates/system-fragments/bootstrap.md +14 -5
- package/kits/templates/system-fragments/commands.md +1 -0
- package/kits/templates/system-fragments/group-history.md +6 -0
- package/kits/templates/system-fragments/identity.md +0 -3
- package/kits/templates/system-fragments/memory.md +79 -0
- package/kits/templates/system-fragments/reply.md +1 -0
- package/kits/templates/system-fragments/venue.md +1 -1
- package/package.json +4 -6
- package/dist/trigger/legacy-session-history.js +0 -19
- package/kits/templates/system-fragments/group-unread-history.md +0 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { resolveCommandPath } from '../../utils/cross-platform.js';
|
|
4
|
-
import { getExistingHClassMaskTargets, getExistingLClassReadOnlyTargets, isSameOrDescendant, } from './protected-paths.js';
|
|
5
|
-
import { resolveRoot } from '../../paths.js';
|
|
4
|
+
import { getExistingHClassMaskTargets, getExistingRelationAttachmentDirs, getExistingLClassReadOnlyTargets, isSameOrDescendant, } from './protected-paths.js';
|
|
5
|
+
import { resolveInstanceSocketPath, resolveRoot } from '../../paths.js';
|
|
6
6
|
let cachedBubblewrapPath;
|
|
7
7
|
let sandboxInitializationCircuit;
|
|
8
8
|
const sessionSandboxInitializationCircuits = new Map();
|
|
@@ -387,7 +387,7 @@ function snapshotSandboxPath(candidate) {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
/** Capture the host-side state used to construct an H-class guard. */
|
|
390
|
-
export function collectSandboxGuardDiagnostics(root = resolveRoot()) {
|
|
390
|
+
export function collectSandboxGuardDiagnostics(root = resolveRoot(), options = {}) {
|
|
391
391
|
const absoluteRoot = path.resolve(root);
|
|
392
392
|
const candidates = [
|
|
393
393
|
path.join(absoluteRoot, 'data', 'causation-aun.json'),
|
|
@@ -396,7 +396,7 @@ export function collectSandboxGuardDiagnostics(root = resolveRoot()) {
|
|
|
396
396
|
];
|
|
397
397
|
let targets = [];
|
|
398
398
|
try {
|
|
399
|
-
targets = getExistingHClassMaskTargets(absoluteRoot).map(target => target.path);
|
|
399
|
+
targets = getExistingHClassMaskTargets(absoluteRoot, options).map(target => target.path);
|
|
400
400
|
}
|
|
401
401
|
catch { }
|
|
402
402
|
// Keep the causation file and its atomic-write sidecars first. The full H
|
|
@@ -512,13 +512,19 @@ function appendContainerEtcFileBinds(args) {
|
|
|
512
512
|
args.push('--ro-bind', candidate, candidate);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function appendHClassMasks(args, root, maskContainerSockets) {
|
|
516
|
-
for (const target of getExistingHClassMaskTargets(root)) {
|
|
515
|
+
function appendHClassMasks(args, root, maskContainerSockets, options = {}) {
|
|
516
|
+
for (const target of getExistingHClassMaskTargets(root, options)) {
|
|
517
517
|
if (target.kind === 'directory')
|
|
518
518
|
pushMaskedDirectory(args, target.path);
|
|
519
519
|
else
|
|
520
520
|
pushMaskedFile(args, target.path);
|
|
521
521
|
}
|
|
522
|
+
// Relation attachments are protected by per-thread Codex ACLs. Do not mask
|
|
523
|
+
// their directories at the outer bind layer, otherwise an exact authorized
|
|
524
|
+
// image read cannot be re-exposed by the inner profile.
|
|
525
|
+
for (const directory of getExistingRelationAttachmentDirs(root, options)) {
|
|
526
|
+
args.push('--ro-bind', directory, directory);
|
|
527
|
+
}
|
|
522
528
|
if (!maskContainerSockets)
|
|
523
529
|
return;
|
|
524
530
|
// bubblewrap cannot replace an existing Unix socket with a regular-file bind
|
|
@@ -527,8 +533,28 @@ function appendHClassMasks(args, root, maskContainerSockets) {
|
|
|
527
533
|
pushMaskedDirectory(args, '/run');
|
|
528
534
|
appendRuntimeBackedEtcFiles(args);
|
|
529
535
|
}
|
|
530
|
-
|
|
531
|
-
|
|
536
|
+
/** Re-expose only the daemon IPC endpoint after masking the runtime data tree. */
|
|
537
|
+
function appendDaemonIpcSocket(args, root) {
|
|
538
|
+
if (process.platform !== 'linux')
|
|
539
|
+
return;
|
|
540
|
+
const socketPath = resolveInstanceSocketPath(root);
|
|
541
|
+
let stat;
|
|
542
|
+
try {
|
|
543
|
+
stat = fs.lstatSync(socketPath);
|
|
544
|
+
}
|
|
545
|
+
catch {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (!stat.isSocket())
|
|
549
|
+
return;
|
|
550
|
+
const dataDir = path.join(root, 'data');
|
|
551
|
+
if (isSameOrDescendant(socketPath, dataDir)) {
|
|
552
|
+
args.push('--dir', path.dirname(socketPath));
|
|
553
|
+
}
|
|
554
|
+
args.push('--ro-bind', socketPath, socketPath);
|
|
555
|
+
}
|
|
556
|
+
function appendLClassReadOnlyBinds(args, root, options = {}) {
|
|
557
|
+
for (const target of getExistingLClassReadOnlyTargets(root, options)) {
|
|
532
558
|
args.push('--ro-bind', target.path, target.path);
|
|
533
559
|
}
|
|
534
560
|
}
|
|
@@ -587,8 +613,9 @@ export function buildHClassGuardCommand(executable, executableArgs, root = resol
|
|
|
587
613
|
'--proc', '/proc',
|
|
588
614
|
];
|
|
589
615
|
if (options.protectEvolcoreFilesystem !== false) {
|
|
590
|
-
appendLClassReadOnlyBinds(args, path.resolve(root));
|
|
591
|
-
appendHClassMasks(args, path.resolve(root), true);
|
|
616
|
+
appendLClassReadOnlyBinds(args, path.resolve(root), options);
|
|
617
|
+
appendHClassMasks(args, path.resolve(root), true, options);
|
|
618
|
+
appendDaemonIpcSocket(args, path.resolve(root));
|
|
592
619
|
}
|
|
593
620
|
if (options.managedCodexRequirements) {
|
|
594
621
|
const requirements = path.resolve(options.managedCodexRequirements);
|
|
@@ -644,8 +671,9 @@ export function buildBubblewrapCommand(executable, executableArgs, options) {
|
|
|
644
671
|
continue;
|
|
645
672
|
args.push('--ro-bind', resolved, resolved);
|
|
646
673
|
}
|
|
647
|
-
appendLClassReadOnlyBinds(args, root);
|
|
648
|
-
appendHClassMasks(args, root, true);
|
|
674
|
+
appendLClassReadOnlyBinds(args, root, options);
|
|
675
|
+
appendHClassMasks(args, root, true, options);
|
|
676
|
+
appendDaemonIpcSocket(args, root);
|
|
649
677
|
args.push('--chdir', projectPath, '--', executable, ...executableArgs);
|
|
650
678
|
return { command: bubblewrapPath, args };
|
|
651
679
|
}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
const PERMISSION_ERROR_CODES = new Set([
|
|
2
|
+
'POLICY_DENIED',
|
|
3
|
+
'ROLE_DENIED',
|
|
4
|
+
'USER_DENIED',
|
|
5
|
+
'APPROVAL_TIMEOUT',
|
|
6
|
+
'DELEGATION_FAILED',
|
|
7
|
+
]);
|
|
8
|
+
const DETAIL_CODE_BY_POLICY_CODE = {
|
|
9
|
+
native_file_change_required: 'NATIVE_FILE_CHANGE_REQUIRED',
|
|
10
|
+
apply_patch_unparseable: 'APPLY_PATCH_UNPARSEABLE',
|
|
11
|
+
apply_patch_workspace_escape: 'APPLY_PATCH_WORKSPACE_ESCAPE',
|
|
12
|
+
ec_shell_invalid_quote: 'INVALID_QUOTE',
|
|
13
|
+
ec_command_not_canonical: 'INVALID_ARGUMENT',
|
|
14
|
+
patch_context_mismatch: 'PATCH_CONTEXT_MISMATCH',
|
|
15
|
+
};
|
|
1
16
|
export function normalizeToolErrorCode(value) {
|
|
2
17
|
if (typeof value !== 'string')
|
|
3
18
|
return undefined;
|
|
@@ -10,27 +25,95 @@ export function normalizeToolErrorCode(value) {
|
|
|
10
25
|
return code;
|
|
11
26
|
return undefined;
|
|
12
27
|
}
|
|
13
|
-
export function
|
|
14
|
-
|
|
28
|
+
export function normalizeToolErrorDetailCode(value) {
|
|
29
|
+
if (typeof value !== 'string')
|
|
30
|
+
return undefined;
|
|
31
|
+
const code = value.trim().toUpperCase().replace(/[ .-]+/g, '_');
|
|
32
|
+
return /^[A-Z][A-Z0-9_]{1,127}$/u.test(code) ? code : undefined;
|
|
33
|
+
}
|
|
34
|
+
function executionFacts(input) {
|
|
35
|
+
const executed = typeof input.executed === 'boolean' ? input.executed : undefined;
|
|
36
|
+
const executionState = typeof input.executionState === 'string'
|
|
37
|
+
? input.executionState.trim().toLowerCase()
|
|
38
|
+
: undefined;
|
|
39
|
+
const exitCode = typeof input.exitCode === 'number' && Number.isInteger(input.exitCode)
|
|
40
|
+
? input.exitCode
|
|
41
|
+
: undefined;
|
|
42
|
+
const started = executed === true || executionState === 'completed' || executionState === 'failed' || exitCode !== undefined;
|
|
43
|
+
const blocked = executed === false && executionState === 'blocked';
|
|
44
|
+
const conflict = (executed === true && executionState === 'blocked')
|
|
45
|
+
|| (executed === false && (executionState === 'completed' || executionState === 'failed'))
|
|
46
|
+
|| (exitCode !== undefined && executed === false);
|
|
47
|
+
return { executed, executionState, exitCode, started, blocked, conflict };
|
|
48
|
+
}
|
|
49
|
+
function detailCodeForInput(input) {
|
|
50
|
+
const explicit = normalizeToolErrorDetailCode(input.errorDetailCode ?? input.detailCode);
|
|
15
51
|
if (explicit)
|
|
16
52
|
return explicit;
|
|
17
|
-
if (input.
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
53
|
+
if (typeof input.policyCode === 'string') {
|
|
54
|
+
return DETAIL_CODE_BY_POLICY_CODE[input.policyCode.trim().toLowerCase()];
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Normalize one tool failure from structured execution facts.
|
|
60
|
+
*
|
|
61
|
+
* Permission errors are emitted only when the operation is explicitly known
|
|
62
|
+
* to have been blocked before execution. Plain `decisionSource=policy` is not
|
|
63
|
+
* enough: providers frequently reuse that field while reporting a process
|
|
64
|
+
* that already started and then failed.
|
|
65
|
+
*/
|
|
66
|
+
export function normalizeToolErrorClassification(input) {
|
|
67
|
+
const explicit = normalizeToolErrorCode(input.errorCode);
|
|
68
|
+
const hadErrorCode = input.errorCode !== undefined && input.errorCode !== null;
|
|
69
|
+
const facts = executionFacts(input);
|
|
70
|
+
const decisionSource = typeof input.decisionSource === 'string'
|
|
71
|
+
? input.decisionSource.trim().toLowerCase()
|
|
72
|
+
: undefined;
|
|
73
|
+
const explicitPermission = explicit !== undefined && PERMISSION_ERROR_CODES.has(explicit);
|
|
74
|
+
const hasPermissionSource = decisionSource === 'policy' || decisionSource === 'approval';
|
|
75
|
+
const exactPermissionBlock = facts.blocked && (hasPermissionSource || explicitPermission);
|
|
76
|
+
let classificationConflict = facts.conflict;
|
|
77
|
+
if (hasPermissionSource && facts.started)
|
|
78
|
+
classificationConflict = true;
|
|
79
|
+
if (explicitPermission && facts.started)
|
|
80
|
+
classificationConflict = true;
|
|
81
|
+
let errorCode;
|
|
82
|
+
if (explicitPermission) {
|
|
83
|
+
errorCode = exactPermissionBlock && !facts.started
|
|
84
|
+
? explicit
|
|
85
|
+
: 'EXECUTION_FAILED';
|
|
86
|
+
}
|
|
87
|
+
else if (explicit) {
|
|
88
|
+
errorCode = explicit;
|
|
89
|
+
}
|
|
90
|
+
else if (exactPermissionBlock) {
|
|
91
|
+
errorCode = decisionSource === 'approval' ? 'USER_DENIED' : 'POLICY_DENIED';
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
errorCode = 'EXECUTION_FAILED';
|
|
95
|
+
}
|
|
96
|
+
const classificationMissing = (!explicit && !exactPermissionBlock)
|
|
97
|
+
|| (hadErrorCode && !explicit);
|
|
98
|
+
const errorDetailCode = detailCodeForInput(input)
|
|
99
|
+
?? (facts.exitCode !== undefined && facts.exitCode !== 0 ? 'PROCESS_EXIT_NONZERO' : undefined);
|
|
100
|
+
return {
|
|
101
|
+
errorCode,
|
|
102
|
+
...(errorDetailCode ? { errorDetailCode } : {}),
|
|
103
|
+
...(classificationMissing ? { classificationMissing: true } : {}),
|
|
104
|
+
...(classificationConflict ? { classificationConflict: true } : {}),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export function classifyToolErrorCode(input) {
|
|
108
|
+
return normalizeToolErrorClassification(input).errorCode;
|
|
22
109
|
}
|
|
23
110
|
/**
|
|
24
111
|
* Map the internal error taxonomy to the intentionally small AUN activity
|
|
25
112
|
* contract. The detailed code remains available to local audit consumers.
|
|
26
113
|
*/
|
|
27
114
|
export function classifyAunToolErrorCode(input) {
|
|
28
|
-
const code =
|
|
29
|
-
if (code
|
|
30
|
-
|| code === 'ROLE_DENIED'
|
|
31
|
-
|| code === 'USER_DENIED'
|
|
32
|
-
|| code === 'APPROVAL_TIMEOUT'
|
|
33
|
-
|| code === 'DELEGATION_FAILED') {
|
|
115
|
+
const code = normalizeToolErrorClassification(input).errorCode;
|
|
116
|
+
if (PERMISSION_ERROR_CODES.has(code)) {
|
|
34
117
|
return 'PERMISSION_DENIED';
|
|
35
118
|
}
|
|
36
119
|
return 'EXECUTION_FAILED';
|