@audiofool/moondog 0.1.0

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 (109) hide show
  1. package/README.md +125 -0
  2. package/assets/brand/moondog-lunar-record/moondog-logo-1x1.png +0 -0
  3. package/contracts/v1/capability-policy.schema.json +572 -0
  4. package/contracts/v1/definitions.schema.json +365 -0
  5. package/contracts/v1/library-track-observation.schema.json +138 -0
  6. package/contracts/v1/listening-event.schema.json +111 -0
  7. package/contracts/v1/profile-evidence.schema.json +237 -0
  8. package/contracts/v1/taste-event.schema.json +258 -0
  9. package/contracts/v1/tool-invocation.schema.json +318 -0
  10. package/contracts/v1/tool-receipt.schema.json +1066 -0
  11. package/contracts/v1/track-ref.schema.json +275 -0
  12. package/contracts/v2/profile-evidence.schema.json +284 -0
  13. package/package.json +105 -0
  14. package/scripts/contract-lib.mjs +361 -0
  15. package/scripts/contract-semantics.mjs +2630 -0
  16. package/scripts/demo-studio.mjs +58 -0
  17. package/scripts/moondog +52 -0
  18. package/scripts/moondog.mjs +954 -0
  19. package/src/core/apple-data-migration.mjs +50 -0
  20. package/src/core/apple-library-source-status.mjs +220 -0
  21. package/src/core/apple-projection-domain-services.mjs +2356 -0
  22. package/src/core/capability-catalog.mjs +577 -0
  23. package/src/core/listening-profile-domain-services.mjs +1010 -0
  24. package/src/core/lyric-library.mjs +121 -0
  25. package/src/core/lyric-profile.mjs +50 -0
  26. package/src/core/lyric-service.mjs +41 -0
  27. package/src/core/moondog-application.mjs +1827 -0
  28. package/src/core/state-directory.mjs +19 -0
  29. package/src/core/synthetic-domain-services.mjs +1485 -0
  30. package/src/core/uuid-v5.mjs +42 -0
  31. package/src/demo/fictional-spotify-history.mjs +400 -0
  32. package/src/demo/moondog-demo.mjs +355 -0
  33. package/src/demo/moondog-interactive-tasteprint-demo.mjs +293 -0
  34. package/src/demo/moondog-tasteprint-demo.mjs +631 -0
  35. package/src/importers/apple-music-library/import-batch.mjs +290 -0
  36. package/src/importers/apple-music-library/index.mjs +76 -0
  37. package/src/importers/apple-music-library/normalize.mjs +1126 -0
  38. package/src/importers/apple-music-library/parse-plist.mjs +357 -0
  39. package/src/importers/apple-music-library/projection-records.mjs +557 -0
  40. package/src/importers/apple-music-library/read-batch.mjs +276 -0
  41. package/src/importers/apple-music-library/sqlite-projection.mjs +1307 -0
  42. package/src/importers/apple-music-library/stable-ids.mjs +19 -0
  43. package/src/importers/apple-music-library/track-snapshot.schema.json +136 -0
  44. package/src/integrations/apple-music/catalog.mjs +770 -0
  45. package/src/integrations/cross-catalog-artist-identity.mjs +222 -0
  46. package/src/integrations/listenbrainz/history-file.mjs +560 -0
  47. package/src/integrations/lyrics/lrclib.mjs +55 -0
  48. package/src/integrations/open-music-similarity/artist-radio.mjs +806 -0
  49. package/src/integrations/public-playlists.mjs +104 -0
  50. package/src/integrations/spotify/account-data-history.mjs +545 -0
  51. package/src/integrations/spotify/account-data-profile.mjs +918 -0
  52. package/src/integrations/spotify/authentication.mjs +791 -0
  53. package/src/integrations/spotify/catalog-resolver.mjs +657 -0
  54. package/src/integrations/spotify/connection.mjs +125 -0
  55. package/src/integrations/spotify/credential-store.mjs +26 -0
  56. package/src/integrations/spotify/extended-streaming-history.mjs +525 -0
  57. package/src/integrations/spotify/history-archive.mjs +59 -0
  58. package/src/integrations/spotify/index.mjs +80 -0
  59. package/src/integrations/spotify/recent-activity.mjs +198 -0
  60. package/src/integrations/spotify/resolution-cache.mjs +260 -0
  61. package/src/integrations/spotify/service.mjs +713 -0
  62. package/src/integrations/spotify/settings.mjs +89 -0
  63. package/src/integrations/spotify/web-api-client.mjs +761 -0
  64. package/src/integrations/web/codex-web.mjs +263 -0
  65. package/src/integrations/youtube-music/takeout.mjs +143 -0
  66. package/src/memory/local-memory-store.mjs +1705 -0
  67. package/src/memory/reflection-worker.mjs +87 -0
  68. package/src/profile/apple-library-import.mjs +28 -0
  69. package/src/profile/history-import.mjs +163 -0
  70. package/src/profile/listener-corrections.mjs +217 -0
  71. package/src/profile/listening-history-store.mjs +2055 -0
  72. package/src/profile/listening-profile-projection.mjs +2520 -0
  73. package/src/profile/local-music-data.mjs +812 -0
  74. package/src/profile/music-import-bundle.mjs +91 -0
  75. package/src/profile/music-providers.mjs +25 -0
  76. package/src/profile/spotify-archive-catalog-hints.mjs +210 -0
  77. package/src/profile/spotify-archive-taste.mjs +482 -0
  78. package/src/runtime/pi/agent-runtime.mjs +6444 -0
  79. package/src/runtime/pi/authentication.mjs +104 -0
  80. package/src/runtime/pi/configured-runtime.mjs +98 -0
  81. package/src/runtime/pi/memory-agent-runtime.mjs +337 -0
  82. package/src/runtime/pi/model-catalog.mjs +62 -0
  83. package/src/runtime/pi/model-transport.mjs +117 -0
  84. package/src/runtime/pi/persistent-credential-store.mjs +670 -0
  85. package/src/runtime/pi/provider-registry.mjs +74 -0
  86. package/src/runtime/pi/runtime-settings.mjs +81 -0
  87. package/src/surfaces/cli/auth-command.mjs +355 -0
  88. package/src/surfaces/cli/brand-components.mjs +390 -0
  89. package/src/surfaces/cli/brand-theme.mjs +231 -0
  90. package/src/surfaces/cli/catalog-command.mjs +509 -0
  91. package/src/surfaces/cli/command-completions.mjs +113 -0
  92. package/src/surfaces/cli/data-command.mjs +214 -0
  93. package/src/surfaces/cli/format-output.mjs +750 -0
  94. package/src/surfaces/cli/history-import-view.mjs +445 -0
  95. package/src/surfaces/cli/import-guides.mjs +9 -0
  96. package/src/surfaces/cli/listenbrainz-command.mjs +129 -0
  97. package/src/surfaces/cli/listening-menu.mjs +171 -0
  98. package/src/surfaces/cli/profile-command.mjs +290 -0
  99. package/src/surfaces/cli/spotify-command.mjs +849 -0
  100. package/src/surfaces/cli/taste-profile-model.mjs +306 -0
  101. package/src/surfaces/cli/taste-profile-view.mjs +272 -0
  102. package/src/surfaces/cli/terminal-art.mjs +295 -0
  103. package/src/surfaces/cli/tui.mjs +1714 -0
  104. package/src/surfaces/cli/web-command.mjs +52 -0
  105. package/src/surfaces/html/tasteprint-artifact.mjs +96 -0
  106. package/src/surfaces/html/tasteprint.mjs +3575 -0
  107. package/src/surfaces/web/showcase.mjs +272 -0
  108. package/src/surfaces/web/studio-page.mjs +4148 -0
  109. package/src/surfaces/web/studio.mjs +2288 -0
