@project-ava-supernova/core 0.2.171 → 0.2.172

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 (205) hide show
  1. package/dist/agent/vision-bridge.d.ts.map +1 -1
  2. package/dist/agent/vision-bridge.js +1 -6
  3. package/dist/agent/vision-bridge.js.map +1 -1
  4. package/dist/audit/cost.d.ts +2 -3
  5. package/dist/audit/cost.d.ts.map +1 -1
  6. package/dist/audit/cost.js +13 -25
  7. package/dist/audit/cost.js.map +1 -1
  8. package/dist/audit/export.d.ts.map +1 -1
  9. package/dist/audit/export.js +3 -5
  10. package/dist/audit/export.js.map +1 -1
  11. package/dist/audit/summary.d.ts +0 -2
  12. package/dist/audit/summary.d.ts.map +1 -1
  13. package/dist/audit/summary.js +2 -8
  14. package/dist/audit/summary.js.map +1 -1
  15. package/dist/audit/types.d.ts +5 -6
  16. package/dist/audit/types.d.ts.map +1 -1
  17. package/dist/auto/auto-coordinator.d.ts +4 -15
  18. package/dist/auto/auto-coordinator.d.ts.map +1 -1
  19. package/dist/auto/auto-coordinator.js +30 -66
  20. package/dist/auto/auto-coordinator.js.map +1 -1
  21. package/dist/auto/coordinator-model.d.ts +1 -1
  22. package/dist/auto/coordinator-model.d.ts.map +1 -1
  23. package/dist/auto/coordinator-model.js +2 -43
  24. package/dist/auto/coordinator-model.js.map +1 -1
  25. package/dist/auto/intent-gate.d.ts +1 -1
  26. package/dist/auto/intent-gate.d.ts.map +1 -1
  27. package/dist/auto/intent-gate.js +2 -12
  28. package/dist/auto/intent-gate.js.map +1 -1
  29. package/dist/auto/model-router.d.ts +1 -2
  30. package/dist/auto/model-router.d.ts.map +1 -1
  31. package/dist/auto/model-router.js +3 -28
  32. package/dist/auto/model-router.js.map +1 -1
  33. package/dist/config/account-merge.d.ts +47 -0
  34. package/dist/config/account-merge.d.ts.map +1 -0
  35. package/dist/config/account-merge.js +228 -0
  36. package/dist/config/account-merge.js.map +1 -0
  37. package/dist/config/config.d.ts +3 -0
  38. package/dist/config/config.d.ts.map +1 -1
  39. package/dist/config/config.js +6 -5
  40. package/dist/config/config.js.map +1 -1
  41. package/dist/config/schema.d.ts +0 -1
  42. package/dist/config/schema.d.ts.map +1 -1
  43. package/dist/config/schema.js.map +1 -1
  44. package/dist/creative/dashscope.d.ts +22 -0
  45. package/dist/creative/dashscope.d.ts.map +1 -1
  46. package/dist/creative/dashscope.js +47 -0
  47. package/dist/creative/dashscope.js.map +1 -1
  48. package/dist/creative/image-local.d.ts.map +1 -1
  49. package/dist/creative/image-local.js +20 -3
  50. package/dist/creative/image-local.js.map +1 -1
  51. package/dist/creative/index.d.ts +0 -5
  52. package/dist/creative/index.d.ts.map +1 -1
  53. package/dist/creative/index.js +0 -20
  54. package/dist/creative/index.js.map +1 -1
  55. package/dist/dataset/events.d.ts +1 -29
  56. package/dist/dataset/events.d.ts.map +1 -1
  57. package/dist/dataset/routing.d.ts +1 -1
  58. package/dist/dataset/routing.d.ts.map +1 -1
  59. package/dist/dataset/routing.js +0 -3
  60. package/dist/dataset/routing.js.map +1 -1
  61. package/dist/docs/adapter.js.map +1 -1
  62. package/dist/docs/data/providers.d.ts +1 -2
  63. package/dist/docs/data/providers.d.ts.map +1 -1
  64. package/dist/docs/data/providers.js +8 -47
  65. package/dist/docs/data/providers.js.map +1 -1
  66. package/dist/docs/types.d.ts +1 -1
  67. package/dist/docs/types.d.ts.map +1 -1
  68. package/dist/i18n/locales/ar.d.ts.map +1 -1
  69. package/dist/i18n/locales/ar.js +66 -18
  70. package/dist/i18n/locales/ar.js.map +1 -1
  71. package/dist/i18n/locales/de.d.ts.map +1 -1
  72. package/dist/i18n/locales/de.js +66 -18
  73. package/dist/i18n/locales/de.js.map +1 -1
  74. package/dist/i18n/locales/en.d.ts +48 -0
  75. package/dist/i18n/locales/en.d.ts.map +1 -1
  76. package/dist/i18n/locales/en.js +68 -18
  77. package/dist/i18n/locales/en.js.map +1 -1
  78. package/dist/i18n/locales/es.d.ts.map +1 -1
  79. package/dist/i18n/locales/es.js +66 -18
  80. package/dist/i18n/locales/es.js.map +1 -1
  81. package/dist/i18n/locales/fr.d.ts.map +1 -1
  82. package/dist/i18n/locales/fr.js +66 -18
  83. package/dist/i18n/locales/fr.js.map +1 -1
  84. package/dist/i18n/locales/hi.d.ts.map +1 -1
  85. package/dist/i18n/locales/hi.js +66 -18
  86. package/dist/i18n/locales/hi.js.map +1 -1
  87. package/dist/i18n/locales/id.d.ts.map +1 -1
  88. package/dist/i18n/locales/id.js +66 -18
  89. package/dist/i18n/locales/id.js.map +1 -1
  90. package/dist/i18n/locales/it.d.ts.map +1 -1
  91. package/dist/i18n/locales/it.js +66 -18
  92. package/dist/i18n/locales/it.js.map +1 -1
  93. package/dist/i18n/locales/ja.d.ts.map +1 -1
  94. package/dist/i18n/locales/ja.js +66 -18
  95. package/dist/i18n/locales/ja.js.map +1 -1
  96. package/dist/i18n/locales/ko.d.ts.map +1 -1
  97. package/dist/i18n/locales/ko.js +66 -18
  98. package/dist/i18n/locales/ko.js.map +1 -1
  99. package/dist/i18n/locales/nl.d.ts.map +1 -1
  100. package/dist/i18n/locales/nl.js +66 -18
  101. package/dist/i18n/locales/nl.js.map +1 -1
  102. package/dist/i18n/locales/pl.d.ts.map +1 -1
  103. package/dist/i18n/locales/pl.js +66 -18
  104. package/dist/i18n/locales/pl.js.map +1 -1
  105. package/dist/i18n/locales/pt.d.ts.map +1 -1
  106. package/dist/i18n/locales/pt.js +66 -18
  107. package/dist/i18n/locales/pt.js.map +1 -1
  108. package/dist/i18n/locales/ru.d.ts.map +1 -1
  109. package/dist/i18n/locales/ru.js +66 -18
  110. package/dist/i18n/locales/ru.js.map +1 -1
  111. package/dist/i18n/locales/th.d.ts.map +1 -1
  112. package/dist/i18n/locales/th.js +66 -18
  113. package/dist/i18n/locales/th.js.map +1 -1
  114. package/dist/i18n/locales/tr.d.ts.map +1 -1
  115. package/dist/i18n/locales/tr.js +66 -18
  116. package/dist/i18n/locales/tr.js.map +1 -1
  117. package/dist/i18n/locales/uk.d.ts.map +1 -1
  118. package/dist/i18n/locales/uk.js +66 -18
  119. package/dist/i18n/locales/uk.js.map +1 -1
  120. package/dist/i18n/locales/vi.d.ts.map +1 -1
  121. package/dist/i18n/locales/vi.js +66 -18
  122. package/dist/i18n/locales/vi.js.map +1 -1
  123. package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
  124. package/dist/i18n/locales/zh-CN.js +66 -18
  125. package/dist/i18n/locales/zh-CN.js.map +1 -1
  126. package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
  127. package/dist/i18n/locales/zh-TW.js +66 -18
  128. package/dist/i18n/locales/zh-TW.js.map +1 -1
  129. package/dist/index.d.ts +6 -7
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +5 -9
  132. package/dist/index.js.map +1 -1
  133. package/dist/projects/storage-categories.d.ts.map +1 -1
  134. package/dist/projects/storage-categories.js +8 -1
  135. package/dist/projects/storage-categories.js.map +1 -1
  136. package/dist/providers/base-provider.d.ts +17 -2
  137. package/dist/providers/base-provider.d.ts.map +1 -1
  138. package/dist/providers/base-provider.js +32 -2
  139. package/dist/providers/base-provider.js.map +1 -1
  140. package/dist/providers/catalog.d.ts +0 -11
  141. package/dist/providers/catalog.d.ts.map +1 -1
  142. package/dist/providers/catalog.js +0 -11
  143. package/dist/providers/catalog.js.map +1 -1
  144. package/dist/providers/key-test.d.ts +26 -0
  145. package/dist/providers/key-test.d.ts.map +1 -0
  146. package/dist/providers/key-test.js +74 -0
  147. package/dist/providers/key-test.js.map +1 -0
  148. package/dist/providers/minimax/models.d.ts.map +1 -1
  149. package/dist/providers/minimax/models.js +32 -17
  150. package/dist/providers/minimax/models.js.map +1 -1
  151. package/dist/providers/provider-registry.d.ts +4 -9
  152. package/dist/providers/provider-registry.d.ts.map +1 -1
  153. package/dist/providers/provider-registry.js +11 -18
  154. package/dist/providers/provider-registry.js.map +1 -1
  155. package/dist/providers/request-shaping/model-ids.d.ts.map +1 -1
  156. package/dist/providers/request-shaping/model-ids.js +5 -0
  157. package/dist/providers/request-shaping/model-ids.js.map +1 -1
  158. package/dist/tools/generate-image.d.ts +1 -1
  159. package/dist/tools/generate-image.d.ts.map +1 -1
  160. package/dist/tools/generate-image.js +6 -37
  161. package/dist/tools/generate-image.js.map +1 -1
  162. package/dist/tools/generate-video.d.ts +6 -7
  163. package/dist/tools/generate-video.d.ts.map +1 -1
  164. package/dist/tools/generate-video.js +13 -130
  165. package/dist/tools/generate-video.js.map +1 -1
  166. package/dist/tools/generate-voice.d.ts +8 -0
  167. package/dist/tools/generate-voice.d.ts.map +1 -1
  168. package/dist/tools/generate-voice.js +10 -41
  169. package/dist/tools/generate-voice.js.map +1 -1
  170. package/dist/tools/health-catalogue-search.d.ts.map +1 -1
  171. package/dist/tools/health-catalogue-search.js +1 -3
  172. package/dist/tools/health-catalogue-search.js.map +1 -1
  173. package/package.json +1 -11
  174. package/dist/billing/credits.d.ts +0 -236
  175. package/dist/billing/credits.d.ts.map +0 -1
  176. package/dist/billing/credits.js +0 -599
  177. package/dist/billing/credits.js.map +0 -1
  178. package/dist/billing/meter.d.ts +0 -43
  179. package/dist/billing/meter.d.ts.map +0 -1
  180. package/dist/billing/meter.js +0 -67
  181. package/dist/billing/meter.js.map +0 -1
  182. package/dist/billing/plans.d.ts +0 -34
  183. package/dist/billing/plans.d.ts.map +0 -1
  184. package/dist/billing/plans.js +0 -108
  185. package/dist/billing/plans.js.map +0 -1
  186. package/dist/journal/platform-sync.d.ts +0 -17
  187. package/dist/journal/platform-sync.d.ts.map +0 -1
  188. package/dist/journal/platform-sync.js +0 -21
  189. package/dist/journal/platform-sync.js.map +0 -1
  190. package/dist/memory/platform-sync.d.ts +0 -54
  191. package/dist/memory/platform-sync.d.ts.map +0 -1
  192. package/dist/memory/platform-sync.js +0 -176
  193. package/dist/memory/platform-sync.js.map +0 -1
  194. package/dist/providers/platform/index.d.ts +0 -20
  195. package/dist/providers/platform/index.d.ts.map +0 -1
  196. package/dist/providers/platform/index.js +0 -30
  197. package/dist/providers/platform/index.js.map +0 -1
  198. package/dist/providers/platform/models.d.ts +0 -3
  199. package/dist/providers/platform/models.d.ts.map +0 -1
  200. package/dist/providers/platform/models.js +0 -204
  201. package/dist/providers/platform/models.js.map +0 -1
  202. package/dist/tasks/platform-sync.d.ts +0 -22
  203. package/dist/tasks/platform-sync.d.ts.map +0 -1
  204. package/dist/tasks/platform-sync.js +0 -132
  205. package/dist/tasks/platform-sync.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/billing/meter.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAY7E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE;IACL,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;0EAEsE;IACtE,qBAAqB,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD,GAAG,IAAI,GAAG,SAAS,GACnB,aAAa,GAAG,SAAS,CAc3B"}
