@dxos/plugin-youtube 0.8.3 → 0.8.4-main.74a063c4e0

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.
Files changed (156) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +49 -8
  2. package/dist/lib/browser/blueprints/index.mjs.map +4 -4
  3. package/dist/lib/browser/{chunk-C26XKDK2.mjs → chunk-FEQD5TPI.mjs} +4 -4
  4. package/dist/lib/browser/{chunk-C26XKDK2.mjs.map → chunk-FEQD5TPI.mjs.map} +2 -2
  5. package/dist/lib/browser/{chunk-P67QEKBQ.mjs → chunk-GIRFSTHR.mjs} +6 -8
  6. package/dist/lib/browser/chunk-GIRFSTHR.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-GTIWG45H.mjs +157 -0
  8. package/dist/lib/browser/chunk-GTIWG45H.mjs.map +7 -0
  9. package/dist/lib/browser/{clear-synced-videos-EVMJIZPD.mjs → clear-synced-videos-NZIWAVGL.mjs} +7 -8
  10. package/dist/lib/browser/clear-synced-videos-NZIWAVGL.mjs.map +7 -0
  11. package/dist/lib/browser/index.mjs +86 -81
  12. package/dist/lib/browser/index.mjs.map +4 -4
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/{sync-423Q4BDD.mjs → sync-T34US6NO.mjs} +18 -19
  15. package/dist/lib/browser/sync-T34US6NO.mjs.map +7 -0
  16. package/dist/lib/browser/types/index.mjs +2 -4
  17. package/dist/lib/node-esm/blueprints/index.mjs +49 -8
  18. package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/{chunk-JSGRZMG3.mjs → chunk-A3SKNJFU.mjs} +6 -8
  20. package/dist/lib/node-esm/chunk-A3SKNJFU.mjs.map +7 -0
  21. package/dist/lib/node-esm/{chunk-JM5SBBP5.mjs → chunk-Q3TVMR5B.mjs} +4 -4
  22. package/dist/lib/node-esm/{chunk-JM5SBBP5.mjs.map → chunk-Q3TVMR5B.mjs.map} +2 -2
  23. package/dist/lib/node-esm/chunk-YOE54ALJ.mjs +158 -0
  24. package/dist/lib/node-esm/chunk-YOE54ALJ.mjs.map +7 -0
  25. package/dist/lib/node-esm/{clear-synced-videos-5UCH6XHL.mjs → clear-synced-videos-ZX7KBPGS.mjs} +7 -8
  26. package/dist/lib/{browser/clear-synced-videos-EVMJIZPD.mjs.map → node-esm/clear-synced-videos-ZX7KBPGS.mjs.map} +2 -2
  27. package/dist/lib/node-esm/index.mjs +86 -81
  28. package/dist/lib/node-esm/index.mjs.map +4 -4
  29. package/dist/lib/node-esm/meta.json +1 -1
  30. package/dist/lib/node-esm/{sync-CEF5DX2J.mjs → sync-RQYQ5LII.mjs} +18 -19
  31. package/dist/lib/node-esm/sync-RQYQ5LII.mjs.map +7 -0
  32. package/dist/lib/node-esm/types/index.mjs +2 -4
  33. package/dist/types/src/YouTubePlugin.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  35. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/index.d.ts +5 -3
  37. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  39. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  41. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +1 -1
  42. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -1
  43. package/dist/types/src/containers/ChannelArticle/index.d.ts +1 -2
  44. package/dist/types/src/containers/ChannelArticle/index.d.ts.map +1 -1
  45. package/dist/types/src/containers/ChannelSettings/index.d.ts +1 -2
  46. package/dist/types/src/containers/ChannelSettings/index.d.ts.map +1 -1
  47. package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts +2 -7
  48. package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts.map +1 -1
  49. package/dist/types/src/containers/VideoArticle/index.d.ts +1 -2
  50. package/dist/types/src/containers/VideoArticle/index.d.ts.map +1 -1
  51. package/dist/types/src/containers/VideoCard/VideoCard.d.ts +2 -2
  52. package/dist/types/src/containers/VideoCard/VideoCard.d.ts.map +1 -1
  53. package/dist/types/src/containers/VideoCard/index.d.ts +1 -2
  54. package/dist/types/src/containers/VideoCard/index.d.ts.map +1 -1
  55. package/dist/types/src/operations/apis/youtube/api.d.ts.map +1 -1
  56. package/dist/types/src/operations/clear-synced-videos.d.ts.map +1 -1
  57. package/dist/types/src/operations/definitions.d.ts +9 -5
  58. package/dist/types/src/operations/definitions.d.ts.map +1 -1
  59. package/dist/types/src/operations/sync.d.ts.map +1 -1
  60. package/dist/types/src/translations.d.ts +38 -38
  61. package/dist/types/src/translations.d.ts.map +1 -1
  62. package/dist/types/src/types/Channel.d.ts +28 -3
  63. package/dist/types/src/types/Channel.d.ts.map +1 -1
  64. package/dist/types/src/types/Video.d.ts +22 -0
  65. package/dist/types/src/types/Video.d.ts.map +1 -1
  66. package/dist/types/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +48 -40
  68. package/src/YouTubePlugin.tsx +12 -6
  69. package/src/blueprints/youtube.ts +1 -1
  70. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +29 -33
  71. package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +1 -1
  72. package/src/capabilities/index.ts +7 -4
  73. package/src/capabilities/migrations.ts +35 -0
  74. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +16 -18
  75. package/src/containers/ChannelArticle/ChannelArticle.tsx +1 -1
  76. package/src/containers/ChannelArticle/index.ts +1 -3
  77. package/src/containers/ChannelSettings/index.ts +1 -3
  78. package/src/containers/VideoArticle/VideoArticle.tsx +2 -7
  79. package/src/containers/VideoArticle/index.ts +1 -3
  80. package/src/containers/VideoCard/VideoCard.tsx +2 -2
  81. package/src/containers/VideoCard/index.ts +1 -3
  82. package/src/operations/apis/youtube/api.ts +0 -1
  83. package/src/operations/clear-synced-videos.ts +0 -1
  84. package/src/operations/definitions.ts +3 -3
  85. package/src/operations/sync.ts +0 -1
  86. package/src/translations.ts +38 -38
  87. package/src/types/Channel.ts +18 -1
  88. package/src/types/Video.ts +25 -1
  89. package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs +0 -90
  90. package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs.map +0 -7
  91. package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs +0 -28
  92. package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs.map +0 -7
  93. package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs +0 -76
  94. package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs.map +0 -7
  95. package/dist/lib/browser/VideoCard-CCPXDCB7.mjs +0 -64
  96. package/dist/lib/browser/VideoCard-CCPXDCB7.mjs.map +0 -7
  97. package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs +0 -195
  98. package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs.map +0 -7
  99. package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs +0 -22
  100. package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs.map +0 -7
  101. package/dist/lib/browser/chunk-DFRSBBSO.mjs +0 -21
  102. package/dist/lib/browser/chunk-DFRSBBSO.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-GFRR4TTX.mjs +0 -72
  104. package/dist/lib/browser/chunk-GFRR4TTX.mjs.map +0 -7
  105. package/dist/lib/browser/chunk-MUE22YUM.mjs +0 -57
  106. package/dist/lib/browser/chunk-MUE22YUM.mjs.map +0 -7
  107. package/dist/lib/browser/chunk-P67QEKBQ.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-YMDT37TA.mjs +0 -62
  109. package/dist/lib/browser/chunk-YMDT37TA.mjs.map +0 -7
  110. package/dist/lib/browser/chunk-Z3DGTMKC.mjs +0 -8
  111. package/dist/lib/browser/chunk-Z3DGTMKC.mjs.map +0 -7
  112. package/dist/lib/browser/react-surface-EDA5VYDC.mjs +0 -77
  113. package/dist/lib/browser/react-surface-EDA5VYDC.mjs.map +0 -7
  114. package/dist/lib/browser/sync-423Q4BDD.mjs.map +0 -7
  115. package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs +0 -91
  116. package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs.map +0 -7
  117. package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs +0 -29
  118. package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs.map +0 -7
  119. package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs +0 -77
  120. package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs.map +0 -7
  121. package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs +0 -65
  122. package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs.map +0 -7
  123. package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs +0 -196
  124. package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs.map +0 -7
  125. package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs +0 -23
  126. package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs.map +0 -7
  127. package/dist/lib/node-esm/chunk-5KNC2JMP.mjs +0 -58
  128. package/dist/lib/node-esm/chunk-5KNC2JMP.mjs.map +0 -7
  129. package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs +0 -73
  130. package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs.map +0 -7
  131. package/dist/lib/node-esm/chunk-CX6MV3QM.mjs +0 -23
  132. package/dist/lib/node-esm/chunk-CX6MV3QM.mjs.map +0 -7
  133. package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs +0 -63
  134. package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs.map +0 -7
  135. package/dist/lib/node-esm/chunk-JSGRZMG3.mjs.map +0 -7
  136. package/dist/lib/node-esm/chunk-M4S6BE47.mjs +0 -10
  137. package/dist/lib/node-esm/chunk-M4S6BE47.mjs.map +0 -7
  138. package/dist/lib/node-esm/clear-synced-videos-5UCH6XHL.mjs.map +0 -7
  139. package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs +0 -78
  140. package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs.map +0 -7
  141. package/dist/lib/node-esm/sync-CEF5DX2J.mjs.map +0 -7
  142. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  143. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  144. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  145. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  146. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  147. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  148. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  149. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  150. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  151. package/src/capabilities/app-graph-builder/index.ts +0 -7
  152. package/src/capabilities/blueprint-definition/index.ts +0 -7
  153. package/src/capabilities/react-surface/index.ts +0 -7
  154. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  155. /package/dist/types/src/capabilities/{blueprint-definition/blueprint-definition.d.ts → blueprint-definition.d.ts} +0 -0
  156. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
