@dxos/plugin-youtube 0.8.3
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/LICENSE +21 -0
- package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs +90 -0
- package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs.map +7 -0
- package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs +28 -0
- package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs.map +7 -0
- package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs +76 -0
- package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs.map +7 -0
- package/dist/lib/browser/VideoCard-CCPXDCB7.mjs +64 -0
- package/dist/lib/browser/VideoCard-CCPXDCB7.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs +195 -0
- package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs +22 -0
- package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +13 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-C26XKDK2.mjs +355 -0
- package/dist/lib/browser/chunk-C26XKDK2.mjs.map +7 -0
- package/dist/lib/browser/chunk-DFRSBBSO.mjs +21 -0
- package/dist/lib/browser/chunk-DFRSBBSO.mjs.map +7 -0
- package/dist/lib/browser/chunk-GFRR4TTX.mjs +72 -0
- package/dist/lib/browser/chunk-GFRR4TTX.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-MUE22YUM.mjs +57 -0
- package/dist/lib/browser/chunk-MUE22YUM.mjs.map +7 -0
- package/dist/lib/browser/chunk-P67QEKBQ.mjs +72 -0
- package/dist/lib/browser/chunk-P67QEKBQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-YMDT37TA.mjs +62 -0
- package/dist/lib/browser/chunk-YMDT37TA.mjs.map +7 -0
- package/dist/lib/browser/chunk-Z3DGTMKC.mjs +8 -0
- package/dist/lib/browser/chunk-Z3DGTMKC.mjs.map +7 -0
- package/dist/lib/browser/clear-synced-videos-EVMJIZPD.mjs +66 -0
- package/dist/lib/browser/clear-synced-videos-EVMJIZPD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +153 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/react-surface-EDA5VYDC.mjs +77 -0
- package/dist/lib/browser/react-surface-EDA5VYDC.mjs.map +7 -0
- package/dist/lib/browser/sync-423Q4BDD.mjs +360 -0
- package/dist/lib/browser/sync-423Q4BDD.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +14 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs +91 -0
- package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs.map +7 -0
- package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs +29 -0
- package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs.map +7 -0
- package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs +77 -0
- package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs.map +7 -0
- package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs +65 -0
- package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs +196 -0
- package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs +23 -0
- package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +14 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5KNC2JMP.mjs +58 -0
- package/dist/lib/node-esm/chunk-5KNC2JMP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs +73 -0
- package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CX6MV3QM.mjs +23 -0
- package/dist/lib/node-esm/chunk-CX6MV3QM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs +63 -0
- package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JM5SBBP5.mjs +356 -0
- package/dist/lib/node-esm/chunk-JM5SBBP5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JSGRZMG3.mjs +73 -0
- package/dist/lib/node-esm/chunk-JSGRZMG3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-M4S6BE47.mjs +10 -0
- package/dist/lib/node-esm/chunk-M4S6BE47.mjs.map +7 -0
- package/dist/lib/node-esm/clear-synced-videos-5UCH6XHL.mjs +67 -0
- package/dist/lib/node-esm/clear-synced-videos-5UCH6XHL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +154 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs +78 -0
- package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs.map +7 -0
- package/dist/lib/node-esm/sync-CEF5DX2J.mjs +361 -0
- package/dist/lib/node-esm/sync-CEF5DX2J.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +15 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/YouTubePlugin.d.ts +3 -0
- package/dist/types/src/YouTubePlugin.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +3 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/youtube.d.ts +4 -0
- package/dist/types/src/blueprints/youtube.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +8 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/index.d.ts +3 -0
- package/dist/types/src/containers/ChannelArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelSettings/ChannelSettings.d.ts +7 -0
- package/dist/types/src/containers/ChannelSettings/ChannelSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ChannelSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts +11 -0
- package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts.map +1 -0
- package/dist/types/src/containers/VideoArticle/index.d.ts +3 -0
- package/dist/types/src/containers/VideoArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/VideoCard/VideoCard.d.ts +9 -0
- package/dist/types/src/containers/VideoCard/VideoCard.d.ts.map +1 -0
- package/dist/types/src/containers/VideoCard/index.d.ts +3 -0
- package/dist/types/src/containers/VideoCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +11 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +3 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/operations/apis/index.d.ts +2 -0
- package/dist/types/src/operations/apis/index.d.ts.map +1 -0
- package/dist/types/src/operations/apis/youtube/api.d.ts +251 -0
- package/dist/types/src/operations/apis/youtube/api.d.ts.map +1 -0
- package/dist/types/src/operations/apis/youtube/index.d.ts +3 -0
- package/dist/types/src/operations/apis/youtube/index.d.ts.map +1 -0
- package/dist/types/src/operations/apis/youtube/types.d.ts +493 -0
- package/dist/types/src/operations/apis/youtube/types.d.ts.map +1 -0
- package/dist/types/src/operations/clear-synced-videos.d.ts +5 -0
- package/dist/types/src/operations/clear-synced-videos.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +45 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +5 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/services/google-credentials.d.ts +35 -0
- package/dist/types/src/operations/services/google-credentials.d.ts.map +1 -0
- package/dist/types/src/operations/services/index.d.ts +2 -0
- package/dist/types/src/operations/services/index.d.ts.map +1 -0
- package/dist/types/src/operations/sync.d.ts +5 -0
- package/dist/types/src/operations/sync.d.ts.map +1 -0
- package/dist/types/src/operations/sync.test.d.ts +2 -0
- package/dist/types/src/operations/sync.test.d.ts.map +1 -0
- package/dist/types/src/operations/transcript.d.ts +12 -0
- package/dist/types/src/operations/transcript.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +49 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/Channel.d.ts +54 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/Video.d.ts +41 -0
- package/dist/types/src/types/Video.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +5 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +113 -0
- package/src/YouTubePlugin.tsx +66 -0
- package/src/blueprints/index.ts +7 -0
- package/src/blueprints/youtube.ts +52 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +148 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +7 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +54 -0
- package/src/containers/ChannelArticle/ChannelArticle.tsx +115 -0
- package/src/containers/ChannelArticle/index.ts +7 -0
- package/src/containers/ChannelSettings/ChannelSettings.tsx +34 -0
- package/src/containers/ChannelSettings/index.ts +7 -0
- package/src/containers/VideoArticle/VideoArticle.tsx +109 -0
- package/src/containers/VideoArticle/index.ts +7 -0
- package/src/containers/VideoCard/VideoCard.tsx +86 -0
- package/src/containers/VideoCard/index.ts +7 -0
- package/src/containers/index.ts +24 -0
- package/src/index.ts +8 -0
- package/src/meta.ts +19 -0
- package/src/operations/apis/index.ts +5 -0
- package/src/operations/apis/youtube/api.ts +149 -0
- package/src/operations/apis/youtube/index.ts +6 -0
- package/src/operations/apis/youtube/types.ts +254 -0
- package/src/operations/clear-synced-videos.ts +50 -0
- package/src/operations/definitions.ts +62 -0
- package/src/operations/index.ts +13 -0
- package/src/operations/services/google-credentials.ts +81 -0
- package/src/operations/services/index.ts +5 -0
- package/src/operations/sync.test.ts +114 -0
- package/src/operations/sync.ts +309 -0
- package/src/operations/transcript.ts +47 -0
- package/src/translations.ts +59 -0
- package/src/types/Channel.ts +80 -0
- package/src/types/Video.ts +67 -0
- package/src/types/index.ts +8 -0
- package/src/types/types.ts +10 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
3
|
+
|
|
4
|
+
// src/containers/ChannelSettings/ChannelSettings.tsx
|
|
5
|
+
import React from "react";
|
|
6
|
+
var ChannelSettings = ({ subject: channel }) => {
|
|
7
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
8
|
+
className: "flex flex-col gap-4 p-4"
|
|
9
|
+
}, /* @__PURE__ */ React.createElement("h3", {
|
|
10
|
+
className: "text-md font-medium"
|
|
11
|
+
}, "Channel Settings"), /* @__PURE__ */ React.createElement("div", {
|
|
12
|
+
className: "flex flex-col gap-2 text-sm"
|
|
13
|
+
}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
14
|
+
className: "text-description"
|
|
15
|
+
}, "Name:"), " ", /* @__PURE__ */ React.createElement("span", null, channel.name ?? "Not set")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
16
|
+
className: "text-description"
|
|
17
|
+
}, "Channel URL:"), " ", /* @__PURE__ */ React.createElement("span", null, channel.channelUrl ?? "Not set")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
18
|
+
className: "text-description"
|
|
19
|
+
}, "Channel ID:"), " ", /* @__PURE__ */ React.createElement("span", null, channel.channelId ?? "Not set")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
20
|
+
className: "text-description"
|
|
21
|
+
}, "Last Synced:"), " ", /* @__PURE__ */ React.createElement("span", null, channel.lastSyncedAt ? new Date(channel.lastSyncedAt).toLocaleString() : "Never"))));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// src/containers/ChannelSettings/index.ts
|
|
25
|
+
var ChannelSettings_default = ChannelSettings;
|
|
26
|
+
export {
|
|
27
|
+
ChannelSettings_default as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=ChannelSettings-DM2HWNKO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/ChannelSettings/ChannelSettings.tsx", "../../../src/containers/ChannelSettings/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport * as Channel from '../../types/Channel';\n\nexport type ChannelSettingsProps = {\n subject: Channel.YouTubeChannel;\n};\n\nexport const ChannelSettings = ({ subject: channel }: ChannelSettingsProps) => {\n return (\n <div className='flex flex-col gap-4 p-4'>\n <h3 className='text-md font-medium'>Channel Settings</h3>\n <div className='flex flex-col gap-2 text-sm'>\n <div>\n <span className='text-description'>Name:</span> <span>{channel.name ?? 'Not set'}</span>\n </div>\n <div>\n <span className='text-description'>Channel URL:</span> <span>{channel.channelUrl ?? 'Not set'}</span>\n </div>\n <div>\n <span className='text-description'>Channel ID:</span> <span>{channel.channelId ?? 'Not set'}</span>\n </div>\n <div>\n <span className='text-description'>Last Synced:</span>{' '}\n <span>{channel.lastSyncedAt ? new Date(channel.lastSyncedAt).toLocaleString() : 'Never'}</span>\n </div>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ChannelSettings } from './ChannelSettings';\n\nexport default ChannelSettings;\n"],
|
|
5
|
+
"mappings": ";;;;AAIA,OAAOA,WAAW;AAQX,IAAMC,kBAAkB,CAAC,EAAEC,SAASC,QAAO,MAAwB;AACxE,SACE,sBAAA,cAACC,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACC,MAAAA;IAAGD,WAAU;KAAsB,kBAAA,GACpC,sBAAA,cAACD,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACD,OAAAA,MACC,sBAAA,cAACG,QAAAA;IAAKF,WAAU;KAAmB,OAAA,GAAY,KAAC,sBAAA,cAACE,QAAAA,MAAMJ,QAAQK,QAAQ,SAAA,CAAA,GAEzE,sBAAA,cAACJ,OAAAA,MACC,sBAAA,cAACG,QAAAA;IAAKF,WAAU;KAAmB,cAAA,GAAmB,KAAC,sBAAA,cAACE,QAAAA,MAAMJ,QAAQM,cAAc,SAAA,CAAA,GAEtF,sBAAA,cAACL,OAAAA,MACC,sBAAA,cAACG,QAAAA;IAAKF,WAAU;KAAmB,aAAA,GAAkB,KAAC,sBAAA,cAACE,QAAAA,MAAMJ,QAAQO,aAAa,SAAA,CAAA,GAEpF,sBAAA,cAACN,OAAAA,MACC,sBAAA,cAACG,QAAAA;IAAKF,WAAU;KAAmB,cAAA,GAAoB,KACvD,sBAAA,cAACE,QAAAA,MAAMJ,QAAQQ,eAAe,IAAIC,KAAKT,QAAQQ,YAAY,EAAEE,eAAc,IAAK,OAAA,CAAA,CAAA,CAAA;AAK1F;;;AC3BA,IAAA,0BAAeC;",
|
|
6
|
+
"names": ["React", "ChannelSettings", "subject", "channel", "div", "className", "h3", "span", "name", "channelUrl", "channelId", "lastSyncedAt", "Date", "toLocaleString", "ChannelSettings"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
3
|
+
|
|
4
|
+
// src/containers/VideoArticle/VideoArticle.tsx
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { Icon, Panel } from "@dxos/react-ui";
|
|
7
|
+
var VideoArticle = ({ subject: video, role }) => {
|
|
8
|
+
const [showPlayer, setShowPlayer] = useState(false);
|
|
9
|
+
const publishedDate = new Date(video.publishedAt).toLocaleDateString();
|
|
10
|
+
const hasTranscript = Boolean(video.transcript);
|
|
11
|
+
const embedUrl = `https://www.youtube.com/embed/${video.videoId}`;
|
|
12
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, null, /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
13
|
+
className: role === "section" ? "overflow-auto" : ""
|
|
14
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
15
|
+
className: "flex flex-col gap-4 p-4 max-w-4xl"
|
|
16
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
17
|
+
className: "flex flex-col gap-2"
|
|
18
|
+
}, /* @__PURE__ */ React.createElement("h2", {
|
|
19
|
+
className: "text-lg font-semibold"
|
|
20
|
+
}, video.title), /* @__PURE__ */ React.createElement("div", {
|
|
21
|
+
className: "flex items-center gap-2 text-sm text-description"
|
|
22
|
+
}, /* @__PURE__ */ React.createElement("span", null, video.channelTitle), /* @__PURE__ */ React.createElement("span", null, "\u2022"), /* @__PURE__ */ React.createElement("span", null, publishedDate), video.viewCount !== void 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", null, "\u2022"), /* @__PURE__ */ React.createElement("span", null, video.viewCount.toLocaleString(), " views")), video.likeCount !== void 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", null, "\u2022"), /* @__PURE__ */ React.createElement("span", null, video.likeCount.toLocaleString(), " likes")))), /* @__PURE__ */ React.createElement("div", {
|
|
23
|
+
className: "aspect-video w-full max-w-2xl"
|
|
24
|
+
}, showPlayer ? /* @__PURE__ */ React.createElement("iframe", {
|
|
25
|
+
src: embedUrl,
|
|
26
|
+
title: video.title,
|
|
27
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
28
|
+
allowFullScreen: true,
|
|
29
|
+
className: "h-full w-full rounded-lg"
|
|
30
|
+
}) : /* @__PURE__ */ React.createElement("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
onClick: () => setShowPlayer(true),
|
|
33
|
+
className: "relative h-full w-full group cursor-pointer"
|
|
34
|
+
}, video.thumbnailUrl ? /* @__PURE__ */ React.createElement("img", {
|
|
35
|
+
src: video.thumbnailUrl,
|
|
36
|
+
alt: video.title,
|
|
37
|
+
className: "h-full w-full object-cover rounded-lg"
|
|
38
|
+
}) : /* @__PURE__ */ React.createElement("div", {
|
|
39
|
+
className: "h-full w-full bg-surface-hover rounded-lg flex items-center justify-center"
|
|
40
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
41
|
+
icon: "ph--play--fill",
|
|
42
|
+
size: 12
|
|
43
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
44
|
+
className: "absolute inset-0 flex items-center justify-center bg-black/30 group-hover:bg-black/50 rounded-lg transition-colors"
|
|
45
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
46
|
+
className: "bg-red-600 text-white rounded-full p-4 group-hover:scale-110 transition-transform"
|
|
47
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
48
|
+
icon: "ph--play--fill",
|
|
49
|
+
size: 8
|
|
50
|
+
}))))), video.description && /* @__PURE__ */ React.createElement("div", {
|
|
51
|
+
className: "max-w-2xl"
|
|
52
|
+
}, /* @__PURE__ */ React.createElement("h3", {
|
|
53
|
+
className: "text-md font-medium mb-2"
|
|
54
|
+
}, "Description"), /* @__PURE__ */ React.createElement("p", {
|
|
55
|
+
className: "whitespace-pre-wrap text-sm"
|
|
56
|
+
}, video.description)), hasTranscript && /* @__PURE__ */ React.createElement("div", {
|
|
57
|
+
className: "max-w-2xl"
|
|
58
|
+
}, /* @__PURE__ */ React.createElement("h3", {
|
|
59
|
+
className: "text-md font-medium mb-2"
|
|
60
|
+
}, "Transcript"), /* @__PURE__ */ React.createElement("div", {
|
|
61
|
+
className: "bg-surface-input p-4 rounded-lg max-h-96 overflow-auto"
|
|
62
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
63
|
+
className: "whitespace-pre-wrap text-sm"
|
|
64
|
+
}, video.transcript))), /* @__PURE__ */ React.createElement("a", {
|
|
65
|
+
href: video.url,
|
|
66
|
+
target: "_blank",
|
|
67
|
+
rel: "noopener noreferrer",
|
|
68
|
+
className: "inline-flex items-center gap-2 text-sm text-primary hover:underline"
|
|
69
|
+
}, "Watch on YouTube \u2192"))));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/containers/VideoArticle/index.ts
|
|
73
|
+
var VideoArticle_default = VideoArticle;
|
|
74
|
+
export {
|
|
75
|
+
VideoArticle_default as default
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=VideoArticle-WLTWZO3K.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/VideoArticle/VideoArticle.tsx", "../../../src/containers/VideoArticle/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { Icon, Panel } from '@dxos/react-ui';\n\nimport * as Channel from '../../types/Channel';\nimport * as Video from '../../types/Video';\n\nexport type VideoArticleProps = {\n role: string | string[];\n subject: Video.YouTubeVideo;\n channel: Channel.YouTubeChannel;\n attendableId?: string;\n};\n\nexport const VideoArticle = ({ subject: video, role }: VideoArticleProps) => {\n const [showPlayer, setShowPlayer] = useState(false);\n const publishedDate = new Date(video.publishedAt).toLocaleDateString();\n const hasTranscript = Boolean(video.transcript);\n const embedUrl = `https://www.youtube.com/embed/${video.videoId}`;\n\n return (\n <Panel.Root>\n <Panel.Content className={role === 'section' ? 'overflow-auto' : ''}>\n <div className='flex flex-col gap-4 p-4 max-w-4xl'>\n <div className='flex flex-col gap-2'>\n <h2 className='text-lg font-semibold'>{video.title}</h2>\n <div className='flex items-center gap-2 text-sm text-description'>\n <span>{video.channelTitle}</span>\n <span>•</span>\n <span>{publishedDate}</span>\n {video.viewCount !== undefined && (\n <>\n <span>•</span>\n <span>{video.viewCount.toLocaleString()} views</span>\n </>\n )}\n {video.likeCount !== undefined && (\n <>\n <span>•</span>\n <span>{video.likeCount.toLocaleString()} likes</span>\n </>\n )}\n </div>\n </div>\n\n <div className='aspect-video w-full max-w-2xl'>\n {showPlayer ? (\n <iframe\n src={embedUrl}\n title={video.title}\n allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'\n allowFullScreen\n className='h-full w-full rounded-lg'\n />\n ) : (\n <button\n type='button'\n onClick={() => setShowPlayer(true)}\n className='relative h-full w-full group cursor-pointer'\n >\n {video.thumbnailUrl ? (\n <img src={video.thumbnailUrl} alt={video.title} className='h-full w-full object-cover rounded-lg' />\n ) : (\n <div className='h-full w-full bg-surface-hover rounded-lg flex items-center justify-center'>\n <Icon icon='ph--play--fill' size={12} />\n </div>\n )}\n <div className='absolute inset-0 flex items-center justify-center bg-black/30 group-hover:bg-black/50 rounded-lg transition-colors'>\n <div className='bg-red-600 text-white rounded-full p-4 group-hover:scale-110 transition-transform'>\n <Icon icon='ph--play--fill' size={8} />\n </div>\n </div>\n </button>\n )}\n </div>\n\n {video.description && (\n <div className='max-w-2xl'>\n <h3 className='text-md font-medium mb-2'>Description</h3>\n <p className='whitespace-pre-wrap text-sm'>{video.description}</p>\n </div>\n )}\n\n {hasTranscript && (\n <div className='max-w-2xl'>\n <h3 className='text-md font-medium mb-2'>Transcript</h3>\n <div className='bg-surface-input p-4 rounded-lg max-h-96 overflow-auto'>\n <p className='whitespace-pre-wrap text-sm'>{video.transcript}</p>\n </div>\n </div>\n )}\n\n <a\n href={video.url}\n target='_blank'\n rel='noopener noreferrer'\n className='inline-flex items-center gap-2 text-sm text-primary hover:underline'\n >\n Watch on YouTube →\n </a>\n </div>\n </Panel.Content>\n </Panel.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { VideoArticle } from './VideoArticle';\n\nexport default VideoArticle;\n"],
|
|
5
|
+
"mappings": ";;;;AAIA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,cAACc,UAAAA;IACCC,MAAK;IACLC,SAAS,MAAM9B,cAAc,IAAA;IAC7Bc,WAAU;KAETjB,MAAMkC,eACL,sBAAA,cAACC,OAAAA;IAAIP,KAAK5B,MAAMkC;IAAcE,KAAKpC,MAAMoB;IAAOH,WAAU;OAE1D,sBAAA,cAACC,OAAAA;IAAID,WAAU;KACb,sBAAA,cAACoB,MAAAA;IAAKC,MAAK;IAAiBC,MAAM;OAGtC,sBAAA,cAACrB,OAAAA;IAAID,WAAU;KACb,sBAAA,cAACC,OAAAA;IAAID,WAAU;KACb,sBAAA,cAACoB,MAAAA;IAAKC,MAAK;IAAiBC,MAAM;UAO3CvC,MAAMwC,eACL,sBAAA,cAACtB,OAAAA;IAAID,WAAU;KACb,sBAAA,cAACwB,MAAAA;IAAGxB,WAAU;KAA2B,aAAA,GACzC,sBAAA,cAACyB,KAAAA;IAAEzB,WAAU;KAA+BjB,MAAMwC,WAAW,CAAA,GAIhE/B,iBACC,sBAAA,cAACS,OAAAA;IAAID,WAAU;KACb,sBAAA,cAACwB,MAAAA;IAAGxB,WAAU;KAA2B,YAAA,GACzC,sBAAA,cAACC,OAAAA;IAAID,WAAU;KACb,sBAAA,cAACyB,KAAAA;IAAEzB,WAAU;KAA+BjB,MAAMW,UAAU,CAAA,CAAA,GAKlE,sBAAA,cAACgC,KAAAA;IACCC,MAAM5C,MAAM6C;IACZC,QAAO;IACPC,KAAI;IACJ9B,WAAU;KACX,yBAAA,CAAA,CAAA,CAAA;AAOX;;;ACtGA,IAAA,uBAAe+B;",
|
|
6
|
+
"names": ["React", "useState", "Icon", "Panel", "VideoArticle", "subject", "video", "role", "showPlayer", "setShowPlayer", "useState", "publishedDate", "Date", "publishedAt", "toLocaleDateString", "hasTranscript", "Boolean", "transcript", "embedUrl", "videoId", "Panel", "Root", "Content", "className", "div", "h2", "title", "span", "channelTitle", "viewCount", "undefined", "toLocaleString", "likeCount", "iframe", "src", "allow", "allowFullScreen", "button", "type", "onClick", "thumbnailUrl", "img", "alt", "Icon", "icon", "size", "description", "h3", "p", "a", "href", "url", "target", "rel", "VideoArticle"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
3
|
+
|
|
4
|
+
// src/containers/VideoCard/VideoCard.tsx
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { Card, Icon } from "@dxos/react-ui";
|
|
7
|
+
var VideoCard = ({ subject: video }) => {
|
|
8
|
+
const [showPlayer, setShowPlayer] = useState(false);
|
|
9
|
+
const publishedDate = new Date(video.publishedAt).toLocaleDateString();
|
|
10
|
+
const hasTranscript = Boolean(video.transcript);
|
|
11
|
+
const embedUrl = `https://www.youtube.com/embed/${video.videoId}?autoplay=1`;
|
|
12
|
+
return /* @__PURE__ */ React.createElement(Card.Content, null, showPlayer ? /* @__PURE__ */ React.createElement("div", {
|
|
13
|
+
className: "aspect-video w-full"
|
|
14
|
+
}, /* @__PURE__ */ React.createElement("iframe", {
|
|
15
|
+
src: embedUrl,
|
|
16
|
+
title: video.title,
|
|
17
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
18
|
+
allowFullScreen: true,
|
|
19
|
+
className: "h-full w-full rounded"
|
|
20
|
+
})) : /* @__PURE__ */ React.createElement("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: () => setShowPlayer(true),
|
|
23
|
+
className: "relative aspect-video w-full group cursor-pointer"
|
|
24
|
+
}, video.thumbnailUrl ? /* @__PURE__ */ React.createElement("img", {
|
|
25
|
+
src: video.thumbnailUrl,
|
|
26
|
+
alt: video.title,
|
|
27
|
+
className: "h-full w-full object-cover rounded"
|
|
28
|
+
}) : /* @__PURE__ */ React.createElement("div", {
|
|
29
|
+
className: "h-full w-full bg-surface-hover rounded flex items-center justify-center"
|
|
30
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
31
|
+
icon: "ph--play--fill",
|
|
32
|
+
size: 12
|
|
33
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
34
|
+
className: "absolute inset-0 flex items-center justify-center bg-black/30 group-hover:bg-black/50 rounded transition-colors"
|
|
35
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
36
|
+
className: "bg-red-600 text-white rounded-full p-3 group-hover:scale-110 transition-transform"
|
|
37
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
38
|
+
icon: "ph--play--fill",
|
|
39
|
+
size: 6
|
|
40
|
+
})))), /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement(Card.IconBlock, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
41
|
+
icon: "ph--youtube-logo--regular",
|
|
42
|
+
size: 5
|
|
43
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
44
|
+
className: "flex gap-3 items-center justify-between col-span-2"
|
|
45
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
46
|
+
className: "grow truncate font-medium"
|
|
47
|
+
}, video.title), /* @__PURE__ */ React.createElement("span", {
|
|
48
|
+
className: "text-xs text-description text-right whitespace-nowrap pe-2"
|
|
49
|
+
}, publishedDate))), /* @__PURE__ */ React.createElement(Card.Row, null, /* @__PURE__ */ React.createElement("span", {
|
|
50
|
+
className: "text-xs text-description"
|
|
51
|
+
}, video.channelTitle)), video.description && /* @__PURE__ */ React.createElement(Card.Row, null, /* @__PURE__ */ React.createElement(Card.Text, {
|
|
52
|
+
variant: "description"
|
|
53
|
+
}, video.description.slice(0, 150), "...")), /* @__PURE__ */ React.createElement(Card.Row, null, /* @__PURE__ */ React.createElement("div", {
|
|
54
|
+
className: "flex gap-2 items-center text-xs text-description"
|
|
55
|
+
}, video.viewCount !== void 0 && /* @__PURE__ */ React.createElement("span", null, video.viewCount.toLocaleString(), " views"), hasTranscript && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", null, "\u2022"), /* @__PURE__ */ React.createElement("span", {
|
|
56
|
+
className: "text-green-600"
|
|
57
|
+
}, "Transcript available")))));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/containers/VideoCard/index.ts
|
|
61
|
+
var VideoCard_default = VideoCard;
|
|
62
|
+
export {
|
|
63
|
+
VideoCard_default as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=VideoCard-FOWQZK75.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/VideoCard/VideoCard.tsx", "../../../src/containers/VideoCard/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Card, Icon } from '@dxos/react-ui';\n\nimport * as Video from '../../types/Video';\n\nexport type VideoCardProps = SurfaceComponentProps<Video.YouTubeVideo>;\n\n/**\n * YouTube video card with embedded player.\n */\nexport const VideoCard = ({ subject: video }: VideoCardProps) => {\n const [showPlayer, setShowPlayer] = useState(false);\n const publishedDate = new Date(video.publishedAt).toLocaleDateString();\n const hasTranscript = Boolean(video.transcript);\n\n const embedUrl = `https://www.youtube.com/embed/${video.videoId}?autoplay=1`;\n\n return (\n <Card.Content>\n {showPlayer ? (\n <div className='aspect-video w-full'>\n <iframe\n src={embedUrl}\n title={video.title}\n allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'\n allowFullScreen\n className='h-full w-full rounded'\n />\n </div>\n ) : (\n <button\n type='button'\n onClick={() => setShowPlayer(true)}\n className='relative aspect-video w-full group cursor-pointer'\n >\n {video.thumbnailUrl ? (\n <img src={video.thumbnailUrl} alt={video.title} className='h-full w-full object-cover rounded' />\n ) : (\n <div className='h-full w-full bg-surface-hover rounded flex items-center justify-center'>\n <Icon icon='ph--play--fill' size={12} />\n </div>\n )}\n <div className='absolute inset-0 flex items-center justify-center bg-black/30 group-hover:bg-black/50 rounded transition-colors'>\n <div className='bg-red-600 text-white rounded-full p-3 group-hover:scale-110 transition-transform'>\n <Icon icon='ph--play--fill' size={6} />\n </div>\n </div>\n </button>\n )}\n <Card.Toolbar>\n <Card.IconBlock>\n <Icon icon='ph--youtube-logo--regular' size={5} />\n </Card.IconBlock>\n <div className='flex gap-3 items-center justify-between col-span-2'>\n <span className='grow truncate font-medium'>{video.title}</span>\n <span className='text-xs text-description text-right whitespace-nowrap pe-2'>{publishedDate}</span>\n </div>\n </Card.Toolbar>\n <Card.Row>\n <span className='text-xs text-description'>{video.channelTitle}</span>\n </Card.Row>\n {video.description && (\n <Card.Row>\n <Card.Text variant='description'>{video.description.slice(0, 150)}...</Card.Text>\n </Card.Row>\n )}\n <Card.Row>\n <div className='flex gap-2 items-center text-xs text-description'>\n {video.viewCount !== undefined && <span>{video.viewCount.toLocaleString()} views</span>}\n {hasTranscript && (\n <>\n <span>•</span>\n <span className='text-green-600'>Transcript available</span>\n </>\n )}\n </div>\n </Card.Row>\n </Card.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { VideoCard } from './VideoCard';\n\nexport default VideoCard;\n"],
|
|
5
|
+
"mappings": ";;;;AAIA,OAAOA,SAASC,gBAAgB;AAGhC,SAASC,MAAMC,YAAY;AASpB,IAAMC,YAAY,CAAC,EAAEC,SAASC,MAAK,MAAkB;AAC1D,QAAM,CAACC,YAAYC,aAAAA,IAAiBC,SAAS,KAAA;AAC7C,QAAMC,gBAAgB,IAAIC,KAAKL,MAAMM,WAAW,EAAEC,mBAAkB;AACpE,QAAMC,gBAAgBC,QAAQT,MAAMU,UAAU;AAE9C,QAAMC,WAAW,iCAAiCX,MAAMY,OAAO;AAE/D,SACE,sBAAA,cAACC,KAAKC,SAAO,MACVb,aACC,sBAAA,cAACc,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACC,UAAAA;IACCC,KAAKP;IACLQ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AA,UAAA,MACE,sBAAA,cAACyB,QAAAA,MAAK,QAAA,GACN,sBAAA,cAACA,QAAAA;IAAKjB,WAAU;KAAiB,sBAAA,CAAA,CAAA,CAAA,CAAA;AAO/C;;;AC/EA,IAAA,oBAAe2B;",
|
|
6
|
+
"names": ["React", "useState", "Card", "Icon", "VideoCard", "subject", "video", "showPlayer", "setShowPlayer", "useState", "publishedDate", "Date", "publishedAt", "toLocaleDateString", "hasTranscript", "Boolean", "transcript", "embedUrl", "videoId", "Card", "Content", "div", "className", "iframe", "src", "title", "allow", "allowFullScreen", "button", "type", "onClick", "thumbnailUrl", "img", "alt", "Icon", "icon", "size", "Toolbar", "IconBlock", "span", "Row", "channelTitle", "description", "Text", "variant", "slice", "viewCount", "undefined", "toLocaleString", "VideoCard"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
meta
|
|
4
|
+
} from "./chunk-CX6MV3QM.mjs";
|
|
5
|
+
import "./chunk-M4S6BE47.mjs";
|
|
6
|
+
import "./chunk-JM5SBBP5.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ClearSyncedVideos,
|
|
9
|
+
Sync
|
|
10
|
+
} from "./chunk-JSGRZMG3.mjs";
|
|
11
|
+
import {
|
|
12
|
+
Channel_exports
|
|
13
|
+
} from "./chunk-6BUJ2DQX.mjs";
|
|
14
|
+
import "./chunk-CZSLL3XQ.mjs";
|
|
15
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
16
|
+
|
|
17
|
+
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
18
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
19
|
+
import * as Effect from "effect/Effect";
|
|
20
|
+
import * as Option from "effect/Option";
|
|
21
|
+
import { Capability } from "@dxos/app-framework";
|
|
22
|
+
import { AppCapabilities, companionSegment, LayoutOperation } from "@dxos/app-toolkit";
|
|
23
|
+
import { Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
24
|
+
import { AtomQuery, AtomRef } from "@dxos/echo-atom";
|
|
25
|
+
import { invariant } from "@dxos/invariant";
|
|
26
|
+
import { log } from "@dxos/log";
|
|
27
|
+
import { Operation } from "@dxos/operation";
|
|
28
|
+
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
29
|
+
import { AutomationCapabilities, invokeFunctionWithTracing } from "@dxos/plugin-automation";
|
|
30
|
+
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
31
|
+
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
32
|
+
var __dxlog_file = "/Users/mykola/dev/dxos/packages/plugins/plugin-youtube/src/capabilities/app-graph-builder/app-graph-builder.ts";
|
|
33
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
34
|
+
const selectionManager = yield* Capability.get(AttentionCapabilities.Selection);
|
|
35
|
+
const selectedId = Atom.family((nodeId) => Atom.make((get) => {
|
|
36
|
+
const state = get(selectionManager.state);
|
|
37
|
+
const selection = state.selections[nodeId];
|
|
38
|
+
return selection?.mode === "single" ? selection.id : void 0;
|
|
39
|
+
}));
|
|
40
|
+
const whenYouTubeChannel = NodeMatcher.whenEchoType(Channel_exports.YouTubeChannel);
|
|
41
|
+
const extensions = yield* Effect.all([
|
|
42
|
+
GraphBuilder.createExtension({
|
|
43
|
+
id: `${meta.id}.channel-video`,
|
|
44
|
+
match: (node) => Channel_exports.instanceOf(node.data) ? Option.some({
|
|
45
|
+
channel: node.data,
|
|
46
|
+
nodeId: node.id
|
|
47
|
+
}) : Option.none(),
|
|
48
|
+
connector: (matched, get) => {
|
|
49
|
+
const channel = matched.channel;
|
|
50
|
+
const db = Obj.getDatabase(channel);
|
|
51
|
+
const feed = channel.feed ? get(AtomRef.make(channel.feed)) : void 0;
|
|
52
|
+
if (!db || !feed) {
|
|
53
|
+
return Effect.succeed([]);
|
|
54
|
+
}
|
|
55
|
+
const videoId = get(selectedId(matched.nodeId));
|
|
56
|
+
const video = get(AtomQuery.make(db, Query.select(videoId ? Filter.id(videoId) : Filter.nothing()).from(feed)))[0];
|
|
57
|
+
return Effect.succeed([
|
|
58
|
+
{
|
|
59
|
+
id: companionSegment("video"),
|
|
60
|
+
type: PLANK_COMPANION_TYPE,
|
|
61
|
+
data: video ?? "video",
|
|
62
|
+
properties: {
|
|
63
|
+
label: [
|
|
64
|
+
"video label",
|
|
65
|
+
{
|
|
66
|
+
ns: meta.id
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
icon: "ph--play--regular",
|
|
70
|
+
disposition: "hidden"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
GraphBuilder.createExtension({
|
|
77
|
+
id: `${meta.id}.sync-channel`,
|
|
78
|
+
match: whenYouTubeChannel,
|
|
79
|
+
actions: (channel) => Effect.succeed([
|
|
80
|
+
{
|
|
81
|
+
id: "sync",
|
|
82
|
+
data: Effect.fnUntraced(function* () {
|
|
83
|
+
const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
84
|
+
const db = Obj.getDatabase(channel);
|
|
85
|
+
invariant(db, void 0, {
|
|
86
|
+
F: __dxlog_file,
|
|
87
|
+
L: 83,
|
|
88
|
+
S: this,
|
|
89
|
+
A: [
|
|
90
|
+
"db",
|
|
91
|
+
""
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
const runtime = computeRuntime.getRuntime(db.spaceId);
|
|
95
|
+
yield* Effect.tryPromise(() => runtime.runPromise(invokeFunctionWithTracing(Sync, {
|
|
96
|
+
channel: Ref.make(channel)
|
|
97
|
+
}))).pipe(Effect.catchAll((error) => {
|
|
98
|
+
log.catch(error, void 0, {
|
|
99
|
+
F: __dxlog_file,
|
|
100
|
+
L: 93,
|
|
101
|
+
S: this,
|
|
102
|
+
C: (f, a) => f(...a)
|
|
103
|
+
});
|
|
104
|
+
return Operation.invoke(LayoutOperation.AddToast, {
|
|
105
|
+
id: `${meta.id}.sync-channel-error`,
|
|
106
|
+
icon: "ph--warning--regular",
|
|
107
|
+
duration: 5e3,
|
|
108
|
+
title: [
|
|
109
|
+
"sync channel error title",
|
|
110
|
+
{
|
|
111
|
+
ns: meta.id
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
closeLabel: [
|
|
115
|
+
"close label",
|
|
116
|
+
{
|
|
117
|
+
ns: meta.id
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}));
|
|
122
|
+
}),
|
|
123
|
+
properties: {
|
|
124
|
+
label: [
|
|
125
|
+
"sync channel label",
|
|
126
|
+
{
|
|
127
|
+
ns: meta.id
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
icon: "ph--arrows-clockwise--regular",
|
|
131
|
+
disposition: "list-item"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: "clear-synced-videos",
|
|
136
|
+
data: Effect.fnUntraced(function* () {
|
|
137
|
+
const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
138
|
+
const db = Obj.getDatabase(channel);
|
|
139
|
+
invariant(db, void 0, {
|
|
140
|
+
F: __dxlog_file,
|
|
141
|
+
L: 115,
|
|
142
|
+
S: this,
|
|
143
|
+
A: [
|
|
144
|
+
"db",
|
|
145
|
+
""
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
const runtime = computeRuntime.getRuntime(db.spaceId);
|
|
149
|
+
yield* Effect.tryPromise(() => runtime.runPromise(invokeFunctionWithTracing(ClearSyncedVideos, {
|
|
150
|
+
channel: Ref.make(channel)
|
|
151
|
+
}))).pipe(Effect.catchAll((error) => {
|
|
152
|
+
log.catch(error, void 0, {
|
|
153
|
+
F: __dxlog_file,
|
|
154
|
+
L: 125,
|
|
155
|
+
S: this,
|
|
156
|
+
C: (f, a) => f(...a)
|
|
157
|
+
});
|
|
158
|
+
return Operation.invoke(LayoutOperation.AddToast, {
|
|
159
|
+
id: `${meta.id}.clear-synced-videos-error`,
|
|
160
|
+
icon: "ph--warning--regular",
|
|
161
|
+
duration: 5e3,
|
|
162
|
+
title: [
|
|
163
|
+
"clear synced videos error title",
|
|
164
|
+
{
|
|
165
|
+
ns: meta.id
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
closeLabel: [
|
|
169
|
+
"close label",
|
|
170
|
+
{
|
|
171
|
+
ns: meta.id
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
}));
|
|
176
|
+
}),
|
|
177
|
+
properties: {
|
|
178
|
+
label: [
|
|
179
|
+
"clear synced videos label",
|
|
180
|
+
{
|
|
181
|
+
ns: meta.id
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
icon: "ph--trash--regular",
|
|
185
|
+
disposition: "list-item"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
])
|
|
189
|
+
})
|
|
190
|
+
]);
|
|
191
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
192
|
+
}));
|
|
193
|
+
export {
|
|
194
|
+
app_graph_builder_default as default
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=app-graph-builder-IU5TBAXN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, companionSegment, LayoutOperation } from '@dxos/app-toolkit';\nimport { type Feed, Filter, Obj, Query, Ref } from '@dxos/echo';\nimport { AtomQuery, AtomRef } from '@dxos/echo-atom';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { Operation } from '@dxos/operation';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { AutomationCapabilities, invokeFunctionWithTracing } from '@dxos/plugin-automation';\nimport { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { ClearSyncedVideos, Sync } from '../../operations';\nimport { meta } from '../../meta';\nimport { Channel, Video } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const selectionManager = yield* Capability.get(AttentionCapabilities.Selection);\n const selectedId = Atom.family((nodeId: string) =>\n Atom.make((get) => {\n const state = get(selectionManager.state);\n const selection = state.selections[nodeId];\n return selection?.mode === 'single' ? selection.id : undefined;\n }),\n );\n\n const whenYouTubeChannel = NodeMatcher.whenEchoType(Channel.YouTubeChannel);\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}.channel-video`,\n match: (node) =>\n Channel.instanceOf(node.data) ? Option.some({ channel: node.data, nodeId: node.id }) : Option.none(),\n connector: (matched, get) => {\n const channel = matched.channel;\n const db = Obj.getDatabase(channel);\n const feed = channel.feed ? (get(AtomRef.make(channel.feed)) as Feed.Feed | undefined) : undefined;\n if (!db || !feed) {\n return Effect.succeed([]);\n }\n\n const videoId = get(selectedId(matched.nodeId));\n const video = get(\n AtomQuery.make<Video.YouTubeVideo>(\n db,\n Query.select(videoId ? Filter.id(videoId) : Filter.nothing()).from(feed),\n ),\n )[0];\n return Effect.succeed([\n {\n id: companionSegment('video'),\n type: PLANK_COMPANION_TYPE,\n data: video ?? 'video',\n properties: {\n label: ['video label', { ns: meta.id }],\n icon: 'ph--play--regular',\n disposition: 'hidden',\n },\n },\n ]);\n },\n }),\n\n GraphBuilder.createExtension({\n id: `${meta.id}.sync-channel`,\n match: whenYouTubeChannel,\n actions: (channel) =>\n Effect.succeed([\n {\n id: 'sync',\n data: Effect.fnUntraced(function* () {\n const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);\n const db = Obj.getDatabase(channel);\n invariant(db);\n const runtime = computeRuntime.getRuntime(db.spaceId);\n yield* Effect.tryPromise(() =>\n runtime.runPromise(\n invokeFunctionWithTracing(Sync, {\n channel: Ref.make(channel),\n }),\n ),\n ).pipe(\n Effect.catchAll((error) => {\n log.catch(error);\n return Operation.invoke(LayoutOperation.AddToast, {\n id: `${meta.id}.sync-channel-error`,\n icon: 'ph--warning--regular',\n duration: 5_000,\n title: ['sync channel error title', { ns: meta.id }],\n closeLabel: ['close label', { ns: meta.id }],\n });\n }),\n );\n }),\n properties: {\n label: ['sync channel label', { ns: meta.id }],\n icon: 'ph--arrows-clockwise--regular',\n disposition: 'list-item',\n },\n },\n {\n id: 'clear-synced-videos',\n data: Effect.fnUntraced(function* () {\n const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);\n const db = Obj.getDatabase(channel);\n invariant(db);\n const runtime = computeRuntime.getRuntime(db.spaceId);\n yield* Effect.tryPromise(() =>\n runtime.runPromise(\n invokeFunctionWithTracing(ClearSyncedVideos, {\n channel: Ref.make(channel),\n }),\n ),\n ).pipe(\n Effect.catchAll((error) => {\n log.catch(error);\n return Operation.invoke(LayoutOperation.AddToast, {\n id: `${meta.id}.clear-synced-videos-error`,\n icon: 'ph--warning--regular',\n duration: 5_000,\n title: ['clear synced videos error title', { ns: meta.id }],\n closeLabel: ['close label', { ns: meta.id }],\n });\n }),\n );\n }),\n properties: {\n label: ['clear synced videos label', { ns: meta.id }],\n icon: 'ph--trash--regular',\n disposition: 'list-item',\n },\n },\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,kBAAkBC,uBAAuB;AACnE,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AG;;YAC5CyC,MAAM;YACNC,aAAa;UACf;QACF;QACA;UACE1C,IAAI;UACJe,MAAa7B,kBAAW,aAAA;AACtB,kBAAM0D,iBAAiB,OAAO5D,WAAWI,IAAIyD,uBAAuBC,cAAc;AAClF,kBAAMzB,KAAKC,IAAIC,YAAYN,OAAAA;AAC3B8B,sBAAU1B,IAAAA,QAAAA;;;;;;;;;AACV,kBAAM2B,UAAUJ,eAAeK,WAAW5B,GAAG6B,OAAO;AACpD,mBAAcC,kBAAW,MACvBH,QAAQI,WACNC,0BAA0Be,mBAAmB;cAC3CnD,SAASsC,IAAI5D,KAAKsB,OAAAA;YACpB,CAAA,CAAA,CAAA,EAEFuC,KACOC,gBAAS,CAACC,UAAAA;AACfC,kBAAIC,MAAMF,OAAAA,QAAAA;;;;;;AACV,qBAAOG,UAAUC,OAAOC,gBAAgBC,UAAU;gBAChDhE,IAAI,GAAGW,KAAKX,EAAE;gBACdyC,MAAM;gBACNwB,UAAU;gBACVC,OAAO;kBAAC;kBAAmC;oBAAE1B,IAAI7B,KAAKX;kBAAG;;gBACzDmE,YAAY;kBAAC;kBAAe;oBAAE3B,IAAI7B,KAAKX;kBAAG;;cAC5C,CAAA;YACF,CAAA,CAAA;UAEJ,CAAA;UACAsC,YAAY;YACVC,OAAO;cAAC;cAA6B;gBAAEC,IAAI7B,KAAKX;cAAG;;YACnDyC,MAAM;YACNC,aAAa;UACf;QACF;OACD;IACL,CAAA;GACD;AAED,SAAO1D,WAAWqF,YAAYC,gBAAgBC,iBAAiBhE,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
+
"names": ["Atom", "Effect", "Option", "Capability", "AppCapabilities", "companionSegment", "LayoutOperation", "Filter", "Obj", "Query", "Ref", "AtomQuery", "AtomRef", "invariant", "log", "Operation", "AttentionCapabilities", "AutomationCapabilities", "invokeFunctionWithTracing", "PLANK_COMPANION_TYPE", "GraphBuilder", "NodeMatcher", "Capability", "makeModule", "fnUntraced", "selectionManager", "get", "AttentionCapabilities", "Selection", "selectedId", "Atom", "family", "nodeId", "make", "state", "selection", "selections", "mode", "id", "undefined", "whenYouTubeChannel", "NodeMatcher", "whenEchoType", "Channel", "YouTubeChannel", "extensions", "all", "GraphBuilder", "createExtension", "meta", "match", "node", "instanceOf", "data", "some", "channel", "none", "connector", "matched", "db", "Obj", "getDatabase", "feed", "AtomRef", "succeed", "videoId", "video", "AtomQuery", "Query", "select", "Filter", "nothing", "from", "companionSegment", "type", "PLANK_COMPANION_TYPE", "properties", "label", "ns", "icon", "disposition", "actions", "computeRuntime", "AutomationCapabilities", "ComputeRuntime", "invariant", "runtime", "getRuntime", "spaceId", "tryPromise", "runPromise", "invokeFunctionWithTracing", "Sync", "Ref", "pipe", "catchAll", "error", "log", "catch", "Operation", "invoke", "LayoutOperation", "AddToast", "duration", "title", "closeLabel", "ClearSyncedVideos", "contributes", "AppCapabilities", "AppGraphBuilder"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
youtube_default
|
|
4
|
+
} from "./chunk-5KNC2JMP.mjs";
|
|
5
|
+
import "./chunk-M4S6BE47.mjs";
|
|
6
|
+
import "./chunk-JM5SBBP5.mjs";
|
|
7
|
+
import "./chunk-JSGRZMG3.mjs";
|
|
8
|
+
import "./chunk-6BUJ2DQX.mjs";
|
|
9
|
+
import "./chunk-CZSLL3XQ.mjs";
|
|
10
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
11
|
+
|
|
12
|
+
// src/capabilities/blueprint-definition/blueprint-definition.ts
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import { Capability } from "@dxos/app-framework";
|
|
15
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
16
|
+
var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
|
|
17
|
+
Capability.contributes(AppCapabilities.BlueprintDefinition, youtube_default)
|
|
18
|
+
]));
|
|
19
|
+
var blueprint_definition_default = blueprintDefinition;
|
|
20
|
+
export {
|
|
21
|
+
blueprint_definition_default as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=blueprint-definition-W264MZ3D.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { YouTubeBlueprint } from '../../blueprints';\n\nconst blueprintDefinition = Capability.makeModule<\n [],\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, YouTubeBlueprint)]));\n\nexport default blueprintDefinition;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,IAAMC,sBAAsBC,WAAWC,WAGrC,MAAaC,eAAQ;EAACF,WAAWG,YAAYC,gBAAgBC,qBAAqBC,eAAAA;CAAkB,CAAA;AAEtG,IAAA,+BAAeP;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "blueprintDefinition", "Capability", "makeModule", "succeed", "contributes", "AppCapabilities", "BlueprintDefinition", "YouTubeBlueprint"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
youtube_default
|
|
4
|
+
} from "../chunk-5KNC2JMP.mjs";
|
|
5
|
+
import "../chunk-M4S6BE47.mjs";
|
|
6
|
+
import "../chunk-JM5SBBP5.mjs";
|
|
7
|
+
import "../chunk-JSGRZMG3.mjs";
|
|
8
|
+
import "../chunk-6BUJ2DQX.mjs";
|
|
9
|
+
import "../chunk-CZSLL3XQ.mjs";
|
|
10
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
11
|
+
export {
|
|
12
|
+
youtube_default as YouTubeBlueprint
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ClearSyncedVideos,
|
|
4
|
+
Sync
|
|
5
|
+
} from "./chunk-JSGRZMG3.mjs";
|
|
6
|
+
|
|
7
|
+
// src/blueprints/youtube.ts
|
|
8
|
+
import { Blueprint, Template } from "@dxos/blueprints";
|
|
9
|
+
import { trim } from "@dxos/util";
|
|
10
|
+
var BLUEPRINT_KEY = "dxos.org/blueprint/youtube";
|
|
11
|
+
var make = () => Blueprint.make({
|
|
12
|
+
key: BLUEPRINT_KEY,
|
|
13
|
+
name: "YouTube",
|
|
14
|
+
tools: Blueprint.toolDefinitions({
|
|
15
|
+
operations: [
|
|
16
|
+
Sync,
|
|
17
|
+
ClearSyncedVideos
|
|
18
|
+
],
|
|
19
|
+
tools: []
|
|
20
|
+
}),
|
|
21
|
+
instructions: Template.make({
|
|
22
|
+
source: trim`
|
|
23
|
+
You manage YouTube channel subscriptions and video content.
|
|
24
|
+
|
|
25
|
+
# Summary formatting:
|
|
26
|
+
- Format summaries as markdown documents without extra comments.
|
|
27
|
+
- Use markdown formatting for headings and bullet points.
|
|
28
|
+
- Format video summaries as lists with key points.
|
|
29
|
+
|
|
30
|
+
# References
|
|
31
|
+
- Use references to objects in the form of:
|
|
32
|
+
@dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M
|
|
33
|
+
- References are rendered as rich content in the response to the user.
|
|
34
|
+
|
|
35
|
+
# Video Analysis
|
|
36
|
+
When analyzing videos:
|
|
37
|
+
- Summarize the key topics and themes.
|
|
38
|
+
- Extract important quotes or statements.
|
|
39
|
+
- Identify action items or recommendations.
|
|
40
|
+
- Note any timestamps for important sections.
|
|
41
|
+
|
|
42
|
+
# Transcript Usage
|
|
43
|
+
- Videos may include transcripts that can be used for deeper analysis.
|
|
44
|
+
- When summarizing content, reference the transcript for accuracy.
|
|
45
|
+
- Transcripts include timestamps that can help locate specific content.
|
|
46
|
+
`
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
var blueprint = {
|
|
50
|
+
key: BLUEPRINT_KEY,
|
|
51
|
+
make
|
|
52
|
+
};
|
|
53
|
+
var youtube_default = blueprint;
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
youtube_default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-5KNC2JMP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/youtube.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { trim } from '@dxos/util';\n\nimport { ClearSyncedVideos, Sync } from '../operations';\n\nconst BLUEPRINT_KEY = 'dxos.org/blueprint/youtube';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'YouTube',\n tools: Blueprint.toolDefinitions({ operations: [Sync, ClearSyncedVideos], tools: [] }),\n instructions: Template.make({\n source: trim`\n You manage YouTube channel subscriptions and video content.\n\n # Summary formatting:\n - Format summaries as markdown documents without extra comments.\n - Use markdown formatting for headings and bullet points.\n - Format video summaries as lists with key points.\n\n # References\n - Use references to objects in the form of:\n @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M\n - References are rendered as rich content in the response to the user.\n\n # Video Analysis\n When analyzing videos:\n - Summarize the key topics and themes.\n - Extract important quotes or statements.\n - Identify action items or recommendations.\n - Note any timestamps for important sections.\n\n # Transcript Usage\n - Videos may include transcripts that can be used for deeper analysis.\n - When summarizing content, reference the transcript for accuracy.\n - Transcripts include timestamps that can help locate specific content.\n `,\n }),\n });\n\nconst blueprint: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAIrB,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKH;EACLI,MAAM;EACNC,OAAOH,UAAUI,gBAAgB;IAAEC,YAAY;MAACC;MAAMC;;IAAoBJ,OAAO,CAAA;EAAG,CAAA;EACpFK,cAAcC,SAASV,KAAK;IAC1BW,QAAQC;;;;;;;;;;;;;;;;;;;;;;;;;EAyBV,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDX,KAAKH;EACLC;AACF;AAEA,IAAA,kBAAea;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "operations", "Sync", "ClearSyncedVideos", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
+
}
|