@project-ava-supernova/core 0.2.182 → 0.2.184

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 (175) hide show
  1. package/dist/agent/agent.d.ts.map +1 -1
  2. package/dist/agent/agent.js +32 -24
  3. package/dist/agent/agent.js.map +1 -1
  4. package/dist/agent/system-prompt.d.ts.map +1 -1
  5. package/dist/agent/system-prompt.js +12 -5
  6. package/dist/agent/system-prompt.js.map +1 -1
  7. package/dist/docs/content/concepts.js +1 -1
  8. package/dist/docs/content/concepts.js.map +1 -1
  9. package/dist/docs/content/features.d.ts.map +1 -1
  10. package/dist/docs/content/features.js +16 -9
  11. package/dist/docs/content/features.js.map +1 -1
  12. package/dist/docs/content/start.d.ts.map +1 -1
  13. package/dist/docs/content/start.js +1 -0
  14. package/dist/docs/content/start.js.map +1 -1
  15. package/dist/docs/data/tools.js +4 -4
  16. package/dist/docs/data/tools.js.map +1 -1
  17. package/dist/docs/i18n/translations.d.ts.map +1 -1
  18. package/dist/docs/i18n/translations.js +1 -1
  19. package/dist/docs/i18n/translations.js.map +1 -1
  20. package/dist/health/progression.d.ts +68 -0
  21. package/dist/health/progression.d.ts.map +1 -0
  22. package/dist/health/progression.js +205 -0
  23. package/dist/health/progression.js.map +1 -0
  24. package/dist/health/share-results.d.ts +45 -0
  25. package/dist/health/share-results.d.ts.map +1 -0
  26. package/dist/health/share-results.js +123 -0
  27. package/dist/health/share-results.js.map +1 -0
  28. package/dist/health/share-workout.d.ts +55 -0
  29. package/dist/health/share-workout.d.ts.map +1 -0
  30. package/dist/health/share-workout.js +69 -0
  31. package/dist/health/share-workout.js.map +1 -0
  32. package/dist/i18n/locales/ar.d.ts.map +1 -1
  33. package/dist/i18n/locales/ar.js +104 -0
  34. package/dist/i18n/locales/ar.js.map +1 -1
  35. package/dist/i18n/locales/de.d.ts.map +1 -1
  36. package/dist/i18n/locales/de.js +104 -0
  37. package/dist/i18n/locales/de.js.map +1 -1
  38. package/dist/i18n/locales/en.d.ts +104 -0
  39. package/dist/i18n/locales/en.d.ts.map +1 -1
  40. package/dist/i18n/locales/en.js +114 -0
  41. package/dist/i18n/locales/en.js.map +1 -1
  42. package/dist/i18n/locales/es.d.ts.map +1 -1
  43. package/dist/i18n/locales/es.js +104 -0
  44. package/dist/i18n/locales/es.js.map +1 -1
  45. package/dist/i18n/locales/fr.d.ts.map +1 -1
  46. package/dist/i18n/locales/fr.js +104 -0
  47. package/dist/i18n/locales/fr.js.map +1 -1
  48. package/dist/i18n/locales/hi.d.ts.map +1 -1
  49. package/dist/i18n/locales/hi.js +104 -0
  50. package/dist/i18n/locales/hi.js.map +1 -1
  51. package/dist/i18n/locales/id.d.ts.map +1 -1
  52. package/dist/i18n/locales/id.js +104 -0
  53. package/dist/i18n/locales/id.js.map +1 -1
  54. package/dist/i18n/locales/it.d.ts.map +1 -1
  55. package/dist/i18n/locales/it.js +104 -0
  56. package/dist/i18n/locales/it.js.map +1 -1
  57. package/dist/i18n/locales/ja.d.ts.map +1 -1
  58. package/dist/i18n/locales/ja.js +104 -0
  59. package/dist/i18n/locales/ja.js.map +1 -1
  60. package/dist/i18n/locales/ko.d.ts.map +1 -1
  61. package/dist/i18n/locales/ko.js +104 -0
  62. package/dist/i18n/locales/ko.js.map +1 -1
  63. package/dist/i18n/locales/nl.d.ts.map +1 -1
  64. package/dist/i18n/locales/nl.js +104 -0
  65. package/dist/i18n/locales/nl.js.map +1 -1
  66. package/dist/i18n/locales/pl.d.ts.map +1 -1
  67. package/dist/i18n/locales/pl.js +104 -0
  68. package/dist/i18n/locales/pl.js.map +1 -1
  69. package/dist/i18n/locales/pt.d.ts.map +1 -1
  70. package/dist/i18n/locales/pt.js +104 -0
  71. package/dist/i18n/locales/pt.js.map +1 -1
  72. package/dist/i18n/locales/ru.d.ts.map +1 -1
  73. package/dist/i18n/locales/ru.js +104 -0
  74. package/dist/i18n/locales/ru.js.map +1 -1
  75. package/dist/i18n/locales/th.d.ts.map +1 -1
  76. package/dist/i18n/locales/th.js +104 -0
  77. package/dist/i18n/locales/th.js.map +1 -1
  78. package/dist/i18n/locales/tr.d.ts.map +1 -1
  79. package/dist/i18n/locales/tr.js +104 -0
  80. package/dist/i18n/locales/tr.js.map +1 -1
  81. package/dist/i18n/locales/uk.d.ts.map +1 -1
  82. package/dist/i18n/locales/uk.js +104 -0
  83. package/dist/i18n/locales/uk.js.map +1 -1
  84. package/dist/i18n/locales/vi.d.ts.map +1 -1
  85. package/dist/i18n/locales/vi.js +104 -0
  86. package/dist/i18n/locales/vi.js.map +1 -1
  87. package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
  88. package/dist/i18n/locales/zh-CN.js +104 -0
  89. package/dist/i18n/locales/zh-CN.js.map +1 -1
  90. package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
  91. package/dist/i18n/locales/zh-TW.js +104 -0
  92. package/dist/i18n/locales/zh-TW.js.map +1 -1
  93. package/dist/tools/authoring/doc-model.d.ts +2 -11
  94. package/dist/tools/authoring/doc-model.d.ts.map +1 -1
  95. package/dist/tools/authoring/doc-model.js +2 -39
  96. package/dist/tools/authoring/doc-model.js.map +1 -1
  97. package/dist/tools/authoring/document-places.d.ts +19 -0
  98. package/dist/tools/authoring/document-places.d.ts.map +1 -0
  99. package/dist/tools/authoring/document-places.js +24 -0
  100. package/dist/tools/authoring/document-places.js.map +1 -0
  101. package/dist/tools/authoring/export-document.d.ts +10 -0
  102. package/dist/tools/authoring/export-document.d.ts.map +1 -1
  103. package/dist/tools/authoring/export-document.js +26 -0
  104. package/dist/tools/authoring/export-document.js.map +1 -1
  105. package/dist/tools/authoring/font-manifest.d.ts +25 -0
  106. package/dist/tools/authoring/font-manifest.d.ts.map +1 -0
  107. package/dist/tools/authoring/font-manifest.js +35 -0
  108. package/dist/tools/authoring/font-manifest.js.map +1 -0
  109. package/dist/tools/authoring/formula-eval.d.ts +34 -0
  110. package/dist/tools/authoring/formula-eval.d.ts.map +1 -0
  111. package/dist/tools/authoring/formula-eval.js +250 -0
  112. package/dist/tools/authoring/formula-eval.js.map +1 -0
  113. package/dist/tools/authoring/index.d.ts +0 -1
  114. package/dist/tools/authoring/index.d.ts.map +1 -1
  115. package/dist/tools/authoring/index.js +2 -3
  116. package/dist/tools/authoring/index.js.map +1 -1
  117. package/dist/tools/authoring/ods-spreadsheet.d.ts +56 -0
  118. package/dist/tools/authoring/ods-spreadsheet.d.ts.map +1 -0
  119. package/dist/tools/authoring/ods-spreadsheet.js +426 -0
  120. package/dist/tools/authoring/ods-spreadsheet.js.map +1 -0
  121. package/dist/tools/authoring/pdf-fonts.d.ts +53 -0
  122. package/dist/tools/authoring/pdf-fonts.d.ts.map +1 -0
  123. package/dist/tools/authoring/pdf-fonts.js +269 -0
  124. package/dist/tools/authoring/pdf-fonts.js.map +1 -0
  125. package/dist/tools/authoring/read-office.d.ts +29 -0
  126. package/dist/tools/authoring/read-office.d.ts.map +1 -0
  127. package/dist/tools/authoring/read-office.js +48 -0
  128. package/dist/tools/authoring/read-office.js.map +1 -0
  129. package/dist/tools/authoring/render-pdf.d.ts.map +1 -1
  130. package/dist/tools/authoring/render-pdf.js +136 -7
  131. package/dist/tools/authoring/render-pdf.js.map +1 -1
  132. package/dist/tools/authoring/sheet-view.d.ts +32 -0
  133. package/dist/tools/authoring/sheet-view.d.ts.map +1 -0
  134. package/dist/tools/authoring/sheet-view.js +122 -0
  135. package/dist/tools/authoring/sheet-view.js.map +1 -0
  136. package/dist/tools/authoring/spreadsheet.d.ts +69 -0
  137. package/dist/tools/authoring/spreadsheet.d.ts.map +1 -0
  138. package/dist/tools/authoring/spreadsheet.js +216 -0
  139. package/dist/tools/authoring/spreadsheet.js.map +1 -0
  140. package/dist/tools/authoring/templates/builtins.d.ts.map +1 -1
  141. package/dist/tools/authoring/templates/builtins.js +2 -0
  142. package/dist/tools/authoring/templates/builtins.js.map +1 -1
  143. package/dist/tools/authoring/xlsx-charts.d.ts +66 -0
  144. package/dist/tools/authoring/xlsx-charts.d.ts.map +1 -0
  145. package/dist/tools/authoring/xlsx-charts.js +272 -0
  146. package/dist/tools/authoring/xlsx-charts.js.map +1 -0
  147. package/dist/tools/authoring/zip.d.ts +6 -0
  148. package/dist/tools/authoring/zip.d.ts.map +1 -1
  149. package/dist/tools/authoring/zip.js +45 -1
  150. package/dist/tools/authoring/zip.js.map +1 -1
  151. package/dist/tools/document-author.d.ts +4 -0
  152. package/dist/tools/document-author.d.ts.map +1 -1
  153. package/dist/tools/document-author.js +36 -24
  154. package/dist/tools/document-author.js.map +1 -1
  155. package/dist/tools/document-manage.d.ts +28 -25
  156. package/dist/tools/document-manage.d.ts.map +1 -1
  157. package/dist/tools/document-manage.js +298 -586
  158. package/dist/tools/document-manage.js.map +1 -1
  159. package/dist/tools/document-styling.d.ts +0 -26
  160. package/dist/tools/document-styling.d.ts.map +1 -1
  161. package/dist/tools/document-styling.js +0 -224
  162. package/dist/tools/document-styling.js.map +1 -1
  163. package/dist/tools/document-templates.d.ts +3 -18
  164. package/dist/tools/document-templates.d.ts.map +1 -1
  165. package/dist/tools/document-templates.js +4 -94
  166. package/dist/tools/document-templates.js.map +1 -1
  167. package/dist/tools/email-draft.d.ts +3 -6
  168. package/dist/tools/email-draft.d.ts.map +1 -1
  169. package/dist/tools/email-draft.js +29 -123
  170. package/dist/tools/email-draft.js.map +1 -1
  171. package/dist/tools/report-generate.d.ts +1 -2
  172. package/dist/tools/report-generate.d.ts.map +1 -1
  173. package/dist/tools/report-generate.js +50 -167
  174. package/dist/tools/report-generate.js.map +1 -1
  175. package/package.json +27 -5