@@ -1,67 +0,0 @@
1
- // Credit meter — the runtime side of the Ava Credits system.
2
- //
3
- // Every metered action (LLM call, Creative Studio generation, orchestration
4
- // hop, Teach session) calls `chargeCredits()` on completion. The helper
5
- // emits a `credits_charged` dataset event that rolls up into usage reports
6
- // and, once Stage 3 flips the switch, into per-user billing.
7
- //
8
- // Stage 2 (this file): dual-write only. Server-side billing continues to
9
- // read raw tokens; the `credits` field is recorded for parity audit.
10
- // Stage 3 (later): flip the feature flag, server reads credits first,
11
- // raw tokens become backup-only.
12
- //
13
- // Design choices:
14
- // - Emission is fire-and-forget via avaEvents (microtask-safe). The
15
- // user-visible response never blocks on metering.
16
- // - No trajectory scope required — if no trajectory is open, avaEvents
17
- // drops the emit silently. That's safer than throwing from a billing
18
- // path.
19
- // - Cache-hit discount is applied here at emit time via creditsFor().
20
- // Callers pass `{ cacheHit: true }` when the provider response
21
- // indicates a prompt-cache hit; the 0.3× multiplier lives in credits.ts.
22
- import { avaEvents } from '../dataset/emitter.js';
23
- import { creditsFor } from './credits.js';
24
- /**
25
- * Charge credits for a completed metered action.
26
- *
27
- * Returns the credits deducted so callers can log or accumulate. Emits
28
- * a `credits_charged` dataset event for the usage pipeline. Never throws
29
- * and never blocks — billing failures cannot take the chat down.
30
- */
31
- export function chargeCredits(action, opts) {
32
- const credits = creditsFor(action, { cacheHit: opts?.cacheHit, model: opts?.model });
33
- avaEvents.emit('credits_charged', {
34
- action,
35
- credits,
36
- cache_hit: opts?.cacheHit ?? false,
37
- raw_input_tokens: opts?.rawTokens?.input,
38
- raw_output_tokens: opts?.rawTokens?.output,
39
- raw_cached_tokens: opts?.rawTokens?.cached,
40
- model: opts?.model,
41
- });
42
- return credits;
43
- }
44
- /**
45
- * Extract raw usage from a provider's CompletionResponse usage field.
46
- * Defensive — providers return usage in varied shapes; this normalises
47
- * to the dual-write envelope. Returns undefined if no usage is present
48
- * (some error paths, some provider non-compliance).
49
- */
50
- export function extractUsage(usage) {
51
- if (!usage)
52
- return undefined;
53
- const input = usage.input_tokens ?? usage.prompt_tokens;
54
- const output = usage.output_tokens ?? usage.completion_tokens;
55
- // Nested first — it is the portable location.
56
- const cached = usage.prompt_tokens_details?.cached_tokens
57
- ?? usage.cached_tokens
58
- ?? usage.prompt_cache_hit_tokens;
59
- if (input == null && output == null)
60
- return undefined;
61
- return {
62
- input: input ?? 0,
63
- output: output ?? 0,
64
- ...(cached != null && { cached }),
65
- };
66
- }
67
- //# sourceMappingURL=meter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meter.js","sourceRoot":"","sources":["../../src/billing/meter.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,2EAA2E;AAC3E,6DAA6D;AAC7D,EAAE;AACF,yEAAyE;AACzE,qEAAqE;AACrE,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,kBAAkB;AAClB,qEAAqE;AACrE,qDAAqD;AACrD,wEAAwE;AACxE,wEAAwE;AACxE,WAAW;AACX,uEAAuE;AACvE,kEAAkE;AAClE,4EAA4E;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiB1C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAAoB,EAAE,IAAiB;IACnE,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACrF,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAChC,MAAM;QACN,OAAO;QACP,SAAS,EAAE,IAAI,EAAE,QAAQ,IAAI,KAAK;QAClC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK;QACxC,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM;QAC1C,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM;QAC1C,KAAK,EAAE,IAAI,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,KAWoB;IAEpB,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,aAAa,CAAC;IACxD,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,iBAAiB,CAAC;IAC9D,8CAA8C;IAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,qBAAqB,EAAE,aAAa;WACpD,KAAK,CAAC,aAAa;WACnB,KAAK,CAAC,uBAAuB,CAAC;IACnC,IAAI,KAAK,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IACtD,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,CAAC;QACjB,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;KAClC,CAAC;AACJ,CAAC"}
@@ -1,34 +0,0 @@
1
- export * from './credits.js';
2
- export type PlanTier = 'free' | 'pro' | 'ultra' | 'enterprise' | 'admin';
3
- export interface PlanDefinition {
4
- /** Display name (Free, Pro, Ultra, Enterprise). */
5
- name: string;
6
- /** Monthly USD price. Zero for free/admin. */
7
- price: number;
8
- /** Monthly Ava Credits allowance. */
9
- credits: number;
10
- /** Included cloud storage in GB (before add-ons). */
11
- storageGb: number;
12
- /** API requests per minute. */
13
- rateLimit: number;
14
- /** Decision-critical feature bullets shown on upgrade cards. */
15
- features: string[];
16
- }
17
- export declare const PLANS: Record<PlanTier, PlanDefinition>;
18
- import { type CreditTopupDefinition } from './credits.js';
19
- /** @deprecated — use CreditTopupDefinition. */
20
- export type TokenTopupDefinition = CreditTopupDefinition;
21
- /** @deprecated — use CREDIT_TOPUPS. Points at the same array. */
22
- export declare const TOKEN_TOPUPS: CreditTopupDefinition[];
23
- export declare const AVA_SITE_BASE = "https://avasupernova.com";
24
- /** Public pricing page — plan cards + top-ups all on one page. */
25
- export declare function pricingUrl(): string;
26
- /** Dashboard billing — current plan, Stripe portal, active top-ups. Signed-in view. */
27
- export declare function dashboardBillingUrl(): string;
28
- /** Pricing page with intent hint so the page can highlight the right card. */
29
- export declare function upgradeUrl(target: Exclude<PlanTier, 'free' | 'admin'>): string;
30
- /** Pricing page scrolled to the top-up grid. */
31
- export declare function creditTopupUrl(topup: CreditTopupDefinition['id']): string;
32
- /** @deprecated — use creditTopupUrl. */
33
- export declare const tokenTopupUrl: typeof creditTopupUrl;
34
- //# sourceMappingURL=plans.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/billing/plans.ts"],"names":[],"mappings":"AAYA,cAAc,cAAc,CAAC;AAE7B,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;AAEzE,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,cAAc,CAgElD,CAAC;AAOF,OAAO,EAAiB,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEzE,+CAA+C;AAC/C,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAEzD,iEAAiE;AACjE,eAAO,MAAM,YAAY,EAAE,qBAAqB,EAAkB,CAAC;AAOnE,eAAO,MAAM,aAAa,6BAA6B,CAAC;AAExD,kEAAkE;AAClE,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,MAAM,CAE9E;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,KAAK,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAAG,MAAM,CAEzE;AAED,wCAAwC;AACxC,eAAO,MAAM,aAAa,uBAAiB,CAAC"}
@@ -1,108 +0,0 @@
1
- // Canonical plan, top-up, and storage add-on definitions used across every
2
- // Ava surface (web, extension, IDE). Post-credits rename (migration 203):
3
- // allowances are denominated in Ava Credits, not raw Qwen tokens. Credit
4
- // cost per action lives in ./credits.ts and is re-exported from this module
5
- // so every consumer imports from a single path.
6
- //
7
- // Everything here is pure data + pure URL builders — no runtime deps, safe
8
- // to import from any surface that takes @ava/core.
9
- // Re-export the action-cost table + credit helpers so importers of
10
- // @ava/core/billing can get everything (plans + credit pricing) without
11
- // chasing sub-paths.
12
- export * from './credits.js';
13
- export const PLANS = {
14
- free: {
15
- name: 'Free',
16
- price: 0,
17
- credits: 300,
18
- storageGb: 2,
19
- rateLimit: 20,
20
- features: [
21
- '300 credits / month',
22
- '4 fleets + single models on credits',
23
- 'Any model via BYOK — costs no credits',
24
- 'Every surface — extension, IDE, companion',
25
- ],
26
- },
27
- pro: {
28
- name: 'Pro',
29
- price: 19,
30
- credits: 5_000,
31
- storageGb: 25,
32
- rateLimit: 60,
33
- features: [
34
- '5,000 credits / month',
35
- '4 fleets + single models on credits',
36
- 'Top-up credits anytime',
37
- '60 requests / minute',
38
- 'Priority support',
39
- ],
40
- },
41
- ultra: {
42
- name: 'Ultra',
43
- price: 39,
44
- credits: 10_000,
45
- storageGb: 100,
46
- rateLimit: 120,
47
- features: [
48
- '10,000 credits / month',
49
- '4 fleets + single models on credits',
50
- '120 requests / minute',
51
- 'Highest-priority routing',
52
- 'Early access to new models',
53
- ],
54
- },
55
- enterprise: {
56
- name: 'Enterprise',
57
- price: 79,
58
- credits: 20_000,
59
- storageGb: 500,
60
- rateLimit: 200,
61
- features: [
62
- '20,000 credits / month',
63
- '4 fleets + single models on credits',
64
- '200 requests / minute',
65
- 'SSO + dedicated support',
66
- 'Custom integrations on request',
67
- ],
68
- },
69
- admin: {
70
- name: 'Admin',
71
- price: 0,
72
- credits: 999_999_999,
73
- storageGb: 10_000,
74
- rateLimit: 999,
75
- features: [],
76
- },
77
- };
78
- // ── Top-up shapes ────────────────────────────────────────────────────────
79
- // The authoritative top-up catalog lives in credits.ts (CREDIT_TOPUPS +
80
- // CreditTopupDefinition). Deprecated token-era aliases below keep any
81
- // import site we haven't migrated compiling.
82
- import { CREDIT_TOPUPS } from './credits.js';
83
- /** @deprecated — use CREDIT_TOPUPS. Points at the same array. */
84
- export const TOKEN_TOPUPS = CREDIT_TOPUPS;
85
- // ── Website URL builders ──────────────────────────────────────────────────
86
- // Surfaces that can't host checkout themselves (the VS Code webview sandbox,
87
- // Tauri's blocked origins) redirect the user to the website. One helper
88
- // per destination keeps the URL in one place.
89
- export const AVA_SITE_BASE = 'https://avasupernova.com';
90
- /** Public pricing page — plan cards + top-ups all on one page. */
91
- export function pricingUrl() {
92
- return `${AVA_SITE_BASE}/pricing`;
93
- }
94
- /** Dashboard billing — current plan, Stripe portal, active top-ups. Signed-in view. */
95
- export function dashboardBillingUrl() {
96
- return `${AVA_SITE_BASE}/dashboard/billing`;
97
- }
98
- /** Pricing page with intent hint so the page can highlight the right card. */
99
- export function upgradeUrl(target) {
100
- return `${AVA_SITE_BASE}/pricing?upgrade=${target}`;
101
- }
102
- /** Pricing page scrolled to the top-up grid. */
103
- export function creditTopupUrl(topup) {
104
- return `${AVA_SITE_BASE}/pricing?topup=${topup}#credits`;
105
- }
106
- /** @deprecated — use creditTopupUrl. */
107
- export const tokenTopupUrl = creditTopupUrl;
108
- //# sourceMappingURL=plans.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/billing/plans.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAC5E,gDAAgD;AAChD,EAAE;AACF,2EAA2E;AAC3E,mDAAmD;AAEnD,mEAAmE;AACnE,wEAAwE;AACxE,qBAAqB;AACrB,cAAc,cAAc,CAAC;AAmB7B,MAAM,CAAC,MAAM,KAAK,GAAqC;IACrD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACR,qBAAqB;YACrB,qCAAqC;YACrC,uCAAuC;YACvC,2CAA2C;SAC5C;KACF;IACD,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACR,uBAAuB;YACvB,qCAAqC;YACrC,wBAAwB;YACxB,sBAAsB;YACtB,kBAAkB;SACnB;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,GAAG;QACd,QAAQ,EAAE;YACR,wBAAwB;YACxB,qCAAqC;YACrC,uBAAuB;YACvB,0BAA0B;YAC1B,4BAA4B;SAC7B;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,GAAG;QACd,QAAQ,EAAE;YACR,wBAAwB;YACxB,qCAAqC;YACrC,uBAAuB;YACvB,yBAAyB;YACzB,gCAAgC;SACjC;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,WAAW;QACpB,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,GAAG;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,4EAA4E;AAC5E,wEAAwE;AACxE,sEAAsE;AACtE,6CAA6C;AAE7C,OAAO,EAAE,aAAa,EAA8B,MAAM,cAAc,CAAC;AAKzE,iEAAiE;AACjE,MAAM,CAAC,MAAM,YAAY,GAA4B,aAAa,CAAC;AAEnE,6EAA6E;AAC7E,6EAA6E;AAC7E,wEAAwE;AACxE,8CAA8C;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;AAExD,kEAAkE;AAClE,MAAM,UAAU,UAAU;IACxB,OAAO,GAAG,aAAa,UAAU,CAAC;AACpC,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,mBAAmB;IACjC,OAAO,GAAG,aAAa,oBAAoB,CAAC;AAC9C,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,MAA2C;IACpE,OAAO,GAAG,aAAa,oBAAoB,MAAM,EAAE,CAAC;AACtD,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,cAAc,CAAC,KAAkC;IAC/D,OAAO,GAAG,aAAa,kBAAkB,KAAK,UAAU,CAAC;AAC3D,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Journal cloud sync — RETIRED.
3
- *
4
- * The journal is now fully local-first (like Tasks and Learning): entries live
5
- * only on the user's machine and never leave it. This implementation is kept as
6
- * an inert no-op so existing wiring compiles; it pushes nothing and pulls
7
- * nothing. The remaining wiring is removed surface-by-surface. Download/transfer
8
- * of journal data is handled by the local export/portability system instead.
9
- */
10
- import type { JournalDay } from './types.js';
11
- import type { PlatformJournalSync } from './journal-manager.js';
12
- export declare class PlatformJournalSyncImpl implements PlatformJournalSync {
13
- constructor(_apiBase: string, _platformKey: string);
14
- pushEntry(_day: JournalDay): Promise<void>;
15
- pullEntries(_from?: string, _to?: string): Promise<JournalDay[]>;
16
- }
17
- //# sourceMappingURL=platform-sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-sync.d.ts","sourceRoot":"","sources":["../../src/journal/platform-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,uBAAwB,YAAW,mBAAmB;gBACrD,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAI5C,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAGvE"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Journal cloud sync — RETIRED.
3
- *
4
- * The journal is now fully local-first (like Tasks and Learning): entries live
5
- * only on the user's machine and never leave it. This implementation is kept as
6
- * an inert no-op so existing wiring compiles; it pushes nothing and pulls
7
- * nothing. The remaining wiring is removed surface-by-surface. Download/transfer
8
- * of journal data is handled by the local export/portability system instead.
9
- */
10
- export class PlatformJournalSyncImpl {
11
- constructor(_apiBase, _platformKey) {
12
- // Intentionally inert — journal no longer syncs to the cloud.
13
- }
14
- async pushEntry(_day) {
15
- // no-op: journal is local-only
16
- }
17
- async pullEntries(_from, _to) {
18
- return [];
19
- }
20
- }
21
- //# sourceMappingURL=platform-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-sync.js","sourceRoot":"","sources":["../../src/journal/platform-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,MAAM,OAAO,uBAAuB;IAClC,YAAY,QAAgB,EAAE,YAAoB;QAChD,8DAA8D;IAChE,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAgB;QAC9B,+BAA+B;IACjC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAc,EAAE,GAAY;QAC5C,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
@@ -1,54 +0,0 @@
1
- /**
2
- * Syncs local memory to/from the Ava platform (Supabase).
3
- * Uses native fetch — no extra dependencies.
4
- */
5
- export interface PlatformMemory {
6
- id: string;
7
- key: string;
8
- content: string;
9
- scope: 'global' | 'project';
10
- project_id: string | null;
11
- updated_at: string;
12
- }
13
- export interface SemanticMatch {
14
- id: string;
15
- key: string;
16
- content: string;
17
- scope: 'global' | 'project';
18
- similarity: number;
19
- }
20
- export declare class PlatformMemorySync {
21
- private readonly apiBase;
22
- private readonly platformKey;
23
- private readonly projectId?;
24
- constructor(apiBase: string, platformKey: string, projectId?: string);
25
- /** Fetch all memories for a given scope from the platform. */
26
- pull(scope: 'global' | 'project'): Promise<PlatformMemory[]>;
27
- /** Push a memory entry to the platform (upsert by key + scope). */
28
- push(scope: 'global' | 'project', key: string, content: string): Promise<void>;
29
- /** Push individual memory entries to the platform (one Supabase row per entry). */
30
- pushEntries(scope: 'global' | 'project', entries: Array<{
31
- id: string;
32
- content: string;
33
- category?: string;
34
- tags?: string[];
35
- archived?: boolean;
36
- layer?: string;
37
- branch?: string;
38
- directoryScope?: string;
39
- }>): Promise<void>;
40
- /**
41
- * Semantic search across memories using vector similarity.
42
- * Pass `allProjects: true` to search across every project the user has worked in.
43
- */
44
- semanticSearch(query: string, opts?: {
45
- scope?: 'global' | 'project';
46
- threshold?: number;
47
- limit?: number;
48
- allProjects?: boolean;
49
- }): Promise<SemanticMatch[]>;
50
- /** Delete a memory by ID. */
51
- delete(id: string): Promise<void>;
52
- private headers;
53
- }
54
- //# sourceMappingURL=platform-sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-sync.d.ts","sourceRoot":"","sources":["../../src/memory/platform-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;gBAExB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAMpE,8DAA8D;IACxD,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAuBlE,mEAAmE;IAC7D,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BpF,mFAAmF;IAC7E,WAAW,CACf,KAAK,EAAE,QAAQ,GAAG,SAAS,EAC3B,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAChK,OAAO,CAAC,IAAI,CAAC;IAwDhB;;;OAGG;IACG,cAAc,CAClB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GACjG,OAAO,CAAC,aAAa,EAAE,CAAC;IAwB3B,6BAA6B;IACvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOvC,OAAO,CAAC,OAAO;CAMhB"}
@@ -1,176 +0,0 @@
1
- /**
2
- * Syncs local memory to/from the Ava platform (Supabase).
3
- * Uses native fetch — no extra dependencies.
4
- */
5
- /** Retry a fetch with exponential backoff */
6
- async function fetchWithRetry(url, opts, maxRetries = 2) {
7
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
8
- try {
9
- const res = await fetch(url, opts);
10
- if (res.ok || res.status < 500)
11
- return res; // Don't retry client errors
12
- if (attempt < maxRetries)
13
- await new Promise(r => setTimeout(r, 1000 * (attempt + 1)));
14
- }
15
- catch (err) {
16
- if (attempt === maxRetries)
17
- throw err;
18
- await new Promise(r => setTimeout(r, 1000 * (attempt + 1)));
19
- }
20
- }
21
- return fetch(url, opts); // Final attempt
22
- }
23
- export class PlatformMemorySync {
24
- apiBase;
25
- platformKey;
26
- projectId;
27
- constructor(apiBase, platformKey, projectId) {
28
- this.apiBase = apiBase.replace(/\/+$/, '');
29
- this.platformKey = platformKey;
30
- this.projectId = projectId;
31
- }
32
- /** Fetch all memories for a given scope from the platform. */
33
- async pull(scope) {
34
- const params = new URLSearchParams({ scope, limit: '1000' });
35
- if (scope === 'project' && this.projectId) {
36
- params.set('project_id', this.projectId);
37
- }
38
- const res = await fetchWithRetry(`${this.apiBase}/memories?${params}`, {
39
- headers: this.headers(),
40
- });
41
- if (!res.ok)
42
- return [];
43
- const data = await res.json();
44
- // GET /api/memories returns { memories, total, limit, offset, hasMore }.
45
- // Older response shape was a bare array — tolerate both so we keep
46
- // working if the server shape changes again.
47
- if (Array.isArray(data))
48
- return data;
49
- if (data && typeof data === 'object' && Array.isArray(data.memories)) {
50
- return data.memories;
51
- }
52
- return [];
53
- }
54
- /** Push a memory entry to the platform (upsert by key + scope). */
55
- async push(scope, key, content) {
56
- // Check if a memory with this key+scope already exists
57
- const existing = await this.pull(scope);
58
- const match = existing.find((m) => m.key === key);
59
- if (match) {
60
- // Update existing
61
- await fetch(`${this.apiBase}/memories/${match.id}`, {
62
- method: 'PATCH',
63
- headers: this.headers(),
64
- body: JSON.stringify({ content }),
65
- });
66
- }
67
- else {
68
- // Create new
69
- await fetch(`${this.apiBase}/memories`, {
70
- method: 'POST',
71
- headers: this.headers(),
72
- body: JSON.stringify({
73
- key,
74
- content,
75
- scope,
76
- project_id: scope === 'project' ? this.projectId : null,
77
- }),
78
- });
79
- }
80
- }
81
- /** Push individual memory entries to the platform (one Supabase row per entry). */
82
- async pushEntries(scope, entries) {
83
- // Pull existing to map local IDs → remote IDs
84
- const existing = await this.pull(scope);
85
- const remoteByKey = new Map(existing.map((m) => [m.key, m]));
86
- for (const entry of entries) {
87
- const remote = remoteByKey.get(entry.id);
88
- if (remote) {
89
- // Update existing — include layer/branch/scope metadata
90
- await fetch(`${this.apiBase}/memories/${remote.id}`, {
91
- method: 'PATCH',
92
- headers: this.headers(),
93
- body: JSON.stringify({
94
- content: entry.content,
95
- category: entry.category ?? null,
96
- archived: entry.archived ?? false,
97
- layer: entry.layer ?? null,
98
- branch: entry.branch ?? null,
99
- directory_scope: entry.directoryScope ?? null,
100
- tags: entry.tags ?? [],
101
- }),
102
- });
103
- }
104
- else {
105
- // Create new — use the local entry ID as the key for dedup
106
- await fetch(`${this.apiBase}/memories`, {
107
- method: 'POST',
108
- headers: this.headers(),
109
- body: JSON.stringify({
110
- key: entry.id,
111
- content: entry.content,
112
- scope,
113
- project_id: scope === 'project' ? this.projectId : null,
114
- category: entry.category ?? null,
115
- layer: entry.layer ?? null,
116
- branch: entry.branch ?? null,
117
- directory_scope: entry.directoryScope ?? null,
118
- tags: entry.tags ?? [],
119
- }),
120
- });
121
- }
122
- }
123
- // Clean up legacy 'memory.json' blob records from the old sync format.
124
- // Previously this block also deleted any remote row whose key wasn't in
125
- // the current local store — that was catastrophic once the local store
126
- // was ever wiped or regenerated with fresh UUIDs (every surviving cloud
127
- // memory would be deleted on next push). Memory is additive: if the user
128
- // wants a cloud row gone, they delete it explicitly.
129
- for (const remote of existing) {
130
- if (remote.key === 'memory.json') {
131
- await this.delete(remote.id);
132
- }
133
- }
134
- }
135
- /**
136
- * Semantic search across memories using vector similarity.
137
- * Pass `allProjects: true` to search across every project the user has worked in.
138
- */
139
- async semanticSearch(query, opts) {
140
- try {
141
- const res = await fetch(`${this.apiBase}/memories/search`, {
142
- method: 'POST',
143
- headers: this.headers(),
144
- body: JSON.stringify({
145
- query,
146
- scope: opts?.allProjects ? null : (opts?.scope || null),
147
- project_id: opts?.allProjects ? null : (opts?.scope === 'project' ? this.projectId : null),
148
- all_projects: opts?.allProjects ?? false,
149
- threshold: opts?.threshold ?? 0.7,
150
- limit: opts?.limit ?? 10,
151
- }),
152
- });
153
- if (!res.ok)
154
- return [];
155
- const data = await res.json();
156
- return Array.isArray(data) ? data : [];
157
- }
158
- catch {
159
- return [];
160
- }
161
- }
162
- /** Delete a memory by ID. */
163
- async delete(id) {
164
- await fetch(`${this.apiBase}/memories/${id}`, {
165
- method: 'DELETE',
166
- headers: this.headers(),
167
- });
168
- }
169
- headers() {
170
- return {
171
- 'Authorization': `Bearer ${this.platformKey}`,
172
- 'Content-Type': 'application/json',
173
- };
174
- }
175
- }
176
- //# sourceMappingURL=platform-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-sync.js","sourceRoot":"","sources":["../../src/memory/platform-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6CAA6C;AAC7C,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,IAAiB,EAAE,UAAU,GAAG,CAAC;IAC1E,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACnC,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG;gBAAE,OAAO,GAAG,CAAC,CAAC,4BAA4B;YACxE,IAAI,OAAO,GAAG,UAAU;gBAAE,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,OAAO,KAAK,UAAU;gBAAE,MAAM,GAAG,CAAC;YACtC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,gBAAgB;AAC3C,CAAC;AA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AAI,EAAE;iBACzB,CAAC;aACH,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,EAAE;gBAAE,OAAO,EAAE,CAAC;YAEvB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,EAAE,EAAE,EAAE;YAC5C,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;SACxB,CAAC,CAAC;IACL,CAAC;IAEO,OAAO;QACb,OAAO;YACL,eAAe,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;YAC7C,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;CACF"}
@@ -1,20 +0,0 @@
1
- import { BaseProvider } from '../base-provider.js';
2
- import type { ModelDefinition } from '../../core/types.js';
3
- export declare class PlatformProvider extends BaseProvider {
4
- readonly name = "platform";
5
- readonly displayName = "Ava Platform";
6
- protected getDefaultBaseUrl(): string;
7
- protected getCompletionUrl(): string;
8
- /**
9
- * Packed as gzip+base64 (27 Oct 2026). The edge firewall in front of the
10
- * platform refuses any body containing text like `| python -c`, and a coding
11
- * agent's history is full of shell commands — one ordinary command locked a
12
- * whole conversation, every turn refused in a tenth of a second. Encoded,
13
- * there is nothing for it to match; gzip also shrinks a long conversation.
14
- * The route unpacks it (web lib/request-body-envelope) and still accepts
15
- * plain bodies from older clients.
16
- */
17
- protected serializeBody(body: unknown): string;
18
- listModels(): ModelDefinition[];
19
- }
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/platform/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,kBAAkB;IAEtC,SAAS,CAAC,iBAAiB,IAAI,MAAM;IAIrC,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAIpC;;;;;;;;OAQG;cACgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;IAKvD,UAAU,IAAI,eAAe,EAAE;CAGhC"}
@@ -1,30 +0,0 @@
1
- import { gzipSync } from 'node:zlib';
2
- import { BaseProvider } from '../base-provider.js';
3
- import { PLATFORM_MODELS } from './models.js';
4
- export class PlatformProvider extends BaseProvider {
5
- name = 'platform';
6
- displayName = 'Ava Platform';
7
- getDefaultBaseUrl() {
8
- return 'https://avasupernova.com/api';
9
- }
10
- getCompletionUrl() {
11
- return `${this.baseUrl}/chat`;
12
- }
13
- /**
14
- * Packed as gzip+base64 (27 Oct 2026). The edge firewall in front of the
15
- * platform refuses any body containing text like `| python -c`, and a coding
16
- * agent's history is full of shell commands — one ordinary command locked a
17
- * whole conversation, every turn refused in a tenth of a second. Encoded,
18
- * there is nothing for it to match; gzip also shrinks a long conversation.
19
- * The route unpacks it (web lib/request-body-envelope) and still accepts
20
- * plain bodies from older clients.
21
- */
22
- serializeBody(body) {
23
- const payload = gzipSync(Buffer.from(JSON.stringify(body), 'utf8')).toString('base64');
24
- return JSON.stringify({ encoding: 'gzip+base64', payload });
25
- }
26
- listModels() {
27
- return PLATFORM_MODELS;
28
- }
29
- }
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/platform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IACvC,IAAI,GAAG,UAAU,CAAC;IAClB,WAAW,GAAG,cAAc,CAAC;IAE5B,iBAAiB;QACzB,OAAO,8BAA8B,CAAC;IACxC,CAAC;IAES,gBAAgB;QACxB,OAAO,GAAG,IAAI,CAAC,OAAO,OAAO,CAAC;IAChC,CAAC;IAED;;;;;;;;OAQG;IACgB,aAAa,CAAC,IAAa;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,UAAU;QACR,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
@@ -1,3 +0,0 @@
1
- import type { ModelDefinition } from '../../core/types.js';
2
- export declare const PLATFORM_MODELS: ModelDefinition[];
3
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/providers/platform/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAsD3D,eAAO,MAAM,eAAe,EAAE,eAAe,EAwJ5C,CAAC"}