@flowe-ai/cli 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -9
- package/dist/chunk-3AO4PCEG.js +5 -0
- package/dist/chunk-B32B6OSK.js +1 -0
- package/dist/{chunk-3HG2U5YK.js → chunk-FXWU7EJA.js} +1 -1
- package/dist/{chunk-MM4EMTNC.js → chunk-LCVEDM2W.js} +1 -1
- package/dist/cli.js +69 -57
- package/dist/{login-Q4QMATEN.js → login-UO2GGRN2.js} +2 -2
- package/dist/mcp-server.js +9 -9
- package/dist/me-3CJ5RYRM.js +1 -0
- package/dist/{session-client-2SS65HUQ.js → session-client-BR4JJT7O.js} +1 -1
- package/dist/{setup-harness-RR77VO5C.js → setup-harness-DWVJK4N5.js} +1 -1
- package/dist/ui/live-session.html +8 -8
- package/dist/ui/micro.html +6 -6
- package/package.json +4 -5
- package/protocols.json +857 -76
- package/skills/flowe/SKILL.md +15 -7
- package/audio/body_scan_60.ada.cues.json +0 -67
- package/audio/body_scan_60.ada.mp3 +0 -0
- package/audio/body_scan_60.ellie.cues.json +0 -67
- package/audio/body_scan_60.ellie.mp3 +0 -0
- package/audio/body_scan_60.sage.cues.json +0 -67
- package/audio/body_scan_60.sage.mp3 +0 -0
- package/audio/box_breath_45.ada.cues.json +0 -103
- package/audio/box_breath_45.ada.mp3 +0 -0
- package/audio/box_breath_45.ellie.cues.json +0 -103
- package/audio/box_breath_45.ellie.mp3 +0 -0
- package/audio/box_breath_45.sage.cues.json +0 -103
- package/audio/box_breath_45.sage.mp3 +0 -0
- package/audio/box_breath_60.ada.cues.json +0 -135
- package/audio/box_breath_60.ada.mp3 +0 -0
- package/audio/box_breath_60.ellie.cues.json +0 -135
- package/audio/box_breath_60.ellie.mp3 +0 -0
- package/audio/box_breath_60.sage.cues.json +0 -135
- package/audio/box_breath_60.sage.mp3 +0 -0
- package/audio/extended_box_90.ada.cues.json +0 -199
- package/audio/extended_box_90.ada.mp3 +0 -0
- package/audio/extended_box_90.ellie.cues.json +0 -199
- package/audio/extended_box_90.ellie.mp3 +0 -0
- package/audio/extended_box_90.sage.cues.json +0 -199
- package/audio/extended_box_90.sage.mp3 +0 -0
- package/audio/eye_rotation_30.ada.cues.json +0 -41
- package/audio/eye_rotation_30.ada.mp3 +0 -0
- package/audio/eye_rotation_30.ellie.cues.json +0 -41
- package/audio/eye_rotation_30.ellie.mp3 +0 -0
- package/audio/eye_rotation_30.sage.cues.json +0 -41
- package/audio/eye_rotation_30.sage.mp3 +0 -0
- package/audio/full_sensory_90.ada.cues.json +0 -60
- package/audio/full_sensory_90.ada.mp3 +0 -0
- package/audio/full_sensory_90.ellie.cues.json +0 -60
- package/audio/full_sensory_90.ellie.mp3 +0 -0
- package/audio/full_sensory_90.sage.cues.json +0 -60
- package/audio/full_sensory_90.sage.mp3 +0 -0
- package/audio/grounded_feet_45.ada.cues.json +0 -40
- package/audio/grounded_feet_45.ada.mp3 +0 -0
- package/audio/grounded_feet_45.ellie.cues.json +0 -40
- package/audio/grounded_feet_45.ellie.mp3 +0 -0
- package/audio/grounded_feet_45.sage.cues.json +0 -40
- package/audio/grounded_feet_45.sage.mp3 +0 -0
- package/audio/neck_rotation_45.ada.cues.json +0 -55
- package/audio/neck_rotation_45.ada.mp3 +0 -0
- package/audio/neck_rotation_45.ellie.cues.json +0 -55
- package/audio/neck_rotation_45.ellie.mp3 +0 -0
- package/audio/neck_rotation_45.sage.cues.json +0 -55
- package/audio/neck_rotation_45.sage.mp3 +0 -0
- package/audio/palming_60.ada.cues.json +0 -61
- package/audio/palming_60.ada.mp3 +0 -0
- package/audio/palming_60.ellie.cues.json +0 -61
- package/audio/palming_60.ellie.mp3 +0 -0
- package/audio/palming_60.sage.cues.json +0 -61
- package/audio/palming_60.sage.mp3 +0 -0
- package/audio/physiological_sigh_30.ada.cues.json +0 -55
- package/audio/physiological_sigh_30.ada.mp3 +0 -0
- package/audio/physiological_sigh_30.ellie.cues.json +0 -55
- package/audio/physiological_sigh_30.ellie.mp3 +0 -0
- package/audio/physiological_sigh_30.sage.cues.json +0 -55
- package/audio/physiological_sigh_30.sage.mp3 +0 -0
- package/audio/progressive_palming_90.ada.cues.json +0 -61
- package/audio/progressive_palming_90.ada.mp3 +0 -0
- package/audio/progressive_palming_90.ellie.cues.json +0 -61
- package/audio/progressive_palming_90.ellie.mp3 +0 -0
- package/audio/progressive_palming_90.sage.cues.json +0 -61
- package/audio/progressive_palming_90.sage.mp3 +0 -0
- package/audio/quick_palming_30.ada.cues.json +0 -40
- package/audio/quick_palming_30.ada.mp3 +0 -0
- package/audio/quick_palming_30.ellie.cues.json +0 -40
- package/audio/quick_palming_30.ellie.mp3 +0 -0
- package/audio/quick_palming_30.sage.cues.json +0 -40
- package/audio/quick_palming_30.sage.mp3 +0 -0
- package/dist/chunk-EC5WRPZP.js +0 -1
- package/dist/chunk-GUTZZ5P5.js +0 -5
- package/dist/me-SZLS6RWX.js +0 -1
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "physiological_sigh_30",
|
|
3
|
-
"voice": "sage",
|
|
4
|
-
"duration_ms": 21440,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "double inhale",
|
|
8
|
-
"mode": "breath",
|
|
9
|
-
"start_ms": 3360,
|
|
10
|
-
"end_ms": 7320,
|
|
11
|
-
"phase": "inhale",
|
|
12
|
-
"round": 1
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"label": "long exhale",
|
|
16
|
-
"mode": "breath",
|
|
17
|
-
"start_ms": 7320,
|
|
18
|
-
"end_ms": 9740,
|
|
19
|
-
"phase": "exhale",
|
|
20
|
-
"round": 1
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"label": "double inhale",
|
|
24
|
-
"mode": "breath",
|
|
25
|
-
"start_ms": 9740,
|
|
26
|
-
"end_ms": 14200,
|
|
27
|
-
"phase": "inhale",
|
|
28
|
-
"round": 2
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"label": "long exhale",
|
|
32
|
-
"mode": "breath",
|
|
33
|
-
"start_ms": 14200,
|
|
34
|
-
"end_ms": 15900,
|
|
35
|
-
"phase": "exhale",
|
|
36
|
-
"round": 2
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"label": "double inhale",
|
|
40
|
-
"mode": "breath",
|
|
41
|
-
"start_ms": 15900,
|
|
42
|
-
"end_ms": 18400,
|
|
43
|
-
"phase": "inhale",
|
|
44
|
-
"round": 3
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"label": "long exhale",
|
|
48
|
-
"mode": "breath",
|
|
49
|
-
"start_ms": 18400,
|
|
50
|
-
"end_ms": 20840,
|
|
51
|
-
"phase": "exhale",
|
|
52
|
-
"round": 3
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "progressive_palming_90",
|
|
3
|
-
"voice": "ada",
|
|
4
|
-
"duration_ms": 37760,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "warm palms",
|
|
8
|
-
"mode": "palming",
|
|
9
|
-
"start_ms": 3200,
|
|
10
|
-
"end_ms": 7000
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "cup over eyes",
|
|
14
|
-
"mode": "palming",
|
|
15
|
-
"start_ms": 7000,
|
|
16
|
-
"end_ms": 11320
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "eye rest",
|
|
20
|
-
"mode": "palming",
|
|
21
|
-
"start_ms": 11320,
|
|
22
|
-
"end_ms": 16020
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"label": "slow breaths",
|
|
26
|
-
"mode": "palming",
|
|
27
|
-
"start_ms": 16020,
|
|
28
|
-
"end_ms": 19060
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"label": "soften forehead",
|
|
32
|
-
"mode": "palming",
|
|
33
|
-
"start_ms": 19060,
|
|
34
|
-
"end_ms": 19840
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"label": "soften jaw",
|
|
38
|
-
"mode": "palming",
|
|
39
|
-
"start_ms": 19840,
|
|
40
|
-
"end_ms": 21780
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"label": "drop shoulders",
|
|
44
|
-
"mode": "palming",
|
|
45
|
-
"start_ms": 21780,
|
|
46
|
-
"end_ms": 25020
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"label": "slow breath",
|
|
50
|
-
"mode": "palming",
|
|
51
|
-
"start_ms": 25020,
|
|
52
|
-
"end_ms": 27700
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"label": "eyes warm dark",
|
|
56
|
-
"mode": "palming",
|
|
57
|
-
"start_ms": 27700,
|
|
58
|
-
"end_ms": 32680
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}
|
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "progressive_palming_90",
|
|
3
|
-
"voice": "ellie",
|
|
4
|
-
"duration_ms": 36900,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "warm palms",
|
|
8
|
-
"mode": "palming",
|
|
9
|
-
"start_ms": 3080,
|
|
10
|
-
"end_ms": 6700
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "cup over eyes",
|
|
14
|
-
"mode": "palming",
|
|
15
|
-
"start_ms": 6700,
|
|
16
|
-
"end_ms": 10680
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "eye rest",
|
|
20
|
-
"mode": "palming",
|
|
21
|
-
"start_ms": 10680,
|
|
22
|
-
"end_ms": 15580
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"label": "slow breaths",
|
|
26
|
-
"mode": "palming",
|
|
27
|
-
"start_ms": 15580,
|
|
28
|
-
"end_ms": 18980
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"label": "soften forehead",
|
|
32
|
-
"mode": "palming",
|
|
33
|
-
"start_ms": 18980,
|
|
34
|
-
"end_ms": 19980
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"label": "soften jaw",
|
|
38
|
-
"mode": "palming",
|
|
39
|
-
"start_ms": 19980,
|
|
40
|
-
"end_ms": 21680
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"label": "drop shoulders",
|
|
44
|
-
"mode": "palming",
|
|
45
|
-
"start_ms": 21680,
|
|
46
|
-
"end_ms": 25240
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"label": "slow breath",
|
|
50
|
-
"mode": "palming",
|
|
51
|
-
"start_ms": 25240,
|
|
52
|
-
"end_ms": 26840
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"label": "eyes warm dark",
|
|
56
|
-
"mode": "palming",
|
|
57
|
-
"start_ms": 26840,
|
|
58
|
-
"end_ms": 31800
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}
|
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "progressive_palming_90",
|
|
3
|
-
"voice": "sage",
|
|
4
|
-
"duration_ms": 34060,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "warm palms",
|
|
8
|
-
"mode": "palming",
|
|
9
|
-
"start_ms": 3100,
|
|
10
|
-
"end_ms": 6340
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "cup over eyes",
|
|
14
|
-
"mode": "palming",
|
|
15
|
-
"start_ms": 6340,
|
|
16
|
-
"end_ms": 10160
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "eye rest",
|
|
20
|
-
"mode": "palming",
|
|
21
|
-
"start_ms": 10160,
|
|
22
|
-
"end_ms": 14360
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"label": "slow breaths",
|
|
26
|
-
"mode": "palming",
|
|
27
|
-
"start_ms": 14360,
|
|
28
|
-
"end_ms": 17360
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"label": "soften forehead",
|
|
32
|
-
"mode": "palming",
|
|
33
|
-
"start_ms": 17360,
|
|
34
|
-
"end_ms": 18280
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"label": "soften jaw",
|
|
38
|
-
"mode": "palming",
|
|
39
|
-
"start_ms": 18280,
|
|
40
|
-
"end_ms": 20000
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"label": "drop shoulders",
|
|
44
|
-
"mode": "palming",
|
|
45
|
-
"start_ms": 20000,
|
|
46
|
-
"end_ms": 23420
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"label": "slow breath",
|
|
50
|
-
"mode": "palming",
|
|
51
|
-
"start_ms": 23420,
|
|
52
|
-
"end_ms": 24980
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"label": "eyes warm dark",
|
|
56
|
-
"mode": "palming",
|
|
57
|
-
"start_ms": 24980,
|
|
58
|
-
"end_ms": 29420
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}
|
|
Binary file
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "quick_palming_30",
|
|
3
|
-
"voice": "ada",
|
|
4
|
-
"duration_ms": 19620,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "warm palms",
|
|
8
|
-
"mode": "palming",
|
|
9
|
-
"start_ms": 1740,
|
|
10
|
-
"end_ms": 3920
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "cup over eyes",
|
|
14
|
-
"mode": "palming",
|
|
15
|
-
"start_ms": 3920,
|
|
16
|
-
"end_ms": 9560
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "breath one",
|
|
20
|
-
"mode": "palming",
|
|
21
|
-
"start_ms": 9560,
|
|
22
|
-
"end_ms": 11260,
|
|
23
|
-
"round": 1
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"label": "breath two",
|
|
27
|
-
"mode": "palming",
|
|
28
|
-
"start_ms": 11260,
|
|
29
|
-
"end_ms": 14040,
|
|
30
|
-
"round": 2
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"label": "breath three",
|
|
34
|
-
"mode": "palming",
|
|
35
|
-
"start_ms": 14040,
|
|
36
|
-
"end_ms": 16060,
|
|
37
|
-
"round": 3
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
Binary file
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "quick_palming_30",
|
|
3
|
-
"voice": "ellie",
|
|
4
|
-
"duration_ms": 19000,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "warm palms",
|
|
8
|
-
"mode": "palming",
|
|
9
|
-
"start_ms": 1540,
|
|
10
|
-
"end_ms": 4320
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "cup over eyes",
|
|
14
|
-
"mode": "palming",
|
|
15
|
-
"start_ms": 4320,
|
|
16
|
-
"end_ms": 9800
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "breath one",
|
|
20
|
-
"mode": "palming",
|
|
21
|
-
"start_ms": 9800,
|
|
22
|
-
"end_ms": 11880,
|
|
23
|
-
"round": 1
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"label": "breath two",
|
|
27
|
-
"mode": "palming",
|
|
28
|
-
"start_ms": 11880,
|
|
29
|
-
"end_ms": 13680,
|
|
30
|
-
"round": 2
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"label": "breath three",
|
|
34
|
-
"mode": "palming",
|
|
35
|
-
"start_ms": 13680,
|
|
36
|
-
"end_ms": 15880,
|
|
37
|
-
"round": 3
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
Binary file
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocol_id": "quick_palming_30",
|
|
3
|
-
"voice": "sage",
|
|
4
|
-
"duration_ms": 17080,
|
|
5
|
-
"cues": [
|
|
6
|
-
{
|
|
7
|
-
"label": "warm palms",
|
|
8
|
-
"mode": "palming",
|
|
9
|
-
"start_ms": 1480,
|
|
10
|
-
"end_ms": 3520
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "cup over eyes",
|
|
14
|
-
"mode": "palming",
|
|
15
|
-
"start_ms": 3520,
|
|
16
|
-
"end_ms": 8920
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "breath one",
|
|
20
|
-
"mode": "palming",
|
|
21
|
-
"start_ms": 8920,
|
|
22
|
-
"end_ms": 10880,
|
|
23
|
-
"round": 1
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"label": "breath two",
|
|
27
|
-
"mode": "palming",
|
|
28
|
-
"start_ms": 10880,
|
|
29
|
-
"end_ms": 12160,
|
|
30
|
-
"round": 2
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"label": "breath three",
|
|
34
|
-
"mode": "palming",
|
|
35
|
-
"start_ms": 12160,
|
|
36
|
-
"end_ms": 14000,
|
|
37
|
-
"round": 3
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
Binary file
|
package/dist/chunk-EC5WRPZP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{readFileSync as x,writeFileSync as A,mkdirSync as E,existsSync as h}from"fs";import{homedir as T,platform as P}from"os";import{join as d}from"path";import{nanoid as D}from"nanoid";var v="https://www.flowe.ai",O=90,b=["sage","ada","ellie"];function V(t){return typeof t=="string"&&b.includes(t)?t:"ellie"}function S(){let t=T();return P()==="win32"?d(t,"AppData","Roaming","flowe"):d(t,".config","flowe")}function k(){return d(S(),"config.json")}function w(){return{version:2,voice:"ellie",anonymous_id:`anon_${D(12)}`,telemetry:"on",backend_url:process.env.FLOWE_BACKEND_URL||v,session_dates:[]}}function N(t){let e=typeof t.version=="number"?t.version:1,n=t.voice,r=V(n),o={version:2,voice:r,anonymous_id:t.anonymous_id??`anon_${D(12)}`,telemetry:t.telemetry??"on",backend_url:t.backend_url??v,session_dates:Array.isArray(t.session_dates)?t.session_dates:[]};return typeof t.first_reset_at=="string"&&(o.first_reset_at=t.first_reset_at),typeof t.user_first_name=="string"&&(o.user_first_name=t.user_first_name),(e<2||n!==r)&&s(o),o}function i(){let t=k();if(!h(t)){let e=w();return s(e),e}try{let e=x(t,"utf-8"),n=JSON.parse(e),r=N(n);return process.env.FLOWE_BACKEND_URL&&(r.backend_url=process.env.FLOWE_BACKEND_URL),r}catch{let e=w();return s(e),e}}function s(t){let e=S();h(e)||E(e,{recursive:!0}),A(k(),JSON.stringify(t,null,2),"utf-8")}function Q(t){let e=i();e.voice=t,s(e)}function X(){let t=i();t.first_reset_at||(t.first_reset_at=new Date().toISOString(),s(t))}function Z(t){let e=i();t&&t.trim().length>0?e.user_first_name=t.trim():delete e.user_first_name,s(e)}function u(t=new Date){let e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}function R(t,e){let n=new Date(e);n.setDate(n.getDate()-O);let r=u(n);return t.filter(o=>o>=r)}function tt(t=new Date){let e=i(),n=u(t),r=R([...e.session_dates,n],t);e.session_dates=r,s(e)}function et(t=new Date){let e=i(),n=u(t);return e.session_dates.filter(r=>r===n).length}function nt(t=new Date){let e=i(),n=new Set(e.session_dates),r=new Date(t);r.setHours(0,0,0,0);let o=new Date(r);n.has(u(o))||o.setDate(o.getDate()-1);let _=0;for(;n.has(u(o));)_+=1,o.setDate(o.getDate()-1);return _}function rt(){return i().session_dates.length}import{execFileSync as g}from"child_process";import{existsSync as m,mkdirSync as K,readFileSync as L,rmSync as U,writeFileSync as I}from"fs";import{homedir as $,platform as l}from"os";import{join as f}from"path";var c="flowe-cli",a="clerk-token";function p(){let t=$(),e=l()==="win32"?f(t,"AppData","Roaming","flowe"):f(t,".config","flowe");return f(e,".token")}function j(){if(l()!=="darwin")return null;try{let t=g("security",["find-generic-password","-s",c,"-a",a,"-w"],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim();return t.length>0?t:null}catch{return null}}function B(t){if(l()!=="darwin")return!1;try{return g("security",["add-generic-password","-U","-s",c,"-a",a,"-w",t],{stdio:"ignore"}),!0}catch{return!1}}function M(){if(l()!=="darwin")return!1;try{return g("security",["delete-generic-password","-s",c,"-a",a],{stdio:"ignore"}),!0}catch{return!1}}function W(){try{let t=p();if(!m(t))return null;let e=L(t,"utf-8").trim();return e.length>0?e:null}catch{return null}}function H(t){let e=p(),n=f(e,"..");m(n)||K(n,{recursive:!0}),I(e,t,{encoding:"utf-8",mode:384})}function J(){try{let t=p();m(t)&&U(t,{force:!0})}catch{}}async function y(){try{let e=(await import("keytar")).default;return e&&typeof e.getPassword=="function"?e:null}catch{return null}}async function ft(){let t=process.env.FLOWE_AUTH_TOKEN?.trim();if(t)return t;let e=await y();if(e)try{let n=await e.getPassword(c,a);return n||null}catch{return null}return j()??W()}async function lt(t){let e=await y();if(e)try{await e.setPassword(c,a,t);return}catch{}B(t)||H(t)}async function dt(){let t=await y();if(t)try{await t.deletePassword(c,a)}catch{}M(),J()}export{i as a,Q as b,X as c,Z as d,tt as e,et as f,nt as g,rt as h,ft as i,lt as j,dt as k};
|
package/dist/chunk-GUTZZ5P5.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as W,c as Q,e as Y,i as G}from"./chunk-EC5WRPZP.js";import{readFileSync as ge}from"fs";import{dirname as ye,join as he}from"path";import{fileURLToPath as be}from"url";var xe=ye(be(import.meta.url));function H(){try{let e=ge(he(xe,"..","package.json"),"utf-8");return JSON.parse(e).version}catch{return"0.0.0"}}var at=["logic_lock","deploy_anxiety","context_switch","sprint_prep","quick_reset","executive_reset","presentation_prep","shutdown"],ct=["ht_stress","ht_anxiety","ht_people_pleasing","ht_relationships","ht_confidence","ht_fears","ht_anger","ht_procrastination","ht_burnout"];import{readFileSync as K}from"fs";import{dirname as Se,join as N}from"path";import{fileURLToPath as ve}from"url";var A=Se(ve(import.meta.url));function Ee(){return N(A,"..","protocols.json")}var g=null;function k(){if(g)return g;try{let e=K(Ee(),"utf-8");return g=JSON.parse(e),g}catch{return g={protocols:{},audio_paths:{},cues_paths:{}},g}}function D(){return Object.values(k().protocols)}function M(e){return e.replace(/_\d+$/,"")}function ft(){let e=new Set;for(let t of D())e.add(M(t.protocol_id));return[...e].sort()}function _t(e){return D().filter(t=>M(t.protocol_id)===e).map(t=>t.duration_seconds).sort((t,r)=>t-r)}function z(e,t){let r=D().filter(n=>n.duration_seconds===e&&(t===void 0||M(n.protocol_id)===t));return r.length===0?null:t!==void 0?r[0]:r[Math.floor(Math.random()*r.length)]}function X(e,t){let r=k(),n=`${e}.${t}`,o=r.audio_paths[n];return o?N(A,"..",o):null}var C=new Map;function Z(e,t){let r=`${e}.${t}`,n=C.get(r);if(n!==void 0)return n;let a=k().cues_paths?.[r];if(!a)return C.set(r,null),null;try{let s=K(N(A,"..",a),"utf-8"),i=JSON.parse(s);return C.set(r,i),i}catch{return C.set(r,null),null}}import{spawn as R}from"child_process";import{platform as Pe}from"os";var d=null;function ee(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?1:Math.min(2,Math.max(.05,e))}function we(e,t=1){let r=ee(t),n=Pe();if(n==="darwin"){let a=r===1?[e]:["-v",String(r),e];return R("afplay",a,{stdio:"ignore"})}if(n==="win32"){let s=["Add-Type -AssemblyName presentationCore;","$p = New-Object System.Windows.Media.MediaPlayer;",`$p.Open([Uri]'${e.replace(/'/g,"''")}');`,`$p.Volume = ${Math.min(1,r)};`,"$p.Play();","Start-Sleep -Milliseconds 300;","while ($p.Position -lt $p.NaturalDuration.TimeSpan -and $p.NaturalDuration.HasTimeSpan) { Start-Sleep -Milliseconds 200 };","$p.Close();"].join(" ");return R("powershell",["-NoProfile","-NonInteractive","-Command",s],{stdio:"ignore"})}let o=Math.round(32768*r);return R("mpg123",["-q","-f",String(o),e],{stdio:"ignore"})}function I(){return d!==null}function xt(){return d?.donePromise??null}function te(e,t={}){if(d)return Promise.reject(new Error("already playing \u2014 call stopAudio first"));let r=ee(t.volume),n=t.spawnPlayer??we,o;try{o=n(e,r)}catch(c){return Promise.reject(c instanceof Error?c:new Error(String(c)))}let a=!1,s=!1,i,u,p=new Promise((c,l)=>{i=c,u=l}),f=()=>{d?.child===o&&(d=null)},_=()=>{a||(a=!0,f(),i())},T=c=>{a||(a=!0,f(),u(c))};return d={child:o,stop:()=>{if(s=!0,f(),!o.killed)try{o.kill("SIGTERM")}catch{}_()},donePromise:p},o.once("error",c=>{if(s){_();return}let l=Object.assign(new Error(`audio playback failed: ${c.message}`),{code:"audio_device"});T(l)}),o.once("exit",(c,l)=>{if(s||l==="SIGTERM"||l==="SIGINT"||c===0||c===null){_();return}let O=Object.assign(new Error(`audio player exited with code ${c}`),{code:"audio_device"});T(O)}),p}function re(){d&&d.stop()}import{nanoid as $e}from"nanoid";import{readFileSync as Te,writeFileSync as Ce,mkdirSync as Fe,existsSync as L,appendFileSync as Oe}from"fs";import{homedir as Ne}from"os";import{join as oe}from"path";var $=oe(Ne(),".cache","flowe"),v=oe($,"pending-events.jsonl"),Ae=5e3;function ke(){let e=process.env.FLOWE_OPT_OUT?.trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}async function F(e,t,r){if(!(t.telemetry==="off"||ke())){De(),Me(e);try{await Ie(t,r)}catch{}}}function De(){L($)||Fe($,{recursive:!0})}function Me(e){for(let t of e)Oe(v,JSON.stringify(t)+`
|
|
2
|
-
`,"utf-8")}function Re(){return L(v)?Te(v,"utf-8").split(`
|
|
3
|
-
`).filter(t=>t.trim().length>0).map(t=>JSON.parse(t)):[]}function ne(){L(v)&&Ce(v,"","utf-8")}async function Ie(e,t){let r=Re();if(r.length===0)return;let n={version:H(),platform:`${process.platform}-${process.arch}`,node_version:process.version},o=new AbortController,a=setTimeout(()=>o.abort(),Ae);try{let s={"Content-Type":"application/json"};t&&(s.Authorization=`Bearer ${t}`);let i=await fetch(`${e.backend_url}/api/v1/reset/log`,{method:"POST",headers:s,body:JSON.stringify({events:r,client:n,anonymous_id:e.anonymous_id}),signal:o.signal});(i.ok||i.status===401||i.status===400)&&ne()}finally{clearTimeout(a)}}function Le(e,t,r){if(e.length===0)return[];let o=t*1e3/e.length;return e.map((a,s)=>({label:a,mode:r,start_ms:Math.round(s*o),end_ms:Math.round((s+1)*o)}))}function Rt(){return I()?(re(),!0):!1}async function It(e,t="user_requested",r,n={}){let o=process.env.FLOWE_SILENT_AUDIO==="1"?"silent":n.audioMode??"local";if(o==="local"&&I())throw Object.assign(new Error("a reset is already running"),{code:"agent_busy"});let a=W(),s=n.voice??a.voice,i=z(e,r);if(!i){let _e=r?`${r} at ${e}s`:`${e}s`;throw Object.assign(new Error(`no protocol available for ${_e}`),{code:"protocol_unavailable"})}let u=X(i.protocol_id,s);if(o==="local"&&!u)throw Object.assign(new Error(`no audio available for ${i.protocol_id}:${s}`),{code:"protocol_unavailable"});let p=`reset_${$e(8)}`,f=new Date,_=Math.floor(f.getTime()/1e3),T=_+e;Q();let c=await G();await F([{type:"reset_started",session_id:p,protocol_id:i.protocol_id,duration_seconds:e,voice:s,trigger:t,client_timestamp:f.toISOString()}],a,c),o==="local"&&u&&te(u).then(()=>{if(n.recordOnComplete)try{Y()}catch{}F([{type:"reset_completed",session_id:p,protocol_id:i.protocol_id,duration_seconds:e,voice:s,trigger:t,client_timestamp:new Date().toISOString()}],a,c).catch(()=>{})}).catch(()=>{F([{type:"reset_abandoned",session_id:p,protocol_id:i.protocol_id,duration_seconds:e,voice:s,trigger:t,client_timestamp:new Date().toISOString()}],a,c).catch(()=>{})});let l=Z(i.protocol_id,s),O=l?l.cues:Le(i.text_cues,e,i.category);return{session_id:p,protocol:i.protocol_id,protocol_display_name:i.display_name,duration_seconds:e,voice:s,category:i.category,audio_mode:o,cues:O,rounds:i.rounds,status:"started",started_at_unix:_,ends_at_unix:T,message_for_user:`${e}s ${i.display_name} started \xB7 ${s}`}}import{existsSync as y,mkdirSync as Ve,readFileSync as V,renameSync as se,rmSync as j,writeFileSync as q}from"fs";import{homedir as je}from"os";import{join as h}from"path";var qe="state.json",Be="daemon.pid",Ue="control.txt",Je="daemon.log",We=3e4,Qe=["pause","resume","skip","quit"];function Ye(){return process.env.FLOWE_HOME??h(je(),".flowe")}function b(){return h(Ye(),"sessions","active")}function ae(){return h(b(),qe)}function B(){return h(b(),Be)}function ce(){return h(b(),Ue)}function ue(){return h(b(),Je)}function E(){let e=b();return y(e)||Ve(e,{recursive:!0}),e}function Bt(e){E();let t=ae(),r=`${t}.tmp`;q(r,JSON.stringify(e,null,2),"utf-8"),se(r,t)}function Ut(e={}){let t=ae();if(!y(t))return null;try{let r=V(t,"utf-8"),n=JSON.parse(r);if(n.version!==1)return null;let o=n;if(!Ge(o)||x()!==o.pid)return null;if(!w(o.pid,e.kill))return P(),null;let s=e.now??Date.now,i=e.staleAfterMs??We;return s()-o.updatedAt>i?null:o}catch{return null}}function Ge(e){return e.version===1&&typeof e.pid=="number"&&Number.isInteger(e.pid)&&e.pid>0&&typeof e.updatedAt=="number"&&Number.isFinite(e.updatedAt)}function P(){let e=b();y(e)&&j(e,{recursive:!0,force:!0})}function ie(e=process.pid){E(),q(B(),String(e),"utf-8")}function x(){let e=B();if(!y(e))return null;try{let t=V(e,"utf-8").trim();if(t.length===0)return null;let r=Number(t);return!Number.isInteger(r)||r<=0?null:r}catch{return null}}function He(){let e=B();y(e)&&j(e,{force:!0})}function w(e,t=(r,n)=>{process.kill(r,n)}){if(!Number.isInteger(e)||e<=0)return!1;try{return t(e,0),!0}catch(r){return r.code==="EPERM"}}function Jt(e={}){let t=e.pidOverride??process.pid,r=x();return r!==null&&r!==t&&w(r,e.kill)?{kind:"busy",pid:r}:r!==null&&r!==t?(P(),ie(t),{kind:"swept",stalePid:r}):(ie(t),{kind:"acquired"})}function Wt(){He()}function Qt(e){let t=x();if(t===null||!w(t))throw t!==null&&P(),new Error("no active focus session");E();let r=ce(),n=`${r}.tmp`;q(n,`${e}
|
|
4
|
-
`,"utf-8"),se(n,r)}function Yt(){let e=ce();if(!y(e))return null;let t;try{t=V(e,"utf-8")}catch{return null}finally{j(e,{force:!0})}let r=t.trim().toLowerCase();return Qe.includes(r)?r:null}import{spawn as Ke}from"child_process";import{openSync as ze,closeSync as Xe}from"fs";var le="FLOWE_FOCUS_DAEMON",U="FLOWE_FOCUS_PRESET",de="FLOWE_FOCUS_AMBIENT_FILE",pe="FLOWE_FOCUS_AMBIENT_ID",me="FLOWE_FOCUS_BREAK_TYPE",fe="FLOWE_FOCUS_LONG_BREAK_TYPE",J=class extends Error{constructor(r){super(`a focus daemon is already running (pid ${r})`);this.existingPid=r;this.name="DaemonAlreadyRunningError"}existingPid};function Ze(e){let t={...process.env,[le]:"1",[U]:e.preset};return e.ambientFilePath&&(t[de]=e.ambientFilePath),e.ambientId&&(t[pe]=e.ambientId),e.breakType&&(t[me]=e.breakType),e.longBreakType&&(t[fe]=e.longBreakType),t}function Zt(e){let t=x();if(t!==null){if(w(t))throw new J(t);P()}E();let r=ue(),n=ze(r,"a"),o=e.spawnArgs?.cmd??process.execPath,a=e.spawnArgs?.args??[...process.execArgv,process.argv[1]??"","focus",e.preset],i=(e.spawnFn??Ke)(o,a,{detached:!0,stdio:["ignore",n,n],env:Ze(e)});if(Xe(n),i.unref(),i.pid===void 0)throw new Error("failed to spawn focus daemon (no pid returned)");let u=e.readyTimeoutMs??(e.spawnFn?0:1500);if(u>0&&!et(i.pid,u))throw new Error("focus daemon did not become ready");return{pid:i.pid,logPath:r}}function et(e,t){let r=Date.now()+t;for(;Date.now()<=r;){if(x()===e)return!0;tt(25)}return!1}function tt(e){let t=new SharedArrayBuffer(4),r=new Int32Array(t);Atomics.wait(r,0,0,e)}function er(){let e=process.env[U];if(e!=="pomodoro"&&e!=="dev"&&e!=="ultradian"&&e!=="test2"&&e!=="test5")throw new Error(`invalid ${U}: ${e??"(unset)"} \u2014 daemon child cannot start`);return{preset:e,ambientFilePath:process.env[de]||void 0,ambientId:process.env[pe]||void 0,breakType:process.env[me]||void 0,longBreakType:process.env[fe]||void 0}}function tr(){return process.env[le]==="1"}function rr(e){return[`detached. pid ${e.pid}.`,`logs: ${e.logPath}`,"status: flowe focus status","pause: flowe focus pause resume: flowe focus resume","skip: flowe focus skip quit: flowe focus quit"].join(`
|
|
5
|
-
`)}export{H as a,at as b,ct as c,D as d,ft as e,_t as f,xt as g,te as h,re as i,ke as j,Rt as k,It as l,Ye as m,Bt as n,Ut as o,P as p,Jt as q,Wt as r,Qt as s,Yt as t,J as u,Zt as v,er as w,tr as x,rr as y};
|
package/dist/me-SZLS6RWX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-3HG2U5YK.js";import"./chunk-EC5WRPZP.js";export{a as fetchMe,b as refreshUserFirstName};
|