@audiofool/moondog 0.1.0 → 0.2.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +156 -68
  3. package/contracts/v1/definitions.schema.json +1 -169
  4. package/package.json +7 -23
  5. package/scripts/contract-lib.mjs +0 -7
  6. package/scripts/contract-semantics.mjs +0 -1904
  7. package/scripts/moondog.mjs +285 -74
  8. package/src/core/apple-library-source-status.mjs +0 -16
  9. package/src/core/apple-projection-domain-services.mjs +253 -53
  10. package/src/core/application-update.mjs +320 -0
  11. package/src/core/capability-catalog.mjs +290 -55
  12. package/src/core/listener-avoids.mjs +101 -0
  13. package/src/core/listening-now.mjs +108 -0
  14. package/src/core/listening-profile-domain-services.mjs +189 -41
  15. package/src/core/listening-upkeep.mjs +31 -0
  16. package/src/core/moondog-application.mjs +2115 -107
  17. package/src/core/playback-preferences.mjs +97 -0
  18. package/src/core/spotify-listening-intent.mjs +124 -0
  19. package/src/core/synthetic-domain-services.mjs +24 -3
  20. package/src/core/track-title.mjs +107 -0
  21. package/src/demo/moondog-demo.mjs +4 -22
  22. package/src/i18n/index.mjs +285 -0
  23. package/src/i18n/messages/de.mjs +135 -0
  24. package/src/i18n/messages/en.mjs +136 -0
  25. package/src/i18n/messages/es.mjs +135 -0
  26. package/src/i18n/messages/fr.mjs +135 -0
  27. package/src/i18n/messages/it.mjs +135 -0
  28. package/src/i18n/messages/ja.mjs +135 -0
  29. package/src/i18n/messages/ko.mjs +135 -0
  30. package/src/i18n/messages/pt.mjs +135 -0
  31. package/src/i18n/messages/zh-Hant.mjs +135 -0
  32. package/src/i18n/messages/zh.mjs +135 -0
  33. package/src/i18n/preferences.mjs +34 -0
  34. package/src/i18n/screen/es.mjs +967 -0
  35. package/src/i18n/screen/ja.mjs +967 -0
  36. package/src/i18n/screen/pt.mjs +967 -0
  37. package/src/i18n/screen/zh.mjs +967 -0
  38. package/src/importers/apple-music-library/index.mjs +0 -16
  39. package/src/importers/apple-music-library/sqlite-projection.mjs +51 -9
  40. package/src/integrations/apple-music/catalog.mjs +166 -14
  41. package/src/integrations/apple-music/music-app.mjs +232 -0
  42. package/src/integrations/apple-music/storefront.mjs +28 -0
  43. package/src/integrations/apple-music/terminal-preview-player.mjs +221 -0
  44. package/src/integrations/lastfm/history.mjs +221 -0
  45. package/src/integrations/lastfm/settings.mjs +75 -0
  46. package/src/integrations/netease/ncm-cli-player.mjs +328 -0
  47. package/src/integrations/open-music-similarity/artist-radio.mjs +26 -18
  48. package/src/integrations/public-playlists.mjs +2 -1
  49. package/src/integrations/spotify/account-data-profile.mjs +14 -6
  50. package/src/integrations/spotify/authentication.mjs +149 -15
  51. package/src/integrations/spotify/catalog-resolver.mjs +9 -6
  52. package/src/integrations/spotify/connection.mjs +2 -1
  53. package/src/integrations/spotify/credential-store.mjs +4 -0
  54. package/src/integrations/spotify/extended-streaming-history.mjs +11 -11
  55. package/src/integrations/spotify/history-archive.mjs +1 -1
  56. package/src/integrations/spotify/library-snapshot.mjs +227 -0
  57. package/src/integrations/spotify/recent-activity.mjs +2 -0
  58. package/src/integrations/spotify/service.mjs +873 -69
  59. package/src/integrations/spotify/web-api-client.mjs +410 -127
  60. package/src/integrations/web/brave-web.mjs +45 -0
  61. package/src/integrations/web/codex-web.mjs +15 -82
  62. package/src/integrations/web/deepseek-web.mjs +81 -0
  63. package/src/integrations/web/web-research.mjs +119 -0
  64. package/src/integrations/web/web-result.mjs +215 -0
  65. package/src/integrations/youtube-music/takeout.mjs +3 -1
  66. package/src/memory/local-memory-store.mjs +542 -57
  67. package/src/profile/history-import.mjs +42 -6
  68. package/src/profile/listener-corrections.mjs +22 -0
  69. package/src/profile/listener-profile-build.mjs +461 -0
  70. package/src/profile/listener-profile-store.mjs +130 -0
  71. package/src/profile/listener-profile-verification.mjs +68 -0
  72. package/src/profile/listener-profile-worker.mjs +179 -0
  73. package/src/profile/listening-history-store.mjs +640 -17
  74. package/src/profile/listening-profile-projection.mjs +454 -86
  75. package/src/profile/local-music-data.mjs +1 -1
  76. package/src/profile/moondog-suggestions.mjs +184 -0
  77. package/src/profile/music-providers.mjs +11 -7
  78. package/src/profile/profile-exploration.mjs +92 -0
  79. package/src/profile/recorded-measures.mjs +24 -0
  80. package/src/profile/spotify-archive-taste.mjs +0 -4
  81. package/src/runtime/pi/agent-runtime.mjs +2536 -692
  82. package/src/runtime/pi/authentication.mjs +34 -1
  83. package/src/runtime/pi/configured-runtime.mjs +22 -6
  84. package/src/runtime/pi/conversation-name.mjs +53 -0
  85. package/src/runtime/pi/memory-agent-runtime.mjs +2 -2
  86. package/src/runtime/pi/model-catalog.mjs +28 -5
  87. package/src/runtime/pi/model-settings.mjs +202 -0
  88. package/src/runtime/pi/model-transport.mjs +10 -0
  89. package/src/runtime/pi/persistent-credential-store.mjs +67 -31
  90. package/src/runtime/pi/profile-build-runtime.mjs +161 -0
  91. package/src/runtime/pi/public-model-catalog.mjs +288 -0
  92. package/src/runtime/pi/runtime-settings.mjs +10 -2
  93. package/src/runtime/pi/skills/listener-profile/SKILL.md +48 -0
  94. package/src/runtime/pi/tool-trace.mjs +37 -0
  95. package/src/surfaces/cli/auth-command.mjs +12 -4
  96. package/src/surfaces/cli/brand-components.mjs +310 -132
  97. package/src/surfaces/cli/brand-theme.mjs +51 -28
  98. package/src/surfaces/cli/command-completions.mjs +58 -42
  99. package/src/surfaces/cli/format-output.mjs +199 -388
  100. package/src/surfaces/cli/history-import-view.mjs +292 -139
  101. package/src/surfaces/cli/import-guides.mjs +2 -0
  102. package/src/surfaces/cli/listener-profile-command.mjs +92 -0
  103. package/src/surfaces/cli/listening-menu.mjs +7 -4
  104. package/src/surfaces/cli/profile-command.mjs +30 -21
  105. package/src/surfaces/cli/seasons-chart.mjs +87 -0
  106. package/src/surfaces/cli/spotify-command.mjs +54 -6
  107. package/src/surfaces/cli/taste-profile-model.mjs +78 -79
  108. package/src/surfaces/cli/taste-profile-view.mjs +33 -26
  109. package/src/surfaces/cli/terminal-art.mjs +140 -35
  110. package/src/surfaces/cli/tui.mjs +1066 -357
  111. package/src/surfaces/cli/update-command.mjs +32 -0
  112. package/src/surfaces/cli/web-command.mjs +53 -14
  113. package/src/surfaces/html/tasteprint.mjs +43 -70
  114. package/contracts/v1/capability-policy.schema.json +0 -572
  115. package/contracts/v1/profile-evidence.schema.json +0 -237
  116. package/contracts/v1/tool-invocation.schema.json +0 -318
  117. package/contracts/v1/tool-receipt.schema.json +0 -1066
  118. package/scripts/demo-studio.mjs +0 -58
  119. package/src/core/apple-data-migration.mjs +0 -50
  120. package/src/demo/moondog-interactive-tasteprint-demo.mjs +0 -293
  121. package/src/demo/moondog-tasteprint-demo.mjs +0 -631
  122. package/src/integrations/spotify/index.mjs +0 -80
  123. package/src/surfaces/web/showcase.mjs +0 -272
  124. package/src/surfaces/web/studio-page.mjs +0 -4148
  125. package/src/surfaces/web/studio.mjs +0 -2288
