@dxos/plugin-youtube 0.8.3 → 0.8.4-main.bcb3aa67d6

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 (129) 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-5N5SWF3I.mjs} +3 -3
  4. package/dist/lib/browser/chunk-GTIWG45H.mjs +157 -0
  5. package/dist/lib/browser/chunk-GTIWG45H.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-P67QEKBQ.mjs → chunk-SWWE4LUJ.mjs} +3 -5
  7. package/dist/lib/browser/{chunk-P67QEKBQ.mjs.map → chunk-SWWE4LUJ.mjs.map} +1 -1
  8. package/dist/lib/browser/{clear-synced-videos-EVMJIZPD.mjs → clear-synced-videos-PIKJZET3.mjs} +4 -5
  9. package/dist/lib/{node-esm/clear-synced-videos-5UCH6XHL.mjs.map → browser/clear-synced-videos-PIKJZET3.mjs.map} +1 -1
  10. package/dist/lib/browser/index.mjs +86 -81
  11. package/dist/lib/browser/index.mjs.map +4 -4
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/{sync-423Q4BDD.mjs → sync-II7O2LPG.mjs} +6 -7
  14. package/dist/lib/{node-esm/sync-CEF5DX2J.mjs.map → browser/sync-II7O2LPG.mjs.map} +1 -1
  15. package/dist/lib/browser/types/index.mjs +2 -4
  16. package/dist/lib/node-esm/blueprints/index.mjs +49 -8
  17. package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
  18. package/dist/lib/node-esm/{chunk-JM5SBBP5.mjs → chunk-BVKMXV2G.mjs} +3 -3
  19. package/dist/lib/node-esm/{chunk-JSGRZMG3.mjs → chunk-RL46XZ2D.mjs} +3 -5
  20. package/dist/lib/node-esm/{chunk-JSGRZMG3.mjs.map → chunk-RL46XZ2D.mjs.map} +1 -1
  21. package/dist/lib/node-esm/chunk-YOE54ALJ.mjs +158 -0
  22. package/dist/lib/node-esm/chunk-YOE54ALJ.mjs.map +7 -0
  23. package/dist/lib/node-esm/{clear-synced-videos-5UCH6XHL.mjs → clear-synced-videos-Q3MZO2CD.mjs} +4 -5
  24. package/dist/lib/node-esm/index.mjs +86 -81
  25. package/dist/lib/node-esm/index.mjs.map +4 -4
  26. package/dist/lib/node-esm/meta.json +1 -1
  27. package/dist/lib/node-esm/{sync-CEF5DX2J.mjs → sync-BEXQNNSH.mjs} +6 -7
  28. package/dist/lib/node-esm/types/index.mjs +2 -4
  29. package/dist/types/src/YouTubePlugin.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/index.d.ts +5 -3
  33. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  35. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  37. package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts +2 -7
  38. package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts.map +1 -1
  39. package/dist/types/src/containers/VideoCard/VideoCard.d.ts +2 -2
  40. package/dist/types/src/containers/VideoCard/VideoCard.d.ts.map +1 -1
  41. package/dist/types/src/operations/definitions.d.ts +6 -2
  42. package/dist/types/src/operations/definitions.d.ts.map +1 -1
  43. package/dist/types/src/translations.d.ts +38 -38
  44. package/dist/types/src/translations.d.ts.map +1 -1
  45. package/dist/types/src/types/Channel.d.ts +28 -3
  46. package/dist/types/src/types/Channel.d.ts.map +1 -1
  47. package/dist/types/src/types/Video.d.ts +22 -0
  48. package/dist/types/src/types/Video.d.ts.map +1 -1
  49. package/dist/types/tsconfig.tsbuildinfo +1 -1
  50. package/package.json +48 -40
  51. package/src/YouTubePlugin.tsx +11 -5
  52. package/src/blueprints/youtube.ts +1 -1
  53. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +19 -22
  54. package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +1 -1
  55. package/src/capabilities/index.ts +7 -4
  56. package/src/capabilities/migrations.ts +35 -0
  57. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +4 -4
  58. package/src/containers/VideoArticle/VideoArticle.tsx +2 -7
  59. package/src/containers/VideoCard/VideoCard.tsx +2 -2
  60. package/src/translations.ts +38 -38
  61. package/src/types/Channel.ts +18 -1
  62. package/src/types/Video.ts +25 -1
  63. package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs +0 -90
  64. package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs.map +0 -7
  65. package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs +0 -28
  66. package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs.map +0 -7
  67. package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs +0 -76
  68. package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs.map +0 -7
  69. package/dist/lib/browser/VideoCard-CCPXDCB7.mjs +0 -64
  70. package/dist/lib/browser/VideoCard-CCPXDCB7.mjs.map +0 -7
  71. package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs +0 -195
  72. package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs.map +0 -7
  73. package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs +0 -22
  74. package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs.map +0 -7
  75. package/dist/lib/browser/chunk-DFRSBBSO.mjs +0 -21
  76. package/dist/lib/browser/chunk-DFRSBBSO.mjs.map +0 -7
  77. package/dist/lib/browser/chunk-GFRR4TTX.mjs +0 -72
  78. package/dist/lib/browser/chunk-GFRR4TTX.mjs.map +0 -7
  79. package/dist/lib/browser/chunk-MUE22YUM.mjs +0 -57
  80. package/dist/lib/browser/chunk-MUE22YUM.mjs.map +0 -7
  81. package/dist/lib/browser/chunk-YMDT37TA.mjs +0 -62
  82. package/dist/lib/browser/chunk-YMDT37TA.mjs.map +0 -7
  83. package/dist/lib/browser/chunk-Z3DGTMKC.mjs +0 -8
  84. package/dist/lib/browser/chunk-Z3DGTMKC.mjs.map +0 -7
  85. package/dist/lib/browser/react-surface-EDA5VYDC.mjs +0 -77
  86. package/dist/lib/browser/react-surface-EDA5VYDC.mjs.map +0 -7
  87. package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs +0 -91
  88. package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs.map +0 -7
  89. package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs +0 -29
  90. package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs.map +0 -7
  91. package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs +0 -77
  92. package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs.map +0 -7
  93. package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs +0 -65
  94. package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs.map +0 -7
  95. package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs +0 -196
  96. package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs.map +0 -7
  97. package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs +0 -23
  98. package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs.map +0 -7
  99. package/dist/lib/node-esm/chunk-5KNC2JMP.mjs +0 -58
  100. package/dist/lib/node-esm/chunk-5KNC2JMP.mjs.map +0 -7
  101. package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs +0 -73
  102. package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-CX6MV3QM.mjs +0 -23
  104. package/dist/lib/node-esm/chunk-CX6MV3QM.mjs.map +0 -7
  105. package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs +0 -63
  106. package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs.map +0 -7
  107. package/dist/lib/node-esm/chunk-M4S6BE47.mjs +0 -10
  108. package/dist/lib/node-esm/chunk-M4S6BE47.mjs.map +0 -7
  109. package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs +0 -78
  110. package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs.map +0 -7
  111. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  112. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  113. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  114. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  115. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  116. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  117. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  118. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  119. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  120. package/src/capabilities/app-graph-builder/index.ts +0 -7
  121. package/src/capabilities/blueprint-definition/index.ts +0 -7
  122. package/src/capabilities/react-surface/index.ts +0 -7
  123. /package/dist/lib/browser/{chunk-C26XKDK2.mjs.map → chunk-5N5SWF3I.mjs.map} +0 -0
  124. /package/dist/lib/node-esm/{chunk-JM5SBBP5.mjs.map → chunk-BVKMXV2G.mjs.map} +0 -0
  125. /package/dist/lib/{browser/clear-synced-videos-EVMJIZPD.mjs.map → node-esm/clear-synced-videos-Q3MZO2CD.mjs.map} +0 -0
  126. /package/dist/lib/{browser/sync-423Q4BDD.mjs.map → node-esm/sync-BEXQNNSH.mjs.map} +0 -0
  127. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  128. /package/dist/types/src/capabilities/{blueprint-definition/blueprint-definition.d.ts → blueprint-definition.d.ts} +0 -0
  129. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
