dialectic 0.3.0 → 0.4.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/README.md +8 -1
- package/dist/agents/role-based-agent.d.ts +4 -4
- package/dist/agents/role-based-agent.d.ts.map +1 -1
- package/dist/agents/role-based-agent.js +9 -9
- package/dist/agents/role-based-agent.js.map +1 -1
- package/dist/cli/commands/debate.d.ts.map +1 -1
- package/dist/cli/commands/debate.js +82 -15
- package/dist/cli/commands/debate.js.map +1 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +4 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/core/agent.d.ts +11 -9
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +34 -15
- package/dist/core/agent.js.map +1 -1
- package/dist/core/judge.d.ts +7 -2
- package/dist/core/judge.d.ts.map +1 -1
- package/dist/core/judge.js +214 -5
- package/dist/core/judge.js.map +1 -1
- package/dist/core/orchestrator.d.ts +4 -2
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +20 -18
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/state-manager.d.ts +1 -2
- package/dist/core/state-manager.d.ts.map +1 -1
- package/dist/core/state-manager.js +3 -14
- package/dist/core/state-manager.js.map +1 -1
- package/dist/tools/context-search-tool.d.ts +2 -2
- package/dist/tools/context-search-tool.d.ts.map +1 -1
- package/dist/tools/context-search-tool.js +4 -3
- package/dist/tools/context-search-tool.js.map +1 -1
- package/dist/tools/tool-implementation.d.ts +2 -2
- package/dist/tools/tool-implementation.d.ts.map +1 -1
- package/dist/tools/tool-implementation.js.map +1 -1
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/tools/tool-registry.js +1 -5
- package/dist/tools/tool-registry.js.map +1 -1
- package/dist/types/agent.types.d.ts +5 -2
- package/dist/types/agent.types.d.ts.map +1 -1
- package/dist/types/debate.types.d.ts +3 -0
- package/dist/types/debate.types.d.ts.map +1 -1
- package/dist/types/debate.types.js.map +1 -1
- package/dist/types/tracing.types.d.ts +30 -0
- package/dist/types/tracing.types.d.ts.map +1 -0
- package/dist/types/tracing.types.js +10 -0
- package/dist/types/tracing.types.js.map +1 -0
- package/dist/utils/common.d.ts +1 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +11 -2
- package/dist/utils/common.js.map +1 -1
- package/dist/utils/console.d.ts +13 -0
- package/dist/utils/console.d.ts.map +1 -1
- package/dist/utils/console.js +47 -0
- package/dist/utils/console.js.map +1 -1
- package/dist/utils/id.d.ts +1 -0
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +10 -0
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +6 -16
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/progress-ui.d.ts +1 -11
- package/dist/utils/progress-ui.d.ts.map +1 -1
- package/dist/utils/progress-ui.js +25 -49
- package/dist/utils/progress-ui.js.map +1 -1
- package/dist/utils/tool-registry-builder.d.ts +1 -2
- package/dist/utils/tool-registry-builder.d.ts.map +1 -1
- package/dist/utils/tool-registry-builder.js +39 -4
- package/dist/utils/tool-registry-builder.js.map +1 -1
- package/dist/utils/tracing-decorator-agent.d.ts +25 -0
- package/dist/utils/tracing-decorator-agent.d.ts.map +1 -0
- package/dist/utils/tracing-decorator-agent.js +185 -0
- package/dist/utils/tracing-decorator-agent.js.map +1 -0
- package/dist/utils/tracing-factory.d.ts +9 -0
- package/dist/utils/tracing-factory.d.ts.map +1 -0
- package/dist/utils/tracing-factory.js +68 -0
- package/dist/utils/tracing-factory.js.map +1 -0
- package/dist/utils/tracing-provider.d.ts +13 -0
- package/dist/utils/tracing-provider.d.ts.map +1 -0
- package/dist/utils/tracing-provider.js +74 -0
- package/dist/utils/tracing-provider.js.map +1 -0
- package/dist/utils/tracing-utils.d.ts +10 -0
- package/dist/utils/tracing-utils.d.ts.map +1 -0
- package/dist/utils/tracing-utils.js +55 -0
- package/dist/utils/tracing-utils.js.map +1 -0
- package/package.json +2 -1
- package/dist/agents/architect-agent.d.ts +0 -15
- package/dist/agents/architect-agent.d.ts.map +0 -1
- package/dist/agents/architect-agent.js +0 -41
- package/dist/agents/architect-agent.js.map +0 -1
- package/dist/agents/performance-agent.d.ts +0 -15
- package/dist/agents/performance-agent.d.ts.map +0 -1
- package/dist/agents/performance-agent.js +0 -41
- package/dist/agents/performance-agent.js.map +0 -1
- package/dist/agents/security-agent.d.ts +0 -15
- package/dist/agents/security-agent.d.ts.map +0 -1
- package/dist/agents/security-agent.js +0 -41
- package/dist/agents/security-agent.js.map +0 -1
- package/dist/utils/stderr.d.ts +0 -2
- package/dist/utils/stderr.d.ts.map +0 -1
- package/dist/utils/stderr.js +0 -7
- package/dist/utils/stderr.js.map +0 -1
package/dist/utils/logger.js
CHANGED
|
@@ -1,37 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Logger = void 0;
|
|
4
|
-
const
|
|
5
|
-
let chalk;
|
|
6
|
-
try {
|
|
7
|
-
chalk = require('chalk');
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
chalk = null;
|
|
11
|
-
}
|
|
12
|
-
function color(method, message) {
|
|
13
|
-
return chalk && chalk[method] ? chalk[method](message) : message;
|
|
14
|
-
}
|
|
4
|
+
const console_1 = require("./console");
|
|
15
5
|
class Logger {
|
|
16
6
|
verbose;
|
|
17
7
|
constructor(verbose = false) {
|
|
18
8
|
this.verbose = verbose;
|
|
19
9
|
}
|
|
20
10
|
info(message) {
|
|
21
|
-
|
|
11
|
+
(0, console_1.logInfo)(message);
|
|
22
12
|
}
|
|
23
13
|
success(message) {
|
|
24
|
-
|
|
14
|
+
(0, console_1.logSuccess)(message);
|
|
25
15
|
}
|
|
26
16
|
warn(message) {
|
|
27
|
-
|
|
17
|
+
(0, console_1.logWarning)(message);
|
|
28
18
|
}
|
|
29
19
|
error(message) {
|
|
30
|
-
|
|
20
|
+
(0, console_1.logWarning)(message);
|
|
31
21
|
}
|
|
32
22
|
debug(message) {
|
|
33
23
|
if (this.verbose) {
|
|
34
|
-
|
|
24
|
+
(0, console_1.logInfo)(message);
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
27
|
agentAction(agentName, action) {
|
package/dist/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;AAAA,uCAA4D;AAE5D,MAAa,MAAM;IACG;IAApB,YAAoB,UAAmB,KAAK;QAAxB,YAAO,GAAP,OAAO,CAAiB;IAAG,CAAC;IAEhD,IAAI,CAAC,OAAe;QAClB,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,WAAW,CAAC,SAAiB,EAAE,MAAc;QAC3C,OAAO,CAAC,GAAG,CAAC,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,SAAS;QACP,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;CACF;AAhCD,wBAgCC"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { ContributionType } from '../types/debate.types';
|
|
2
|
-
|
|
3
|
-
INFO = "info",
|
|
4
|
-
SUCCESS = "success",
|
|
5
|
-
WARNING = "warning"
|
|
6
|
-
}
|
|
7
|
-
export declare const MESSAGE_ICONS: {
|
|
8
|
-
readonly INFO: "ℹ";
|
|
9
|
-
readonly SUCCESS: "✓";
|
|
10
|
-
readonly WARNING: "⚠";
|
|
11
|
-
};
|
|
2
|
+
import { MessageType } from './console';
|
|
12
3
|
export declare class DebateProgressUI {
|
|
13
4
|
private state;
|
|
14
5
|
private totalRounds;
|
|
@@ -26,7 +17,6 @@ export declare class DebateProgressUI {
|
|
|
26
17
|
complete(): Promise<void>;
|
|
27
18
|
handleError(error: Error): void;
|
|
28
19
|
private formatMessageWithRound;
|
|
29
|
-
private formatMessage;
|
|
30
20
|
private appendMessage;
|
|
31
21
|
}
|
|
32
22
|
//# sourceMappingURL=progress-ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-ui.d.ts","sourceRoot":"","sources":["../../src/utils/progress-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"progress-ui.d.ts","sourceRoot":"","sources":["../../src/utils/progress-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAmC,MAAM,WAAW,CAAC;AAuCzE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,WAAW,CAAa;;IAgBhC,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAQ/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAU5B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,WAA8B,GAAG,IAAI;IAUhE,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAYrC,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,GAAG,IAAI;IAgBrE,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAe7D,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAuChE,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAW5C,cAAc,IAAI,IAAI;IAStB,iBAAiB,IAAI,IAAI;IASnB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAS/B,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAc/B,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -1,40 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DebateProgressUI =
|
|
3
|
+
exports.DebateProgressUI = void 0;
|
|
4
4
|
const debate_types_1 = require("../types/debate.types");
|
|
5
5
|
const console_1 = require("./console");
|
|
6
|
-
let chalk;
|
|
7
|
-
try {
|
|
8
|
-
chalk = require('chalk');
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
chalk = new Proxy({}, {
|
|
12
|
-
get: () => (text) => text
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
var MessageType;
|
|
16
|
-
(function (MessageType) {
|
|
17
|
-
MessageType["INFO"] = "info";
|
|
18
|
-
MessageType["SUCCESS"] = "success";
|
|
19
|
-
MessageType["WARNING"] = "warning";
|
|
20
|
-
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
21
|
-
exports.MESSAGE_ICONS = {
|
|
22
|
-
INFO: 'ℹ',
|
|
23
|
-
SUCCESS: '✓',
|
|
24
|
-
WARNING: '⚠'
|
|
25
|
-
};
|
|
26
|
-
const MESSAGE_FORMATS = {
|
|
27
|
-
[MessageType.INFO]: { icon: exports.MESSAGE_ICONS.INFO, color: chalk.blueBright },
|
|
28
|
-
[MessageType.SUCCESS]: { icon: exports.MESSAGE_ICONS.SUCCESS, color: chalk.greenBright },
|
|
29
|
-
[MessageType.WARNING]: { icon: exports.MESSAGE_ICONS.WARNING, color: chalk.yellowBright }
|
|
30
|
-
};
|
|
31
6
|
const PHASE_LABELS = {
|
|
32
7
|
[debate_types_1.CONTRIBUTION_TYPES.PROPOSAL]: 'Proposals',
|
|
33
8
|
[debate_types_1.CONTRIBUTION_TYPES.CRITIQUE]: 'Critiques',
|
|
34
9
|
[debate_types_1.CONTRIBUTION_TYPES.REFINEMENT]: 'Refinements',
|
|
35
10
|
};
|
|
36
11
|
const SYNTHESIS_LABEL = 'Synthesis';
|
|
37
|
-
const ICON_SPACING = ' ';
|
|
38
12
|
class DebateProgressUI {
|
|
39
13
|
state;
|
|
40
14
|
totalRounds = 0;
|
|
@@ -51,14 +25,14 @@ class DebateProgressUI {
|
|
|
51
25
|
}
|
|
52
26
|
async start() {
|
|
53
27
|
}
|
|
54
|
-
log(message, type = MessageType.INFO) {
|
|
28
|
+
log(message, type = console_1.MessageType.INFO) {
|
|
55
29
|
const formattedMessage = this.formatMessageWithRound(message, type);
|
|
56
30
|
this.appendMessage(formattedMessage, type);
|
|
57
31
|
}
|
|
58
32
|
startRound(roundNumber) {
|
|
59
33
|
this.state.currentRound = roundNumber;
|
|
60
34
|
this.state.currentPhase = '';
|
|
61
|
-
this.appendMessage(`Round ${roundNumber}/${this.totalRounds} starting`, MessageType.INFO);
|
|
35
|
+
this.appendMessage(`Round ${roundNumber}/${this.totalRounds} starting`, console_1.MessageType.INFO);
|
|
62
36
|
}
|
|
63
37
|
startPhase(phase, expectedAgentCount) {
|
|
64
38
|
const phaseLabel = PHASE_LABELS[phase];
|
|
@@ -66,15 +40,15 @@ class DebateProgressUI {
|
|
|
66
40
|
const phaseKey = `${this.state.currentRound}-${phase}`;
|
|
67
41
|
this.state.phaseProgress.set(phaseKey, { current: 0, total: expectedAgentCount });
|
|
68
42
|
this.state.agentActivity.clear();
|
|
69
|
-
const message = this.formatMessageWithRound(`${phaseLabel} phase starting`, MessageType.INFO);
|
|
70
|
-
this.appendMessage(message, MessageType.INFO);
|
|
43
|
+
const message = this.formatMessageWithRound(`${phaseLabel} phase starting`, console_1.MessageType.INFO);
|
|
44
|
+
this.appendMessage(message, console_1.MessageType.INFO);
|
|
71
45
|
}
|
|
72
46
|
startAgentActivity(agentName, activity) {
|
|
73
47
|
const activities = this.state.agentActivity.get(agentName) ?? [];
|
|
74
48
|
activities.push(activity);
|
|
75
49
|
this.state.agentActivity.set(agentName, activities);
|
|
76
|
-
const message = this.formatMessageWithRound(`${agentName} is ${activity}...`, MessageType.INFO);
|
|
77
|
-
this.appendMessage(message, MessageType.INFO);
|
|
50
|
+
const message = this.formatMessageWithRound(`${agentName} is ${activity}...`, console_1.MessageType.INFO);
|
|
51
|
+
this.appendMessage(message, console_1.MessageType.INFO);
|
|
78
52
|
}
|
|
79
53
|
completeAgentActivity(agentName, activity) {
|
|
80
54
|
const activities = this.state.agentActivity.get(agentName);
|
|
@@ -100,30 +74,30 @@ class DebateProgressUI {
|
|
|
100
74
|
this.state.phaseProgress.set(phaseKey, progress);
|
|
101
75
|
}
|
|
102
76
|
}
|
|
103
|
-
const message = this.formatMessageWithRound(`${agentName} completed ${activity}`, MessageType.SUCCESS);
|
|
104
|
-
this.appendMessage(message, MessageType.SUCCESS);
|
|
77
|
+
const message = this.formatMessageWithRound(`${agentName} completed ${activity}`, console_1.MessageType.SUCCESS);
|
|
78
|
+
this.appendMessage(message, console_1.MessageType.SUCCESS);
|
|
105
79
|
}
|
|
106
80
|
completePhase(phase) {
|
|
107
81
|
const phaseLabel = PHASE_LABELS[phase];
|
|
108
82
|
this.state.currentPhase = '';
|
|
109
83
|
this.state.agentActivity.clear();
|
|
110
|
-
const message = this.formatMessageWithRound(`${phaseLabel} phase completed`, MessageType.SUCCESS);
|
|
111
|
-
this.appendMessage(message, MessageType.SUCCESS);
|
|
84
|
+
const message = this.formatMessageWithRound(`${phaseLabel} phase completed`, console_1.MessageType.SUCCESS);
|
|
85
|
+
this.appendMessage(message, console_1.MessageType.SUCCESS);
|
|
112
86
|
}
|
|
113
87
|
startSynthesis() {
|
|
114
88
|
this.state.currentPhase = SYNTHESIS_LABEL;
|
|
115
89
|
this.state.agentActivity.clear();
|
|
116
|
-
this.appendMessage('Synthesis starting', MessageType.INFO);
|
|
90
|
+
this.appendMessage('Synthesis starting', console_1.MessageType.INFO);
|
|
117
91
|
}
|
|
118
92
|
completeSynthesis() {
|
|
119
93
|
this.state.currentPhase = '';
|
|
120
|
-
this.appendMessage('Synthesis completed', MessageType.SUCCESS);
|
|
94
|
+
this.appendMessage('Synthesis completed', console_1.MessageType.SUCCESS);
|
|
121
95
|
}
|
|
122
96
|
async complete() {
|
|
123
|
-
this.appendMessage('Debate completed', MessageType.SUCCESS);
|
|
97
|
+
this.appendMessage('Debate completed', console_1.MessageType.SUCCESS);
|
|
124
98
|
}
|
|
125
99
|
handleError(error) {
|
|
126
|
-
this.appendMessage(`Error: ${error.message}`, MessageType.WARNING);
|
|
100
|
+
this.appendMessage(`Error: ${error.message}`, console_1.MessageType.WARNING);
|
|
127
101
|
}
|
|
128
102
|
formatMessageWithRound(message, _type) {
|
|
129
103
|
if (this.state.currentRound > 0) {
|
|
@@ -131,14 +105,16 @@ class DebateProgressUI {
|
|
|
131
105
|
}
|
|
132
106
|
return message;
|
|
133
107
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
(
|
|
108
|
+
appendMessage(message, type = console_1.MessageType.INFO) {
|
|
109
|
+
if (type === console_1.MessageType.INFO) {
|
|
110
|
+
(0, console_1.logInfo)(message);
|
|
111
|
+
}
|
|
112
|
+
else if (type === console_1.MessageType.SUCCESS) {
|
|
113
|
+
(0, console_1.logSuccess)(message);
|
|
114
|
+
}
|
|
115
|
+
else if (type === console_1.MessageType.WARNING) {
|
|
116
|
+
(0, console_1.logWarning)(message);
|
|
117
|
+
}
|
|
142
118
|
}
|
|
143
119
|
}
|
|
144
120
|
exports.DebateProgressUI = DebateProgressUI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-ui.js","sourceRoot":"","sources":["../../src/utils/progress-ui.ts"],"names":[],"mappings":";;;AAAA,wDAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"progress-ui.js","sourceRoot":"","sources":["../../src/utils/progress-ui.ts"],"names":[],"mappings":";;;AAAA,wDAA6E;AAC7E,uCAAyE;AAGzE,MAAM,YAAY,GAAG;IACnB,CAAC,iCAAkB,CAAC,QAAQ,CAAC,EAAE,WAAW;IAC1C,CAAC,iCAAkB,CAAC,QAAQ,CAAC,EAAE,WAAW;IAC1C,CAAC,iCAAkB,CAAC,UAAU,CAAC,EAAE,aAAa;CACtC,CAAC;AAEX,MAAM,eAAe,GAAG,WAAW,CAAC;AA8BpC,MAAa,gBAAgB;IACnB,KAAK,CAAgB;IACrB,WAAW,GAAW,CAAC,CAAC;IAEhC;QACE,IAAI,CAAC,KAAK,GAAG;YACX,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,EAAE;YAChB,aAAa,EAAE,IAAI,GAAG,EAAoB;YAC1C,aAAa,EAAE,IAAI,GAAG,EAAE;SACzB,CAAC;IACJ,CAAC;IAOD,UAAU,CAAC,WAAmB;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAMD,KAAK,CAAC,KAAK;IAEX,CAAC;IAQD,GAAG,CAAC,OAAe,EAAE,OAAoB,qBAAW,CAAC,IAAI;QACvD,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACpE,IAA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AC,QAAQ;QACZ,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,qBAAW,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAOD,WAAW,CAAC,KAAY;QACtB,IAAI,CAAC,aAAa,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,EAAE,qBAAW,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IAYO,sBAAsB,CAAC,OAAe,EAAE,KAAkB;QAIhE,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,UAAU,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,OAAO,EAAE,CAAC;QACzD,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAQO,aAAa,CAAC,OAAe,EAAE,OAAoB,qBAAW,CAAC,IAAI;QACzE,IAAI,IAAI,KAAK,qBAAW,CAAC,IAAI,EAAE,CAAC;YAC9B,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;QACnB,CAAC;aAAM,IAAI,IAAI,KAAK,qBAAW,CAAC,OAAO,EAAE,CAAC;YACxC,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;QACtB,CAAC;aAAM,IAAI,IAAI,KAAK,qBAAW,CAAC,OAAO,EAAE,CAAC;YACxC,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;CACF;AA7MD,4CA6MC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AgentConfig } from '../types/agent.types';
|
|
2
2
|
import { ToolRegistry } from '../tools/tool-registry';
|
|
3
|
-
|
|
4
|
-
export declare function buildToolRegistry(agentConfig: AgentConfig, baseRegistry: ToolRegistry, _context?: DebateContext): ToolRegistry;
|
|
3
|
+
export declare function buildToolRegistry(agentConfig: AgentConfig): ToolRegistry;
|
|
5
4
|
//# sourceMappingURL=tool-registry-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry-builder.d.ts","sourceRoot":"","sources":["../../src/utils/tool-registry-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-registry-builder.d.ts","sourceRoot":"","sources":["../../src/utils/tool-registry-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAiDtD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,GAAG,YAAY,CAiCxE"}
|
|
@@ -2,11 +2,46 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildToolRegistry = buildToolRegistry;
|
|
4
4
|
const tool_registry_1 = require("../tools/tool-registry");
|
|
5
|
-
|
|
5
|
+
const context_search_tool_1 = require("../tools/context-search-tool");
|
|
6
|
+
const console_1 = require("./console");
|
|
7
|
+
const AVAILABLE_TOOLS = {
|
|
8
|
+
context_search: {
|
|
9
|
+
schema: {
|
|
10
|
+
name: 'context_search',
|
|
11
|
+
description: 'Search for a term in the debate history. Returns relevant contributions containing the search term.',
|
|
12
|
+
parameters: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
term: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'The search term to find in debate history',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ['term'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
createImplementation: () => new context_search_tool_1.ContextSearchTool(),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
function buildToolRegistry(agentConfig) {
|
|
27
|
+
const registry = new tool_registry_1.ToolRegistry();
|
|
6
28
|
if (!agentConfig.tools || agentConfig.tools.length === 0) {
|
|
7
|
-
return
|
|
29
|
+
return registry;
|
|
8
30
|
}
|
|
9
|
-
const
|
|
10
|
-
|
|
31
|
+
for (const toolConfig of agentConfig.tools) {
|
|
32
|
+
const toolName = toolConfig.name;
|
|
33
|
+
if (!toolName || toolName.trim() === '') {
|
|
34
|
+
(0, console_1.logWarning)(`Invalid tool name (empty string) configured for agent "${agentConfig.id}". Skipping.`);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const toolDefinition = AVAILABLE_TOOLS[toolName];
|
|
38
|
+
if (!toolDefinition) {
|
|
39
|
+
(0, console_1.logWarning)(`Unknown tool "${toolName}" configured for agent "${agentConfig.id}". Skipping.`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const toolImplementation = toolDefinition.createImplementation();
|
|
43
|
+
registry.register(toolImplementation);
|
|
44
|
+
}
|
|
45
|
+
return registry;
|
|
11
46
|
}
|
|
12
47
|
//# sourceMappingURL=tool-registry-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry-builder.js","sourceRoot":"","sources":["../../src/utils/tool-registry-builder.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tool-registry-builder.js","sourceRoot":"","sources":["../../src/utils/tool-registry-builder.ts"],"names":[],"mappings":";;AAkDA,8CAiCC;AAlFD,0DAAsD;AAGtD,sEAAiE;AACjE,uCAAuC;AAcvC,MAAM,eAAe,GAAmC;IACtD,cAAc,EAAE;QACd,MAAM,EAAE;YACN,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,qGAAqG;YAClH,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,2CAA2C;qBACzD;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;SACF;QACD,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI,uCAAiB,EAAE;KACpD;CACF,CAAC;AAaF,SAAgB,iBAAiB,CAAC,WAAwB;IACxD,MAAM,QAAQ,GAAG,IAAI,4BAAY,EAAE,CAAC;IAGpC,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAGD,KAAK,MAAM,UAAU,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;QAEjC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACxC,IAAA,oBAAU,EAAC,0DAA0D,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC;YACnG,SAAS;QACX,CAAC;QAED,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;QAEjD,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,IAAA,oBAAU,EAAC,iBAAiB,QAAQ,2BAA2B,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC;YAC7F,SAAS;QACX,CAAC;QAED,MAAM,kBAAkB,GAAG,cAAc,CAAC,oBAAoB,EAAE,CAAC;QAKjE,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Agent, AgentLLMResponse } from '../core/agent';
|
|
2
|
+
import { Proposal, Critique } from '../types/agent.types';
|
|
3
|
+
import { DebateContext, ContextPreparationResult, ClarificationQuestionsResponse, DebateState } from '../types/debate.types';
|
|
4
|
+
import { TracingContext } from '../types/tracing.types';
|
|
5
|
+
import { ToolCall, ToolResult } from '../types/tool.types';
|
|
6
|
+
import { ToolImplementation } from '../tools/tool-implementation';
|
|
7
|
+
export declare class TracingDecoratorAgent extends Agent {
|
|
8
|
+
private readonly wrappedAgent;
|
|
9
|
+
private readonly tracingContext;
|
|
10
|
+
constructor(wrappedAgent: Agent, tracingContext: TracingContext);
|
|
11
|
+
propose(problem: string, context: DebateContext, state?: DebateState): Promise<Proposal>;
|
|
12
|
+
critique(proposal: Proposal, context: DebateContext, state?: DebateState): Promise<Critique>;
|
|
13
|
+
refine(originalProposal: Proposal, critiques: Critique[], context: DebateContext, state?: DebateState): Promise<Proposal>;
|
|
14
|
+
prepareContext(context: DebateContext, roundNumber: number): Promise<ContextPreparationResult>;
|
|
15
|
+
askClarifyingQuestions(problem: string, context: DebateContext): Promise<ClarificationQuestionsResponse>;
|
|
16
|
+
shouldSummarize(context: DebateContext): boolean;
|
|
17
|
+
protected proposeImpl(context: DebateContext, systemPrompt: string, userPrompt: string, state?: DebateState): Promise<Proposal>;
|
|
18
|
+
protected critiqueImpl(context: DebateContext, systemPrompt: string, userPrompt: string, state?: DebateState): Promise<Critique>;
|
|
19
|
+
protected refineImpl(context: DebateContext, systemPrompt: string, userPrompt: string, state?: DebateState): Promise<Proposal>;
|
|
20
|
+
protected callLLM(systemPrompt: string, userPrompt: string, context?: DebateContext, state?: DebateState): Promise<AgentLLMResponse>;
|
|
21
|
+
protected executeTool(tool: ToolImplementation, args: Record<string, unknown>, toolCall: ToolCall, context: DebateContext | undefined, state: DebateState | undefined, toolResultsForThisIteration: ToolResult[], allToolResults: ToolResult[]): void;
|
|
22
|
+
private executeWithSpan;
|
|
23
|
+
private extractRoundNumber;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tracing-decorator-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracing-decorator-agent.d.ts","sourceRoot":"","sources":["../../src/utils/tracing-decorator-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,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EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;cAOtH,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;cAQpH,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAS1I,SAAS,CAAC,WAAW,CACnB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,2BAA2B,EAAE,UAAU,EAAE,EACzC,cAAc,EAAE,UAAU,EAAE,GAC3B,IAAI;YA0EO,eAAe;IA0D7B,OAAO,CAAC,kBAAkB;CAO3B"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TracingDecoratorAgent = void 0;
|
|
4
|
+
const agent_1 = require("../core/agent");
|
|
5
|
+
const tracing_types_1 = require("../types/tracing.types");
|
|
6
|
+
const console_1 = require("./console");
|
|
7
|
+
const tool_types_1 = require("../types/tool.types");
|
|
8
|
+
const tracing_provider_1 = require("./tracing-provider");
|
|
9
|
+
const tracing_utils_1 = require("./tracing-utils");
|
|
10
|
+
const prompts_1 = require("../agents/prompts");
|
|
11
|
+
class TracingDecoratorAgent extends agent_1.Agent {
|
|
12
|
+
wrappedAgent;
|
|
13
|
+
tracingContext;
|
|
14
|
+
constructor(wrappedAgent, tracingContext) {
|
|
15
|
+
const provider = wrappedAgent.provider;
|
|
16
|
+
const toolRegistry = wrappedAgent.toolRegistry;
|
|
17
|
+
const toolCallLimit = wrappedAgent.toolCallLimit;
|
|
18
|
+
const logger = wrappedAgent.logger;
|
|
19
|
+
super(wrappedAgent.config, provider, toolRegistry, toolCallLimit, logger);
|
|
20
|
+
this.wrappedAgent = wrappedAgent;
|
|
21
|
+
this.tracingContext = tracingContext;
|
|
22
|
+
if (provider instanceof tracing_provider_1.TracingLLMProvider) {
|
|
23
|
+
provider.setAgentId(this.config.id);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async propose(problem, context, state) {
|
|
27
|
+
const spanName = `agent-propose-${this.config.id}`;
|
|
28
|
+
return this.executeWithSpan(spanName, context, async () => {
|
|
29
|
+
const wrappedAgentAny = this.wrappedAgent;
|
|
30
|
+
const systemPrompt = wrappedAgentAny.resolvedSystemPrompt;
|
|
31
|
+
const rolePrompts = wrappedAgentAny.rolePrompts || (0, prompts_1.getPromptsForRole)(this.config.role);
|
|
32
|
+
const userPrompt = rolePrompts.proposePrompt(problem, context, this.config.id, context.includeFullHistory);
|
|
33
|
+
return await this.proposeImpl(context, systemPrompt, userPrompt, state);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async critique(proposal, context, state) {
|
|
37
|
+
const spanName = `agent-critique-${this.config.id}`;
|
|
38
|
+
return this.executeWithSpan(spanName, context, async () => {
|
|
39
|
+
const wrappedAgentAny = this.wrappedAgent;
|
|
40
|
+
const systemPrompt = wrappedAgentAny.resolvedSystemPrompt;
|
|
41
|
+
const rolePrompts = wrappedAgentAny.rolePrompts || (0, prompts_1.getPromptsForRole)(this.config.role);
|
|
42
|
+
const userPrompt = rolePrompts.critiquePrompt(proposal.content, context, this.config.id, context.includeFullHistory);
|
|
43
|
+
return await this.critiqueImpl(context, systemPrompt, userPrompt, state);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async refine(originalProposal, critiques, context, state) {
|
|
47
|
+
const spanName = `agent-refine-${this.config.id}`;
|
|
48
|
+
return this.executeWithSpan(spanName, context, async () => {
|
|
49
|
+
const wrappedAgentAny = this.wrappedAgent;
|
|
50
|
+
const systemPrompt = wrappedAgentAny.resolvedSystemPrompt;
|
|
51
|
+
const rolePrompts = wrappedAgentAny.rolePrompts || (0, prompts_1.getPromptsForRole)(this.config.role);
|
|
52
|
+
const critiquesText = critiques.map((c, i) => `Critique ${i + 1}:\n${c.content}`).join('\n\n');
|
|
53
|
+
const userPrompt = rolePrompts.refinePrompt(originalProposal.content, critiquesText, context, this.config.id, context.includeFullHistory);
|
|
54
|
+
return await this.refineImpl(context, systemPrompt, userPrompt, state);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async prepareContext(context, roundNumber) {
|
|
58
|
+
const spanName = `agent-prepareContext-${this.config.id}`;
|
|
59
|
+
return this.executeWithSpan(spanName, context, async () => {
|
|
60
|
+
return await this.wrappedAgent.prepareContext(context, roundNumber);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async askClarifyingQuestions(problem, context) {
|
|
64
|
+
const spanName = `agent-askClarifyingQuestions-${this.config.id}`;
|
|
65
|
+
return this.executeWithSpan(spanName, context, async () => {
|
|
66
|
+
return await this.wrappedAgent.askClarifyingQuestions(problem, context);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
shouldSummarize(context) {
|
|
70
|
+
return this.wrappedAgent.shouldSummarize(context);
|
|
71
|
+
}
|
|
72
|
+
async proposeImpl(context, systemPrompt, userPrompt, state) {
|
|
73
|
+
return super.proposeImpl(context, systemPrompt, userPrompt, state);
|
|
74
|
+
}
|
|
75
|
+
async critiqueImpl(context, systemPrompt, userPrompt, state) {
|
|
76
|
+
return super.critiqueImpl(context, systemPrompt, userPrompt, state);
|
|
77
|
+
}
|
|
78
|
+
async refineImpl(context, systemPrompt, userPrompt, state) {
|
|
79
|
+
return super.refineImpl(context, systemPrompt, userPrompt, state);
|
|
80
|
+
}
|
|
81
|
+
async callLLM(systemPrompt, userPrompt, context, state) {
|
|
82
|
+
return super.callLLM(systemPrompt, userPrompt, context, state);
|
|
83
|
+
}
|
|
84
|
+
executeTool(tool, args, toolCall, context, state, toolResultsForThisIteration, allToolResults) {
|
|
85
|
+
const spanName = `tool-execution-${toolCall.name}`;
|
|
86
|
+
if (!this.tracingContext) {
|
|
87
|
+
super.executeTool(tool, args, toolCall, context, state, toolResultsForThisIteration, allToolResults);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const toolSpan = (0, tracing_utils_1.getSpanParent)(this.tracingContext, this.config.id).span({
|
|
92
|
+
name: spanName,
|
|
93
|
+
input: args,
|
|
94
|
+
metadata: {
|
|
95
|
+
toolName: toolCall.name,
|
|
96
|
+
agentId: this.config.id,
|
|
97
|
+
debateId: context?.tracingContext?.trace?.id || 'unknown',
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
const resultCountBefore = toolResultsForThisIteration.length;
|
|
101
|
+
super.executeTool(tool, args, toolCall, context, state, toolResultsForThisIteration, allToolResults);
|
|
102
|
+
const result = toolResultsForThisIteration[resultCountBefore];
|
|
103
|
+
if (result) {
|
|
104
|
+
try {
|
|
105
|
+
const resultContent = JSON.parse(result.content);
|
|
106
|
+
if (resultContent.status === tool_types_1.TOOL_RESULT_STATUS.ERROR) {
|
|
107
|
+
toolSpan.end({
|
|
108
|
+
level: tracing_types_1.SPAN_LEVEL.ERROR,
|
|
109
|
+
statusMessage: resultContent.error || 'Tool execution failed',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
toolSpan.end({
|
|
114
|
+
output: result.content,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (parseError) {
|
|
119
|
+
toolSpan.end({
|
|
120
|
+
output: result.content,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
toolSpan.end();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (tracingError) {
|
|
129
|
+
(0, console_1.logWarning)(`Langfuse tracing failed for tool execution: ${tracingError.message}`);
|
|
130
|
+
super.executeTool(tool, args, toolCall, context, state, toolResultsForThisIteration, allToolResults);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async executeWithSpan(spanName, context, fn) {
|
|
134
|
+
const provider = this.wrappedAgent.provider;
|
|
135
|
+
if (provider instanceof tracing_provider_1.TracingLLMProvider) {
|
|
136
|
+
provider.resetIterationCount();
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
const span = this.tracingContext.trace.span({
|
|
140
|
+
name: spanName,
|
|
141
|
+
metadata: {
|
|
142
|
+
agentName: this.config.name,
|
|
143
|
+
agentRole: this.config.role,
|
|
144
|
+
agentId: this.config.id,
|
|
145
|
+
debateId: context.tracingContext?.trace?.id || 'unknown',
|
|
146
|
+
roundNumber: this.extractRoundNumber(context),
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
const previousSpan = this.tracingContext.currentSpans.get(this.config.id);
|
|
150
|
+
this.tracingContext.currentSpans.set(this.config.id, span);
|
|
151
|
+
try {
|
|
152
|
+
const result = await fn();
|
|
153
|
+
span.end();
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
span.end({
|
|
158
|
+
level: tracing_types_1.SPAN_LEVEL.ERROR,
|
|
159
|
+
statusMessage: error.message,
|
|
160
|
+
});
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
if (previousSpan !== undefined) {
|
|
165
|
+
this.tracingContext.currentSpans.set(this.config.id, previousSpan);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.tracingContext.currentSpans.delete(this.config.id);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch (tracingError) {
|
|
173
|
+
(0, console_1.logWarning)(`Langfuse tracing failed for ${spanName}: ${tracingError.message}`);
|
|
174
|
+
return await fn();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
extractRoundNumber(context) {
|
|
178
|
+
if (context.history && context.history.length > 0) {
|
|
179
|
+
return context.history[context.history.length - 1]?.roundNumber;
|
|
180
|
+
}
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.TracingDecoratorAgent = TracingDecoratorAgent;
|
|
185
|
+
//# sourceMappingURL=tracing-decorator-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracing-decorator-agent.js","sourceRoot":"","sources":["../../src/utils/tracing-decorator-agent.ts"],"names":[],"mappings":";;;AAAA,yCAAwD;AAGxD,0DAAoE;AACpE,uCAAuC;AACvC,oDAA+E;AAE/E,yDAAwD;AACxD,mDAAgD;AAChD,+CAAsD;AAWtD,MAAa,qBAAsB,SAAQ,aAAK;IAE3B;IACA;IAFnB,YACmB,YAAmB,EACnB,cAA8B;QAG/C,MAAM,QAAQ,GAAI,YAAoB,CAAC,QAAuB,CAAC;QAC/D,MAAM,YAAY,GAAI,YAAoB,CAAC,YAAY,CAAC;QACxD,MAAM,aAAa,GAAI,YAAoB,CAAC,aAAa,CAAC;QAC1D,MAAM,MAAM,GAAI,YAAoB,CAAC,MAAM,CAAC;QAG5C,KAAK,CACH,YAAY,CAAC,MAAM,EACnB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,MAAM,CACP,CAAC;QAhBe,iBAAY,GAAZ,YAAY,CAAO;QACnB,mBAAc,GAAd,cAAc,CAAgB;QAmB/C,IAAI,QAAQ,YAAY,qCAAkB,EAAE,CAAC;YAC3C,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IASD,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,OAAsB,EAAE,KAAmB;QACxE,MAAM,QAAQ,GAA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M,EAAE,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAKO,kBAAkB,CAAC,OAAsB;QAE/C,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC;QAClE,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5SD,sDA4SC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TracingContext, TraceMetadata } from '../types/tracing.types';
|
|
2
|
+
import { DebateConfig } from '../types/debate.types';
|
|
3
|
+
import { Agent } from '../core/agent';
|
|
4
|
+
import { LLMProvider } from '../providers/llm-provider';
|
|
5
|
+
export declare function validateLangfuseConfig(): void;
|
|
6
|
+
export declare function createTracingContext(debateConfig: DebateConfig, traceMetadata: TraceMetadata, traceName: string, tags: string[]): TracingContext | undefined;
|
|
7
|
+
export declare function createTracingProvider(provider: LLMProvider, tracingContext?: TracingContext): LLMProvider;
|
|
8
|
+
export declare function createTracingAgent(agent: Agent, tracingContext?: TracingContext): Agent;
|
|
9
|
+
//# sourceMappingURL=tracing-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracing-factory.d.ts","sourceRoot":"","sources":["../../src/utils/tracing-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAsBxD,wBAAgB,sBAAsB,IAAI,IAAI,CAW7C;AAWD,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EAAE,GACb,cAAc,GAAG,SAAS,CAuC5B;AASD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,WAAW,EACrB,cAAc,CAAC,EAAE,cAAc,GAC9B,WAAW,CAMb;AASD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,cAAc,CAAC,EAAE,cAAc,GAC9B,KAAK,CAMP"}
|