@@ -1,572 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:moondog:contract:capability-policy:1",
4
- "title": "Moondog CapabilityPolicy v1",
5
- "type": "object",
6
- "properties": {
7
- "schema_version": {
8
- "$ref": "urn:moondog:contract:definitions:1#/$defs/schema_version"
9
- },
10
- "policy_id": {
11
- "$ref": "urn:moondog:contract:definitions:1#/$defs/uuid"
12
- },
13
- "policy_version": {
14
- "type": "integer",
15
- "minimum": 1
16
- },
17
- "subject_id": {
18
- "$ref": "urn:moondog:contract:definitions:1#/$defs/uuid"
19
- },
20
- "effect": {
21
- "enum": [
22
- "allow",
23
- "deny"
24
- ]
25
- },
26
- "enabled": {
27
- "type": "boolean"
28
- },
29
- "capability_ids": {
30
- "type": "array",
31
- "minItems": 1,
32
- "items": {
33
- "$ref": "urn:moondog:contract:definitions:1#/$defs/namespaced_key"
34
- },
35
- "uniqueItems": true
36
- },
37
- "actor_types": {
38
- "type": "array",
39
- "minItems": 1,
40
- "items": {
41
- "enum": [
42
- "user",
43
- "agent",
44
- "service"
45
- ]
46
- },
47
- "uniqueItems": true
48
- },
49
- "actor_refs": {
50
- "type": "array",
51
- "minItems": 1,
52
- "items": {
53
- "$ref": "urn:moondog:contract:definitions:1#/$defs/actor_ref"
54
- },
55
- "uniqueItems": true
56
- },
57
- "surfaces": {
58
- "type": "array",
59
- "minItems": 1,
60
- "items": {
61
- "$ref": "urn:moondog:contract:definitions:1#/$defs/namespaced_key"
62
- },
63
- "uniqueItems": true
64
- },
65
- "account_refs": {
66
- "type": "array",
67
- "minItems": 1,
68
- "items": {
69
- "$ref": "urn:moondog:contract:definitions:1#/$defs/external_ref"
70
- },
71
- "uniqueItems": true
72
- },
73
- "allowed_execution_modes": {
74
- "type": "array",
75
- "minItems": 1,
76
- "items": {
77
- "enum": [
78
- "plan",
79
- "dry_run",
80
- "execute"
81
- ]
82
- },
83
- "uniqueItems": true
84
- },
85
- "allowed_effects": {
86
- "type": "array",
87
- "minItems": 1,
88
- "items": {
89
- "$ref": "urn:moondog:contract:definitions:1#/$defs/effect_kind"
90
- },
91
- "uniqueItems": true
92
- },
93
- "risk_limits": {
94
- "type": "array",
95
- "minItems": 1,
96
- "items": {
97
- "type": "object",
98
- "properties": {
99
- "domain": {
100
- "$ref": "urn:moondog:contract:definitions:1#/$defs/risk_domain"
101
- },
102
- "max_level": {
103
- "enum": [
104
- "none",
105
- "low",
106
- "medium",
107
- "high"
108
- ]
109
- }
110
- },
111
- "required": [
112
- "domain",
113
- "max_level"
114
- ],
115
- "additionalProperties": false
116
- }
117
- },
118
- "privacy": {
119
- "type": "object",
120
- "properties": {
121
- "purpose_id": {
122
- "$ref": "urn:moondog:contract:definitions:1#/$defs/namespaced_key"
123
- },
124
- "purpose": {
125
- "$ref": "urn:moondog:contract:definitions:1#/$defs/non_empty_string"
126
- },
127
- "allowed_data_classes": {
128
- "type": "array",
129
- "minItems": 1,
130
- "items": {
131
- "$ref": "urn:moondog:contract:definitions:1#/$defs/data_class"
132
- },
133
- "uniqueItems": true
134
- },
135
- "allowed_destinations": {
136
- "type": "array",
137
- "minItems": 1,
138
- "items": {
139
- "$ref": "urn:moondog:contract:definitions:1#/$defs/external_destination"
140
- },
141
- "uniqueItems": true
142
- },
143
- "raw_data_egress_allowed": {
144
- "type": "boolean"
145
- },
146
- "rights_basis_required": {
147
- "type": "boolean"
148
- },
149
- "retention_days": {
150
- "type": "integer",
151
- "minimum": 0
152
- }
153
- },
154
- "required": [
155
- "purpose_id",
156
- "purpose",
157
- "allowed_data_classes",
158
- "allowed_destinations",
159
- "raw_data_egress_allowed",
160
- "rights_basis_required"
161
- ],
162
- "additionalProperties": false
163
- },
164
- "confirmation": {
165
- "type": "object",
166
- "properties": {
167
- "mode": {
168
- "enum": [
169
- "never",
170
- "always"
171
- ]
172
- },
173
- "scope": {
174
- "const": "invocation"
175
- },
176
- "ttl_seconds": {
177
- "type": "integer",
178
- "minimum": 1,
179
- "maximum": 3600
180
- },
181
- "max_uses": {
182
- "type": "integer",
183
- "const": 1
184
- }
185
- },
186
- "required": [
187
- "mode"
188
- ],
189
- "allOf": [
190
- {
191
- "if": {
192
- "properties": {
193
- "mode": {
194
- "const": "never"
195
- }
196
- },
197
- "required": [
198
- "mode"
199
- ]
200
- },
201
- "then": {
202
- "not": {
203
- "anyOf": [
204
- {
205
- "required": [
206
- "scope"
207
- ]
208
- },
209
- {
210
- "required": [
211
- "ttl_seconds"
212
- ]
213
- },
214
- {
215
- "required": [
216
- "max_uses"
217
- ]
218
- }
219
- ]
220
- }
221
- },
222
- "else": {
223
- "required": [
224
- "scope",
225
- "ttl_seconds",
226
- "max_uses"
227
- ]
228
- }
229
- }
230
- ],
231
- "additionalProperties": false
232
- },
233
- "budgets": {
234
- "type": "array",
235
- "items": {
236
- "type": "object",
237
- "properties": {
238
- "resource": {
239
- "$ref": "urn:moondog:contract:definitions:1#/$defs/namespaced_key"
240
- },
241
- "unit": {
242
- "$ref": "urn:moondog:contract:definitions:1#/$defs/non_empty_string"
243
- },
244
- "max_per_invocation": {
245
- "type": "integer",
246
- "minimum": 0
247
- },
248
- "max_per_window": {
249
- "type": "integer",
250
- "minimum": 0
251
- },
252
- "window_seconds": {
253
- "type": "integer",
254
- "minimum": 1
255
- }
256
- },
257
- "required": [
258
- "resource",
259
- "unit"
260
- ],
261
- "anyOf": [
262
- {
263
- "required": [
264
- "max_per_invocation"
265
- ]
266
- },
267
- {
268
- "required": [
269
- "max_per_window",
270
- "window_seconds"
271
- ]
272
- }
273
- ],
274
- "dependentRequired": {
275
- "max_per_window": [
276
- "window_seconds"
277
- ],
278
- "window_seconds": [
279
- "max_per_window"
280
- ]
281
- },
282
- "additionalProperties": false
283
- }
284
- },
285
- "idempotency": {
286
- "type": "object",
287
- "properties": {
288
- "required_for": {
289
- "type": "array",
290
- "items": {
291
- "enum": [
292
- "write_local",
293
- "write_external",
294
- "send_message",
295
- "spend",
296
- "publish",
297
- "delete"
298
- ]
299
- },
300
- "uniqueItems": true
301
- },
302
- "key_ttl_seconds": {
303
- "type": "integer",
304
- "minimum": 86400
305
- }
306
- },
307
- "required": [
308
- "required_for",
309
- "key_ttl_seconds"
310
- ],
311
- "additionalProperties": false
312
- },
313
- "retry": {
314
- "type": "object",
315
- "properties": {
316
- "max_attempts": {
317
- "type": "integer",
318
- "minimum": 1,
319
- "maximum": 10
320
- },
321
- "backoff": {
322
- "enum": [
323
- "none",
324
- "fixed",
325
- "exponential"
326
- ]
327
- },
328
- "base_delay_ms": {
329
- "type": "integer",
330
- "minimum": 0
331
- },
332
- "retryable_categories": {
333
- "type": "array",
334
- "items": {
335
- "enum": [
336
- "timeout",
337
- "rate_limit",
338
- "external_service"
339
- ]
340
- },
341
- "uniqueItems": true
342
- }
343
- },
344
- "required": [
345
- "max_attempts",
346
- "backoff",
347
- "base_delay_ms",
348
- "retryable_categories"
349
- ],
350
- "additionalProperties": false
351
- },
352
- "timeout_seconds": {
353
- "type": "integer",
354
- "minimum": 1,
355
- "maximum": 3600
356
- },
357
- "escalate_on": {
358
- "type": "array",
359
- "items": {
360
- "enum": [
361
- "approval_expired",
362
- "budget_exceeded",
363
- "authentication_required",
364
- "human_challenge",
365
- "required_context_missing",
366
- "repeated_failure",
367
- "ambiguous_intent",
368
- "irreversible_action",
369
- "unknown_outcome"
370
- ]
371
- },
372
- "uniqueItems": true
373
- },
374
- "audit": {
375
- "type": "object",
376
- "properties": {
377
- "required": {
378
- "type": "boolean"
379
- },
380
- "redact_argument_paths": {
381
- "type": "array",
382
- "items": {
383
- "type": "string",
384
- "pattern": "^/"
385
- },
386
- "uniqueItems": true
387
- },
388
- "redact_result_paths": {
389
- "type": "array",
390
- "items": {
391
- "type": "string",
392
- "pattern": "^/"
393
- },
394
- "uniqueItems": true
395
- },
396
- "retention_days": {
397
- "type": "integer",
398
- "minimum": 0
399
- }
400
- },
401
- "required": [
402
- "required",
403
- "redact_argument_paths",
404
- "redact_result_paths"
405
- ],
406
- "additionalProperties": false
407
- },
408
- "valid_from": {
409
- "$ref": "urn:moondog:contract:definitions:1#/$defs/utc_timestamp"
410
- },
411
- "valid_until": {
412
- "$ref": "urn:moondog:contract:definitions:1#/$defs/utc_timestamp"
413
- },
414
- "priority": {
415
- "type": "integer",
416
- "minimum": 0,
417
- "maximum": 1000
418
- },
419
- "extensions": {
420
- "$ref": "urn:moondog:contract:definitions:1#/$defs/extensions"
421
- }
422
- },
423
- "required": [
424
- "schema_version",
425
- "policy_id",
426
- "policy_version",
427
- "subject_id",
428
- "effect",
429
- "enabled",
430
- "capability_ids",
431
- "actor_types",
432
- "surfaces",
433
- "allowed_execution_modes",
434
- "allowed_effects",
435
- "risk_limits",
436
- "privacy",
437
- "confirmation",
438
- "budgets",
439
- "idempotency",
440
- "retry",
441
- "timeout_seconds",
442
- "escalate_on",
443
- "audit",
444
- "valid_from"
445
- ],
446
- "allOf": [
447
- {
448
- "if": {
449
- "properties": {
450
- "effect": {
451
- "const": "allow"
452
- },
453
- "allowed_effects": {
454
- "type": "array",
455
- "contains": {
456
- "enum": [
457
- "write_external",
458
- "send_message",
459
- "spend",
460
- "publish",
461
- "delete",
462
- "use_credentials"
463
- ]
464
- }
465
- }
466
- },
467
- "required": [
468
- "effect",
469
- "allowed_effects"
470
- ]
471
- },
472
- "then": {
473
- "required": [
474
- "account_refs"
475
- ],
476
- "properties": {
477
- "confirmation": {
478
- "type": "object",
479
- "properties": {
480
- "mode": {
481
- "const": "always"
482
- }
483
- }
484
- }
485
- }
486
- }
487
- },
488
- {
489
- "if": {
490
- "properties": {
491
- "effect": {
492
- "const": "allow"
493
- },
494
- "allowed_effects": {
495
- "type": "array",
496
- "contains": {
497
- "const": "spend"
498
- }
499
- }
500
- },
501
- "required": [
502
- "effect",
503
- "allowed_effects"
504
- ]
505
- },
506
- "then": {
507
- "properties": {
508
- "budgets": {
509
- "type": "array",
510
- "minItems": 1
511
- }
512
- }
513
- }
514
- },
515
- {
516
- "if": {
517
- "properties": {
518
- "effect": {
519
- "const": "allow"
520
- }
521
- },
522
- "required": [
523
- "effect"
524
- ]
525
- },
526
- "then": {
527
- "required": [
528
- "actor_refs"
529
- ]
530
- }
531
- },
532
- {
533
- "if": {
534
- "properties": {
535
- "effect": {
536
- "const": "allow"
537
- },
538
- "allowed_effects": {
539
- "type": "array",
540
- "contains": {
541
- "enum": [
542
- "write_external",
543
- "send_message",
544
- "spend",
545
- "publish",
546
- "delete",
547
- "use_credentials"
548
- ]
549
- }
550
- }
551
- },
552
- "required": [
553
- "effect",
554
- "allowed_effects"
555
- ]
556
- },
557
- "then": {
558
- "properties": {
559
- "audit": {
560
- "type": "object",
561
- "properties": {
562
- "required": {
563
- "const": true
564
- }
565
- }
566
- }
567
- }
568
- }
569
- }
570
- ],
571
- "additionalProperties": false
572
- }