veryfront 0.1.337 → 0.1.338

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.337",
3
+ "version": "0.1.338",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -0,0 +1,28 @@
1
+ export interface DefaultResearchArtifactPaths {
2
+ topicSlug: string;
3
+ topicRootPath: string;
4
+ currentReportPath: string;
5
+ runReportPath: string;
6
+ findingsPath: string;
7
+ sourcesPath: string;
8
+ }
9
+ export declare function shouldInjectDefaultResearchArtifactPath(input: {
10
+ description: string;
11
+ prompt: string;
12
+ }): boolean;
13
+ export declare function buildDefaultResearchArtifactPathReminder(input: {
14
+ description: string;
15
+ prompt: string;
16
+ runId?: string;
17
+ }): string | null;
18
+ export declare function buildDefaultResearchArtifactPaths(input: {
19
+ description: string;
20
+ prompt: string;
21
+ runId?: string;
22
+ }): DefaultResearchArtifactPaths;
23
+ export declare function withDefaultResearchArtifactPath(input: {
24
+ description: string;
25
+ prompt: string;
26
+ runId?: string;
27
+ }): string;
28
+ //# sourceMappingURL=default-research-artifact-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-research-artifact-policy.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-research-artifact-policy.ts"],"names":[],"mappings":"AAiEA,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAaV;AAED,wBAAgB,wCAAwC,CAAC,KAAK,EAAE;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,GAAG,IAAI,CAehB;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,4BAA4B,CAe/B;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAOT"}
@@ -0,0 +1,99 @@
1
+ const RESEARCH_TASK_CUE_PATTERN = /\b(research|report|findings|sources|authoritative sources)\b/i;
2
+ const RESEARCH_PROJECT_SAVE_CUE_PATTERN = /\b(?:save|write|persist|store|compile)\b[^\n]{0,120}\b(?:to|into)\b[^\n]{0,40}\b(?:the\s+)?project\b/i;
3
+ const PROJECT_ARTIFACT_PATH_PATTERN = /(?:\/|\.{1,2}\/)?(?:[\w.-]+\/)+[\w.-]+\.[\w.-]+/g;
4
+ function slugifyArtifactSegment(value) {
5
+ return value
6
+ .toLowerCase()
7
+ .replace(/['"]/g, "")
8
+ .replace(/[^a-z0-9]+/g, "-")
9
+ .replace(/^-+|-+$/g, "");
10
+ }
11
+ function slugifyRunArtifactSegment(value) {
12
+ return value
13
+ .toLowerCase()
14
+ .replace(/[^a-z0-9_-]+/g, "-")
15
+ .replace(/^-+|-+$/g, "");
16
+ }
17
+ function hasAnyArtifactPath(prompt) {
18
+ PROJECT_ARTIFACT_PATH_PATTERN.lastIndex = 0;
19
+ return PROJECT_ARTIFACT_PATH_PATTERN.test(prompt);
20
+ }
21
+ function isGenericResearchTopic(value) {
22
+ const normalized = value.trim().toLowerCase();
23
+ return normalized.length === 0 ||
24
+ normalized === "this" ||
25
+ normalized === "that" ||
26
+ normalized === "it" ||
27
+ normalized === "the project" ||
28
+ normalized === "the topic";
29
+ }
30
+ function extractResearchTopic(input) {
31
+ const quotedPromptTopic = input.prompt.match(/\bresearch(?:\s+on|\s+about)?\s+["“]([^"”]+)["”]/i)?.[1];
32
+ if (quotedPromptTopic?.trim() && !isGenericResearchTopic(quotedPromptTopic)) {
33
+ return quotedPromptTopic.trim();
34
+ }
35
+ const cleanedDescription = input.description
36
+ .replace(/^research\s+/i, "")
37
+ .replace(/\.\s+.*$/s, "")
38
+ .replace(/\s+and\s+(?:save|write|persist|store|compile)\b.*$/i, "")
39
+ .replace(/\s+across\b.*$/i, "")
40
+ .trim();
41
+ if (cleanedDescription.length > 0) {
42
+ return cleanedDescription;
43
+ }
44
+ const promptTopic = input.prompt
45
+ .match(/\bresearch(?:\s+on|\s+about)?\s+([^\n.,:]+)/i)?.[1]
46
+ ?.replace(/\s+and\s+save\b.*$/i, "")
47
+ ?.replace(/\s+and\s+write\b.*$/i, "")
48
+ ?.trim();
49
+ if (!promptTopic || isGenericResearchTopic(promptTopic)) {
50
+ return null;
51
+ }
52
+ return promptTopic;
53
+ }
54
+ export function shouldInjectDefaultResearchArtifactPath(input) {
55
+ if (!RESEARCH_TASK_CUE_PATTERN.test(input.description) &&
56
+ !RESEARCH_TASK_CUE_PATTERN.test(input.prompt)) {
57
+ return false;
58
+ }
59
+ if (!RESEARCH_PROJECT_SAVE_CUE_PATTERN.test(input.prompt)) {
60
+ return false;
61
+ }
62
+ return !hasAnyArtifactPath(input.prompt);
63
+ }
64
+ export function buildDefaultResearchArtifactPathReminder(input) {
65
+ if (!shouldInjectDefaultResearchArtifactPath(input)) {
66
+ return null;
67
+ }
68
+ const artifactPaths = buildDefaultResearchArtifactPaths(input);
69
+ return [
70
+ "Default research workspace (because no exact artifact path was provided):",
71
+ `- Write the run-scoped report to exactly ${artifactPaths.runReportPath}.`,
72
+ `- Then create or update the current topic report at exactly ${artifactPaths.currentReportPath}.`,
73
+ `- Supporting artifacts can live at ${artifactPaths.findingsPath} and ${artifactPaths.sourcesPath} when useful.`,
74
+ `CRITICAL: The task is incomplete until ${artifactPaths.runReportPath} and ${artifactPaths.currentReportPath} both exist with the final report content.`,
75
+ "Use create_file or update_file yourself before finishing.",
76
+ ].join("\n");
77
+ }
78
+ export function buildDefaultResearchArtifactPaths(input) {
79
+ const topic = extractResearchTopic(input);
80
+ const topicSlug = topic ? slugifyArtifactSegment(topic) : "research-report";
81
+ const sanitizedRunId = slugifyRunArtifactSegment(input.runId ?? "");
82
+ const effectiveRunId = sanitizedRunId.length > 0 ? sanitizedRunId : "latest";
83
+ const topicRootPath = `/research/${topicSlug}`;
84
+ return {
85
+ topicSlug,
86
+ topicRootPath,
87
+ currentReportPath: `${topicRootPath}/report.md`,
88
+ runReportPath: `${topicRootPath}/runs/${effectiveRunId}.report.md`,
89
+ findingsPath: `${topicRootPath}/findings.md`,
90
+ sourcesPath: `${topicRootPath}/sources.md`,
91
+ };
92
+ }
93
+ export function withDefaultResearchArtifactPath(input) {
94
+ const reminder = buildDefaultResearchArtifactPathReminder(input);
95
+ if (!reminder) {
96
+ return input.prompt;
97
+ }
98
+ return [input.prompt, "", reminder].join("\n");
99
+ }
@@ -0,0 +1,39 @@
1
+ import type { ChatSystemMessage } from "../chat/types.js";
2
+ import { type DefaultResearchArtifactPaths } from "./default-research-artifact-policy.js";
3
+ export type DefaultResearchArtifacts = DefaultResearchArtifactPaths;
4
+ export interface DefaultResearchArtifactContext {
5
+ availableToolNames?: string[];
6
+ parentRunId?: string;
7
+ defaultResearchArtifacts?: DefaultResearchArtifacts | null;
8
+ }
9
+ export interface DefaultResearchArtifactLogger {
10
+ debug?: (message: string, metadata?: Record<string, unknown>) => void;
11
+ }
12
+ export declare function extractLatestUserText(messages: readonly unknown[]): string | null;
13
+ export declare function fetchLatestConversationUserText(input: {
14
+ apiUrl: string;
15
+ authToken: string;
16
+ conversationId?: string;
17
+ logger?: DefaultResearchArtifactLogger;
18
+ }): Promise<string | null>;
19
+ export declare function updateDefaultResearchArtifacts(input: {
20
+ taskContext: DefaultResearchArtifactContext;
21
+ latestUserText: string | null;
22
+ system: string | ChatSystemMessage[];
23
+ }): string | ChatSystemMessage[];
24
+ export declare function applyDefaultResearchArtifactPath(toolName: string, toolInput: Record<string, unknown>, taskContext: DefaultResearchArtifactContext): Record<string, unknown>;
25
+ export declare function shouldRetryCreateResearchArtifactAsUpdate(input: {
26
+ toolName: string;
27
+ toolInput: Record<string, unknown>;
28
+ taskContext: DefaultResearchArtifactContext;
29
+ error: unknown;
30
+ }): boolean;
31
+ export declare function mirrorDefaultResearchRunArtifact(input: {
32
+ toolName: string;
33
+ toolInput: Record<string, unknown>;
34
+ taskContext: DefaultResearchArtifactContext;
35
+ activeProjectId: string | null;
36
+ executeContext: Record<string, unknown> | undefined;
37
+ executeTool: (toolName: string, args: Record<string, unknown>, context: Record<string, unknown> | undefined) => Promise<unknown>;
38
+ }): Promise<void>;
39
+ //# sourceMappingURL=default-research-artifact-support.d.ts.map
@@ -0,0 +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,EAGL,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,Q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C/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,CAmChB"}
@@ -0,0 +1,184 @@
1
+ import { isHostedChildCreateFileAlreadyExistsResult } from "./hosted-child-artifact-support.js";
2
+ import { buildDefaultResearchArtifactPathReminder, buildDefaultResearchArtifactPaths, } from "./default-research-artifact-policy.js";
3
+ function isRecord(value) {
4
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5
+ }
6
+ export function extractLatestUserText(messages) {
7
+ for (let index = messages.length - 1; index >= 0; index -= 1) {
8
+ const message = messages[index];
9
+ if (!isRecord(message) || message.role !== "user") {
10
+ continue;
11
+ }
12
+ const content = message.content;
13
+ if (typeof content === "string" && content.trim().length > 0) {
14
+ return content;
15
+ }
16
+ if (!Array.isArray(content)) {
17
+ continue;
18
+ }
19
+ const text = content
20
+ .flatMap((part) => isRecord(part) && part.type === "text" && typeof part.text === "string"
21
+ ? [part.text.trim()]
22
+ : [])
23
+ .filter((value) => value.length > 0)
24
+ .join("\n");
25
+ if (text.length > 0) {
26
+ return text;
27
+ }
28
+ }
29
+ return null;
30
+ }
31
+ function extractLatestUserDescription(text) {
32
+ const withoutCommandSpan = text.replace(/<span\s+data-command="[^"]+">\s*(\/[a-z0-9_-]+)\s*<\/span>/gi, "$1");
33
+ const withoutLeadingSlashCommand = withoutCommandSpan.replace(/^\s*\/[a-z0-9_-]+\s*/i, "");
34
+ return withoutLeadingSlashCommand.trim();
35
+ }
36
+ export async function fetchLatestConversationUserText(input) {
37
+ if (!input.conversationId) {
38
+ return null;
39
+ }
40
+ try {
41
+ const response = await fetch(`${input.apiUrl}/conversations/${input.conversationId}/messages?limit=20`, {
42
+ headers: {
43
+ Authorization: `Bearer ${input.authToken}`,
44
+ },
45
+ });
46
+ if (!response.ok) {
47
+ input.logger?.debug?.("Could not preload conversation messages for research workspace detection", {
48
+ conversationId: input.conversationId,
49
+ status: response.status,
50
+ });
51
+ return null;
52
+ }
53
+ const payload = await response.json();
54
+ const data = isRecord(payload) ? payload.data : undefined;
55
+ const messages = Array.isArray(data)
56
+ ? data.map((message) => ({
57
+ role: isRecord(message) ? message.role : undefined,
58
+ content: isRecord(message) && Array.isArray(message.parts) ? message.parts : [],
59
+ }))
60
+ : [];
61
+ return extractLatestUserText(messages);
62
+ }
63
+ catch (error) {
64
+ input.logger?.debug?.("Failed to preload conversation messages for research workspace detection", {
65
+ conversationId: input.conversationId,
66
+ error,
67
+ });
68
+ return null;
69
+ }
70
+ }
71
+ export function updateDefaultResearchArtifacts(input) {
72
+ if (!input.latestUserText) {
73
+ return input.system;
74
+ }
75
+ const latestUserDescription = extractLatestUserDescription(input.latestUserText);
76
+ const defaultResearchWorkspaceReminder = buildDefaultResearchArtifactPathReminder({
77
+ description: latestUserDescription,
78
+ prompt: input.latestUserText,
79
+ runId: input.taskContext.parentRunId,
80
+ });
81
+ if (!defaultResearchWorkspaceReminder) {
82
+ input.taskContext.defaultResearchArtifacts = null;
83
+ return input.system;
84
+ }
85
+ input.taskContext.defaultResearchArtifacts = buildDefaultResearchArtifactPaths({
86
+ description: latestUserDescription,
87
+ prompt: input.latestUserText,
88
+ runId: input.taskContext.parentRunId,
89
+ });
90
+ return appendSystemReminder(input.system, defaultResearchWorkspaceReminder);
91
+ }
92
+ function appendSystemReminder(instructions, reminder) {
93
+ if (typeof instructions === "string") {
94
+ return instructions.includes(reminder) ? instructions : `${instructions}\n\n${reminder}`;
95
+ }
96
+ if (instructions.some((message) => message.content.includes(reminder))) {
97
+ return instructions;
98
+ }
99
+ return [
100
+ ...instructions,
101
+ {
102
+ role: "system",
103
+ content: reminder,
104
+ },
105
+ ];
106
+ }
107
+ export function applyDefaultResearchArtifactPath(toolName, toolInput, taskContext) {
108
+ const defaultArtifacts = taskContext.defaultResearchArtifacts;
109
+ if (!defaultArtifacts || (toolName !== "create_file" && toolName !== "update_file")) {
110
+ return toolInput;
111
+ }
112
+ const path = typeof toolInput.path === "string" ? toolInput.path.replace(/^\/+/, "") : null;
113
+ if (!path) {
114
+ return toolInput;
115
+ }
116
+ const canonicalCurrentPath = defaultArtifacts.currentReportPath.replace(/^\/+/, "");
117
+ const canonicalRunPath = defaultArtifacts.runReportPath.replace(/^\/+/, "");
118
+ const canonicalFindingsPath = defaultArtifacts.findingsPath.replace(/^\/+/, "");
119
+ const canonicalSourcesPath = defaultArtifacts.sourcesPath.replace(/^\/+/, "");
120
+ if (path === canonicalCurrentPath || path === canonicalRunPath || path === canonicalFindingsPath ||
121
+ path === canonicalSourcesPath) {
122
+ return toolInput;
123
+ }
124
+ if (!path.endsWith("/report.md") && path !== "report.md") {
125
+ return toolInput;
126
+ }
127
+ return {
128
+ ...toolInput,
129
+ path: canonicalCurrentPath,
130
+ };
131
+ }
132
+ export function shouldRetryCreateResearchArtifactAsUpdate(input) {
133
+ if (input.toolName !== "create_file") {
134
+ return false;
135
+ }
136
+ const defaultArtifacts = input.taskContext.defaultResearchArtifacts;
137
+ if (!isHostedChildCreateFileAlreadyExistsResult(input.error)) {
138
+ return false;
139
+ }
140
+ const path = typeof input.toolInput.path === "string"
141
+ ? input.toolInput.path.replace(/^\/+/, "")
142
+ : null;
143
+ const content = typeof input.toolInput.content === "string" ? input.toolInput.content : null;
144
+ if (!path || !content) {
145
+ return false;
146
+ }
147
+ if (!defaultArtifacts) {
148
+ return path.startsWith("research/") && path.endsWith(".md");
149
+ }
150
+ const topicRootPath = defaultArtifacts.currentReportPath.replace(/^\/+/, "").replace(/\/report\.md$/, "");
151
+ return path === topicRootPath || path.startsWith(`${topicRootPath}/`);
152
+ }
153
+ export async function mirrorDefaultResearchRunArtifact(input) {
154
+ const defaultArtifacts = input.taskContext.defaultResearchArtifacts;
155
+ if (!defaultArtifacts || (input.toolName !== "create_file" && input.toolName !== "update_file")) {
156
+ return;
157
+ }
158
+ const content = typeof input.toolInput.content === "string" ? input.toolInput.content : null;
159
+ const path = typeof input.toolInput.path === "string"
160
+ ? input.toolInput.path.replace(/^\/+/, "")
161
+ : null;
162
+ const canonicalCurrentPath = defaultArtifacts.currentReportPath.replace(/^\/+/, "");
163
+ const canonicalRunPath = defaultArtifacts.runReportPath.replace(/^\/+/, "");
164
+ if (!content || path !== canonicalCurrentPath) {
165
+ return;
166
+ }
167
+ const mirroredInput = {
168
+ ...input.toolInput,
169
+ path: canonicalRunPath,
170
+ };
171
+ if (input.activeProjectId) {
172
+ mirroredInput.project_reference = input.activeProjectId;
173
+ }
174
+ try {
175
+ await input.executeTool(input.toolName, mirroredInput, input.executeContext);
176
+ }
177
+ catch (error) {
178
+ if (input.toolName === "create_file" && isHostedChildCreateFileAlreadyExistsResult(error)) {
179
+ await input.executeTool("update_file", mirroredInput, input.executeContext);
180
+ return;
181
+ }
182
+ throw error;
183
+ }
184
+ }
@@ -120,6 +120,8 @@ export { createHostedChildPendingToolLifecycle, type HostedChildPendingToolCallP
120
120
  export { composeAbortSignals, HOSTED_CHILD_STREAM_TIMEOUT_TOKEN, HostedChildStreamIdleTimeoutError, type HostedChildStreamWatchdogPhase, type HostedChildStreamWatchdogState, resolveHostedChildPromiseWithTimeout, resolveHostedChildStreamWatchdogState, withHostedChildStreamIdleTimeout, } from "./hosted-child-stream-watchdog.js";
121
121
  export { buildHostedChildToolDescription, expandHostedChildRequestedTools, type HostedChildRequestedToolsInput, sanitizeHostedChildRequestedTools, shouldPruneSandboxToolsFromHostedChildRequest, } from "./hosted-child-requested-tools.js";
122
122
  export { getHostedChildWrittenArtifactPath, type HostedChildFileWriteFallbackLogger, type HostedChildFileWriteFallbackTool, type HostedChildFileWriteFallbackToolExecute, type HostedChildWrittenArtifactPathInput, isHostedChildCreateFileAlreadyExistsResult, isHostedChildTextProjectArtifactPrompt, normalizeHostedChildArtifactPath, withHostedChildRerunnableFileWriteFallbacks, } from "./hosted-child-artifact-support.js";
123
+ export { buildDefaultResearchArtifactPathReminder, buildDefaultResearchArtifactPaths, type DefaultResearchArtifactPaths, shouldInjectDefaultResearchArtifactPath, withDefaultResearchArtifactPath, } from "./default-research-artifact-policy.js";
124
+ export { applyDefaultResearchArtifactPath, type DefaultResearchArtifactContext, type DefaultResearchArtifactLogger, type DefaultResearchArtifacts, extractLatestUserText, fetchLatestConversationUserText, mirrorDefaultResearchRunArtifact, shouldRetryCreateResearchArtifactAsUpdate, updateDefaultResearchArtifacts, } from "./default-research-artifact-support.js";
123
125
  export { buildHostedChildCompletedLog, buildHostedChildErrorLog, buildHostedChildExhaustedStepBudgetLog, type HostedChildExecutionLogEntry, type HostedChildExecutionLogLevel, } from "./hosted-child-execution-logging.js";
124
126
  export { buildChildRunResultSummary, buildRootOwnedChildRunResultHint, buildRootOwnedChildRunResultText, summarizeChildRunResultText, summarizeChildRunResultValue, } from "./child-run-result-summary.js";
125
127
  export { buildChildRunExecutionSnapshot, buildChildRunFailureResult, buildChildRunFailureSnapshot, buildChildRunResultCommon, buildChildRunSuccessResult, buildChildRunSuccessSnapshot, type ChildRunExecutionResult, type ChildRunExecutionSnapshot, type ChildRunExecutionUsage, type ChildRunResultCommon, type ChildRunToolCallSnapshot, type ChildRunToolResultSnapshot, getChildRunSnapshotUsage, } from "./child-run-execution-snapshot.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,E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,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
@@ -119,6 +119,8 @@ export { createHostedChildPendingToolLifecycle, } from "./hosted-child-pending-t
119
119
  export { composeAbortSignals, HOSTED_CHILD_STREAM_TIMEOUT_TOKEN, HostedChildStreamIdleTimeoutError, resolveHostedChildPromiseWithTimeout, resolveHostedChildStreamWatchdogState, withHostedChildStreamIdleTimeout, } from "./hosted-child-stream-watchdog.js";
120
120
  export { buildHostedChildToolDescription, expandHostedChildRequestedTools, sanitizeHostedChildRequestedTools, shouldPruneSandboxToolsFromHostedChildRequest, } from "./hosted-child-requested-tools.js";
121
121
  export { getHostedChildWrittenArtifactPath, isHostedChildCreateFileAlreadyExistsResult, isHostedChildTextProjectArtifactPrompt, normalizeHostedChildArtifactPath, withHostedChildRerunnableFileWriteFallbacks, } from "./hosted-child-artifact-support.js";
122
+ export { buildDefaultResearchArtifactPathReminder, buildDefaultResearchArtifactPaths, shouldInjectDefaultResearchArtifactPath, withDefaultResearchArtifactPath, } from "./default-research-artifact-policy.js";
123
+ export { applyDefaultResearchArtifactPath, extractLatestUserText, fetchLatestConversationUserText, mirrorDefaultResearchRunArtifact, shouldRetryCreateResearchArtifactAsUpdate, updateDefaultResearchArtifacts, } from "./default-research-artifact-support.js";
122
124
  export { buildHostedChildCompletedLog, buildHostedChildErrorLog, buildHostedChildExhaustedStepBudgetLog, } from "./hosted-child-execution-logging.js";
123
125
  export { buildChildRunResultSummary, buildRootOwnedChildRunResultHint, buildRootOwnedChildRunResultText, summarizeChildRunResultText, summarizeChildRunResultValue, } from "./child-run-result-summary.js";
124
126
  export { buildChildRunExecutionSnapshot, buildChildRunFailureResult, buildChildRunFailureSnapshot, buildChildRunResultCommon, buildChildRunSuccessResult, buildChildRunSuccessSnapshot, getChildRunSnapshotUsage, } from "./child-run-execution-snapshot.js";
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.337";
1
+ export declare const VERSION = "0.1.338";
2
2
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.337";
3
+ export const VERSION = "0.1.338";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.337",
3
+ "version": "0.1.338",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.337",
3
+ "version": "0.1.338",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -0,0 +1,146 @@
1
+ const RESEARCH_TASK_CUE_PATTERN = /\b(research|report|findings|sources|authoritative sources)\b/i;
2
+ const RESEARCH_PROJECT_SAVE_CUE_PATTERN =
3
+ /\b(?:save|write|persist|store|compile)\b[^\n]{0,120}\b(?:to|into)\b[^\n]{0,40}\b(?:the\s+)?project\b/i;
4
+
5
+ const PROJECT_ARTIFACT_PATH_PATTERN = /(?:\/|\.{1,2}\/)?(?:[\w.-]+\/)+[\w.-]+\.[\w.-]+/g;
6
+
7
+ function slugifyArtifactSegment(value: string): string {
8
+ return value
9
+ .toLowerCase()
10
+ .replace(/['"]/g, "")
11
+ .replace(/[^a-z0-9]+/g, "-")
12
+ .replace(/^-+|-+$/g, "");
13
+ }
14
+
15
+ function slugifyRunArtifactSegment(value: string): string {
16
+ return value
17
+ .toLowerCase()
18
+ .replace(/[^a-z0-9_-]+/g, "-")
19
+ .replace(/^-+|-+$/g, "");
20
+ }
21
+
22
+ function hasAnyArtifactPath(prompt: string): boolean {
23
+ PROJECT_ARTIFACT_PATH_PATTERN.lastIndex = 0;
24
+ return PROJECT_ARTIFACT_PATH_PATTERN.test(prompt);
25
+ }
26
+
27
+ function isGenericResearchTopic(value: string): boolean {
28
+ const normalized = value.trim().toLowerCase();
29
+ return normalized.length === 0 ||
30
+ normalized === "this" ||
31
+ normalized === "that" ||
32
+ normalized === "it" ||
33
+ normalized === "the project" ||
34
+ normalized === "the topic";
35
+ }
36
+
37
+ function extractResearchTopic(input: { description: string; prompt: string }): string | null {
38
+ const quotedPromptTopic = input.prompt.match(/\bresearch(?:\s+on|\s+about)?\s+["“]([^"”]+)["”]/i)
39
+ ?.[1];
40
+ if (quotedPromptTopic?.trim() && !isGenericResearchTopic(quotedPromptTopic)) {
41
+ return quotedPromptTopic.trim();
42
+ }
43
+
44
+ const cleanedDescription = input.description
45
+ .replace(/^research\s+/i, "")
46
+ .replace(/\.\s+.*$/s, "")
47
+ .replace(/\s+and\s+(?:save|write|persist|store|compile)\b.*$/i, "")
48
+ .replace(/\s+across\b.*$/i, "")
49
+ .trim();
50
+ if (cleanedDescription.length > 0) {
51
+ return cleanedDescription;
52
+ }
53
+
54
+ const promptTopic = input.prompt
55
+ .match(/\bresearch(?:\s+on|\s+about)?\s+([^\n.,:]+)/i)?.[1]
56
+ ?.replace(/\s+and\s+save\b.*$/i, "")
57
+ ?.replace(/\s+and\s+write\b.*$/i, "")
58
+ ?.trim();
59
+ if (!promptTopic || isGenericResearchTopic(promptTopic)) {
60
+ return null;
61
+ }
62
+
63
+ return promptTopic;
64
+ }
65
+
66
+ export interface DefaultResearchArtifactPaths {
67
+ topicSlug: string;
68
+ topicRootPath: string;
69
+ currentReportPath: string;
70
+ runReportPath: string;
71
+ findingsPath: string;
72
+ sourcesPath: string;
73
+ }
74
+
75
+ export function shouldInjectDefaultResearchArtifactPath(input: {
76
+ description: string;
77
+ prompt: string;
78
+ }): boolean {
79
+ if (
80
+ !RESEARCH_TASK_CUE_PATTERN.test(input.description) &&
81
+ !RESEARCH_TASK_CUE_PATTERN.test(input.prompt)
82
+ ) {
83
+ return false;
84
+ }
85
+
86
+ if (!RESEARCH_PROJECT_SAVE_CUE_PATTERN.test(input.prompt)) {
87
+ return false;
88
+ }
89
+
90
+ return !hasAnyArtifactPath(input.prompt);
91
+ }
92
+
93
+ export function buildDefaultResearchArtifactPathReminder(input: {
94
+ description: string;
95
+ prompt: string;
96
+ runId?: string;
97
+ }): string | null {
98
+ if (!shouldInjectDefaultResearchArtifactPath(input)) {
99
+ return null;
100
+ }
101
+
102
+ const artifactPaths = buildDefaultResearchArtifactPaths(input);
103
+
104
+ return [
105
+ "Default research workspace (because no exact artifact path was provided):",
106
+ `- Write the run-scoped report to exactly ${artifactPaths.runReportPath}.`,
107
+ `- Then create or update the current topic report at exactly ${artifactPaths.currentReportPath}.`,
108
+ `- Supporting artifacts can live at ${artifactPaths.findingsPath} and ${artifactPaths.sourcesPath} when useful.`,
109
+ `CRITICAL: The task is incomplete until ${artifactPaths.runReportPath} and ${artifactPaths.currentReportPath} both exist with the final report content.`,
110
+ "Use create_file or update_file yourself before finishing.",
111
+ ].join("\n");
112
+ }
113
+
114
+ export function buildDefaultResearchArtifactPaths(input: {
115
+ description: string;
116
+ prompt: string;
117
+ runId?: string;
118
+ }): DefaultResearchArtifactPaths {
119
+ const topic = extractResearchTopic(input);
120
+ const topicSlug = topic ? slugifyArtifactSegment(topic) : "research-report";
121
+ const sanitizedRunId = slugifyRunArtifactSegment(input.runId ?? "");
122
+ const effectiveRunId = sanitizedRunId.length > 0 ? sanitizedRunId : "latest";
123
+ const topicRootPath = `/research/${topicSlug}`;
124
+
125
+ return {
126
+ topicSlug,
127
+ topicRootPath,
128
+ currentReportPath: `${topicRootPath}/report.md`,
129
+ runReportPath: `${topicRootPath}/runs/${effectiveRunId}.report.md`,
130
+ findingsPath: `${topicRootPath}/findings.md`,
131
+ sourcesPath: `${topicRootPath}/sources.md`,
132
+ };
133
+ }
134
+
135
+ export function withDefaultResearchArtifactPath(input: {
136
+ description: string;
137
+ prompt: string;
138
+ runId?: string;
139
+ }): string {
140
+ const reminder = buildDefaultResearchArtifactPathReminder(input);
141
+ if (!reminder) {
142
+ return input.prompt;
143
+ }
144
+
145
+ return [input.prompt, "", reminder].join("\n");
146
+ }
@@ -0,0 +1,289 @@
1
+ import type { ChatSystemMessage } from "../chat/types.js";
2
+ import { isHostedChildCreateFileAlreadyExistsResult } from "./hosted-child-artifact-support.js";
3
+ import {
4
+ buildDefaultResearchArtifactPathReminder,
5
+ buildDefaultResearchArtifactPaths,
6
+ type DefaultResearchArtifactPaths,
7
+ } from "./default-research-artifact-policy.js";
8
+
9
+ export type DefaultResearchArtifacts = DefaultResearchArtifactPaths;
10
+
11
+ export interface DefaultResearchArtifactContext {
12
+ availableToolNames?: string[];
13
+ parentRunId?: string;
14
+ defaultResearchArtifacts?: DefaultResearchArtifacts | null;
15
+ }
16
+
17
+ export interface DefaultResearchArtifactLogger {
18
+ debug?: (message: string, metadata?: Record<string, unknown>) => void;
19
+ }
20
+
21
+ function isRecord(value: unknown): value is Record<string, unknown> {
22
+ return typeof value === "object" && value !== null && !Array.isArray(value);
23
+ }
24
+
25
+ export function extractLatestUserText(messages: readonly unknown[]): string | null {
26
+ for (let index = messages.length - 1; index >= 0; index -= 1) {
27
+ const message = messages[index];
28
+ if (!isRecord(message) || message.role !== "user") {
29
+ continue;
30
+ }
31
+
32
+ const content = message.content;
33
+ if (typeof content === "string" && content.trim().length > 0) {
34
+ return content;
35
+ }
36
+
37
+ if (!Array.isArray(content)) {
38
+ continue;
39
+ }
40
+
41
+ const text = content
42
+ .flatMap((part) =>
43
+ isRecord(part) && part.type === "text" && typeof part.text === "string"
44
+ ? [part.text.trim()]
45
+ : []
46
+ )
47
+ .filter((value) => value.length > 0)
48
+ .join("\n");
49
+
50
+ if (text.length > 0) {
51
+ return text;
52
+ }
53
+ }
54
+
55
+ return null;
56
+ }
57
+
58
+ function extractLatestUserDescription(text: string): string {
59
+ const withoutCommandSpan = text.replace(
60
+ /<span\s+data-command="[^"]+">\s*(\/[a-z0-9_-]+)\s*<\/span>/gi,
61
+ "$1",
62
+ );
63
+ const withoutLeadingSlashCommand = withoutCommandSpan.replace(/^\s*\/[a-z0-9_-]+\s*/i, "");
64
+
65
+ return withoutLeadingSlashCommand.trim();
66
+ }
67
+
68
+ export async function fetchLatestConversationUserText(input: {
69
+ apiUrl: string;
70
+ authToken: string;
71
+ conversationId?: string;
72
+ logger?: DefaultResearchArtifactLogger;
73
+ }): Promise<string | null> {
74
+ if (!input.conversationId) {
75
+ return null;
76
+ }
77
+
78
+ try {
79
+ const response = await fetch(
80
+ `${input.apiUrl}/conversations/${input.conversationId}/messages?limit=20`,
81
+ {
82
+ headers: {
83
+ Authorization: `Bearer ${input.authToken}`,
84
+ },
85
+ },
86
+ );
87
+
88
+ if (!response.ok) {
89
+ input.logger?.debug?.(
90
+ "Could not preload conversation messages for research workspace detection",
91
+ {
92
+ conversationId: input.conversationId,
93
+ status: response.status,
94
+ },
95
+ );
96
+ return null;
97
+ }
98
+
99
+ const payload = await response.json();
100
+ const data = isRecord(payload) ? payload.data : undefined;
101
+ const messages = Array.isArray(data)
102
+ ? data.map((message) => ({
103
+ role: isRecord(message) ? message.role : undefined,
104
+ content: isRecord(message) && Array.isArray(message.parts) ? message.parts : [],
105
+ }))
106
+ : [];
107
+
108
+ return extractLatestUserText(messages);
109
+ } catch (error) {
110
+ input.logger?.debug?.(
111
+ "Failed to preload conversation messages for research workspace detection",
112
+ {
113
+ conversationId: input.conversationId,
114
+ error,
115
+ },
116
+ );
117
+ return null;
118
+ }
119
+ }
120
+
121
+ export function updateDefaultResearchArtifacts(input: {
122
+ taskContext: DefaultResearchArtifactContext;
123
+ latestUserText: string | null;
124
+ system: string | ChatSystemMessage[];
125
+ }): string | ChatSystemMessage[] {
126
+ if (!input.latestUserText) {
127
+ return input.system;
128
+ }
129
+
130
+ const latestUserDescription = extractLatestUserDescription(input.latestUserText);
131
+ const defaultResearchWorkspaceReminder = buildDefaultResearchArtifactPathReminder({
132
+ description: latestUserDescription,
133
+ prompt: input.latestUserText,
134
+ runId: input.taskContext.parentRunId,
135
+ });
136
+
137
+ if (!defaultResearchWorkspaceReminder) {
138
+ input.taskContext.defaultResearchArtifacts = null;
139
+ return input.system;
140
+ }
141
+
142
+ input.taskContext.defaultResearchArtifacts = buildDefaultResearchArtifactPaths({
143
+ description: latestUserDescription,
144
+ prompt: input.latestUserText,
145
+ runId: input.taskContext.parentRunId,
146
+ });
147
+
148
+ return appendSystemReminder(input.system, defaultResearchWorkspaceReminder);
149
+ }
150
+
151
+ function appendSystemReminder(
152
+ instructions: string | ChatSystemMessage[],
153
+ reminder: string,
154
+ ): string | ChatSystemMessage[] {
155
+ if (typeof instructions === "string") {
156
+ return instructions.includes(reminder) ? instructions : `${instructions}\n\n${reminder}`;
157
+ }
158
+
159
+ if (instructions.some((message) => message.content.includes(reminder))) {
160
+ return instructions;
161
+ }
162
+
163
+ return [
164
+ ...instructions,
165
+ {
166
+ role: "system",
167
+ content: reminder,
168
+ },
169
+ ];
170
+ }
171
+
172
+ export function applyDefaultResearchArtifactPath(
173
+ toolName: string,
174
+ toolInput: Record<string, unknown>,
175
+ taskContext: DefaultResearchArtifactContext,
176
+ ): Record<string, unknown> {
177
+ const defaultArtifacts = taskContext.defaultResearchArtifacts;
178
+ if (!defaultArtifacts || (toolName !== "create_file" && toolName !== "update_file")) {
179
+ return toolInput;
180
+ }
181
+
182
+ const path = typeof toolInput.path === "string" ? toolInput.path.replace(/^\/+/, "") : null;
183
+ if (!path) {
184
+ return toolInput;
185
+ }
186
+
187
+ const canonicalCurrentPath = defaultArtifacts.currentReportPath.replace(/^\/+/, "");
188
+ const canonicalRunPath = defaultArtifacts.runReportPath.replace(/^\/+/, "");
189
+ const canonicalFindingsPath = defaultArtifacts.findingsPath.replace(/^\/+/, "");
190
+ const canonicalSourcesPath = defaultArtifacts.sourcesPath.replace(/^\/+/, "");
191
+
192
+ if (
193
+ path === canonicalCurrentPath || path === canonicalRunPath || path === canonicalFindingsPath ||
194
+ path === canonicalSourcesPath
195
+ ) {
196
+ return toolInput;
197
+ }
198
+
199
+ if (!path.endsWith("/report.md") && path !== "report.md") {
200
+ return toolInput;
201
+ }
202
+
203
+ return {
204
+ ...toolInput,
205
+ path: canonicalCurrentPath,
206
+ };
207
+ }
208
+
209
+ export function shouldRetryCreateResearchArtifactAsUpdate(input: {
210
+ toolName: string;
211
+ toolInput: Record<string, unknown>;
212
+ taskContext: DefaultResearchArtifactContext;
213
+ error: unknown;
214
+ }): boolean {
215
+ if (input.toolName !== "create_file") {
216
+ return false;
217
+ }
218
+
219
+ const defaultArtifacts = input.taskContext.defaultResearchArtifacts;
220
+ if (!isHostedChildCreateFileAlreadyExistsResult(input.error)) {
221
+ return false;
222
+ }
223
+
224
+ const path = typeof input.toolInput.path === "string"
225
+ ? input.toolInput.path.replace(/^\/+/, "")
226
+ : null;
227
+ const content = typeof input.toolInput.content === "string" ? input.toolInput.content : null;
228
+ if (!path || !content) {
229
+ return false;
230
+ }
231
+
232
+ if (!defaultArtifacts) {
233
+ return path.startsWith("research/") && path.endsWith(".md");
234
+ }
235
+
236
+ const topicRootPath = defaultArtifacts.currentReportPath.replace(/^\/+/, "").replace(
237
+ /\/report\.md$/,
238
+ "",
239
+ );
240
+ return path === topicRootPath || path.startsWith(`${topicRootPath}/`);
241
+ }
242
+
243
+ export async function mirrorDefaultResearchRunArtifact(input: {
244
+ toolName: string;
245
+ toolInput: Record<string, unknown>;
246
+ taskContext: DefaultResearchArtifactContext;
247
+ activeProjectId: string | null;
248
+ executeContext: Record<string, unknown> | undefined;
249
+ executeTool: (
250
+ toolName: string,
251
+ args: Record<string, unknown>,
252
+ context: Record<string, unknown> | undefined,
253
+ ) => Promise<unknown>;
254
+ }): Promise<void> {
255
+ const defaultArtifacts = input.taskContext.defaultResearchArtifacts;
256
+ if (!defaultArtifacts || (input.toolName !== "create_file" && input.toolName !== "update_file")) {
257
+ return;
258
+ }
259
+
260
+ const content = typeof input.toolInput.content === "string" ? input.toolInput.content : null;
261
+ const path = typeof input.toolInput.path === "string"
262
+ ? input.toolInput.path.replace(/^\/+/, "")
263
+ : null;
264
+ const canonicalCurrentPath = defaultArtifacts.currentReportPath.replace(/^\/+/, "");
265
+ const canonicalRunPath = defaultArtifacts.runReportPath.replace(/^\/+/, "");
266
+
267
+ if (!content || path !== canonicalCurrentPath) {
268
+ return;
269
+ }
270
+
271
+ const mirroredInput: Record<string, unknown> = {
272
+ ...input.toolInput,
273
+ path: canonicalRunPath,
274
+ };
275
+
276
+ if (input.activeProjectId) {
277
+ mirroredInput.project_reference = input.activeProjectId;
278
+ }
279
+
280
+ try {
281
+ await input.executeTool(input.toolName, mirroredInput, input.executeContext);
282
+ } catch (error) {
283
+ if (input.toolName === "create_file" && isHostedChildCreateFileAlreadyExistsResult(error)) {
284
+ await input.executeTool("update_file", mirroredInput, input.executeContext);
285
+ return;
286
+ }
287
+ throw error;
288
+ }
289
+ }
@@ -419,6 +419,24 @@ export {
419
419
  normalizeHostedChildArtifactPath,
420
420
  withHostedChildRerunnableFileWriteFallbacks,
421
421
  } from "./hosted-child-artifact-support.js";
422
+ export {
423
+ buildDefaultResearchArtifactPathReminder,
424
+ buildDefaultResearchArtifactPaths,
425
+ type DefaultResearchArtifactPaths,
426
+ shouldInjectDefaultResearchArtifactPath,
427
+ withDefaultResearchArtifactPath,
428
+ } from "./default-research-artifact-policy.js";
429
+ export {
430
+ applyDefaultResearchArtifactPath,
431
+ type DefaultResearchArtifactContext,
432
+ type DefaultResearchArtifactLogger,
433
+ type DefaultResearchArtifacts,
434
+ extractLatestUserText,
435
+ fetchLatestConversationUserText,
436
+ mirrorDefaultResearchRunArtifact,
437
+ shouldRetryCreateResearchArtifactAsUpdate,
438
+ updateDefaultResearchArtifacts,
439
+ } from "./default-research-artifact-support.js";
422
440
  export {
423
441
  buildHostedChildCompletedLog,
424
442
  buildHostedChildErrorLog,
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.337";
3
+ export const VERSION = "0.1.338";