@@ -0,0 +1,19 @@
1
+ import { isUuid, uuidV5 } from "../../core/uuid-v5.mjs";
2
+
3
+ export { isUuid, uuidV5 };
4
+
5
+ export const APPLE_LIBRARY_BATCH_NAMESPACE =
6
+ "d68f4c5b-6a24-553d-9e6c-693a8302d906";
7
+ export const APPLE_LIBRARY_TRACK_NAMESPACE =
8
+ "ba322462-2585-5ac5-a1f4-8e2d1838a268";
9
+ export const APPLE_LIBRARY_SNAPSHOT_NAMESPACE =
10
+ "230e10d2-68a0-58a3-8b64-964100b60de1";
11
+ export const APPLE_LIBRARY_CANONICAL_TRACK_NAMESPACE =
12
+ "5f30a928-3ee0-5df3-8a10-d31bbd491e6d";
13
+ export const APPLE_LIBRARY_OBSERVATION_NAMESPACE =
14
+ "8cb519da-458d-5a48-85e3-181bc27fcc49";
15
+ export const APPLE_LIBRARY_PROFILE_EVIDENCE_NAMESPACE =
16
+ "a8bdb2d1-aa5c-5b06-94cc-c9a866094326";
17
+ export const APPLE_MUSIC_LIBRARY_IMPORTER_NAME =
18
+ "moondog.apple_music_library";
19
+ export const APPLE_MUSIC_LIBRARY_IMPORTER_VERSION = "0.1.0";
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:moondog:import:apple-music-library:track-snapshot:1",
4
+ "title": "Moondog Apple Music Library Track Snapshot v1",
5
+ "type": "object",
6
+ "$defs": {
7
+ "uuid": {
8
+ "type": "string",
9
+ "format": "uuid"
10
+ },
11
+ "utc_timestamp": {
12
+ "type": "string",
13
+ "format": "date-time",
14
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$"
15
+ },
16
+ "rating": {
17
+ "type": "object",
18
+ "properties": {
19
+ "value": {
20
+ "type": "integer",
21
+ "minimum": 0,
22
+ "maximum": 100
23
+ },
24
+ "computed": {
25
+ "type": "boolean"
26
+ }
27
+ },
28
+ "required": [
29
+ "value"
30
+ ],
31
+ "additionalProperties": false
32
+ }
33
+ },
34
+ "properties": {
35
+ "schema_version": {
36
+ "const": "1"
37
+ },
38
+ "track_snapshot_id": {
39
+ "$ref": "#/$defs/uuid"
40
+ },
41
+ "import_batch_id": {
42
+ "$ref": "#/$defs/uuid"
43
+ },
44
+ "subject_id": {
45
+ "$ref": "#/$defs/uuid"
46
+ },
47
+ "track_ref_id": {
48
+ "$ref": "#/$defs/uuid"
49
+ },
50
+ "captured_at": {
51
+ "$ref": "#/$defs/utc_timestamp"
52
+ },
53
+ "source_record_key_sha256": {
54
+ "type": "string",
55
+ "pattern": "^[0-9a-f]{64}$"
56
+ },
57
+ "snapshot_kind": {
58
+ "const": "aggregate_library_state"
59
+ },
60
+ "aggregate_state": {
61
+ "type": "object",
62
+ "properties": {
63
+ "play_count": {
64
+ "type": "integer",
65
+ "minimum": 0
66
+ },
67
+ "last_played_at": {
68
+ "$ref": "#/$defs/utc_timestamp"
69
+ },
70
+ "skip_count": {
71
+ "type": "integer",
72
+ "minimum": 0
73
+ },
74
+ "last_skipped_at": {
75
+ "$ref": "#/$defs/utc_timestamp"
76
+ },
77
+ "rating": {
78
+ "$ref": "#/$defs/rating"
79
+ },
80
+ "album_rating": {
81
+ "$ref": "#/$defs/rating"
82
+ },
83
+ "loved": {
84
+ "type": "boolean"
85
+ },
86
+ "favorited": {
87
+ "type": "boolean"
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ },
92
+ "library_state": {
93
+ "type": "object",
94
+ "properties": {
95
+ "date_added": {
96
+ "$ref": "#/$defs/utc_timestamp"
97
+ },
98
+ "date_modified": {
99
+ "$ref": "#/$defs/utc_timestamp"
100
+ },
101
+ "apple_music": {
102
+ "type": "boolean"
103
+ },
104
+ "purchased": {
105
+ "type": "boolean"
106
+ },
107
+ "playlist_only": {
108
+ "type": "boolean"
109
+ },
110
+ "compilation": {
111
+ "type": "boolean"
112
+ },
113
+ "unplayed": {
114
+ "type": "boolean"
115
+ },
116
+ "disabled": {
117
+ "type": "boolean"
118
+ }
119
+ },
120
+ "additionalProperties": false
121
+ }
122
+ },
123
+ "required": [
124
+ "schema_version",
125
+ "track_snapshot_id",
126
+ "import_batch_id",
127
+ "subject_id",
128
+ "track_ref_id",
129
+ "captured_at",
130
+ "source_record_key_sha256",
131
+ "snapshot_kind",
132
+ "aggregate_state",
133
+ "library_state"
134
+ ],
135
+ "additionalProperties": false
136
+ }