veryfront 0.1.418 → 0.1.419
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/esm/deno.js +1 -1
- package/esm/src/agent/default-research-artifact-support.d.ts.map +1 -1
- package/esm/src/agent/default-research-artifact-support.js +26 -7
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/agent/default-research-artifact-support.ts +36 -7
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-research-artifact-support.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-research-artifact-support.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAE/C,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,CAAC;AAEpE,MAAM,WAAW,8BAA8B;IAC7C,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,6BAA6B;IAC5C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACvE;
|
|
1
|
+
{"version":3,"file":"default-research-artifact-support.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-research-artifact-support.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAE/C,MAAM,MAAM,wBAA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A8B,CAAC;IAC5C,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CA2BV;AAED,wBAAsB,gCAAgC,CAAC,KAAK,EAAE;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,8BAA8B,CAAC;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACpD,WAAW,EAAE,CACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,KACzC,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDhB"}
|
|
@@ -9,6 +9,23 @@ function extractToolResultPath(result) {
|
|
|
9
9
|
}
|
|
10
10
|
return result.path.replace(/^\/+/, "");
|
|
11
11
|
}
|
|
12
|
+
function isReportPath(path) {
|
|
13
|
+
return path !== null && (path === "report.md" || path.endsWith("/report.md"));
|
|
14
|
+
}
|
|
15
|
+
function currentReportPathMatches(artifacts, path) {
|
|
16
|
+
if (!artifacts || !path) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return artifacts.currentReportPath.replace(/^\/+/, "") === path;
|
|
20
|
+
}
|
|
21
|
+
function buildDefaultArtifactsFromResultPath(input) {
|
|
22
|
+
return input.resultPath && isReportPath(input.resultPath)
|
|
23
|
+
? buildDefaultResearchArtifactPathsFromCurrentReportPath({
|
|
24
|
+
currentReportPath: input.resultPath,
|
|
25
|
+
runId: input.parentRunId,
|
|
26
|
+
})
|
|
27
|
+
: null;
|
|
28
|
+
}
|
|
12
29
|
export function extractLatestUserText(messages) {
|
|
13
30
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
14
31
|
const message = messages[index];
|
|
@@ -165,13 +182,15 @@ export async function mirrorDefaultResearchRunArtifact(input) {
|
|
|
165
182
|
? input.toolInput.path.replace(/^\/+/, "")
|
|
166
183
|
: null;
|
|
167
184
|
const resultPath = extractToolResultPath(input.toolResult);
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
185
|
+
const contextArtifacts = input.taskContext.defaultResearchArtifacts;
|
|
186
|
+
const resultArtifacts = buildDefaultArtifactsFromResultPath({
|
|
187
|
+
resultPath,
|
|
188
|
+
parentRunId: input.taskContext.parentRunId,
|
|
189
|
+
});
|
|
190
|
+
const defaultArtifacts = resultArtifacts &&
|
|
191
|
+
!currentReportPathMatches(contextArtifacts, resultPath)
|
|
192
|
+
? resultArtifacts
|
|
193
|
+
: contextArtifacts ?? resultArtifacts;
|
|
175
194
|
if (!defaultArtifacts) {
|
|
176
195
|
return;
|
|
177
196
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.419";
|
|
2
2
|
//# sourceMappingURL=version-constant.d.ts.map
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -31,6 +31,33 @@ function extractToolResultPath(result: unknown): string | null {
|
|
|
31
31
|
return result.path.replace(/^\/+/, "");
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
function isReportPath(path: string | null): path is string {
|
|
35
|
+
return path !== null && (path === "report.md" || path.endsWith("/report.md"));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function currentReportPathMatches(
|
|
39
|
+
artifacts: DefaultResearchArtifacts | null | undefined,
|
|
40
|
+
path: string | null,
|
|
41
|
+
): boolean {
|
|
42
|
+
if (!artifacts || !path) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return artifacts.currentReportPath.replace(/^\/+/, "") === path;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function buildDefaultArtifactsFromResultPath(input: {
|
|
50
|
+
resultPath: string | null;
|
|
51
|
+
parentRunId?: string;
|
|
52
|
+
}): DefaultResearchArtifacts | null {
|
|
53
|
+
return input.resultPath && isReportPath(input.resultPath)
|
|
54
|
+
? buildDefaultResearchArtifactPathsFromCurrentReportPath({
|
|
55
|
+
currentReportPath: input.resultPath,
|
|
56
|
+
runId: input.parentRunId,
|
|
57
|
+
})
|
|
58
|
+
: null;
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
export function extractLatestUserText(messages: readonly unknown[]): string | null {
|
|
35
62
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
36
63
|
const message = messages[index];
|
|
@@ -271,13 +298,15 @@ export async function mirrorDefaultResearchRunArtifact(input: {
|
|
|
271
298
|
? input.toolInput.path.replace(/^\/+/, "")
|
|
272
299
|
: null;
|
|
273
300
|
const resultPath = extractToolResultPath(input.toolResult);
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
301
|
+
const contextArtifacts = input.taskContext.defaultResearchArtifacts;
|
|
302
|
+
const resultArtifacts = buildDefaultArtifactsFromResultPath({
|
|
303
|
+
resultPath,
|
|
304
|
+
parentRunId: input.taskContext.parentRunId,
|
|
305
|
+
});
|
|
306
|
+
const defaultArtifacts = resultArtifacts &&
|
|
307
|
+
!currentReportPathMatches(contextArtifacts, resultPath)
|
|
308
|
+
? resultArtifacts
|
|
309
|
+
: contextArtifacts ?? resultArtifacts;
|
|
281
310
|
if (!defaultArtifacts) {
|
|
282
311
|
return;
|
|
283
312
|
}
|