larkup 0.1.30 → 0.1.31
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +2 -2
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/analytics.html +1 -1
- package/.next/server/app/analytics.rsc +1 -1
- package/.next/server/app/analytics.segments/_full.segment.rsc +1 -1
- package/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
- package/.next/server/app/analytics.segments/_index.segment.rsc +1 -1
- package/.next/server/app/analytics.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/analytics.segments/analytics/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/analytics.segments/analytics.segment.rsc +1 -1
- package/.next/server/app/chat.html +1 -1
- package/.next/server/app/chat.rsc +1 -1
- package/.next/server/app/chat.segments/_full.segment.rsc +1 -1
- package/.next/server/app/chat.segments/_head.segment.rsc +1 -1
- package/.next/server/app/chat.segments/_index.segment.rsc +1 -1
- package/.next/server/app/chat.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/chat.segments/chat.segment.rsc +1 -1
- package/.next/server/app/data/page_client-reference-manifest.js +1 -1
- package/.next/server/app/data.html +1 -1
- package/.next/server/app/data.rsc +2 -2
- package/.next/server/app/data.segments/_full.segment.rsc +2 -2
- package/.next/server/app/data.segments/_head.segment.rsc +1 -1
- package/.next/server/app/data.segments/_index.segment.rsc +1 -1
- package/.next/server/app/data.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/data.segments/data/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/data.segments/data.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +1 -1
- package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/chunks/0598_next_dist_esm_build_templates_app-route_0kbcuk-.js +16 -3
- package/.next/server/chunks/[root-of-the-server]__01al2n0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ahdfq9._.js +3 -3
- package/.next/server/chunks/packages_core_src_generator_generate-server_ts_11-w3m3._.js +2 -2
- package/.next/server/chunks/packages_marketplace_src_125_g2p._.js +1 -1
- package/.next/server/chunks/ssr/_169pdlf._.js +1 -1
- package/.next/server/chunks/ssr/packages_core_src_generator_generate-server_ts_15zzrn2._.js +2 -2
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/{1uzf7x2okeuab.js → 0ff5osu771ajz.js} +1 -1
- package/CHANGELOG.md +21 -0
- package/app/api/chat/route.ts +13 -1
- package/app/api/chat/tools.ts +2 -2
- package/app/api/firecrawl/local/route.ts +6 -3
- package/components/data/firecrawl-notice.tsx +1 -9
- package/next-env.d.ts +1 -1
- package/package.json +8 -8
- /package/.next/static/{Laf7YhpONHOZXSCw6POiL → kaW1RhJBmrNB5F_JAJ6QO}/_buildManifest.js +0 -0
- /package/.next/static/{Laf7YhpONHOZXSCw6POiL → kaW1RhJBmrNB5F_JAJ6QO}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{Laf7YhpONHOZXSCw6POiL → kaW1RhJBmrNB5F_JAJ6QO}/_ssgManifest.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# larkup
|
|
2
2
|
|
|
3
|
+
## 0.1.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 197c629: fix: Docker compatibility, AI agent tool priority, and indexing reliability
|
|
8
|
+
|
|
9
|
+
- Fix yt-dlp "No supported JavaScript runtime" error in Docker by passing --js-runtimes nodejs:node
|
|
10
|
+
- Fix LanceDB "Found field not in schema: metadata" by always serializing metadata column
|
|
11
|
+
- Speed up Marketplace tool installs in Docker with --prefer-offline
|
|
12
|
+
- Enforce RAG-first tool priority: searchKnowledgeBase → webSearch → other tools
|
|
13
|
+
- Instruct AI to use presentMedia for image previews instead of raw markdown (fixes [Image unavailable])
|
|
14
|
+
- Strengthen webSearch tool description to enforce secondary priority
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [197c629]
|
|
17
|
+
- @larkup/vector-stores@0.1.23
|
|
18
|
+
- @larkup/tool-video-audio@0.2.2
|
|
19
|
+
- @larkup/marketplace@0.1.7
|
|
20
|
+
- @larkup/core@0.2.4
|
|
21
|
+
- @larkup/tool-doc-editor@0.2.5
|
|
22
|
+
- @larkup/scraper@0.1.25
|
|
23
|
+
|
|
3
24
|
## 0.1.30
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/app/api/chat/route.ts
CHANGED
|
@@ -65,11 +65,24 @@ function createChatModel(
|
|
|
65
65
|
const SMART_RETRIEVAL_POLICY = `
|
|
66
66
|
|
|
67
67
|
CONVERSATION, RETRIEVAL, AND MEDIA POLICY:
|
|
68
|
+
|
|
69
|
+
TOOL PRIORITY (strict order):
|
|
70
|
+
1. searchKnowledgeBase — ALWAYS try this FIRST when the question may relate to the user's indexed data. This includes any question mentioning "I", "my", "our", "the document", "the file", "the diagram", "the image", "show me", or referencing specific topics the user has likely indexed.
|
|
71
|
+
2. Web search (if enabled) — Use ONLY if searchKnowledgeBase returned zero relevant hits AND the question is factual and benefits from web results.
|
|
72
|
+
3. Other tools (tabular queries, analysis, etc.) — Use when the question specifically requires them.
|
|
73
|
+
4. General knowledge — Answer from your training data ONLY for general knowledge questions clearly unrelated to the user's data.
|
|
74
|
+
5. If no tool yields relevant results AND you cannot answer reliably from general knowledge, respond honestly: "I could not find relevant information in your knowledge base or available sources."
|
|
75
|
+
|
|
76
|
+
RETRIEVAL RULES:
|
|
68
77
|
- Default to a short, direct answer. One to three sentences is usually enough; use structure only when the task is genuinely complex.
|
|
69
78
|
- Do not search for greetings, casual conversation, writing help, brainstorming, explanations you can answer reliably from general knowledge, or questions unrelated to the user's indexed data.
|
|
70
79
|
- Use searchKnowledgeBase only when the answer depends on the user's indexed/private content, an exact source-specific fact, or a topic that plausibly refers to something the user indexed.
|
|
71
80
|
- Treat questions about the user or their materials as knowledge-base questions: phrases such as "I", "my", "our", "you have", "the database", "the document", "the file", or "the diagram" require searchKnowledgeBase before answering whenever indexed content may contain the answer.
|
|
72
81
|
- Search at most once per user request unless the first search is clearly irrelevant. Never repeat a search when a prior tool result in this conversation already contains enough evidence.
|
|
82
|
+
|
|
83
|
+
IMAGE AND MEDIA RULES:
|
|
84
|
+
- NEVER output raw markdown image syntax like . The chat UI blocks these and shows "[Image unavailable]". Instead, always use the presentMedia tool to display images, videos, or audio from indexed content.
|
|
85
|
+
- When search results contain metadata.images or a mediaAssetId referencing an image, use presentMedia with the exact assetId to embed the image in the chat. This is the ONLY way images can appear in the conversation.
|
|
73
86
|
- For a follow-up such as "show me that part", "play the clip", "show the image", or "let me hear it", reuse the mediaAssetId and timestamps already present in the earlier search result and call presentMedia directly. Do not search again just to rediscover the same media.
|
|
74
87
|
- Use presentMedia to embed exactly one best video, image, or audio citation when the user asks to see/hear it or when one compact preview materially supports the answer. Do not present every search result.
|
|
75
88
|
- Keep the written answer minimal around a media citation. Do not print internal media reference markers.
|
|
@@ -177,7 +190,6 @@ export async function POST(req: Request) {
|
|
|
177
190
|
});
|
|
178
191
|
}
|
|
179
192
|
|
|
180
|
-
// Clean parts (AI SDK v5 UIMessage format) — strip heavy data from tool results and file parts
|
|
181
193
|
if (Array.isArray(anyM.parts)) {
|
|
182
194
|
anyM.parts = anyM.parts.map((part: any) => {
|
|
183
195
|
// Tool invocation parts — strip heavy results
|
package/app/api/chat/tools.ts
CHANGED
|
@@ -313,7 +313,7 @@ export async function getChatTools(context: {
|
|
|
313
313
|
const builtInTools: Record<string, any> = {
|
|
314
314
|
searchKnowledgeBase: tool({
|
|
315
315
|
description:
|
|
316
|
-
"Search the user's private RAG knowledge base when
|
|
316
|
+
"HIGHEST PRIORITY TOOL — Search the user's private RAG knowledge base. ALWAYS use this FIRST before webSearch or any other tool when the question may relate to the user's indexed data. This includes questions about documents, files, images, diagrams, videos, or anything the user may have uploaded. Do not use for general knowledge, casual conversation, or writing tasks. Search once with a focused query. For media, inspect the returned timeline and endingContext, and reuse exact mediaAssetId/startSecs/endSecs values with presentMedia when a preview is useful. Never guess timestamps.",
|
|
317
317
|
inputSchema: z.object({
|
|
318
318
|
query: z.string().describe('The search query for the knowledge base.'),
|
|
319
319
|
}),
|
|
@@ -891,7 +891,7 @@ export async function getChatTools(context: {
|
|
|
891
891
|
|
|
892
892
|
webSearch: tool({
|
|
893
893
|
description:
|
|
894
|
-
|
|
894
|
+
"Search the public internet for current information, news, or facts. IMPORTANT: Only use this AFTER searchKnowledgeBase has been tried first and returned no relevant results. Never use webSearch as a first resort — the user's indexed knowledge base always takes priority. Use webSearch for questions about current events, public facts, or topics clearly outside the user's indexed data.",
|
|
895
895
|
inputSchema: z.object({
|
|
896
896
|
query: z.string().describe('The search query.'),
|
|
897
897
|
}),
|
|
@@ -67,14 +67,17 @@ export async function POST(req: Request) {
|
|
|
67
67
|
|
|
68
68
|
if (runtimeEnv === 'docker') {
|
|
69
69
|
if (action === 'start') {
|
|
70
|
-
|
|
70
|
+
let state = await connectDockerSibling();
|
|
71
|
+
if (!state.running) {
|
|
72
|
+
state = await startLocal();
|
|
73
|
+
}
|
|
71
74
|
const { apiKey, ...safe } = state;
|
|
72
75
|
return NextResponse.json({ state: { ...safe, hasKey: Boolean(apiKey) } });
|
|
73
76
|
} else {
|
|
74
|
-
const state = await
|
|
77
|
+
const state = await stopLocal();
|
|
75
78
|
const { apiKey, ...safe } = state;
|
|
76
79
|
return NextResponse.json({
|
|
77
|
-
state: { ...safe,
|
|
80
|
+
state: { ...safe, hasKey: Boolean(apiKey) },
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
83
|
}
|
|
@@ -133,10 +133,6 @@ export function FirecrawlNotice({
|
|
|
133
133
|
<Button
|
|
134
134
|
variant="outline"
|
|
135
135
|
onClick={() => {
|
|
136
|
-
if (runtimeEnv === 'docker' && !dockerReady) {
|
|
137
|
-
router.push('/settings?section=general#web-crawler');
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
136
|
control('start');
|
|
141
137
|
}}
|
|
142
138
|
disabled={busy !== null || isLoading}
|
|
@@ -147,11 +143,7 @@ export function FirecrawlNotice({
|
|
|
147
143
|
) : (
|
|
148
144
|
<img src="/icons/firecrawl2.png" alt="" className="size-3 object-contain" />
|
|
149
145
|
)}
|
|
150
|
-
{runtimeEnv === 'docker' &&
|
|
151
|
-
? 'Crawler settings'
|
|
152
|
-
: runtimeEnv === 'docker'
|
|
153
|
-
? 'Connect Crawler'
|
|
154
|
-
: 'Launch Crawler'}
|
|
146
|
+
{runtimeEnv === 'docker' && dockerReady ? 'Connect Crawler' : 'Launch Crawler'}
|
|
155
147
|
</Button>
|
|
156
148
|
)}
|
|
157
149
|
</div>
|
package/next-env.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import
|
|
3
|
+
import './.next/types/routes.d.ts';
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larkup",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"larkup": "./bin/larkup.js"
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"xlsx": "^0.18.5",
|
|
54
54
|
"zod": "^4.4.3",
|
|
55
55
|
"zustand": "^5.0.14",
|
|
56
|
-
"@larkup/
|
|
57
|
-
"@larkup/
|
|
58
|
-
"@larkup/
|
|
59
|
-
"@larkup/
|
|
60
|
-
"@larkup/
|
|
61
|
-
"@larkup/
|
|
62
|
-
"@larkup/
|
|
56
|
+
"@larkup/sandbox": "0.1.2",
|
|
57
|
+
"@larkup/core": "0.2.4",
|
|
58
|
+
"@larkup/marketplace": "0.1.7",
|
|
59
|
+
"@larkup/scraper": "0.1.25",
|
|
60
|
+
"@larkup/vector-stores": "0.1.23",
|
|
61
|
+
"@larkup/tool-doc-editor": "0.2.5",
|
|
62
|
+
"@larkup/tool-video-audio": "0.2.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@tailwindcss/postcss": "^4.2.0",
|
|
File without changes
|
/package/.next/static/{Laf7YhpONHOZXSCw6POiL → kaW1RhJBmrNB5F_JAJ6QO}/_clientMiddlewareManifest.js
RENAMED
|
File without changes
|
|
File without changes
|