@@ -1,7 +0,0 @@
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,SAAS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AAG;;cAC5C,CAAA;YACF,CAAA,CAAA;UAEJ,CAAA;UACAsC,YAAY;YACVC,OAAO;cAAC;cAAsB;gBAAEC,IAAI7B,KAAKX;cAAG;;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
- }
@@ -1,23 +0,0 @@
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
@@ -1,7 +0,0 @@
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
- }
@@ -1,58 +0,0 @@
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
@@ -1,7 +0,0 @@
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
- }
@@ -1,73 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- __export
4
- } from "./chunk-HSLMI22Q.mjs";
5
-
6
- // src/types/types.ts
7
- var YouTubeOperation = {};
8
-
9
- // src/types/Channel.ts
10
- var Channel_exports = {};
11
- __export(Channel_exports, {
12
- CreateYouTubeChannelSchema: () => CreateYouTubeChannelSchema,
13
- YouTubeChannel: () => YouTubeChannel,
14
- instanceOf: () => instanceOf,
15
- make: () => make
16
- });
17
- import * as Schema from "effect/Schema";
18
- import { Annotation, Feed, Obj, Ref, Type } from "@dxos/echo";
19
- import { FormInputAnnotation } from "@dxos/echo/internal";
20
- import { FeedAnnotation } from "@dxos/schema";
21
- import { AccessToken } from "@dxos/types";
22
- var YouTubeChannel = Schema.Struct({
23
- /** Display name for the channel. */
24
- name: Schema.String.pipe(Schema.optional),
25
- /** YouTube channel ID (e.g., UC...). */
26
- channelId: Schema.String.pipe(Schema.optional),
27
- /** YouTube channel URL or handle. */
28
- channelUrl: Schema.String.pipe(Schema.optional),
29
- /** Feed containing YouTubeVideo objects. */
30
- feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),
31
- /** Last sync timestamp. */
32
- lastSyncedAt: Schema.String.pipe(FormInputAnnotation.set(false), Schema.optional),
33
- /** Google API credentials for fetching channel data. */
34
- accessToken: Schema.optional(Ref.Ref(AccessToken.AccessToken).annotations({
35
- title: "Account",
36
- description: "Google account credentials for syncing this YouTube channel."
37
- }))
38
- }).pipe(Type.object({
39
- typename: "org.dxos.type.youtube-channel",
40
- version: "0.1.0"
41
- }), Annotation.IconAnnotation.set({
42
- icon: "ph--youtube-logo--regular",
43
- hue: "red"
44
- }), FeedAnnotation.set(true));
45
- var instanceOf = (value) => Obj.instanceOf(YouTubeChannel, value);
46
- var CreateYouTubeChannelSchema = Schema.Struct({
47
- name: Schema.optional(Schema.String.annotations({
48
- title: "Name"
49
- })),
50
- channelUrl: Schema.optional(Schema.String.annotations({
51
- title: "Channel URL",
52
- description: "YouTube channel URL, handle (e.g., @channelname), or channel ID."
53
- })),
54
- accessToken: Schema.optional(Ref.Ref(AccessToken.AccessToken).annotations({
55
- title: "Account",
56
- description: "Google account credentials for syncing this YouTube channel."
57
- }))
58
- });
59
- var make = (props = {}) => {
60
- const feed = Feed.make();
61
- const channel = Obj.make(YouTubeChannel, {
62
- feed: Ref.make(feed),
63
- ...props
64
- });
65
- Obj.setParent(feed, channel);
66
- return channel;
67
- };
68
-
69
- export {
70
- YouTubeOperation,
71
- Channel_exports
72
- };
73
- //# sourceMappingURL=chunk-6BUJ2DQX.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/types.ts", "../../../src/types/Channel.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * YouTube plugin operations (placeholder for future expansion).\n */\nexport const YouTubeOperation = {\n // Operations will be defined here when needed.\n} as const;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Feed, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { FeedAnnotation } from '@dxos/schema';\nimport { AccessToken } from '@dxos/types';\n\n// @import-as-namespace\n\n/**\n * YouTubeChannel schema representing a YouTube channel to sync videos from.\n */\nexport const YouTubeChannel = Schema.Struct({\n /** Display name for the channel. */\n name: Schema.String.pipe(Schema.optional),\n /** YouTube channel ID (e.g., UC...). */\n channelId: Schema.String.pipe(Schema.optional),\n /** YouTube channel URL or handle. */\n channelUrl: Schema.String.pipe(Schema.optional),\n /** Feed containing YouTubeVideo objects. */\n feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),\n /** Last sync timestamp. */\n lastSyncedAt: Schema.String.pipe(FormInputAnnotation.set(false), Schema.optional),\n /** Google API credentials for fetching channel data. */\n accessToken: Schema.optional(\n Ref.Ref(AccessToken.AccessToken).annotations({\n title: 'Account',\n description: 'Google account credentials for syncing this YouTube channel.',\n }),\n ),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.youtube-channel',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--youtube-logo--regular',\n hue: 'red',\n }),\n FeedAnnotation.set(true),\n);\n\nexport interface YouTubeChannel extends Schema.Schema.Type<typeof YouTubeChannel> {}\n\n/** Checks if a value is a YouTubeChannel object. */\nexport const instanceOf = (value: unknown): value is YouTubeChannel => Obj.instanceOf(YouTubeChannel, value);\n\nexport const CreateYouTubeChannelSchema = Schema.Struct({\n name: Schema.optional(Schema.String.annotations({ title: 'Name' })),\n channelUrl: Schema.optional(\n Schema.String.annotations({\n title: 'Channel URL',\n description: 'YouTube channel URL, handle (e.g., @channelname), or channel ID.',\n }),\n ),\n accessToken: Schema.optional(\n Ref.Ref(AccessToken.AccessToken).annotations({\n title: 'Account',\n description: 'Google account credentials for syncing this YouTube channel.',\n }),\n ),\n});\nexport interface CreateYouTubeChannelSchema extends Schema.Schema.Type<typeof CreateYouTubeChannelSchema> {}\n\ntype YouTubeChannelProps = Omit<Obj.MakeProps<typeof YouTubeChannel>, 'feed' | 'lastSyncedAt'>;\n\n/** Creates a YouTubeChannel object with a backing feed. */\nexport const make = (props: YouTubeChannelProps = {}) => {\n const feed = Feed.make();\n const channel = Obj.make(YouTubeChannel, {\n feed: Ref.make(feed),\n ...props,\n });\n Obj.setParent(feed, channel);\n return channel;\n};\n"],
5
- "mappings": ";;;;;;AAOO,IAAMA,mBAAmB,CAEhC;;;ACTA;;;;;;;AAIA,YAAYC,YAAY;AAExB,SAASC,YAAYC,MAAMC,KAAKC,KAAKC,YAAY;AACjD,SAASC,2BAA2B;AACpC,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAOrB,IAAMC,iBAAwBC,cAAO;;EAE1CC,MAAaC,cAAOC,KAAYC,eAAQ;;EAExCC,WAAkBH,cAAOC,KAAYC,eAAQ;;EAE7CE,YAAmBJ,cAAOC,KAAYC,eAAQ;;EAE9CG,MAAMC,IAAIA,IAAIC,KAAKA,IAAI,EAAEN,KAAKO,oBAAoBC,IAAI,KAAA,CAAA;;EAEtDC,cAAqBV,cAAOC,KAAKO,oBAAoBC,IAAI,KAAA,GAAeP,eAAQ;;EAEhFS,aAAoBT,gBAClBI,IAAIA,IAAIM,YAAYA,WAAW,EAAEC,YAAY;IAC3CC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA,EAAGd,KACDe,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,eAAeZ,IAAI;EAC5Ba,MAAM;EACNC,KAAK;AACP,CAAA,GACAC,eAAef,IAAI,IAAA,CAAA;AAMd,IAAMgB,aAAa,CAACC,UAA4CC,IAAIF,WAAW5B,gBAAgB6B,KAAAA;AAE/F,IAAME,6BAAoC9B,cAAO;EACtDC,MAAaG,gBAAgBF,cAAOa,YAAY;IAAEC,OAAO;EAAO,CAAA,CAAA;EAChEV,YAAmBF,gBACVF,cAAOa,YAAY;IACxBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;EAEFJ,aAAoBT,gBAClBI,IAAIA,IAAIM,YAAYA,WAAW,EAAEC,YAAY;IAC3CC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA;AAMO,IAAMc,OAAO,CAACC,QAA6B,CAAC,MAAC;AAClD,QAAMzB,OAAOE,KAAKsB,KAAI;AACtB,QAAME,UAAUJ,IAAIE,KAAKhC,gBAAgB;IACvCQ,MAAMC,IAAIuB,KAAKxB,IAAAA;IACf,GAAGyB;EACL,CAAA;AACAH,MAAIK,UAAU3B,MAAM0B,OAAAA;AACpB,SAAOA;AACT;",
6
- "names": ["YouTubeOperation", "Schema", "Annotation", "Feed", "Obj", "Ref", "Type", "FormInputAnnotation", "FeedAnnotation", "AccessToken", "YouTubeChannel", "Struct", "name", "String", "pipe", "optional", "channelId", "channelUrl", "feed", "Ref", "Feed", "FormInputAnnotation", "set", "lastSyncedAt", "accessToken", "AccessToken", "annotations", "title", "description", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "icon", "hue", "FeedAnnotation", "instanceOf", "value", "Obj", "CreateYouTubeChannelSchema", "make", "props", "channel", "setParent"]
7
- }
@@ -1,23 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/meta.ts
4
- import { trim } from "@dxos/util";
5
- var meta = {
6
- id: "org.dxos.plugin.youtube",
7
- name: "YouTube",
8
- description: trim`
9
- YouTube channel subscription and video feed management.
10
- Sync videos from channels and access transcripts for analysis.
11
- `,
12
- icon: "ph--youtube-logo--regular",
13
- iconHue: "red",
14
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-youtube",
15
- tags: [
16
- "labs"
17
- ]
18
- };
19
-
20
- export {
21
- meta
22
- };
23
- //# sourceMappingURL=chunk-CX6MV3QM.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.youtube',\n name: 'YouTube',\n description: trim`\n YouTube channel subscription and video feed management.\n Sync videos from channels and access transcripts for analysis.\n `,\n icon: 'ph--youtube-logo--regular',\n iconHue: 'red',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-youtube',\n tags: ['labs'],\n};\n"],
5
- "mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "tags"]
7
- }
@@ -1,63 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- __export
4
- } from "./chunk-HSLMI22Q.mjs";
5
-
6
- // src/types/Video.ts
7
- var Video_exports = {};
8
- __export(Video_exports, {
9
- TranscriptSegment: () => TranscriptSegment,
10
- YouTubeVideo: () => YouTubeVideo,
11
- instanceOf: () => instanceOf
12
- });
13
- import * as Schema from "effect/Schema";
14
- import { Annotation, Obj, Type } from "@dxos/echo";
15
- var TranscriptSegment = Schema.Struct({
16
- /** Transcript text. */
17
- text: Schema.String,
18
- /** Start time in seconds. */
19
- offset: Schema.Number,
20
- /** Duration in seconds. */
21
- duration: Schema.Number
22
- });
23
- var YouTubeVideo = Schema.Struct({
24
- /** Video title. */
25
- title: Schema.String,
26
- /** YouTube video ID. */
27
- videoId: Schema.String,
28
- /** Video description. */
29
- description: Schema.String.pipe(Schema.optional),
30
- /** Video URL. */
31
- url: Schema.String,
32
- /** Thumbnail URL. */
33
- thumbnailUrl: Schema.String.pipe(Schema.optional),
34
- /** Channel name. */
35
- channelTitle: Schema.String.pipe(Schema.optional),
36
- /** Published date as ISO string. */
37
- publishedAt: Schema.String,
38
- /** Video duration in ISO 8601 format (e.g., PT1H30M15S). */
39
- duration: Schema.String.pipe(Schema.optional),
40
- /** View count. */
41
- viewCount: Schema.Number.pipe(Schema.optional),
42
- /** Like count. */
43
- likeCount: Schema.Number.pipe(Schema.optional),
44
- /** Full transcript text. */
45
- transcript: Schema.String.pipe(Schema.optional),
46
- /** Transcript segments with timestamps. */
47
- transcriptSegments: Schema.Array(TranscriptSegment).pipe(Schema.optional),
48
- /** True when transcript text was successfully loaded; false when disabled or none available. */
49
- transcriptFetched: Schema.Boolean.pipe(Schema.optional)
50
- }).pipe(Type.object({
51
- typename: "org.dxos.type.youtube-video",
52
- version: "0.1.0"
53
- }), Annotation.IconAnnotation.set({
54
- icon: "ph--play--regular",
55
- hue: "red"
56
- }));
57
- var instanceOf = (value) => Obj.instanceOf(YouTubeVideo, value);
58
-
59
- export {
60
- YouTubeVideo,
61
- Video_exports
62
- };
63
- //# sourceMappingURL=chunk-CZSLL3XQ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Video.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\n\n/**\n * Transcript segment from a YouTube video.\n */\nexport const TranscriptSegment = Schema.Struct({\n /** Transcript text. */\n text: Schema.String,\n /** Start time in seconds. */\n offset: Schema.Number,\n /** Duration in seconds. */\n duration: Schema.Number,\n});\n\nexport type TranscriptSegment = Schema.Schema.Type<typeof TranscriptSegment>;\n\n/**\n * YouTubeVideo schema representing a video from a YouTube channel.\n */\nexport const YouTubeVideo = Schema.Struct({\n /** Video title. */\n title: Schema.String,\n /** YouTube video ID. */\n videoId: Schema.String,\n /** Video description. */\n description: Schema.String.pipe(Schema.optional),\n /** Video URL. */\n url: Schema.String,\n /** Thumbnail URL. */\n thumbnailUrl: Schema.String.pipe(Schema.optional),\n /** Channel name. */\n channelTitle: Schema.String.pipe(Schema.optional),\n /** Published date as ISO string. */\n publishedAt: Schema.String,\n /** Video duration in ISO 8601 format (e.g., PT1H30M15S). */\n duration: Schema.String.pipe(Schema.optional),\n /** View count. */\n viewCount: Schema.Number.pipe(Schema.optional),\n /** Like count. */\n likeCount: Schema.Number.pipe(Schema.optional),\n /** Full transcript text. */\n transcript: Schema.String.pipe(Schema.optional),\n /** Transcript segments with timestamps. */\n transcriptSegments: Schema.Array(TranscriptSegment).pipe(Schema.optional),\n /** True when transcript text was successfully loaded; false when disabled or none available. */\n transcriptFetched: Schema.Boolean.pipe(Schema.optional),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.youtube-video',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--play--regular',\n hue: 'red',\n }),\n);\n\nexport interface YouTubeVideo extends Schema.Schema.Type<typeof YouTubeVideo> {}\n\n/** Checks if a value is a YouTubeVideo object. */\nexport const instanceOf = (value: unknown): value is YouTubeVideo => Obj.instanceOf(YouTubeVideo, value);\n"],
5
- "mappings": ";;;;;;AAAA;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AAK/B,IAAMC,oBAA2BC,cAAO;;EAE7CC,MAAaC;;EAEbC,QAAeC;;EAEfC,UAAiBD;AACnB,CAAA;AAOO,IAAME,eAAsBN,cAAO;;EAExCO,OAAcL;;EAEdM,SAAgBN;;EAEhBO,aAAoBP,cAAOQ,KAAYC,eAAQ;;EAE/CC,KAAYV;;EAEZW,cAAqBX,cAAOQ,KAAYC,eAAQ;;EAEhDG,cAAqBZ,cAAOQ,KAAYC,eAAQ;;EAEhDI,aAAoBb;;EAEpBG,UAAiBH,cAAOQ,KAAYC,eAAQ;;EAE5CK,WAAkBZ,cAAOM,KAAYC,eAAQ;;EAE7CM,WAAkBb,cAAOM,KAAYC,eAAQ;;EAE7CO,YAAmBhB,cAAOQ,KAAYC,eAAQ;;EAE9CQ,oBAA2BC,aAAMrB,iBAAAA,EAAmBW,KAAYC,eAAQ;;EAExEU,mBAA0BC,eAAQZ,KAAYC,eAAQ;AACxD,CAAA,EAAGD,KACDa,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,eAAeC,IAAI;EAC5BC,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAMK,IAAMC,aAAa,CAACC,UAA0CC,IAAIF,WAAW1B,cAAc2B,KAAAA;",
6
- "names": ["Schema", "Annotation", "Obj", "Type", "TranscriptSegment", "Struct", "text", "String", "offset", "Number", "duration", "YouTubeVideo", "title", "videoId", "description", "pipe", "optional", "url", "thumbnailUrl", "channelTitle", "publishedAt", "viewCount", "likeCount", "transcript", "transcriptSegments", "Array", "transcriptFetched", "Boolean", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "set", "icon", "hue", "instanceOf", "value", "Obj"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Operation } from '@dxos/operation';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Feed, Ref } from '@dxos/echo';\nimport { CredentialsService } from '@dxos/functions';\n\nimport { Channel, Video } from '../types';\n\nexport const Sync = Operation.make({\n meta: {\n key: 'dxos.org/function/youtube/sync',\n name: 'Sync YouTube Channel',\n description: 'Sync videos from a YouTube channel to the feed.',\n },\n input: Schema.Struct({\n channel: Ref.Ref(Channel.YouTubeChannel).annotations({\n description: 'Reference to the YouTube channel to sync videos from.',\n }),\n restrictedMode: Schema.Boolean.pipe(\n Schema.annotations({\n description:\n 'Use restricted mode to limit to max 20 videos. Reduces API calls. Useful for testing or quick syncs.',\n }),\n Schema.optional,\n ),\n includeTranscripts: Schema.Boolean.pipe(\n Schema.annotations({\n description:\n 'Whether to fetch transcripts: Data API when your account can manage the video, otherwise watch-page captions (browser uses a public CORS proxy for YouTube fetches).',\n }),\n Schema.optional,\n ),\n }),\n output: Schema.Struct({\n newVideos: Schema.Number,\n channelTitle: Schema.String.pipe(Schema.optional),\n }),\n types: [Channel.YouTubeChannel, Video.YouTubeVideo],\n services: [Database.Service, Feed.Service, CredentialsService],\n});\n\nexport const ClearSyncedVideos = Operation.make({\n meta: {\n key: 'dxos.org/function/youtube/clear-synced-videos',\n name: 'Clear Synced YouTube Videos',\n description: 'Remove all synced videos from the channel by replacing its feed with a new empty feed.',\n },\n input: Schema.Struct({\n channel: Ref.Ref(Channel.YouTubeChannel).annotations({\n description: 'Reference to the YouTube channel whose synced videos should be cleared.',\n }),\n }),\n output: Schema.Struct({\n removedVideos: Schema.Number,\n }),\n types: [Channel.YouTubeChannel, Video.YouTubeVideo],\n services: [Database.Service, Feed.Service],\n});\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,iBAAiB;AAC1B,YAAYC,YAAY;AAExB,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,0BAA0B;AAI5B,IAAMC,OAAOC,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,SAASC,IAAIA,IAAIC,gBAAQC,cAAc,EAAEC,YAAY;MACnDP,aAAa;IACf,CAAA;IACAQ,gBAAuBC,eAAQC,KACtBH,mBAAY;MACjBP,aACE;IACJ,CAAA,GACOW,eAAQ;IAEjBC,oBAA2BH,eAAQC,KAC1BH,mBAAY;MACjBP,aACE;IACJ,CAAA,GACOW,eAAQ;EAEnB,CAAA;EACAE,QAAeX,cAAO;IACpBY,WAAkBC;IAClBC,cAAqBC,cAAOP,KAAYC,eAAQ;EAClD,CAAA;EACAO,OAAO;IAACb,gBAAQC;IAAgBa,cAAMC;;EACtCC,UAAU;IAACC,SAASC;IAASC,KAAKD;IAASE;;AAC7C,CAAA;AAEO,IAAMC,oBAAoB/B,UAAUC,KAAK;EAC9CC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,SAASC,IAAIA,IAAIC,gBAAQC,cAAc,EAAEC,YAAY;MACnDP,aAAa;IACf,CAAA;EACF,CAAA;EACAa,QAAeX,cAAO;IACpByB,eAAsBZ;EACxB,CAAA;EACAG,OAAO;IAACb,gBAAQC;IAAgBa,cAAMC;;EACtCC,UAAU;IAACC,SAASC;IAASC,KAAKD;;AACpC,CAAA;",
6
- "names": ["Operation", "Schema", "Database", "Feed", "Ref", "CredentialsService", "Sync", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "channel", "Ref", "Channel", "YouTubeChannel", "annotations", "restrictedMode", "Boolean", "pipe", "optional", "includeTranscripts", "output", "newVideos", "Number", "channelTitle", "String", "types", "Video", "YouTubeVideo", "services", "Database", "Service", "Feed", "CredentialsService", "ClearSyncedVideos", "removedVideos"]
7
- }
@@ -1,10 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/operations/index.ts
4
- import { OperationHandlerSet } from "@dxos/operation";
5
- var YouTubeHandlers = OperationHandlerSet.lazy(() => import("./clear-synced-videos-5UCH6XHL.mjs"), () => import("./sync-CEF5DX2J.mjs"));
6
-
7
- export {
8
- YouTubeHandlers
9
- };
10
- //# sourceMappingURL=chunk-M4S6BE47.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/operation';\n\nexport { YouTube } from './apis';\nexport * from './definitions';\n\nexport const YouTubeHandlers = OperationHandlerSet.lazy(\n () => import('./clear-synced-videos'),\n () => import('./sync'),\n);\n"],
5
- "mappings": ";;;AAIA,SAASA,2BAA2B;AAK7B,IAAMC,kBAAkBC,oBAAoBC,KACjD,MAAM,OAAO,oCAAA,GACb,MAAM,OAAO,qBAAA,CAAA;",
6
- "names": ["OperationHandlerSet", "YouTubeHandlers", "OperationHandlerSet", "lazy"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/clear-synced-videos.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';\nimport { log } from '@dxos/log';\nimport { Operation } from '@dxos/operation';\n\nimport { Channel, Video } from '../types';\n\nimport { ClearSyncedVideos } from './definitions';\n\nconst handler: Operation.WithHandler<typeof ClearSyncedVideos> = ClearSyncedVideos.pipe(\n Operation.withHandler(({ channel: channelRef }) =>\n Effect.gen(function* () {\n log('clearing youtube channel synced videos', { channel: channelRef.dxn.toString() });\n const channel = (yield* Database.load(channelRef)) as Channel.YouTubeChannel;\n const oldFeed = yield* Database.load(channel.feed as Ref.Ref<Feed.Feed>);\n\n const videos = yield* Feed.runQuery(oldFeed, Filter.type(Video.YouTubeVideo));\n log('removing synced videos', { count: videos.length });\n\n const newFeed = Feed.make();\n yield* Database.add(newFeed);\n Obj.setParent(newFeed, channel);\n\n Obj.change(channel, (mutable) => {\n mutable.feed = Ref.make(newFeed);\n delete mutable.lastSyncedAt;\n });\n\n if (videos.length > 0) {\n yield* Feed.remove(oldFeed, videos);\n }\n\n for (const video of videos) {\n yield* Database.remove(video);\n }\n\n yield* Database.remove(oldFeed);\n\n log('replaced youtube channel feed', { removedVideos: videos.length });\n return { removedVideos: videos.length };\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,UAAUC,MAAMC,QAAQC,KAAKC,WAAW;AACjD,SAASC,WAAW;AACpB,SAASC,iBAAiB;;AAM1B,IAAMC,UAA2DC,kBAAkBC,KACjFC,UAAUC,YAAY,CAAC,EAAEC,SAASC,WAAU,MACnCC,WAAI,aAAA;AACTC,MAAI,0CAA0C;IAAEH,SAASC,WAAWG,IAAIC,SAAQ;EAAG,GAAA;;;;;;AACnF,QAAML,UAAW,OAAOM,SAASC,KAAKN,UAAAA;AACtC,QAAMO,UAAU,OAAOF,SAASC,KAAKP,QAAQS,IAAI;AAEjD,QAAMC,SAAS,OAAOC,KAAKC,SAASJ,SAASK,OAAOC,KAAKC,cAAMC,YAAY,CAAA;AAC3Eb,MAAI,0BAA0B;IAAEc,OAAOP,OAAOQ;EAAO,GAAA;;;;;;AAErD,QAAMC,UAAUR,KAAKS,KAAI;AACzB,SAAOd,SAASe,IAAIF,OAAAA;AACpBG,MAAIC,UAAUJ,SAASnB,OAAAA;AAEvBsB,MAAIE,OAAOxB,SAAS,CAACyB,YAAAA;AACnBA,YAAQhB,OAAOiB,IAAIN,KAAKD,OAAAA;AACxB,WAAOM,QAAQE;EACjB,CAAA;AAEA,MAAIjB,OAAOQ,SAAS,GAAG;AACrB,WAAOP,KAAKiB,OAAOpB,SAASE,MAAAA;EAC9B;AAEA,aAAWmB,SAASnB,QAAQ;AAC1B,WAAOJ,SAASsB,OAAOC,KAAAA;EACzB;AAEA,SAAOvB,SAASsB,OAAOpB,OAAAA;AAEvBL,MAAI,iCAAiC;IAAE2B,eAAepB,OAAOQ;EAAO,GAAA;;;;;;AACpE,SAAO;IAAEY,eAAepB,OAAOQ;EAAO;AACxC,CAAA,CAAA,CAAA;AAIJ,IAAA,8BAAevB;",
6
- "names": ["Effect", "Database", "Feed", "Filter", "Obj", "Ref", "log", "Operation", "handler", "ClearSyncedVideos", "pipe", "Operation", "withHandler", "channel", "channelRef", "gen", "log", "dxn", "toString", "Database", "load", "oldFeed", "feed", "videos", "Feed", "runQuery", "Filter", "type", "Video", "YouTubeVideo", "count", "length", "newFeed", "make", "add", "Obj", "setParent", "change", "mutable", "Ref", "lastSyncedAt", "remove", "video", "removedVideos"]
7
- }
@@ -1,78 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-CX6MV3QM.mjs";
5
- import {
6
- Channel_exports
7
- } from "./chunk-6BUJ2DQX.mjs";
8
- import {
9
- Video_exports
10
- } from "./chunk-CZSLL3XQ.mjs";
11
- import "./chunk-HSLMI22Q.mjs";
12
-
13
- // src/capabilities/react-surface/react-surface.tsx
14
- import * as Effect from "effect/Effect";
15
- import React from "react";
16
- import { Capabilities, Capability } from "@dxos/app-framework";
17
- import { Surface } from "@dxos/app-framework/ui";
18
-
19
- // src/containers/index.ts
20
- import { lazy } from "react";
21
- var ChannelArticle = lazy(() => import("./ChannelArticle-GQ64BO7V.mjs"));
22
- var ChannelSettings = lazy(() => import("./ChannelSettings-DM2HWNKO.mjs"));
23
- var VideoArticle = lazy(() => import("./VideoArticle-WLTWZO3K.mjs"));
24
- var VideoCard = lazy(() => import("./VideoCard-FOWQZK75.mjs"));
25
-
26
- // src/capabilities/react-surface/react-surface.tsx
27
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
28
- Surface.create({
29
- id: `${meta.id}.channel`,
30
- role: [
31
- "article"
32
- ],
33
- filter: (data) => Channel_exports.instanceOf(data.subject),
34
- component: ({ data }) => {
35
- return /* @__PURE__ */ React.createElement(ChannelArticle, {
36
- subject: data.subject,
37
- attendableId: data.attendableId
38
- });
39
- }
40
- }),
41
- Surface.create({
42
- id: `${meta.id}.video`,
43
- role: [
44
- "article",
45
- "section"
46
- ],
47
- filter: (data) => typeof data.attendableId === "string" && Video_exports.instanceOf(data.subject) && Channel_exports.instanceOf(data.companionTo),
48
- component: ({ data: { attendableId, companionTo, subject }, role }) => {
49
- return /* @__PURE__ */ React.createElement(VideoArticle, {
50
- role,
51
- subject,
52
- channel: companionTo,
53
- attendableId
54
- });
55
- }
56
- }),
57
- Surface.create({
58
- id: `${meta.id}.video-card`,
59
- role: "card--content",
60
- filter: (data) => Video_exports.instanceOf(data?.subject),
61
- component: ({ data: { subject }, role }) => /* @__PURE__ */ React.createElement(VideoCard, {
62
- subject,
63
- role
64
- })
65
- }),
66
- Surface.create({
67
- id: `${meta.id}.channel.companion.settings`,
68
- role: "object-settings",
69
- filter: (data) => Channel_exports.instanceOf(data.subject),
70
- component: ({ data }) => /* @__PURE__ */ React.createElement(ChannelSettings, {
71
- subject: data.subject
72
- })
73
- })
74
- ])));
75
- export {
76
- react_surface_default as default
77
- };
78
- //# sourceMappingURL=react-surface-5DJAQPHJ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\n\nimport { ChannelArticle, ChannelSettings, VideoArticle, VideoCard } from '../../containers';\nimport { meta } from '../../meta';\nimport { Channel, Video } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: `${meta.id}.channel`,\n role: ['article'],\n filter: (data): data is { attendableId?: string; subject: Channel.YouTubeChannel } =>\n Channel.instanceOf(data.subject),\n component: ({ data }) => {\n return <ChannelArticle subject={data.subject} attendableId={data.attendableId} />;\n },\n }),\n Surface.create({\n id: `${meta.id}.video`,\n role: ['article', 'section'],\n filter: (\n data,\n ): data is { attendableId: string; subject: Video.YouTubeVideo; companionTo: Channel.YouTubeChannel } =>\n typeof data.attendableId === 'string' &&\n Video.instanceOf(data.subject) &&\n Channel.instanceOf(data.companionTo),\n component: ({ data: { attendableId, companionTo, subject }, role }) => {\n return <VideoArticle role={role} subject={subject} channel={companionTo} attendableId={attendableId} />;\n },\n }),\n Surface.create({\n id: `${meta.id}.video-card`,\n role: 'card--content',\n filter: (data): data is { subject: Video.YouTubeVideo } => Video.instanceOf(data?.subject),\n component: ({ data: { subject }, role }) => <VideoCard subject={subject} role={role} />,\n }),\n Surface.create({\n id: `${meta.id}.channel.companion.settings`,\n role: 'object-settings',\n filter: (data): data is { subject: Channel.YouTubeChannel } => Channel.instanceOf(data.subject),\n component: ({ data }) => <ChannelSettings subject={data.subject} />,\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ComponentType, lazy, type LazyExoticComponent } from 'react';\n\nimport type { ChannelArticleProps } from './ChannelArticle/ChannelArticle';\nimport type { ChannelSettingsProps } from './ChannelSettings/ChannelSettings';\nimport type { VideoArticleProps } from './VideoArticle/VideoArticle';\nimport type { VideoCardProps } from './VideoCard/VideoCard';\n\nexport type { ChannelArticleProps, ChannelSettingsProps, VideoArticleProps, VideoCardProps };\n\nexport const ChannelArticle: LazyExoticComponent<ComponentType<ChannelArticleProps>> = lazy(\n () => import('./ChannelArticle'),\n);\n\nexport const ChannelSettings: LazyExoticComponent<ComponentType<ChannelSettingsProps>> = lazy(\n () => import('./ChannelSettings'),\n);\n\nexport const VideoArticle: LazyExoticComponent<ComponentType<VideoArticleProps>> = lazy(() => import('./VideoArticle'));\n\nexport const VideoCard: LazyExoticComponent<ComponentType<VideoCardProps>> = lazy(() => import('./VideoCard'));\n"],
5
- "mappings": ";;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;;;ACJxB,SAA6BC,YAAsC;AAS5D,IAAMC,iBAA0EC,KACrF,MAAM,OAAO,+BAAA,CAAA;AAGR,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AW,CAAC,EAAEJ,KAAI,MAAO,sBAAA,cAACY,iBAAAA;MAAgBT,SAASH,KAAKG;;EAC1D,CAAA;CACD,CAAA,CAAA;",
6
- "names": ["Effect", "React", "Capabilities", "Capability", "Surface", "lazy", "ChannelArticle", "lazy", "ChannelSettings", "VideoArticle", "VideoCard", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Channel", "instanceOf", "subject", "component", "ChannelArticle", "attendableId", "Video", "companionTo", "VideoArticle", "channel", "VideoCard", "ChannelSettings"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/sync.ts", "../../../src/operations/transcript.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as FetchHttpClient from '@effect/platform/FetchHttpClient';\nimport * as Chunk from 'effect/Chunk';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Predicate from 'effect/Predicate';\nimport * as Stream from 'effect/Stream';\n\nimport { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';\nimport { log } from '@dxos/log';\nimport { Operation } from '@dxos/operation';\n\nimport { Channel, Video } from '../types';\n\nimport { YouTube } from './apis';\nimport { Sync } from './definitions';\nimport { GoogleCredentials } from './services/google-credentials';\nimport { fetchTranscript } from './transcript';\n\nconst handler: Operation.WithHandler<typeof Sync> = Sync.pipe(\n Operation.withHandler(({ channel: channelRef, restrictedMode = false, includeTranscripts = true }) =>\n Effect.gen(function* () {\n log('syncing youtube channel', { channel: channelRef.dxn.toString(), restrictedMode, includeTranscripts });\n const channel = yield* Database.load(channelRef);\n\n const channelUrl =\n (channel as Channel.YouTubeChannel).channelUrl ?? (channel as Channel.YouTubeChannel).channelId;\n if (!channelUrl) {\n return yield* Effect.fail(new Error('No channel URL or ID configured'));\n }\n\n const channelInfo = extractChannelInfo(channelUrl);\n log('extracted channel info', channelInfo);\n\n const { channelId, channelTitle, uploadsPlaylistId } = yield* getUploadsPlaylistId(channelInfo);\n log('found channel', { channelId, channelTitle, uploadsPlaylistId });\n\n Obj.change(channel as Channel.YouTubeChannel, (channelObj) => {\n channelObj.channelId = channelId;\n if (!channelObj.name) {\n channelObj.name = channelTitle;\n }\n });\n\n // Get the feed and query for existing videos.\n const feed = yield* Database.load((channel as Channel.YouTubeChannel).feed as Ref.Ref<Feed.Feed>);\n const existingVideos = yield* Feed.runQuery(feed, Filter.type(Video.YouTubeVideo));\n const existingVideoIds = new Set(existingVideos.map((video: Video.YouTubeVideo) => video.videoId));\n log('existing videos', { count: existingVideoIds.size });\n\n const newVideosCount = yield* streamVideosToFeed(\n uploadsPlaylistId,\n feed,\n existingVideoIds,\n restrictedMode,\n includeTranscripts,\n );\n\n Obj.change(channel as Channel.YouTubeChannel, (channelObj) => {\n channelObj.lastSyncedAt = new Date().toISOString();\n });\n\n log('sync complete', { newVideos: newVideosCount, channelTitle });\n return {\n newVideos: newVideosCount,\n channelTitle,\n };\n }).pipe(Effect.provide(Layer.mergeAll(FetchHttpClient.layer, GoogleCredentials.fromChannelRef(channelRef)))),\n ),\n);\n\nconst STREAMING_CONFIG = {\n /** Videos per page from YouTube API. */\n maxResults: 50,\n /** Parallel transcript fetches. */\n transcriptFetchConcurrency: 3,\n /** In-flight video buffer. */\n bufferSize: 10,\n /** Videos per feed append. */\n feedBatchSize: 10,\n /** Max videos in restricted mode. */\n restrictedMax: 20,\n} as const;\n\n/**\n * Extracts channel ID from various YouTube URL formats.\n */\nconst extractChannelInfo = (\n urlOrHandle: string,\n): { type: 'id'; value: string } | { type: 'handle'; value: string } | { type: 'url'; value: string } => {\n const trimmed = urlOrHandle.trim();\n\n if (trimmed.startsWith('@')) {\n return { type: 'handle', value: trimmed.slice(1) };\n }\n\n if (trimmed.startsWith('UC') && trimmed.length === 24) {\n return { type: 'id', value: trimmed };\n }\n\n try {\n const url = new URL(trimmed);\n const pathname = url.pathname;\n\n if (pathname.startsWith('/channel/')) {\n const channelId = pathname.split('/')[2];\n if (channelId) {\n return { type: 'id', value: channelId };\n }\n }\n\n if (pathname.startsWith('/@')) {\n return { type: 'handle', value: pathname.slice(2) };\n }\n\n if (pathname.startsWith('/c/') || pathname.startsWith('/user/')) {\n const name = pathname.split('/')[2];\n if (name) {\n return { type: 'handle', value: name };\n }\n }\n } catch {\n if (/^[a-zA-Z0-9_-]+$/.test(trimmed)) {\n return { type: 'handle', value: trimmed };\n }\n }\n\n return { type: 'url', value: trimmed };\n};\n\n/**\n * Gets the uploads playlist ID for a channel.\n */\nconst getUploadsPlaylistId = Effect.fn(function* (channelInfo: { type: string; value: string }) {\n let channelResponse;\n\n if (channelInfo.type === 'id') {\n channelResponse = yield* YouTube.getChannel(channelInfo.value);\n } else {\n channelResponse = yield* YouTube.getChannelByHandle(channelInfo.value);\n }\n\n const channel = channelResponse.items[0];\n if (!channel) {\n return yield* Effect.fail(new Error(`Channel not found: ${channelInfo.value}`));\n }\n\n const uploadsPlaylistId = channel.contentDetails?.relatedPlaylists?.uploads;\n if (!uploadsPlaylistId) {\n return yield* Effect.fail(new Error(`No uploads playlist found for channel: ${channelInfo.value}`));\n }\n\n return {\n channelId: channel.id,\n channelTitle: channel.snippet?.title ?? '',\n uploadsPlaylistId,\n };\n});\n\n/**\n * Fetches videos from an uploads playlist, returning them from newest to oldest.\n */\nconst fetchPlaylistVideos = (uploadsPlaylistId: string, maxVideos?: number) => {\n let videoCount = 0;\n\n return Stream.unfoldChunkEffect({ pageToken: Option.none<string>(), done: false }, (state) =>\n Effect.gen(function* () {\n if (state.done || (maxVideos && videoCount >= maxVideos)) {\n return Option.none();\n }\n\n const response = yield* YouTube.listPlaylistItems(\n uploadsPlaylistId,\n STREAMING_CONFIG.maxResults,\n Option.getOrUndefined(state.pageToken),\n );\n\n const videoIds = response.items\n .map((item) => item.snippet?.resourceId?.videoId)\n .filter((id): id is string => Boolean(id));\n\n log('fetched playlist items', {\n count: videoIds.length,\n pageToken: Option.getOrUndefined(state.pageToken),\n hasMore: Boolean(response.nextPageToken),\n });\n\n videoCount += videoIds.length;\n\n const nextState = {\n pageToken: Option.fromNullable(response.nextPageToken),\n done: !response.nextPageToken || (maxVideos !== undefined && videoCount >= maxVideos),\n };\n\n return Option.some([Chunk.fromIterable(videoIds), nextState]);\n }),\n );\n};\n\ntype TranscriptData = { segments: Video.TranscriptSegment[]; fullText: string };\n\n/**\n * Maps YouTube API video item to YouTubeVideo data.\n */\nconst mapVideoData = (\n item: YouTube.VideoItem,\n transcript: TranscriptData | undefined,\n includeTranscripts: boolean,\n): Omit<Video.YouTubeVideo, 'id' | '~@dxos/echo/Kind'> => {\n const hasTranscript = Boolean(transcript?.fullText?.trim());\n return {\n title: item.snippet?.title ?? 'Untitled',\n videoId: item.id,\n description: item.snippet?.description,\n url: `https://www.youtube.com/watch?v=${item.id}`,\n thumbnailUrl:\n item.snippet?.thumbnails?.high?.url ??\n item.snippet?.thumbnails?.medium?.url ??\n item.snippet?.thumbnails?.default?.url,\n channelTitle: item.snippet?.channelTitle,\n publishedAt: item.snippet?.publishedAt ?? new Date().toISOString(),\n duration: item.contentDetails?.duration,\n viewCount: item.statistics?.viewCount ? parseInt(item.statistics.viewCount, 10) : undefined,\n likeCount: item.statistics?.likeCount ? parseInt(item.statistics.likeCount, 10) : undefined,\n transcript: transcript && hasTranscript ? transcript.fullText : undefined,\n transcriptSegments: transcript && hasTranscript ? transcript.segments : undefined,\n transcriptFetched: includeTranscripts ? hasTranscript : false,\n };\n};\n\n/**\n * Stream videos with transcripts into a DXOS feed.\n */\nconst streamVideosToFeed = Effect.fn(function* (\n uploadsPlaylistId: string,\n feed: Feed.Feed,\n existingVideoIds: Set<string>,\n restricted: boolean,\n includeTranscripts: boolean,\n) {\n const count = yield* Function.pipe(\n fetchPlaylistVideos(uploadsPlaylistId, restricted ? STREAMING_CONFIG.restrictedMax : undefined),\n Stream.filter((videoId) => {\n const isDuplicate = existingVideoIds.has(videoId);\n if (isDuplicate) {\n log('skipping duplicate video', { videoId });\n }\n return !isDuplicate;\n }),\n restricted ? Stream.take(STREAMING_CONFIG.restrictedMax) : Function.identity,\n Stream.grouped(10),\n Stream.flatMap(\n (videoIdChunk) =>\n Effect.gen(function* () {\n const videoIds = Chunk.toArray(videoIdChunk);\n log('fetching video details', { count: videoIds.length });\n\n const response = yield* YouTube.getVideoDetails(videoIds);\n return response.items;\n }),\n { concurrency: 1 },\n ),\n Stream.flatMap((items) => Stream.fromIterable(items)),\n Stream.flatMap(\n (item) =>\n Effect.gen(function* () {\n let transcript: TranscriptData | undefined;\n\n if (includeTranscripts) {\n log('fetching transcript', { videoId: item.id });\n const result = yield* fetchTranscript(item.id);\n if (result) {\n transcript = result;\n log('transcript fetched', { videoId: item.id, length: transcript.fullText.length });\n } else {\n log('no transcript available', { videoId: item.id });\n }\n }\n\n return mapVideoData(item, transcript, includeTranscripts);\n }),\n {\n concurrency: STREAMING_CONFIG.transcriptFetchConcurrency,\n bufferSize: STREAMING_CONFIG.bufferSize,\n },\n ),\n Stream.filter(Predicate.isNotNullable),\n Stream.grouped(STREAMING_CONFIG.feedBatchSize),\n Stream.mapEffect((batch) =>\n Effect.gen(function* () {\n const videos = Chunk.toArray(batch);\n log('appending batch to feed', { count: videos.length });\n const videoObjects = videos.map((video) => Obj.make(Video.YouTubeVideo, video));\n yield* Feed.append(feed, videoObjects);\n return videos.length;\n }),\n ),\n Stream.runFold(0, (acc, batchCount) => acc + batchCount),\n );\n\n return count;\n});\n\nexport default handler;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { log } from '@dxos/log';\n\nimport type { TranscriptSegment } from '../types/Video';\n\nexport type TranscriptResult = {\n segments: TranscriptSegment[];\n fullText: string;\n};\n\n/**\n * Fetches captions for a YouTube video using youtube-caption-extractor.\n * Works in both browser and Node/edge environments.\n */\nexport const fetchTranscript = (videoId: string, lang?: string): Effect.Effect<TranscriptResult | undefined> =>\n Effect.tryPromise({\n try: async () => {\n const { getSubtitles } = await import('youtube-caption-extractor');\n const subtitles = await getSubtitles({ videoID: videoId, lang: lang ?? 'en' });\n\n if (!subtitles || subtitles.length === 0) {\n return undefined;\n }\n\n const segments: TranscriptSegment[] = subtitles.map((sub) => ({\n text: sub.text,\n offset: parseFloat(sub.start),\n duration: parseFloat(sub.dur),\n }));\n\n const fullText = segments.map((segment) => segment.text).join(' ');\n return { segments, fullText };\n },\n catch: (error) => {\n log('failed to fetch transcript', { videoId, error });\n return undefined;\n },\n }).pipe(\n Effect.catchAll(() => Effect.succeed(undefined)),\n Effect.timeout('30 seconds'),\n Effect.catchAll(() => Effect.succeed(undefined)),\n );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAIA,YAAYA,qBAAqB;AACjC,YAAYC,WAAW;AACvB,YAAYC,aAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,eAAe;AAC3B,YAAYC,YAAY;AAExB,SAASC,UAAUC,MAAMC,QAAQC,WAAgB;AACjD,SAASC,OAAAA,YAAW;AACpB,SAASC,iBAAiB;;;ACX1B,YAAYC,YAAY;AAExB,SAASC,WAAW;;AAab,IAAMC,kBAAkB,CAACC,SAAiBC,SACxCC,kBAAW;EAChBC,KAAK,YAAA;AACH,UAAM,EAAEC,aAAY,IAAK,MAAM,OAAO,2BAAA;AACtC,UAAMC,YAAY,MAAMD,aAAa;MAAEE,SAASN;MAASC,MAAMA,QAAQ;IAAK,CAAA;AAE5E,QAAI,CAACI,aAAaA,UAAUE,WAAW,GAAG;AACxC,aAAOC;IACT;AAEA,UAAMC,WAAgCJ,UAAUK,IAAI,CAACC,SAAS;MAC5DC,MAAMD,IAAIC;MACVC,QAAQC,WAAWH,IAAII,KAAK;MAC5BC,UAAUF,WAAWH,IAAIM,GAAG;IAC9B,EAAA;AAEA,UAAMC,WAAWT,SAASC,IAAI,CAACS,YAAYA,QAAQP,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,OAAOC,gBAAgB1C,KAAKf,EAAE;AAC7C,UAAIwD,QAAQ;AACV7B,qBAAa6B;AACb/H,QAAAA,KAAI,sBAAsB;UAAE8B,SAASwD,KAAKf;UAAIf,QAAQ0C,WAAWE,SAAS5C;QAAO,GAAA;;;;;;MACnF,OAAO;AACLxD,QAAAA,KAAI,2BAA2B;UAAE8B,SAASwD,KAAKf;QAAG,GAAA;;;;;;MACpD;IACF;AAEA,WAAO0B,aAAaX,MAAMY,YAAYpG,kBAAAA;EACxC,CAAA,GACF;IACEgI,aAAalF,iBAAiBE;IAC9BC,YAAYH,iBAAiBG;EAC/B,CAAA,GAEKyC,cAAiByC,uBAAa,GAC9BR,eAAQ7E,iBAAiBI,aAAa,GACtCkF,iBAAU,CAACC,UACTpI,YAAI,aAAA;AACT,UAAMqI,SAAeR,cAAQO,KAAAA;AAC7BnI,IAAAA,KAAI,2BAA2B;MAAE+B,OAAOqG,OAAO5E;IAAO,GAAA;;;;;;AACtD,UAAM6E,eAAeD,OAAOxG,IAAI,CAACC,UAAUf,IAAIwH,KAAK9G,cAAMC,cAAcI,KAAAA,CAAAA;AACxE,WAAOT,KAAKmH,OAAOrH,MAAMmH,YAAAA;AACzB,WAAOD,OAAO5E;EAChB,CAAA,CAAA,GAEKgF,eAAQ,GAAG,CAACC,KAAKC,eAAeD,MAAMC,UAAAA,CAAAA;AAG/C,SAAO3G;AACT,CAAA;AAEA,IAAA,eAAezC;",
6
- "names": ["FetchHttpClient", "Chunk", "Effect", "Function", "Layer", "Option", "Predicate", "Stream", "Database", "Feed", "Filter", "Obj", "log", "Operation", "Effect", "log", "fetchTranscript", "videoId", "lang", "tryPromise", "try", "getSubtitles", "subtitles", "videoID", "length", "undefined", "segments", "map", "sub", "text", "offset", "parseFloat", "start", "duration", "dur", "fullText", "segment", "join", "catch", "error", "pipe", "catchAll", "succeed", "timeout", "handler", "Sync", "pipe", "Operation", "withHandler", "channel", "channelRef", "restrictedMode", "includeTranscripts", "gen", "log", "dxn", "toString", "Database", "load", "channelUrl", "channelId", "fail", "Error", "channelInfo", "extractChannelInfo", "channelTitle", "uploadsPlaylistId", "getUploadsPlaylistId", "Obj", "change", "channelObj", "name", "feed", "existingVideos", "Feed", "runQuery", "Filter", "type", "Video", "YouTubeVideo", "existingVideoIds", "Set", "map", "video", "videoId", "count", "size", "newVideosCount", "streamVideosToFeed", "lastSyncedAt", "Date", "toISOString", "newVideos", "provide", "mergeAll", "layer", "GoogleCredentials", "fromChannelRef", "STREAMING_CONFIG", "maxResults", "transcriptFetchConcurrency", "bufferSize", "feedBatchSize", "restrictedMax", "urlOrHandle", "trimmed", "trim", "startsWith", "value", "slice", "length", "url", "URL", "pathname", "split", "test", "fn", "channelResponse", "YouTube", "getChannel", "getChannelByHandle", "items", "contentDetails", "relatedPlaylists", "uploads", "id", "snippet", "title", "fetchPlaylistVideos", "maxVideos", "videoCount", "unfoldChunkEffect", "pageToken", "none", "done", "state", "response", "listPlaylistItems", "getOrUndefined", "videoIds", "item", "resourceId", "filter", "Boolean", "hasMore", "nextPageToken", "nextState", "fromNullable", "undefined", "some", "fromIterable", "mapVideoData", "transcript", "hasTranscript", "fullText", "description", "thumbnailUrl", "thumbnails", "high", "medium", "default", "publishedAt", "duration", "viewCount", "statistics", "parseInt", "likeCount", "transcriptSegments", "segments", "transcriptFetched", "restricted", "isDuplicate", "has", "take", "identity", "grouped", "flatMap", "videoIdChunk", "toArray", "getVideoDetails", "concurrency", "result", "fetchTranscript", "isNotNullable", "mapEffect", "batch", "videos", "videoObjects", "make", "append", "runFold", "acc", "batchCount"]
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAUjD,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAC;;AAM/D,wBA2HE"}
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const AppGraphBuilder: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-graph").BuilderExtensions>>, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/app-graph-builder/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,eAAe,qIAA0E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"blueprint-definition.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,QAAA,MAAM,mBAAmB,gJAG+E,CAAC;AAEzG,eAAe,mBAAmB,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const BlueprintDefinition: Capability.LazyCapability<[], Capability.Capability<Capability.InterfaceDef<import("@dxos/app-toolkit").AppCapabilities.BlueprintDefinition>>[], Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/blueprint-definition/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,yJAAiF,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").ReactSurface>>, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iJAAmE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAO/D,wBAuCE"}
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));