@tangle-network/agent-runtime 0.14.1 → 0.15.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/dist/agent.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -1
- package/dist/{types-jr_EFhrD.d.ts → types-CYxfw14J.d.ts} +9 -0
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tangle_network_agent_eval from '@tangle-network/agent-eval';
|
|
2
2
|
import { FindingSubject, TraceAnalystKindSpec, AnalystFinding, TraceStore, RunCompleteHook, FeedbackLabel, FeedbackTrajectoryStore } from '@tangle-network/agent-eval';
|
|
3
|
-
import { R as RuntimeStreamEvent } from './types-
|
|
3
|
+
import { R as RuntimeStreamEvent } from './types-CYxfw14J.js';
|
|
4
4
|
import { I as ImprovementAdapter, K as KnowledgeAdapter, a as RunAnalystLoopResult } from './types-D_MXrmJP.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentEvalError, KnowledgeReadinessReport, ControlEvalResult, KnowledgeRequirement, TraceEvent } from '@tangle-network/agent-eval';
|
|
2
2
|
export { AgentEvalError, AgentEvalErrorCode, CaptureIntegrityError, ConfigError, ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, JudgeError, KnowledgeReadinessReport, KnowledgeRequirement, NotFoundError, ReplayError, RunRecord, UserQuestion, ValidationError, VerificationError } from '@tangle-network/agent-eval';
|
|
3
|
-
import { A as AgentBackendInput, a as AgentExecutionBackend, b as AgentBackendContext, R as RuntimeStreamEvent, c as AgentTaskSpec, K as KnowledgeReadinessDecision, d as RunAgentTaskOptions, e as AgentTaskRunResult, f as RunAgentTaskStreamOptions, g as AgentTaskRunSummary, h as AgentRuntimeEvent, i as AgentTaskStatus, j as RuntimeSessionStore, k as RuntimeSession } from './types-
|
|
4
|
-
export { l as AgentAdapter, m as AgentKnowledgeProvider, n as AgentRuntimeEventSink, o as AgentTaskContext } from './types-
|
|
3
|
+
import { A as AgentBackendInput, a as AgentExecutionBackend, b as AgentBackendContext, R as RuntimeStreamEvent, c as AgentTaskSpec, K as KnowledgeReadinessDecision, d as RunAgentTaskOptions, e as AgentTaskRunResult, f as RunAgentTaskStreamOptions, g as AgentTaskRunSummary, h as AgentRuntimeEvent, i as AgentTaskStatus, j as RuntimeSessionStore, k as RuntimeSession } from './types-CYxfw14J.js';
|
|
4
|
+
export { l as AgentAdapter, m as AgentKnowledgeProvider, n as AgentRuntimeEventSink, o as AgentTaskContext } from './types-CYxfw14J.js';
|
|
5
5
|
import { AgentProfilePrompt, AgentProfileResources, AgentSubagentProfile, AgentProfile, SandboxInstance } from '@tangle-network/sandbox';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/index.js
CHANGED
|
@@ -293,6 +293,36 @@ function mapCommonBackendEvent(event, context) {
|
|
|
293
293
|
timestamp: nowIso()
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
+
if (type === "artifact") {
|
|
297
|
+
const artifactId = stringValue(data.artifactId) ?? stringValue(data.id) ?? stringValue(record.artifactId);
|
|
298
|
+
if (!artifactId) return void 0;
|
|
299
|
+
return {
|
|
300
|
+
type: "artifact",
|
|
301
|
+
task: context.task,
|
|
302
|
+
session: context.session,
|
|
303
|
+
artifactId,
|
|
304
|
+
name: stringValue(data.name) ?? stringValue(record.name),
|
|
305
|
+
mimeType: stringValue(data.mimeType) ?? stringValue(record.mimeType),
|
|
306
|
+
uri: stringValue(data.uri) ?? stringValue(record.uri),
|
|
307
|
+
content: stringValue(data.content) ?? stringValue(data.body) ?? stringValue(record.content),
|
|
308
|
+
metadata: data.metadata && typeof data.metadata === "object" ? data.metadata : void 0,
|
|
309
|
+
timestamp: nowIso()
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
if (type === "proposal_created" || type === "proposal" || type === "filing") {
|
|
313
|
+
const proposalId = stringValue(data.proposalId) ?? stringValue(data.id) ?? stringValue(record.proposalId);
|
|
314
|
+
if (!proposalId) return void 0;
|
|
315
|
+
const status = stringValue(data.status) ?? stringValue(record.status);
|
|
316
|
+
return {
|
|
317
|
+
type: "proposal_created",
|
|
318
|
+
task: context.task,
|
|
319
|
+
session: context.session,
|
|
320
|
+
proposalId,
|
|
321
|
+
title: stringValue(data.title) ?? stringValue(record.title) ?? proposalId,
|
|
322
|
+
status: status === "pending" || status === "approved" || status === "rejected" ? status : void 0,
|
|
323
|
+
timestamp: nowIso()
|
|
324
|
+
};
|
|
325
|
+
}
|
|
296
326
|
if (type === "result" || type === "final") {
|
|
297
327
|
const text = stringValue(data.finalText) ?? stringValue(data.text) ?? stringValue(record.text);
|
|
298
328
|
return text ? {
|
|
@@ -2726,9 +2756,21 @@ function sanitizeRuntimeStreamEvent(event, options = {}) {
|
|
|
2726
2756
|
name: event.name,
|
|
2727
2757
|
mimeType: event.mimeType,
|
|
2728
2758
|
uri: options.includeEvidenceIds ? event.uri : void 0,
|
|
2759
|
+
content: options.includeControlPayloads ? event.content : void 0,
|
|
2729
2760
|
metadata: options.includeMetadata ? event.metadata : void 0
|
|
2730
2761
|
};
|
|
2731
2762
|
}
|
|
2763
|
+
if (event.type === "proposal_created") {
|
|
2764
|
+
return {
|
|
2765
|
+
type: event.type,
|
|
2766
|
+
...withTask,
|
|
2767
|
+
...withSession,
|
|
2768
|
+
timestamp: event.timestamp,
|
|
2769
|
+
proposalId: event.proposalId,
|
|
2770
|
+
title: options.includeControlPayloads ? event.title : void 0,
|
|
2771
|
+
status: event.status
|
|
2772
|
+
};
|
|
2773
|
+
}
|
|
2732
2774
|
if (event.type === "final") {
|
|
2733
2775
|
return {
|
|
2734
2776
|
type: event.type,
|
|
@@ -3102,6 +3144,16 @@ function projectToTraceEvent(event) {
|
|
|
3102
3144
|
mimeType: event.mimeType
|
|
3103
3145
|
}
|
|
3104
3146
|
};
|
|
3147
|
+
case "proposal_created":
|
|
3148
|
+
return {
|
|
3149
|
+
kind: "state_mutation",
|
|
3150
|
+
payload: {
|
|
3151
|
+
phase: "proposal_created",
|
|
3152
|
+
proposalId: event.proposalId,
|
|
3153
|
+
title: event.title,
|
|
3154
|
+
status: event.status
|
|
3155
|
+
}
|
|
3156
|
+
};
|
|
3105
3157
|
case "task_end":
|
|
3106
3158
|
return {
|
|
3107
3159
|
kind: event.status === "failed" || event.status === "aborted" ? "error" : "log",
|