@lightcone-ai/daemon 0.14.14 → 0.14.16
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/package.json +1 -1
- package/src/_vendor/video/recorder/chromium-driver.js +125 -0
- package/src/_vendor/video/recorder/display-pool.js +126 -0
- package/src/_vendor/video/recorder/ffmpeg-runner.js +291 -0
- package/src/_vendor/video/recorder/index.js +362 -0
- package/src/_vendor/video/recorder/plan-executor.js +424 -0
- package/src/chat-bridge.js +51 -0
- package/src/record-url-narration-tool.js +165 -0
- package/src/submit-to-library-tool.js +39 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function toolText(text) {
|
|
2
|
+
return { content: [{ type: 'text', text }] };
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function toolError(text) {
|
|
6
|
+
return { isError: true, content: [{ type: 'text', text }] };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function buildSubmitToLibraryBody(args = {}, workspaceId = '') {
|
|
10
|
+
return {
|
|
11
|
+
...(args ?? {}),
|
|
12
|
+
workspace_id: workspaceId,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function runSubmitToLibraryTool({
|
|
17
|
+
args = {},
|
|
18
|
+
currentWorkspaceId = '',
|
|
19
|
+
apiFn,
|
|
20
|
+
} = {}) {
|
|
21
|
+
if (!currentWorkspaceId) {
|
|
22
|
+
return toolError('No workspace context.');
|
|
23
|
+
}
|
|
24
|
+
if (typeof apiFn !== 'function') {
|
|
25
|
+
return toolError('Error: submit_to_library apiFn is required.');
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const data = await apiFn(
|
|
29
|
+
'POST',
|
|
30
|
+
'/content-library/submit',
|
|
31
|
+
buildSubmitToLibraryBody(args, currentWorkspaceId)
|
|
32
|
+
);
|
|
33
|
+
return toolText(
|
|
34
|
+
`Submitted to content library: itemId=${data.itemId}, version=${data.version}, kind=${data.kind ?? 'content_video_draft'}`
|
|
35
|
+
);
|
|
36
|
+
} catch (err) {
|
|
37
|
+
return toolError(`Error: ${err.message}`);
|
|
38
|
+
}
|
|
39
|
+
}
|