@@ -1,12 +1,53 @@
1
- import {
2
- youtube_default
3
- } from "../chunk-MUE22YUM.mjs";
4
- import "../chunk-Z3DGTMKC.mjs";
5
- import "../chunk-C26XKDK2.mjs";
6
- import "../chunk-P67QEKBQ.mjs";
7
- import "../chunk-GFRR4TTX.mjs";
8
- import "../chunk-YMDT37TA.mjs";
9
1
  import "../chunk-J5LGTIGS.mjs";
2
+
3
+ // src/blueprints/youtube.ts
4
+ import { Blueprint, Template } from "@dxos/blueprints";
5
+ import { trim } from "@dxos/util";
6
+ import { ClearSyncedVideos, Sync } from "#operations";
7
+ var BLUEPRINT_KEY = "dxos.org/blueprint/youtube";
8
+ var make = () => Blueprint.make({
9
+ key: BLUEPRINT_KEY,
10
+ name: "YouTube",
11
+ tools: Blueprint.toolDefinitions({
12
+ operations: [
13
+ Sync,
14
+ ClearSyncedVideos
15
+ ],
16
+ tools: []
17
+ }),
18
+ instructions: Template.make({
19
+ source: trim`
20
+ You manage YouTube channel subscriptions and video content.
21
+
22
+ # Summary formatting:
23
+ - Format summaries as markdown documents without extra comments.
24
+ - Use markdown formatting for headings and bullet points.
25
+ - Format video summaries as lists with key points.
26
+
27
+ # References
28
+ - Use references to objects in the form of:
29
+ @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M
30
+ - References are rendered as rich content in the response to the user.
31
+
32
+ # Video Analysis
33
+ When analyzing videos:
34
+ - Summarize the key topics and themes.
35
+ - Extract important quotes or statements.
36
+ - Identify action items or recommendations.
37
+ - Note any timestamps for important sections.
38
+
39
+ # Transcript Usage
40
+ - Videos may include transcripts that can be used for deeper analysis.
41
+ - When summarizing content, reference the transcript for accuracy.
42
+ - Transcripts include timestamps that can help locate specific content.
43
+ `
44
+ })
45
+ });
46
+ var blueprint = {
47
+ key: BLUEPRINT_KEY,
48
+ make
49
+ };
50
+ var youtube_default = blueprint;
10
51
  export {
11
52
  youtube_default as YouTubeBlueprint
12
53
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
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;AAErB,SAASC,mBAAmBC,YAAY;AAExC,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", "ClearSyncedVideos", "Sync", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "operations", "Sync", "ClearSyncedVideos", "instructions", "Template", "source", "trim", "blueprint"]
7
7
  }