@@ -0,0 +1,68 @@
1
+ import type { GymSession, GymExercise } from './session-types.js';
2
+ import type { HealthPlanExercise, HealthPlanRecord } from './types.js';
3
+ export type ProgressionStep = 'keep' | 'one_more_rep' | 'one_more_set' | 'heavier';
4
+ /** What happened to one exercise the last time it was logged. */
5
+ export interface LastTime {
6
+ date: string;
7
+ /** Sets recorded, and the planned count at the time. */
8
+ done: number;
9
+ target: number | null;
10
+ reps: number[];
11
+ topKg: number | null;
12
+ /** as_planned / above = every set done; short = fewer; ticked = done, no numbers. */
13
+ verdict: 'as_planned' | 'above' | 'short' | 'ticked';
14
+ /** The plan at the time, to tell whether it has been stepped up since. */
15
+ targetReps: string | null;
16
+ targetWeight: string | null;
17
+ }
18
+ export interface StepOption {
19
+ step: ProgressionStep;
20
+ /** What the row would read after the step: sets, reps, weight. */
21
+ sets: number | null;
22
+ reps: string | null;
23
+ weight: string | null;
24
+ }
25
+ /** A kilogram figure from plan text — ONLY when it says kg or lb. "RPE 7",
26
+ * "bodyweight", "red band" are not weights to add to. */
27
+ export declare function plannedKg(text: string | null | undefined): number | null;
28
+ /** Read one logged exercise as a LastTime, or null when there is nothing to go on. */
29
+ export declare function lastTimeOf(ex: GymExercise, date: string): LastTime | null;
30
+ /** The most recent logged performance of an exercise (by library slug), on or before `onOrBefore`. */
31
+ export declare function lastTimeFor(sessions: GymSession[], slug: string, onOrBefore?: string): LastTime | null;
32
+ /** The usual smallest jump for the kit: kettlebells 4 kg, dumbbells 2 kg, else 2.5 kg. */
33
+ export declare function weightJump(ex: Pick<HealthPlanExercise, 'name' | 'meta'>): number;
34
+ /**
35
+ * The choices for one plan row, given how it went last time. Empty when
36
+ * nothing should be offered (short, ticked-only with nothing to step, a
37
+ * warm-up, no last time at all).
38
+ */
39
+ export declare function stepOptions(ex: HealthPlanExercise, last: LastTime | null): StepOption[];
40
+ export interface ProgressionChoice {
41
+ slug: string;
42
+ step: ProgressionStep;
43
+ /** For 'heavier': the weight that was offered. */
44
+ weight?: string | null;
45
+ }
46
+ /**
47
+ * Apply the chosen steps to every row of those exercises on days
48
+ * `fromDayIndex` onward. Days before it — already done — are left alone.
49
+ */
50
+ export declare function applyProgression<P extends HealthPlanRecord>(plan: P, fromDayIndex: number, choices: ProgressionChoice[]): P;
51
+ /** One row of "Saved. Next time?" or of the plan day's "Last time" line. */
52
+ export interface ProgressionRow {
53
+ slug: string;
54
+ name: string;
55
+ last: LastTime;
56
+ options: StepOption[];
57
+ /** The plan row has changed since then (they already stepped it up). */
58
+ stepped: boolean;
59
+ }
60
+ /**
61
+ * "Saved. Next time?" — for a session just saved against a plan day. Rows are
62
+ * the exercises that come up AGAIN later in the plan; options are worked out
63
+ * on that next appearance. Returns [] when nothing would be offered.
64
+ */
65
+ export declare function progressionAfterSession(plan: HealthPlanRecord, session: GymSession): ProgressionRow[];
66
+ /** The plan day's "Last time" line for each exercise, from the log. */
67
+ export declare function lastTimesForDay(plan: HealthPlanRecord, dayIndex: number, sessions: GymSession[], dayDate: string): Record<string, ProgressionRow>;
68
+ //# sourceMappingURL=progression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progression.d.ts","sourceRoot":"","sources":["../../src/health/progression.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,cAAc,GAAG,cAAc,GAAG,SAAS,CAAC;AAEnF,iEAAiE;AACjE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qFAAqF;IACrF,OAAO,EAAE,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrD,0EAA0E;IAC1E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,kEAAkE;IAClE,IAAI,EAAE,MAAM,GAAG,IAAI,C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,OAAO,CAAC;CAClB;AAyBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,GAAG,cAAc,EAAE,CAgBrG;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAYjJ"}
@@ -0,0 +1,205 @@
1
+ // Progression from what they actually did (Health Part 6, mockup approved
2
+ // 14 Nov 2026). The "better thing that needs the log" duplicate.ts promised.
3
+ //
4
+ // The rules that bind it are the coach's rules, enforced in code:
5
+ //
6
+ // - THE PERSON CHOOSES. Nothing here changes a plan by itself; it offers
7
+ // "Keep it / One more rep / One more set / Heavier" and applies the one
8
+ // they pick. Ava never steps anyone up on her own judgement.
9
+ // - ONLY AFTER A COMPLETE SESSION. A step is offered when every planned set
10
+ // was done last time. Short, skipped or unrecorded → nothing offered, and
11
+ // an unrecorded exercise is never read as a failure.
12
+ // - HEAVIER ONLY FROM A REAL NUMBER. Weight is free text ("bodyweight",
13
+ // "red band"); a heavier option exists only when a kilogram figure was
14
+ // recorded or planned, and it goes up by the usual jump for the kit.
15
+ // - WARM-UPS, COOL-DOWNS AND MOBILITY DO NOT PROGRESS (same guard as
16
+ // progressDays).
17
+ // - DAYS ALREADY DONE ARE NOT TOUCHED. A step applies from a day onward.
18
+ //
19
+ // Pure, shared by the extension host and the IDE sidecar.
20
+ import { bumpReps } from './duplicate.js';
21
+ /** A kilogram figure from plan text — ONLY when it says kg or lb. "RPE 7",
22
+ * "bodyweight", "red band" are not weights to add to. */
23
+ export function plannedKg(text) {
24
+ const m = (text ?? '').match(/(\d+(?:\.\d+)?)\s*(kg|kgs|kilo|lb|lbs|pound)/i);
25
+ if (!m)
26
+ return null;
27
+ const n = Number(m[1]);
28
+ return /^(lb|lbs|pound)/i.test(m[2]) ? Math.round(n * 0.453592 * 10) / 10 : n;
29
+ }
30
+ const ROLE_NO_PROGRESS = new Set(['warmup', 'cooldown', 'mobility']);
31
+ const num = (s) => {
32
+ const m = (s ?? '').match(/^\s*(\d+)\s*$/);
33
+ return m ? Number(m[1]) : null;
34
+ };
35
+ /** Read one logged exercise as a LastTime, or null when there is nothing to go on. */
36
+ export function lastTimeOf(ex, date) {
37
+ if (ex.state === 'skipped' || ex.notes === 'skipped')
38
+ return null;
39
+ const sets = ex.sets ?? [];
40
+ if (!sets.length && ex.state !== 'done')
41
+ return null; // unrecorded: unknown, not a failure
42
+ const reps = sets.map((s) => s.reps).filter((r) => typeof r === 'number');
43
+ const kgs = sets.map((s) => s.weight).filter((w) => typeof w === 'number');
44
+ const topKg = kgs.length ? Math.max(...kgs) : null;
45
+ const base = { date, target: ex.target_sets, reps, topKg, targetReps: ex.target_reps, targetWeight: ex.target_weight };
46
+ if (!sets.length)
47
+ return { ...base, done: 0, verdict: 'ticked' };
48
+ if (ex.target_sets != null && sets.length < ex.target_sets)
49
+ return { ...base, done: sets.length, verdict: 'short' };
50
+ const tr = num(ex.target_reps);
51
+ const askedKg = plannedKg(ex.target_weight);
52
+ const above = (tr != null && reps.some((r) => r > tr)) || (askedKg != null && topKg != null && topKg > askedKg);
53
+ return { ...base, done: sets.length, verdict: above ? 'above' : 'as_planned' };
54
+ }
55
+ /** The most recent logged performance of an exercise (by library slug), on or before `onOrBefore`. */
56
+ export function lastTimeFor(sessions, slug, onOrBefore) {
57
+ const sorted = [...(sessions ?? [])]
58
+ .filter((s) => !onOrBefore || s.date <= onOrBefore)
59
+ .sort((a, b) => b.date.localeCompare(a.date) || String(b.updated_at).localeCompare(String(a.updated_at)));
60
+ for (const s of sorted) {
61
+ for (const ex of s.exercises ?? []) {
62
+ if (ex.ref?.slug !== slug)
63
+ continue;
64
+ const lt = lastTimeOf(ex, s.date);
65
+ if (lt)
66
+ return lt;
67
+ }
68
+ }
69
+ return null;
70
+ }
71
+ /** The usual smallest jump for the kit: kettlebells 4 kg, dumbbells 2 kg, else 2.5 kg. */
72
+ export function weightJump(ex) {
73
+ const kit = [...(ex.meta?.equipment ?? []), ex.name].join(' ').toLowerCase();
74
+ if (/kettlebell/.test(kit))
75
+ return 4;
76
+ if (/dumbbell/.test(kit))
77
+ return 2;
78
+ return 2.5;
79
+ }
80
+ const fmtKg = (n) => `${Math.round(n * 10) / 10} kg`;
81
+ /**
82
+ * The choices for one plan row, given how it went last time. Empty when
83
+ * nothing should be offered (short, ticked-only with nothing to step, a
84
+ * warm-up, no last time at all).
85
+ */
86
+ export function stepOptions(ex, last) {
87
+ if (!last || last.verdict === 'short')
88
+ return [];
89
+ if (ROLE_NO_PROGRESS.has(ex.meta?.session_role ?? ''))
90
+ return [];
91
+ const out = [{ step: 'keep', sets: ex.sets, reps: ex.reps, weight: ex.weight }];
92
+ const bumped = bumpReps(ex.reps);
93
+ if (bumped && bumped !== ex.reps)
94
+ out.push({ step: 'one_more_rep', sets: ex.sets, reps: bumped, weight: ex.weight });
95
+ if (ex.sets != null)
96
+ out.push({ step: 'one_more_set', sets: ex.sets + 1, reps: ex.reps, weight: ex.weight });
97
+ // From the heavier of what they lifted and what the row already asks.
98
+ const kgs = [last.topKg, plannedKg(ex.weight ?? '')].filter((n) => n != null);
99
+ const base = kgs.length ? Math.max(...kgs) : null;
100
+ if (base != null && base > 0 && !/bodyweight/i.test(ex.weight ?? '')) {
101
+ out.push({ step: 'heavier', sets: ex.sets, reps: ex.reps, weight: fmtKg(base + weightJump(ex)) });
102
+ }
103
+ return out.length > 1 ? out : [];
104
+ }
105
+ /** Apply one step to one row (each row steps from its OWN values). */
106
+ function stepRow(ex, step, heavierWeight) {
107
+ if (step === 'one_more_rep')
108
+ return { ...ex, reps: bumpReps(ex.reps) };
109
+ if (step === 'one_more_set')
110
+ return ex.sets == null ? ex : { ...ex, sets: ex.sets + 1 };
111
+ if (step === 'heavier' && heavierWeight)
112
+ return { ...ex, weight: heavierWeight };
113
+ return ex;
114
+ }
115
+ /**
116
+ * Apply the chosen steps to every row of those exercises on days
117
+ * `fromDayIndex` onward. Days before it — already done — are left alone.
118
+ */
119
+ export function applyProgression(plan, fromDayIndex, choices) {
120
+ const bySlug = new Map(choices.filter((c) => c.step !== 'keep').map((c) => [c.slug, c]));
121
+ if (!bySlug.size)
122
+ return plan;
123
+ return {
124
+ ...plan,
125
+ days: plan.days.map((day) => {
126
+ if (day.day_index < fromDayIndex || day.kind !== 'training')
127
+ return day;
128
+ return {
129
+ ...day,
130
+ training: day.training.map((ex) => {
131
+ const c = ex.ref?.slug ? bySlug.get(ex.ref.slug) : undefined;
132
+ if (!c || ROLE_NO_PROGRESS.has(ex.meta?.session_role ?? ''))
133
+ return ex;
134
+ return stepRow(ex, c.step, c.weight ?? null);
135
+ }),
136
+ };
137
+ }),
138
+ };
139
+ }
140
+ /** The row asks for MORE than last time's plan did — they already stepped it up. */
141
+ function steppedSince(ex, last) {
142
+ const up = (now, then) => now != null && then != null && now > then;
143
+ return up(ex.sets, last.target) || up(num(ex.reps), num(last.targetReps))
144
+ || up(plannedKg(ex.weight ?? ''), plannedKg(last.targetWeight ?? ''));
145
+ }
146
+ function rowFor(ex, last) {
147
+ if (!ex.ref?.slug || !last)
148
+ return null;
149
+ const stepped = steppedSince(ex, last);
150
+ return { slug: ex.ref.slug, name: ex.name, last, options: stepped ? [] : stepOptions(ex, last), stepped };
151
+ }
152
+ /** The next plan day (after `dayIndex`) that has this exercise, or the row itself. */
153
+ function nextRow(plan, dayIndex, slug) {
154
+ for (const d of [...plan.days].sort((a, b) => a.day_index - b.day_index)) {
155
+ if (d.day_index <= dayIndex)
156
+ continue;
157
+ const ex = d.training.find((e) => e.ref?.slug === slug);
158
+ if (ex)
159
+ return ex;
160
+ }
161
+ return null;
162
+ }
163
+ /**
164
+ * "Saved. Next time?" — for a session just saved against a plan day. Rows are
165
+ * the exercises that come up AGAIN later in the plan; options are worked out
166
+ * on that next appearance. Returns [] when nothing would be offered.
167
+ */
168
+ export function progressionAfterSession(plan, session) {
169
+ if (session.day_index == null)
170
+ return [];
171
+ const rows = [];
172
+ const seen = new Set();
173
+ for (const ex of session.exercises ?? []) {
174
+ const slug = ex.ref?.slug;
175
+ if (!slug || seen.has(slug))
176
+ continue;
177
+ seen.add(slug);
178
+ const last = lastTimeOf(ex, session.date);
179
+ const next = nextRow(plan, session.day_index, slug);
180
+ if (!last || !next)
181
+ continue;
182
+ const opts = stepOptions(next, last);
183
+ if (!opts.length && last.verdict !== 'short')
184
+ continue;
185
+ rows.push({ slug, name: ex.name, last, options: opts, stepped: false });
186
+ }
187
+ return rows.some((r) => r.options.length) ? rows : [];
188
+ }
189
+ /** The plan day's "Last time" line for each exercise, from the log. */
190
+ export function lastTimesForDay(plan, dayIndex, sessions, dayDate) {
191
+ const day = plan.days.find((d) => d.day_index === dayIndex);
192
+ const out = {};
193
+ // The log BEFORE this day: on the day itself, "last time" means the time before.
194
+ const before = (sessions ?? []).filter((s) => s.date < dayDate);
195
+ for (const ex of day?.training ?? []) {
196
+ const slug = ex.ref?.slug;
197
+ if (!slug || out[slug])
198
+ continue;
199
+ const row = rowFor(ex, lastTimeFor(before, slug));
200
+ if (row)
201
+ out[slug] = row;
202
+ }
203
+ return out;
204
+ }
205
+ //# sourceMappingURL=progression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progression.js","sourceRoot":"","sources":["../../src/health/progression.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,6EAA6E;AAC7E,EAAE;AACF,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,iEAAiE;AACjE,8EAA8E;AAC9E,8EAA8E;AAC9E,yDAAyD;AACzD,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,uEAAuE;AACvE,qBAAqB;AACrB,2EAA2E;AAC3E,EAAE;AACF,0DAA0D;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,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C3B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { type GymSession } from './session-types.js';
2
+ export declare const RESULTS_URL = "https://avasupernova.com/log";
3
+ export interface ResultsExercise {
4
+ /** Name and library slug, as sent to the phone. */
5
+ n: string;
6
+ s: string;
7
+ /** What was planned: sets, reps ("10", "8-12", "30s"), load guidance. */
8
+ ts: number;
9
+ tr: string;
10
+ tw: string;
11
+ /** What was done: one [reps, weight] per completed set, as typed on the phone. */
12
+ done: Array<[string, string]>;
13
+ }
14
+ export interface SharedResults {
15
+ v: 1;
16
+ title: string;
17
+ date: string;
18
+ plan: string;
19
+ day: number;
20
+ /** Minutes from first set to Finish, when known. */
21
+ mins: number;
22
+ exercises: ResultsExercise[];
23
+ }
24
+ export declare function encodeResults(r: SharedResults): Promise<string>;
25
+ /** Accepts the bare payload, "#payload", or a whole link that carries it after a `#`. */
26
+ export declare function decodeResults(input: string): Promise<SharedResults | null>;
27
+ export declare function resultsUrl(r: SharedResults): Promise<string>;
28
+ /** "16 kg" → 16; "35 lb" → 15.9; "bodyweight" → null. The log keeps kilograms. */
29
+ export declare function kgFrom(text: string): number | null;
30
+ export type ResultVerdict = 'on_plan' | 'above' | 'short' | 'not_done';
31
+ /** One exercise, planned against done — facts for the screen, never a score. */
32
+ export declare function compareExercise(e: ResultsExercise): {
33
+ verdict: ResultVerdict;
34
+ setsShort: number;
35
+ };
36
+ /**
37
+ * The results as a training-log session, tied back to the plan day it came
38
+ * from. Reps and weight are parsed where they are numbers ("12", "16 kg");
39
+ * anything else ("30s", "bodyweight") stays in the set's note so nothing the
40
+ * person typed is lost. An exercise with no sets ticked is left UNRECORDED,
41
+ * never "skipped": skipped is a fact someone states, and an unticked row may
42
+ * simply be a set nobody tapped. Ava's rules depend on that difference.
43
+ */
44
+ export declare function sessionFromResults(r: SharedResults, nowIso?: string): GymSession;
45
+ //# sourceMappingURL=share-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":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aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAOjG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,SAA2B,GAAG,UAAU,CAiClG"}
@@ -0,0 +1,123 @@
1
+ // What was done at the gym, back from the phone into the training log
2
+ // (Health Part 6, mockup approved 14 Nov 2026). The reverse of
3
+ // share-workout.ts, and private the same way: the results travel INSIDE the
4
+ // link, after the `#`. The phone sends it to the person themselves (WhatsApp,
5
+ // email); avasupernova.com/log on their computer hands it to the extension
6
+ // (vscode://…) or the IDE, or they copy it into the app. Nothing passes
7
+ // through our server.
8
+ //
9
+ // Ava already reads the training log in the Health room
10
+ // (summariseTrainingLog), so a session saved from here is what she sees when
11
+ // they next ask her to repeat or build a plan.
12
+ //
13
+ // The website's WorkoutApp carries a copy of the encoder; the format is
14
+ // versioned ("1.") and pinned by the round-trip test. Change one, change both.
15
+ import { newGymItemId } from './session-types.js';
16
+ export const RESULTS_URL = 'https://avasupernova.com/log';
17
+ const toWire = (r) => [1, r.title, r.date, r.plan, r.day, r.mins,
18
+ r.exercises.map((e) => [e.n, e.s, e.ts, e.tr, e.tw, e.done])];
19
+ const fromWire = (w) => ({
20
+ v: 1, title: String(w[1] ?? ''), date: String(w[2] ?? ''), plan: String(w[3] ?? ''), day: Number(w[4]) || 0, mins: Number(w[5]) || 0,
21
+ exercises: (w[6] ?? []).map(([n, s, ts, tr, tw, done]) => ({
22
+ n: String(n ?? ''), s: String(s ?? ''), ts: Math.max(0, Number(ts) || 0), tr: String(tr ?? ''), tw: String(tw ?? ''),
23
+ done: (Array.isArray(done) ? done : []).slice(0, 30).map((d) => [String(d?.[0] ?? ''), String(d?.[1] ?? '')]),
24
+ })),
25
+ });
26
+ function b64url(bytes) {
27
+ let s = '';
28
+ for (const b of bytes)
29
+ s += String.fromCharCode(b);
30
+ return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
31
+ }
32
+ function unb64url(s) {
33
+ const b = atob(s.replace(/-/g, '+').replace(/_/g, '/') + '==='.slice((s.length + 3) % 4));
34
+ return Uint8Array.from(b, (c) => c.charCodeAt(0));
35
+ }
36
+ async function pipe(bytes, stream) {
37
+ const out = new Response(new Blob([bytes.slice().buffer]).stream().pipeThrough(stream));
38
+ return new Uint8Array(await out.arrayBuffer());
39
+ }
40
+ export async function encodeResults(r) {
41
+ const json = new TextEncoder().encode(JSON.stringify(toWire(r)));
42
+ return '1.' + b64url(await pipe(json, new CompressionStream('deflate-raw')));
43
+ }
44
+ /** Accepts the bare payload, "#payload", or a whole link that carries it after a `#`. */
45
+ export async function decodeResults(input) {
46
+ try {
47
+ const raw = input.trim();
48
+ const h = raw.includes('#') ? raw.slice(raw.indexOf('#') + 1) : raw;
49
+ if (!h.startsWith('1.'))
50
+ return null;
51
+ const json = await pipe(unb64url(h.slice(2)), new DecompressionStream('deflate-raw'));
52
+ const w = JSON.parse(new TextDecoder().decode(json));
53
+ return Array.isArray(w) && w[0] === 1 ? fromWire(w) : null;
54
+ }
55
+ catch {
56
+ return null;
57
+ }
58
+ }
59
+ export async function resultsUrl(r) {
60
+ return `${RESULTS_URL}#${await encodeResults(r)}`;
61
+ }
62
+ const firstNumber = (s) => { const m = s.match(/\d+(\.\d+)?/); return m ? Number(m[0]) : null; };
63
+ /** "16 kg" → 16; "35 lb" → 15.9; "bodyweight" → null. The log keeps kilograms. */
64
+ export function kgFrom(text) {
65
+ const n = firstNumber(text);
66
+ if (n == null)
67
+ return null;
68
+ return /\b(lb|lbs|pound)/i.test(text) ? Math.round(n * 0.453592 * 10) / 10 : n;
69
+ }
70
+ /** One exercise, planned against done — facts for the screen, never a score. */
71
+ export function compareExercise(e) {
72
+ if (!e.done.length)
73
+ return { verdict: 'not_done', setsShort: e.ts };
74
+ const short = Math.max(0, e.ts - e.done.length);
75
+ if (short > 0)
76
+ return { verdict: 'short', setsShort: short };
77
+ const target = firstNumber(e.tr);
78
+ const above = target != null && /^\s*\d+\s*$/.test(e.tr) && e.done.some(([reps]) => (firstNumber(reps) ?? 0) > target);
79
+ return { verdict: above ? 'above' : 'on_plan', setsShort: 0 };
80
+ }
81
+ /**
82
+ * The results as a training-log session, tied back to the plan day it came
83
+ * from. Reps and weight are parsed where they are numbers ("12", "16 kg");
84
+ * anything else ("30s", "bodyweight") stays in the set's note so nothing the
85
+ * person typed is lost. An exercise with no sets ticked is left UNRECORDED,
86
+ * never "skipped": skipped is a fact someone states, and an unticked row may
87
+ * simply be a set nobody tapped. Ava's rules depend on that difference.
88
+ */
89
+ export function sessionFromResults(r, nowIso = new Date().toISOString()) {
90
+ return {
91
+ schema_version: 1,
92
+ id: newGymItemId('ses'),
93
+ date: r.date,
94
+ source: r.plan ? 'plan' : 'freestyle',
95
+ plan_id: r.plan || null,
96
+ day_index: r.plan ? r.day : null,
97
+ status: 'completed',
98
+ title: r.title || null,
99
+ exercises: r.exercises.map((e) => ({
100
+ id: newGymItemId('ex'),
101
+ ref: e.s ? { kind: 'exercise', slug: e.s } : null,
102
+ name: e.n,
103
+ target_sets: e.ts || null,
104
+ target_reps: e.tr || null,
105
+ target_weight: e.tw || null,
106
+ target_rest_seconds: null,
107
+ tempo: null,
108
+ notes: null,
109
+ state: null,
110
+ sets: e.done.map(([reps, weight]) => {
111
+ const r2 = /^\s*\d+\s*$/.test(reps) ? Number(reps) : null;
112
+ const kg = kgFrom(weight);
113
+ const note = [r2 == null && reps ? reps : '', kg == null && weight ? weight : ''].filter(Boolean).join(' · ');
114
+ return { id: newGymItemId('set'), weight: kg, reps: r2, rpe: null, notes: note || null, completed_at: nowIso };
115
+ }),
116
+ })),
117
+ notes: r.mins ? `From the phone · ${r.mins} min` : 'From the phone',
118
+ started_at: null,
119
+ completed_at: nowIso,
120
+ updated_at: nowIso,
121
+ };
122
+ }
123
+ //# sourceMappingURL=share-results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-results.js","sourceRoot":"","sources":["../../src/health/share-results.ts"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AAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9G,OAAO,EAAE,EAAE,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;YACjH,CAAC,CAAC;SACH,CAAC,CAAC;QACH,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,gBAAgB;QACnE,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;KACnB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ export declare const WORKOUT_URL = "https://avasupernova.com/workout";
2
+ export interface SharedWorkoutExercise {
3
+ /** Name, in the sender's language. */
4
+ n: string;
5
+ /** Library slug, for "How to do it". Empty for a custom exercise. */
6
+ s: string;
7
+ /** Sets planned (at least 1). */
8
+ sets: number;
9
+ /** Target reps: "10", "8-12", "30s", "AMRAP". */
10
+ reps: string;
11
+ /** Load guidance: "16 kg", "bodyweight", "RPE 7". */
12
+ w: string;
13
+ /** Rest between sets, seconds (0 = none given). */
14
+ rest: number;
15
+ /** A note to show with it — e.g. "take care with your left knee: …". */
16
+ note: string;
17
+ }
18
+ export interface SharedWorkout {
19
+ v: 1;
20
+ /** "Lower body", or the plan day's title. */
21
+ title: string;
22
+ /** The day it is for (ISO date). */
23
+ date: string;
24
+ /** Plan id and day, so results can find their way back to the plan (Part 6). */
25
+ plan: string;
26
+ day: number;
27
+ exercises: SharedWorkoutExercise[];
28
+ }
29
+ /** The part after `#`: "1." + deflated, base64url JSON. */
30
+ export declare function encodeSharedWorkout(w: SharedWorkout): Promise<string>;
31
+ export declare function decodeSharedWorkout(hash: string): Promise<SharedWorkout | null>;
32
+ export declare function sharedWorkoutUrl(w: SharedWorkout): Promise<string>;
33
+ /** A plan day's training as a phone session. Rest falls back to 60 s; the
34
+ * exercise's own note (a caution from the safety check) travels with it. */
35
+ export declare function workoutFromDay(opts: {
36
+ planId: string;
37
+ day: {
38
+ day_index: number;
39
+ title: string | null;
40
+ training: Array<{
41
+ name: string;
42
+ ref?: {
43
+ slug: string;
44
+ } | null;
45
+ sets: number | null;
46
+ reps: string | null;
47
+ weight: string | null;
48
+ rest_seconds: number | null;
49
+ notes: string | null;
50
+ }>;
51
+ };
52
+ date: string;
53
+ fallbackTitle: string;
54
+ }): SharedWorkout;
55
+ //# sourceMappingURL=share-workout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-workout.d.ts","sourceRoot":"","sources":["../../src/health/share-workout.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,qCAAqC,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,CAAC,EAAE,MAAM,CAAC;IACV,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,CAAC,EAAE,MAAM,CAAC;IACV,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,CAAC,CAAC;IACL,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,qBAAqB,EAAE,CAAC;CACpC;AA+BD,2DAA2D;AAC3D,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAG3E;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAUrF;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAExE;AAED;6EAC6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;YAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IACvO,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,aAAa,CAYhB"}
@@ -0,0 +1,69 @@
1
+ // A training session sent to the phone (Health Part 5b, mockup approved
2
+ // 14 Nov 2026: "take it to the gym"). Same idea as the shopping list
3
+ // (share-list.ts): the session travels INSIDE the link, after the `#`, which
4
+ // browsers never send to a server. avasupernova.com/workout draws it, keeps it
5
+ // on the phone and works with no signal. Nothing is stored by us.
6
+ //
7
+ // The website's WorkoutApp carries a copy of the decoder; the format is
8
+ // versioned ("1.") and pinned by the round-trip test. Change one, change both.
9
+ export const WORKOUT_URL = 'https://avasupernova.com/workout';
10
+ const toWire = (w) => [1, w.title, w.date, w.plan, w.day,
11
+ w.exercises.map((e) => [e.n, e.s, e.sets, e.reps, e.w, e.rest, e.note])];
12
+ const fromWire = (w) => ({
13
+ v: 1, title: String(w[1] ?? ''), date: String(w[2] ?? ''), plan: String(w[3] ?? ''), day: Number(w[4]) || 0,
14
+ exercises: (w[5] ?? []).map(([n, s, sets, reps, wt, rest, note]) => ({
15
+ n: String(n ?? ''), s: String(s ?? ''), sets: Math.max(1, Math.min(20, Number(sets) || 1)),
16
+ reps: String(reps ?? ''), w: String(wt ?? ''), rest: Math.max(0, Math.min(900, Number(rest) || 0)), note: String(note ?? ''),
17
+ })),
18
+ });
19
+ function b64url(bytes) {
20
+ let s = '';
21
+ for (const b of bytes)
22
+ s += String.fromCharCode(b);
23
+ return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
24
+ }
25
+ function unb64url(s) {
26
+ const b = atob(s.replace(/-/g, '+').replace(/_/g, '/') + '==='.slice((s.length + 3) % 4));
27
+ return Uint8Array.from(b, (c) => c.charCodeAt(0));
28
+ }
29
+ async function pipe(bytes, stream) {
30
+ const out = new Response(new Blob([bytes.slice().buffer]).stream().pipeThrough(stream));
31
+ return new Uint8Array(await out.arrayBuffer());
32
+ }
33
+ /** The part after `#`: "1." + deflated, base64url JSON. */
34
+ export async function encodeSharedWorkout(w) {
35
+ const json = new TextEncoder().encode(JSON.stringify(toWire(w)));
36
+ return '1.' + b64url(await pipe(json, new CompressionStream('deflate-raw')));
37
+ }
38
+ export async function decodeSharedWorkout(hash) {
39
+ try {
40
+ const h = hash.replace(/^#/, '');
41
+ if (!h.startsWith('1.'))
42
+ return null;
43
+ const json = await pipe(unb64url(h.slice(2)), new DecompressionStream('deflate-raw'));
44
+ const w = JSON.parse(new TextDecoder().decode(json));
45
+ return Array.isArray(w) && w[0] === 1 ? fromWire(w) : null;
46
+ }
47
+ catch {
48
+ return null;
49
+ }
50
+ }
51
+ export async function sharedWorkoutUrl(w) {
52
+ return `${WORKOUT_URL}#${await encodeSharedWorkout(w)}`;
53
+ }
54
+ /** A plan day's training as a phone session. Rest falls back to 60 s; the
55
+ * exercise's own note (a caution from the safety check) travels with it. */
56
+ export function workoutFromDay(opts) {
57
+ return {
58
+ v: 1,
59
+ title: opts.day.title || opts.fallbackTitle,
60
+ date: opts.date,
61
+ plan: opts.planId,
62
+ day: opts.day.day_index,
63
+ exercises: opts.day.training.map((e) => ({
64
+ n: e.name, s: e.ref?.slug ?? '', sets: e.sets && e.sets > 0 ? e.sets : 3, reps: e.reps ?? '',
65
+ w: e.weight ?? '', rest: e.rest_seconds ?? 60, note: e.notes ?? '',
66
+ })),
67
+ };
68
+ }
69
+ //# sourceMappingURL=share-workout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-workout.js","sourceRoot":"","sources":["../../src/health/share-workout.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,kEAAkE;AAClE,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAoC9D,MAAM,MAAM,GAAG,CAAC,CAAgB,EAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG;IAC3E,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAW,CAAC,CAAC,CAAC;AACrF,MAAM,QAAQ,GAAG,CAAC,CA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CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;YAC5F,CAAC,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,YAAY,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;SACnE,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/ar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CA6iJxD,CAAC"}
1
+ {"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/ar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAqpJxD,CAAC"}