@@ -9,7 +9,7 @@ import * as Layer from "effect/Layer";
9
9
  import { Database } from "@dxos/echo";
10
10
  import { CredentialsService } from "@dxos/functions";
11
11
  import { log } from "@dxos/log";
12
- var __dxlog_file = "/Users/mykola/dev/dxos/packages/plugins/plugin-youtube/src/operations/services/google-credentials.ts";
12
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-youtube/src/operations/services/google-credentials.ts";
13
13
  var makeService = (cachedToken) => ({
14
14
  get: () => cachedToken ? Effect.succeed(cachedToken) : Effect.map(CredentialsService.getCredential({
15
15
  service: "google.com"
@@ -261,7 +261,7 @@ var CaptionsListResponse = Schema.Struct({
261
261
  });
262
262
 
263
263
  // src/operations/apis/youtube/api.ts
264
- var __dxlog_file2 = "/Users/mykola/dev/dxos/packages/plugins/plugin-youtube/src/operations/apis/youtube/api.ts";
264
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-youtube/src/operations/apis/youtube/api.ts";
265
265
  var API_URL = "https://www.googleapis.com/youtube/v3";
266
266
  var createUrl = (parts, params) => {
267
267
  const url = new URL(parts.filter(Boolean).join("/"));
@@ -352,4 +352,4 @@ export {
352
352
  GoogleCredentials,
353
353
  youtube_exports
354
354
  };
355
- //# sourceMappingURL=chunk-C26XKDK2.mjs.map
355
+ //# sourceMappingURL=chunk-5N5SWF3I.mjs.map
@@ -0,0 +1,157 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-J5LGTIGS.mjs";
4
+
5
+ // src/types/types.ts
6
+ var YouTubeOperation = {};
7
+
8
+ // src/types/Channel.ts
9
+ var Channel_exports = {};
10
+ __export(Channel_exports, {
11
+ CreateYouTubeChannelSchema: () => CreateYouTubeChannelSchema,
12
+ LegacyYouTubeChannel: () => LegacyYouTubeChannel,
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 LegacyYouTubeChannel = Schema.Struct({
23
+ name: Schema.String.pipe(Schema.optional),
24
+ channelId: Schema.String.pipe(Schema.optional),
25
+ channelUrl: Schema.String.pipe(Schema.optional),
26
+ feed: Ref.Ref(Feed.Feed),
27
+ lastSyncedAt: Schema.String.pipe(Schema.optional),
28
+ accessToken: Schema.optional(Ref.Ref(AccessToken.AccessToken))
29
+ }).pipe(Type.object({
30
+ typename: "org.dxos.type.youtube-channel",
31
+ version: "0.1.0"
32
+ }));
33
+ var YouTubeChannel = Schema.Struct({
34
+ /** Display name for the channel. */
35
+ name: Schema.String.pipe(Schema.optional),
36
+ /** YouTube channel ID (e.g., UC...). */
37
+ channelId: Schema.String.pipe(Schema.optional),
38
+ /** YouTube channel URL or handle. */
39
+ channelUrl: Schema.String.pipe(Schema.optional),
40
+ /** Feed containing YouTubeVideo objects. */
41
+ feed: Ref.Ref(Feed.Feed).pipe(FormInputAnnotation.set(false)),
42
+ /** Last sync timestamp. */
43
+ lastSyncedAt: Schema.String.pipe(FormInputAnnotation.set(false), Schema.optional),
44
+ /** Google API credentials for fetching channel data. */
45
+ accessToken: Schema.optional(Ref.Ref(AccessToken.AccessToken).annotations({
46
+ title: "Account",
47
+ description: "Google account credentials for syncing this YouTube channel."
48
+ }))
49
+ }).pipe(Type.object({
50
+ typename: "org.dxos.type.youtubeChannel",
51
+ version: "0.1.0"
52
+ }), Annotation.IconAnnotation.set({
53
+ icon: "ph--youtube-logo--regular",
54
+ hue: "red"
55
+ }), FeedAnnotation.set(true));
56
+ var instanceOf = (value) => Obj.instanceOf(YouTubeChannel, value);
57
+ var CreateYouTubeChannelSchema = Schema.Struct({
58
+ name: Schema.optional(Schema.String.annotations({
59
+ title: "Name"
60
+ })),
61
+ channelUrl: Schema.optional(Schema.String.annotations({
62
+ title: "Channel URL",
63
+ description: "YouTube channel URL, handle (e.g., @channelname), or channel ID."
64
+ })),
65
+ accessToken: Schema.optional(Ref.Ref(AccessToken.AccessToken).annotations({
66
+ title: "Account",
67
+ description: "Google account credentials for syncing this YouTube channel."
68
+ }))
69
+ });
70
+ var make = (props = {}) => {
71
+ const feed = Feed.make();
72
+ const channel = Obj.make(YouTubeChannel, {
73
+ feed: Ref.make(feed),
74
+ ...props
75
+ });
76
+ Obj.setParent(feed, channel);
77
+ return channel;
78
+ };
79
+
80
+ // src/types/Video.ts
81
+ var Video_exports = {};
82
+ __export(Video_exports, {
83
+ LegacyYouTubeVideo: () => LegacyYouTubeVideo,
84
+ TranscriptSegment: () => TranscriptSegment,
85
+ YouTubeVideo: () => YouTubeVideo,
86
+ instanceOf: () => instanceOf2
87
+ });
88
+ import * as Schema2 from "effect/Schema";
89
+ import { Annotation as Annotation2, Obj as Obj2, Type as Type2 } from "@dxos/echo";
90
+ var TranscriptSegment = Schema2.Struct({
91
+ /** Transcript text. */
92
+ text: Schema2.String,
93
+ /** Start time in seconds. */
94
+ offset: Schema2.Number,
95
+ /** Duration in seconds. */
96
+ duration: Schema2.Number
97
+ });
98
+ var LegacyYouTubeVideo = Schema2.Struct({
99
+ title: Schema2.String,
100
+ videoId: Schema2.String,
101
+ description: Schema2.String.pipe(Schema2.optional),
102
+ url: Schema2.String,
103
+ thumbnailUrl: Schema2.String.pipe(Schema2.optional),
104
+ channelTitle: Schema2.String.pipe(Schema2.optional),
105
+ publishedAt: Schema2.String,
106
+ duration: Schema2.String.pipe(Schema2.optional),
107
+ viewCount: Schema2.Number.pipe(Schema2.optional),
108
+ likeCount: Schema2.Number.pipe(Schema2.optional),
109
+ transcript: Schema2.String.pipe(Schema2.optional),
110
+ transcriptSegments: Schema2.Array(TranscriptSegment).pipe(Schema2.optional),
111
+ transcriptFetched: Schema2.Boolean.pipe(Schema2.optional)
112
+ }).pipe(Type2.object({
113
+ typename: "org.dxos.type.youtube-video",
114
+ version: "0.1.0"
115
+ }));
116
+ var YouTubeVideo = Schema2.Struct({
117
+ /** Video title. */
118
+ title: Schema2.String,
119
+ /** YouTube video ID. */
120
+ videoId: Schema2.String,
121
+ /** Video description. */
122
+ description: Schema2.String.pipe(Schema2.optional),
123
+ /** Video URL. */
124
+ url: Schema2.String,
125
+ /** Thumbnail URL. */
126
+ thumbnailUrl: Schema2.String.pipe(Schema2.optional),
127
+ /** Channel name. */
128
+ channelTitle: Schema2.String.pipe(Schema2.optional),
129
+ /** Published date as ISO string. */
130
+ publishedAt: Schema2.String,
131
+ /** Video duration in ISO 8601 format (e.g., PT1H30M15S). */
132
+ duration: Schema2.String.pipe(Schema2.optional),
133
+ /** View count. */
134
+ viewCount: Schema2.Number.pipe(Schema2.optional),
135
+ /** Like count. */
136
+ likeCount: Schema2.Number.pipe(Schema2.optional),
137
+ /** Full transcript text. */
138
+ transcript: Schema2.String.pipe(Schema2.optional),
139
+ /** Transcript segments with timestamps. */
140
+ transcriptSegments: Schema2.Array(TranscriptSegment).pipe(Schema2.optional),
141
+ /** True when transcript text was successfully loaded; false when disabled or none available. */
142
+ transcriptFetched: Schema2.Boolean.pipe(Schema2.optional)
143
+ }).pipe(Type2.object({
144
+ typename: "org.dxos.type.youtubeVideo",
145
+ version: "0.1.0"
146
+ }), Annotation2.IconAnnotation.set({
147
+ icon: "ph--play--regular",
148
+ hue: "red"
149
+ }));
150
+ var instanceOf2 = (value) => Obj2.instanceOf(YouTubeVideo, value);
151
+
152
+ export {
153
+ YouTubeOperation,
154
+ Channel_exports,
155
+ Video_exports
156
+ };
157
+ //# sourceMappingURL=chunk-GTIWG45H.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/types.ts", "../../../src/types/Channel.ts", "../../../src/types/Video.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/** @deprecated Use YouTubeChannel instead. */\nexport const LegacyYouTubeChannel = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n channelId: Schema.String.pipe(Schema.optional),\n channelUrl: Schema.String.pipe(Schema.optional),\n feed: Ref.Ref(Feed.Feed),\n lastSyncedAt: Schema.String.pipe(Schema.optional),\n accessToken: Schema.optional(Ref.Ref(AccessToken.AccessToken)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.youtube-channel',\n version: '0.1.0',\n }),\n);\n\nexport interface LegacyYouTubeChannel extends Schema.Schema.Type<typeof LegacyYouTubeChannel> {}\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.youtubeChannel',\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", "//\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/** @deprecated Use YouTubeVideo instead. */\nexport const LegacyYouTubeVideo = Schema.Struct({\n title: Schema.String,\n videoId: Schema.String,\n description: Schema.String.pipe(Schema.optional),\n url: Schema.String,\n thumbnailUrl: Schema.String.pipe(Schema.optional),\n channelTitle: Schema.String.pipe(Schema.optional),\n publishedAt: Schema.String,\n duration: Schema.String.pipe(Schema.optional),\n viewCount: Schema.Number.pipe(Schema.optional),\n likeCount: Schema.Number.pipe(Schema.optional),\n transcript: Schema.String.pipe(Schema.optional),\n transcriptSegments: Schema.Array(TranscriptSegment).pipe(Schema.optional),\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);\n\nexport interface LegacyYouTubeVideo extends Schema.Schema.Type<typeof LegacyYouTubeVideo> {}\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.youtubeVideo',\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": ";;;;;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;AAKrB,IAAMC,uBAA8BC,cAAO;EAChDC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,WAAkBH,cAAOC,KAAYC,eAAQ;EAC7CE,YAAmBJ,cAAOC,KAAYC,eAAQ;EAC9CG,MAAMC,IAAIA,IAAIC,KAAKA,IAAI;EACvBC,cAAqBR,cAAOC,KAAYC,eAAQ;EAChDO,aAAoBP,gBAASI,IAAIA,IAAII,YAAYA,WAAW,CAAA;AAC9D,CAAA,EAAGT,KACDU,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;AAQK,IAAMC,iBAAwBjB,cAAO;;EAE1CC,MAAaC,cAAOC,KAAYC,eAAQ;;EAExCC,WAAkBH,cAAOC,KAAYC,eAAQ;;EAE7CE,YAAmBJ,cAAOC,KAAYC,eAAQ;;EAE9CG,MAAMC,IAAIA,IAAIC,KAAKA,IAAI,EAAEN,KAAKe,oBAAoBC,IAAI,KAAA,CAAA;;EAEtDT,cAAqBR,cAAOC,KAAKe,oBAAoBC,IAAI,KAAA,GAAef,eAAQ;;EAEh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", "channelUrl", "feed", "Ref", "Feed", "lastSyncedAt", "accessToken", "AccessToken", "Type", "object", "typename", "version", "YouTubeChannel", "FormInputAnnotation", "set", "annotations", "title", "description", "Annotation", "IconAnnotation", "icon", "hue", "FeedAnnotation", "instanceOf", "value", "Obj", "CreateYouTubeChannelSchema", "make", "props", "channel", "setParent", "instanceOf", "Schema", "Annotation", "Obj", "Type", "TranscriptSegment", "Struct", "text", "String", "offset", "Number", "duration", "LegacyYouTubeVideo", "title", "videoId", "description", "pipe", "optional", "url", "thumbnailUrl", "channelTitle", "publishedAt", "viewCount", "likeCount", "transcript", "transcriptSegments", "Array", "transcriptFetched", "Boolean", "Type", "object", "typename", "version", "YouTubeVideo", "Annotation", "IconAnnotation", "set", "icon", "hue", "instanceOf", "value", "Obj"]
7
+ }
@@ -1,9 +1,7 @@
1
1
  import {
2
- Channel_exports
3
- } from "./chunk-GFRR4TTX.mjs";
4
- import {
2
+ Channel_exports,
5
3
  Video_exports
6
- } from "./chunk-YMDT37TA.mjs";
4
+ } from "./chunk-GTIWG45H.mjs";
7
5
 
8
6
  // src/operations/definitions.ts
9
7
  import { Operation } from "@dxos/operation";
@@ -69,4 +67,4 @@ export {
69
67
  Sync,
70
68
  ClearSyncedVideos
71
69
  };
72
- //# sourceMappingURL=chunk-P67QEKBQ.mjs.map
70
+ //# sourceMappingURL=chunk-SWWE4LUJ.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/operations/definitions.ts"],
4
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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MC,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
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
7
  }
@@ -1,10 +1,9 @@
1
1
  import {
2
2
  ClearSyncedVideos
3
- } from "./chunk-P67QEKBQ.mjs";
4
- import "./chunk-GFRR4TTX.mjs";
3
+ } from "./chunk-SWWE4LUJ.mjs";
5
4
  import {
6
5
  Video_exports
7
- } from "./chunk-YMDT37TA.mjs";
6
+ } from "./chunk-GTIWG45H.mjs";
8
7
  import "./chunk-J5LGTIGS.mjs";
9
8
 
10
9
  // src/operations/clear-synced-videos.ts
@@ -12,7 +11,7 @@ import * as Effect from "effect/Effect";
12
11
  import { Database, Feed, Filter, Obj, Ref } from "@dxos/echo";
13
12
  import { log } from "@dxos/log";
14
13
  import { Operation } from "@dxos/operation";
15
- var __dxlog_file = "/Users/mykola/dev/dxos/packages/plugins/plugin-youtube/src/operations/clear-synced-videos.ts";
14
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-youtube/src/operations/clear-synced-videos.ts";
16
15
  var handler = ClearSyncedVideos.pipe(Operation.withHandler(({ channel: channelRef }) => Effect.gen(function* () {
17
16
  log("clearing youtube channel synced videos", {
18
17
  channel: channelRef.dxn.toString()
@@ -63,4 +62,4 @@ var clear_synced_videos_default = handler;
63
62
  export {
64
63
  clear_synced_videos_default as default
65
64
  };
66
- //# sourceMappingURL=clear-synced-videos-EVMJIZPD.mjs.map
65
+ //# sourceMappingURL=clear-synced-videos-PIKJZET3.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/operations/clear-synced-videos.ts"],
4
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,WAA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AASC,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
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
7
  }
@@ -1,27 +1,34 @@
1
- import {
2
- meta
3
- } from "./chunk-DFRSBBSO.mjs";
4
- import {
5
- youtube_default
6
- } from "./chunk-MUE22YUM.mjs";
7
- import {
8
- YouTubeHandlers
9
- } from "./chunk-Z3DGTMKC.mjs";
10
1
  import {
11
2
  youtube_exports
12
- } from "./chunk-C26XKDK2.mjs";
3
+ } from "./chunk-5N5SWF3I.mjs";
13
4
  import {
14
5
  ClearSyncedVideos,
15
6
  Sync
16
- } from "./chunk-P67QEKBQ.mjs";
17
- import {
18
- Channel_exports
19
- } from "./chunk-GFRR4TTX.mjs";
20
- import {
21
- Video_exports
22
- } from "./chunk-YMDT37TA.mjs";
7
+ } from "./chunk-SWWE4LUJ.mjs";
8
+ import "./chunk-GTIWG45H.mjs";
23
9
  import "./chunk-J5LGTIGS.mjs";
24
10
 
11
+ // src/meta.ts
12
+ import { trim } from "@dxos/util";
13
+ var meta = {
14
+ id: "org.dxos.plugin.youtube",
15
+ name: "YouTube",
16
+ description: trim`
17
+ YouTube channel subscription and video feed management.
18
+ Sync videos from channels and access transcripts for analysis.
19
+ `,
20
+ icon: "ph--youtube-logo--regular",
21
+ iconHue: "red",
22
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-youtube",
23
+ tags: [
24
+ "labs"
25
+ ]
26
+ };
27
+
28
+ // src/operations/index.ts
29
+ import { OperationHandlerSet } from "@dxos/operation";
30
+ var YouTubeHandlers = OperationHandlerSet.lazy(() => import("./clear-synced-videos-PIKJZET3.mjs"), () => import("./sync-II7O2LPG.mjs"));
31
+
25
32
  // src/YouTubePlugin.tsx
26
33
  import * as Effect from "effect/Effect";
27
34
  import * as Option from "effect/Option";
@@ -29,73 +36,68 @@ import { ActivationEvent, Plugin } from "@dxos/app-framework";
29
36
  import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
30
37
  import { Annotation } from "@dxos/echo";
31
38
  import { Operation } from "@dxos/operation";
32
- import { AttentionEvents } from "@dxos/plugin-attention";
39
+ import { AttentionEvents } from "@dxos/plugin-attention/types";
40
+ import { ClientEvents } from "@dxos/plugin-client/types";
33
41
  import { SpaceOperation } from "@dxos/plugin-space/operations";
34
-
35
- // src/capabilities/app-graph-builder/index.ts
36
- import { Capability } from "@dxos/app-framework";
37
- var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./app-graph-builder-MJY6A6SN.mjs"));
38
-
39
- // src/capabilities/blueprint-definition/index.ts
40
- import { Capability as Capability2 } from "@dxos/app-framework";
41
- var BlueprintDefinition = Capability2.lazy("BlueprintDefinition", () => import("./blueprint-definition-FRYUYJ22.mjs"));
42
-
43
- // src/capabilities/react-surface/index.ts
44
- import { Capability as Capability3 } from "@dxos/app-framework";
45
- var ReactSurface = Capability3.lazy("ReactSurface", () => import("./react-surface-EDA5VYDC.mjs"));
42
+ import { YouTubeBlueprint } from "#blueprints";
43
+ import { meta as meta3 } from "#meta";
46
44
 
47
45
  // src/translations.ts
46
+ import { meta as meta2 } from "#meta";
47
+ import { Channel, Video } from "#types";
48
48
  var translations = [
49
49
  {
50
50
  "en-US": {
51
- [Channel_exports.YouTubeChannel.typename]: {
52
- "typename label": "YouTube Channel",
53
- "typename label_zero": "YouTube Channels",
54
- "typename label_one": "YouTube Channel",
55
- "typename label_other": "YouTube Channels",
56
- "object name placeholder": "New YouTube channel",
57
- "add object label": "Add YouTube channel",
58
- "rename object label": "Rename YouTube channel",
59
- "delete object label": "Delete YouTube channel",
60
- "object deleted label": "YouTube channel deleted"
51
+ [Channel.YouTubeChannel.typename]: {
52
+ "typename.label": "YouTube Channel",
53
+ "typename.label_zero": "YouTube Channels",
54
+ "typename.label_one": "YouTube Channel",
55
+ "typename.label_other": "YouTube Channels",
56
+ "object-name.placeholder": "New YouTube channel",
57
+ "add-object.label": "Add YouTube channel",
58
+ "rename-object.label": "Rename YouTube channel",
59
+ "delete-object.label": "Delete YouTube channel",
60
+ "object-deleted.label": "YouTube channel deleted"
61
61
  },
62
- [Video_exports.YouTubeVideo.typename]: {
63
- "typename label": "Video",
64
- "typename label_zero": "Videos",
65
- "typename label_one": "Video",
66
- "typename label_other": "Videos",
67
- "object name placeholder": "New video",
68
- "add object label": "Add video",
69
- "rename object label": "Rename video",
70
- "delete object label": "Delete video",
71
- "object deleted label": "Video deleted"
62
+ [Video.YouTubeVideo.typename]: {
63
+ "typename.label": "Video",
64
+ "typename.label_zero": "Videos",
65
+ "typename.label_one": "Video",
66
+ "typename.label_other": "Videos",
67
+ "object-name.placeholder": "New video",
68
+ "add-object.label": "Add video",
69
+ "rename-object.label": "Rename video",
70
+ "delete-object.label": "Delete video",
71
+ "object-deleted.label": "Video deleted"
72
72
  },
73
- [meta.id]: {
74
- "plugin name": "YouTube",
75
- "channel label": "YouTube Channel",
76
- "video label": "Video",
77
- "sync channel label": "Sync channel",
78
- "sync channel error title": "Failed to sync channel",
79
- "clear synced videos label": "Clear synced videos",
80
- "clear synced videos error title": "Failed to clear synced videos",
81
- "close label": "Close",
82
- "new channel label": "New YouTube Channel",
83
- "empty channel message": "No videos synced yet",
84
- "no video message": "Select a video to view it",
85
- "channel account label": "Account",
86
- "channel account placeholder": "Select account...",
87
- "channel sync label": "Channel Sync",
88
- "enable background sync label": "Enable background sync",
89
- "enabling background sync label": "Enabling...",
90
- "disable background sync label": "Disable background sync",
91
- "view trigger label": "View trigger"
73
+ [meta2.id]: {
74
+ "plugin.name": "YouTube",
75
+ "channel.label": "YouTube Channel",
76
+ "video.label": "Video",
77
+ "sync-channel.label": "Sync channel",
78
+ "sync-channel-error.title": "Failed to sync channel",
79
+ "clear-synced-videos.label": "Clear synced videos",
80
+ "clear-synced-videos-error.title": "Failed to clear synced videos",
81
+ "close.label": "Close",
82
+ "new-channel.label": "New YouTube Channel",
83
+ "empty-channel.message": "No videos synced yet",
84
+ "no-video.message": "Select a video to view it",
85
+ "channel-account.label": "Account",
86
+ "channel-account.placeholder": "Select account...",
87
+ "channel-sync.label": "Channel Sync",
88
+ "enable-background-sync.label": "Enable background sync",
89
+ "enabling-background-sync.label": "Enabling...",
90
+ "disable-background-sync.label": "Disable background sync",
91
+ "view-trigger.label": "View trigger"
92
92
  }
93
93
  }
94
94
  }
95
95
  ];
96
96
 
97
97
  // src/YouTubePlugin.tsx
98
- var YouTubePlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
98
+ import { Channel as Channel2, Video as Video2 } from "#types";
99
+ import { AppGraphBuilder, BlueprintDefinition, Migrations, ReactSurface } from "#capabilities";
100
+ var YouTubePlugin = Plugin.define(meta3).pipe(AppPlugin.addAppGraphModule({
99
101
  activatesOn: ActivationEvent.allOf(AppActivationEvents.SetupAppGraph, AttentionEvents.AttentionReady),
100
102
  activate: AppGraphBuilder
101
103
  }), AppPlugin.addBlueprintDefinitionModule({
@@ -103,17 +105,17 @@ var YouTubePlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
103
105
  }), AppPlugin.addMetadataModule({
104
106
  metadata: [
105
107
  {
106
- id: Channel_exports.YouTubeChannel.typename,
108
+ id: Channel2.YouTubeChannel.typename,
107
109
  metadata: {
108
110
  label: (object) => object.name ?? object.channelUrl ?? object.channelId ?? "YouTube",
109
- icon: Annotation.IconAnnotation.get(Channel_exports.YouTubeChannel).pipe(Option.getOrThrow).icon,
110
- iconHue: Annotation.IconAnnotation.get(Channel_exports.YouTubeChannel).pipe(Option.getOrThrow).hue ?? "white",
111
+ icon: Annotation.IconAnnotation.get(Channel2.YouTubeChannel).pipe(Option.getOrThrow).icon,
112
+ iconHue: Annotation.IconAnnotation.get(Channel2.YouTubeChannel).pipe(Option.getOrThrow).hue ?? "white",
111
113
  blueprints: [
112
- youtube_default.key
114
+ YouTubeBlueprint.key
113
115
  ],
114
- inputSchema: Channel_exports.CreateYouTubeChannelSchema,
116
+ inputSchema: Channel2.CreateYouTubeChannelSchema,
115
117
  createObject: (props, options) => Effect.gen(function* () {
116
- const object = Channel_exports.make(props);
118
+ const object = Channel2.make(props);
117
119
  return yield* Operation.invoke(SpaceOperation.AddObject, {
118
120
  object,
119
121
  target: options.target,
@@ -124,23 +126,26 @@ var YouTubePlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
124
126
  }
125
127
  },
126
128
  {
127
- id: Video_exports.YouTubeVideo.typename,
129
+ id: Video2.YouTubeVideo.typename,
128
130
  metadata: {
129
131
  label: (object) => object.title,
130
- icon: Annotation.IconAnnotation.get(Video_exports.YouTubeVideo).pipe(Option.getOrThrow).icon,
131
- iconHue: Annotation.IconAnnotation.get(Video_exports.YouTubeVideo).pipe(Option.getOrThrow).hue ?? "white"
132
+ icon: Annotation.IconAnnotation.get(Video2.YouTubeVideo).pipe(Option.getOrThrow).icon,
133
+ iconHue: Annotation.IconAnnotation.get(Video2.YouTubeVideo).pipe(Option.getOrThrow).hue ?? "white"
132
134
  }
133
135
  }
134
136
  ]
135
137
  }), AppPlugin.addSchemaModule({
136
138
  schema: [
137
- Channel_exports.YouTubeChannel,
138
- Video_exports.YouTubeVideo
139
+ Channel2.YouTubeChannel,
140
+ Video2.YouTubeVideo
139
141
  ]
140
142
  }), AppPlugin.addSurfaceModule({
141
143
  activate: ReactSurface
142
144
  }), AppPlugin.addTranslationsModule({
143
145
  translations
146
+ }), Plugin.addModule({
147
+ activatesOn: ClientEvents.SetupMigration,
148
+ activate: Migrations
144
149
  }), Plugin.make);
145
150
  export {
146
151
  ClearSyncedVideos,